Thankyou keith and Ioannis for ur contributions, pliz help me with the link for the manual and i try to follow it up. I dont have hard copy, mean while i wil make the changes u have told me
regards
Thankyou keith and Ioannis for ur contributions, pliz help me with the link for the manual and i try to follow it up. I dont have hard copy, mean while i wil make the changes u have told me
regards
I read through the manual and made the changes, now the new code is succesful with 16f84 but i wanted the same message to be sent to two phone numbers, pliz help me and check the code below;
code:
PushButton var PORTB.0 ' Setup the name PushButton to mean PortB input 0
Main:
IF PushButton = 0 THEN SMS 'If button is pressed then run the SMS routine below
goto main ' however if the button is not pushed then just go back to the Main
' routine to wait for the button to be pressed
SMS: ' this is the SMS commands routine in order to send an SMS
SEROUT PORTB.1,6,["AT" ,13,10] ' send AT to phone followed by a CR and line feed
SERIN PORTB.2,6,["OK"] ' now wait until OK is received
SEROUT PORTB.1,6,["AT+CMGF=1" ,13,10]
SERIN PORTB.2,6,["OK"]
SEROUT PORTB.1,6,["AT+CMGS=+256782277658"]
SEROUT PORTB.1,6,[13,10]
SERIN PORTB.2,6,[">"]
SEROUT PORTB.1,6,["BUTTON HAS BEEN PRESSED!"]
SEROUT PORTB.1,6,[26] ' this is ASCII for Ctrl+Z of which completes SMS sending
SERIN PORTB.2,6,["+CMG"] ' then PIC should receive +CMG from modem
SEROUT PORTB.1,6,[10] 'ascii code for a line feed
end
regards
Something like this?
IoannisCode:PushButton var PORTB.0 ' Setup the name PushButton to mean PortB input 0 Main: IF PushButton = 0 THEN SMS 'If button is pressed then run the SMS routine below goto main ' however if the button is not pushed then just go back to the Main ' routine to wait for the button to be pressed SMS: ' this is the SMS commands routine in order to send an SMS SEROUT PORTB.1,6,["AT" ,13,10] ' send AT to phone followed by a CR and line feed SERIN PORTB.2,6,["OK"] ' now wait until OK is received SEROUT PORTB.1,6,["AT+CMGF=1" ,13,10] SERIN PORTB.2,6,["OK"] SEROUT PORTB.1,6,["AT+CMGS=+256782277658"] SEROUT PORTB.1,6,[13,10] SERIN PORTB.2,6,[">"] SEROUT PORTB.1,6,["BUTTON HAS BEEN PRESSED!"] SEROUT PORTB.1,6,[26] ' this is ASCII for Ctrl+Z of which completes SMS sending SERIN PORTB.2,6,["+CMG"] ' then PIC should receive +CMG from modem SEROUT PORTB.1,6,[10] 'ascii code for a line feed '---------- second number------------ SEROUT PORTB.1,6,["AT+CMGS=+000222333666444"] SEROUT PORTB.1,6,[13,10] SERIN PORTB.2,6,[">"] SEROUT PORTB.1,6,["BUTTON HAS BEEN PRESSED!"] SEROUT PORTB.1,6,[26] ' this is ASCII for Ctrl+Z of which completes SMS sending SERIN PORTB.2,6,["+CMG"] ' then PIC should receive +CMG from modem SEROUT PORTB.1,6,[10] 'ascii code for a line feed end
Thank you Ioannis, i highly appreciate ur help;
Now i need to connect the phone to microcontroller, am looking for the models u told me nokia 6210, 6310 but i needed to know when i acquire the phone, how do i test whether it supports AT commands, any software i need to instal?
regards
dumato
I would recommend to find a GSM module or a device like the Wavecom, Siemens or other brand. All support AT commands.
Mobile phones are not designed for this job, although they will work eventually.
Ioannis
Ioannis, I would stress your above recommendation adding that some old phone will accept AT command, but they will work only in PDU mode, while the OP needs to work in Text mode.
Al.
All progress began with an idea
Bookmarks