problem sending/receiving data to 40x2 from PGM editor

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

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
 
Excellent !! Thanks for that,
i had tried adding the # previously.
but having the (space) after 12 then sending bought success
why is this so? i don't need it with the editor simulation.
what does the (space) do?
cheers
 

Technical

Technical Support
Staff member
The PICAXE chips needs to know the ASCII number has finished. Consider:

1space
12space
123space

Basically # keeps going forever until it gets any character that is not 0-9, it doesn't have to be space, this would work just as well

1?
12?
123?
 

hippy

Ex-Staff (retired)
The space terminates the number, lets the PICAXE know the number has ended. It's like the 'over and out' on a walkie-talkie as otherwise you never know if the sender is going to send some more or has finished.
 
Top