Here is some test code.
define OSC 20 ' set the correct speed here!!
define LOADER_USED 1
define HSER_RCSTA 90h
DEFINE HSER_TXSTA 20h
DEFINE HSER_BAUD 9600
DEFINE HSER_SPBRG 32
DEFINE HSER_CLROERR 1
Teladd var byte
TelephoneNo1 var byte[16]
For Teladd = 0 To 15 ' Read Telephone number in memory
Read Teladd,TelephoneNo1[Teladd]
Next TelAdd
sms:
'THIS WORKS
hserOUT [65,84,13] 'Sending "AT" and Carraige return to GSM module
hserin 5000, SMS,[WAIT("OK")] ' wait for response ok for 5 seconds
hserOUT ["AT+CMGS=",34,"07771716175",34,13] 'Here the GSM module is told the desitnation phone number
hserin 15000,SMS,[WAIT(62)]
hserOUT ["WJ Groundwater Limited One Pump Failed",26]
hserin 15000,SMS,[WAIT(43,67,77,71)]
'AND THIS DOES NOT
hserOUT [65,84,13] 'Sending "AT" and Carraige return to GSM module
hserin 5000, SMS,[WAIT("OK")] ' wait for response ok for 5 seconds
hserOUT ["AT+CMGS=",34,str TelephoneNo1\16,34,13] 'Here the GSM module is told the desitnation phone number
hserin 15000,SMS,[WAIT(62)]
hserOUT ["WJ Groundwater Limited One Pump Failed",26]
hserin 15000,SMS,[WAIT(43,67,77,71)]
serout portc.5,6,[12, "msg SENT"]
Bookmarks