With my compiler I have if I include "-n" in the command line it allows longs.
Please look at the section of code:
Code:
d0 = dat[0]: d1 = dat[1]: d2 = dat[2]: d3 = dat[3]: d4 = dat[4]: d5 = dat[5]
d0 = (d0-48)*100000
d1 = (d1-48)*10000
d2 = (d2-48)*1000
d3 = (d3-48)*100
d4 = (d4-48)*10
d5 = (d5-48)
j = d0+d1+d2+d3+d4+d5
This converts a string of char #'s into a integer I can store/use.
So If I sent the pic 745647 into a serial terminal, the pic would be able to use the integer number.
It doesn't over flow, I have tested it to 999999 w/o issue.
Per PBP Compiler manual, I can send the write command a long w/o issue.
Code:
write 0, long senres
When I read it back in the serial menu at this point:
Code:
if rx = 82 then 'found R
HSerOUT [" Read", 13,10]
pause 1000
senres = 0 ' clear all values
calcon = 0
sernum = 0
read 40, long sernum ' read them from EEPROM
read 20, long calcon
read 0, long senres
HSerOUT [" Serial # =", dec sernum, " Calibration Number =", dec calcon, " Sensor resistance =", dec senres, 13,10] ' Display
hserout [" :)", 13,10]
It reports the values expected. When The Pic reboots, the values are gone at boot:
Code:
pause 5000
senres = 0
calcon = 0
sernum = 0
read 40, long sernum
read 20, long calcon
read 0, long senres
hserout[" Sen Res = ",dec senres,10,13]
hserout[" CalCon = ",dec calcon,10,13]
hserout[" Ser # = ",dec sernum,10,13]
Any help would be great.
Bookmarks