I have a simple gosub which asks the modem for a value, and this value is returned as a HEX value. Example in Hyperterminal:
"+++" ' sent to modem to enter AT command
OK ' modem responds OK
ATRS ' sent to modem - what is your RS value?
33 ' modem response (actually it sends back HEX values)
ATCN ' sent to modem to exit AT command
The value of RS will typically range from 6 – 54 (0x06 – 0x36 hex). This above answer of '33' equates to a decimal value of 51.
I want to read this RS on my 16F88, and display RS as a DECIMAL value and can't seem to get the right numbers to come out.. Here is the code:
dis4:
' third pass - RSSI
' Send command to radio and read RS value back
Serout2 Cpinout,84,["+++"]
Serin2 Cpinin,84,1000,noradio,[Wait ("K")]
Serout2 Cpinout,84,["ATRS",10,13]
Serin2 Cpinin,84,1000,noradio,[STR RSSI\2]
serout2 cpinout,84,["ATCN",10,13]
SSD1=RSSI[1]
SSD2=RSSI[2]
RSSIval=(ssd2*16)+ssd1 ' convert to dec
serout2 Apinout, 16468, [I,CLR]
serout2 Apinout, 16468, [I,L1_C1]
serout2 Apinout, 16468, ["RSSI: ",#RSSIval Dig 2, #RSSIval Dig 1]
pause 1000
Return
Anyone have any ideas? I am seeing '03' or '04' when it should be sending '51' or some number in that range...
NAKKK!!
Bookmarks