Need help with FullDulexSerial coding ...
I am trying to send an "AT" command to another chip from the Propeller with the code below; I must be overlooking something simple. Is my serial.str( ) command formatted wrong? If I wanted to append a Carrage return command after the AT command as well should would I just add a /r outside the parenthesis?
Thanks for any help that you give,
JMLStamp2p
_______________________________________________________________________________________________
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000 'Sets Clock Mde for 80 MHz
VAR
long rXdata 'Declares Local Varibles
long tXdata
OBJ
serial : "FullDuplexSerial" 'Includes access to the FullDuplexSerial Functions via the term"serial"
PUB MAIN
serial.start(31, 30, 0, 115200) 'Sets up Serial Baud rate and Pins
serial.rxFlush 'Flush Input Buffer
serial.str ("AT") 'Send AT command out pin 30 to SIMCOM900
Thanks for any help that you give,
JMLStamp2p
_______________________________________________________________________________________________
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000 'Sets Clock Mde for 80 MHz
VAR
long rXdata 'Declares Local Varibles
long tXdata
OBJ
serial : "FullDuplexSerial" 'Includes access to the FullDuplexSerial Functions via the term"serial"
PUB MAIN
serial.start(31, 30, 0, 115200) 'Sets up Serial Baud rate and Pins
serial.rxFlush 'Flush Input Buffer
serial.str ("AT") 'Send AT command out pin 30 to SIMCOM900
Comments
write
serial.str(string("AT",13))
instead of
serial.str ("AT")
SPIN can handle only bytes, words, longs directly
a string must be transformed into a bytesequence which is terminated by value zero
the command serial.str(string("AT",13)) stores the bytesequence decimal values 65,84,13,0 somewhere in the HUB-RAM and
passes the HUB-RAM-ADRESS to the method "str"
If you want to use strings with a variable content you have to define a byte-array
and always have to pass the ADRESS of the bytearray by using the "@"-operatot
best regards
Stefan
JMLtamp2p
serial.str(string(17,90,0)) 'Send the Equivelent of CTL & Z
!outa[10] 'Flash LED when Completed.
waitcnt(Wait_Cycles + cnt)
JMLStamp2p
serial.str(string(26,43,90,0))
JMLStamp2p
Thanks for your Help,
JMLStamp2p