
Originally Posted by
NavMicroSystems
I have tried it using a NOKIA Phone and it works fine.
The Phone is connected to the HW-USART via MAX232
Baudrate: 9600 8N1
You need a clock spped of minimum 8MHz
(I'm using a 12MHz resonator)
-------------------------------------
DEFINE OSC 12
DEFINE HSER_TXSTA 20h
DEFINE HSER_RCSTA 90h
DEFINE HSER_BAUD 9600
DEFINE HSER_CLROERR 1
GSMBUFFER VAR BYTE[16]
Caller VAR BYTE[13]
GSMTime VAR BYTE[17]
'Send SMS Test-Message
HSerout ["ATZ",13,10]
Pause 1000
HSerout ["AT+CMGF=1",13,10] 'Set Text Mode
Pause 500
HSerout ["AT+CMGS=",34,"+491232456789",34,",129",13,10]
Pause 500
HSerout ["Test-Message",10,13]
HSerout [26]
Pause 500
' Check for new incomming Messages
HSerout ["ATZ",13,10]
Pause 1000
HSerout ["AT+CMGF=1",13,10]
Pause 1000
Loop:
'List new Messages
HSerout ["AT+CMGL",13,10]
' Read Caller ID, time and 16 CHARs of Message
' The timeout value in the HSERIN statement is important, it takes some time before the phone replies to the AT+CMGL command
HSerin 5000,loop,[wait("UNREAD"),skip 3,STR Caller\13,skip 4,STR GSMTime\17,skip 6, STR GSMBUFFER\16\13]
' --- Put your code to output the result here
' i.e. LCDOUT . . . .
Goto Loop:
-------------------------------------------------
There are certainly better ways to do the job, this was just a quick test and it works
Bookmarks