scamanderriver
Member
Hi
looking for help here to solve an issue I'm having ... (another big learning curve happening here)
I am trying to send data from the PGM editor (using the terminal via the serial programming cable) to a 40x2 using the SERRXD command.
using the below code it works fine within the Editor Simulation, BUT!!
when i send to the 40x2, problems occur
if i send 1 the LCD displays 49 which appears to be the lcd dec code for 1
if i send 12 the LCD displays also 49
it seems i can only send/receive the first digit(1) and that it is always received/displayed as the character dec value 49 (2 = 50 etc)
I don't understand what is happening, I need the 40X2 to receive and correctly display the full number 12.
I'm wondering if the issue here has something to do with "uncompressed BCD usually implies a full byte for each digit, whereas packed BCD typically encodes two decimal digits within a single byte"
I would be grateful if someone could please offer me an explanation to what is happening here. it'd be great to solve this.
Thanks
looking for help here to solve an issue I'm having ... (another big learning curve happening here)
I am trying to send data from the PGM editor (using the terminal via the serial programming cable) to a 40x2 using the SERRXD command.
using the below code it works fine within the Editor Simulation, BUT!!
when i send to the 40x2, problems occur
if i send 1 the LCD displays 49 which appears to be the lcd dec code for 1
if i send 12 the LCD displays also 49
it seems i can only send/receive the first digit(1) and that it is always received/displayed as the character dec value 49 (2 = 50 etc)
I don't understand what is happening, I need the 40X2 to receive and correctly display the full number 12.
I'm wondering if the issue here has something to do with "uncompressed BCD usually implies a full byte for each digit, whereas packed BCD typically encodes two decimal digits within a single byte"
I would be grateful if someone could please offer me an explanation to what is happening here. it'd be great to solve this.
Thanks
Code:
#PICAXE 40x2
disconnect
START:
'loops waiting for input from PC
SEROUT d.1,N2400,(254,1) ' Picaxe 16x2 OLED LCD
serrxd [2000],b10 'input from PGMing editor via serial port
if b10 <> 0 then : goto show :endif 'show the received i/p
SEROUT d.1,N2400,(254,128,"waiting ",#b10)
pause 200
goto start
SHOW:'displays received number
SEROUT d.1,N2400,(254,128,"received ",#b10)
pause 200
b10 = 0
pause 2000
goto start