im having difficulty understanding how to store characters from rs232 to eeprom, i need to store values between 0 and 255, i wish to prompt my users to enter seconds, or days, say 200, but when i get my values, first value in eeprom is equivalent to ascii '2',, im not looking for clever 16 bit stuff, just the textual value into a hex number would do,,,
from RS232 is too vague
unless I am mistaken RS232 is a hardware protocol
it doesn't specify what format; BCD, or ASCII [even within ASCII there are variations], or whatever
do you know the format coming over your RS232 connection?
reset register value
check if incoming value is a number:
if yes, multiply your register x 10, then add your incoming number (incoming hex value - hex30).
***
example:
value is cleared (0)
then a "2" comes in (hex32) - hex(30) = 2
multiply value (0) by 10 --> still 0
add 2 --> value is 2
then a "0" comes in (hex30) - hex(30) = 0
multiply value (2) by 10 --> (20)
add 0 --> value is 20
then a "0" comes in (hex30) - hex(30) = 0
multiply value (20) by 10 --> (200)
add 0 --> value is 200
then [enter] comes in...
--> save the value to EEPROM