Hyperterminal is a 'Terminal Emulation' program that runs on the PC. If you are using the PIC to send/receive, HYperterminal doesn't apply.sakura41308 said:i know we can used hyperterminal and AT command..
But, how ?
You can use any language.sakura41308 said:What kind of languange can used..C or assembly..
what software and compiler need...
It's curious that you have seperate schematcis for the send and receive circuits - why not make one schematic?sakura41308 said:This is my circuit for interface between GSM modem and PIc
You connect the serial port of the phone to the serial port of the PIC, then you send the 'AT' commands through the serial port.codewiz said:But my greatest doubt is: when you connect a mobile phone to PIC, where do you put the AT command
You write code to receive a packet from the phone, parse the message out of the packet and decode the message to determine what it is, and then act upon it.codewiz said:and how do you code the PIC to understand the signal from the phone. for instance, when a particular sms arive in the mobile phone, how will the PIC detect and decode the message? thanks.
That's correct.codewiz said:Thanks GSM Man for your swift and expert reply. what i understood in your explanation is that the Tx and Rx of the PIC is connected to that of the mobile phone in a standard serial communication. then the AT commands will be in form of messages transmitted to the mobile phone. And message from the mobile phone is filtered by the PIC to do action according to code. am i right?
When you read an SMS message from the modem it will be a string that contains other data such as the caller's number, date & time. For example, a message with the text "This is a test" may look like this:codewiz said:i don't know how to parse message. i think i need a sample code, book or tutorial for this. i'm completely newbie to this but willing to learn.
+CMGR: "REC UNREAD","19085551212",,"09/07/17,08:52:57-16"
This is a test
Just clcik on the PM button on any of my posts and you can send me a Personal Messagesakura41308 said:can u give me your email..so, we can chat and you can help me. along this project process .. (",). i
sakura41308 said:Gsm man...can u check my interface circuit...and plz help me correct the circuit ..
include the value 0f each component
as example : what value of crystal are used , 20 Mhz or 4 Mhz...
amila133 said:Hi,
I want to send and read SMS using PIC. I hope to use AT commands for this purpose. I found lot of AT commands. But I am confuse with How should I process AT commnds with PIC.
I am going to use MikroC for PIC programming, Is it suitable?
Can any one explain this Using simple example?
' Initialization
TRISB=%00000000
PORTB=%00000000
'Definitions
DEFINE OSC 4
DEFINE HSER_TXSTA 20h
DEFINE HSER_RCSTA 90h
DEFINE HSER_BAUD 2400
DEFINE HSER_SPBRG 25
BEGIN:
PORTB = 0
HIGH PORTB.7
PAUSE 1000
LOW PORTB.7
HIGH PORTB.6
HSerout ["AT",13,10] 'TEST COMMUNICATION
HSERIN 5000,begin,[WAIT("OK")]
HIGH PORTB.5
PAUSE 500
GOTO begin
'END
End
'Definitions
DEFINE OSC 4 'for 4 Mhz
'DEFINE OSC 8 'for 8 Mhz
DEFINE HSER_TXSTA 20h 'I wonder shall I define as DEFINE HSER_TXSTA 24h???
DEFINE HSER_RCSTA 90h 'same for all
DEFINE HSER_BAUD 2400 'for 2400 Baud rate
'DEFINE HSER_BAUD 4800 'for 4800 Baud rate
'DEFINE HSER_BAUD 9600 'for 9600 Baud rate
DEFINE HSER_SPBRG 25 'for 4Mhz/2400 & 8Mhz/4800 with an error %0.16
'DEFINE HSER_SPBRG 12 'for 4Mhz/4800 & 8Mhz/9600 with an error %0.16
DEFINE HSER_CLROERR 1 'same for all
' Initialization & Declaration
i var byte
TRISB=%00000000
PORTB=%00000000
TRISD=%00001111
PORTD=%00000000
' CHECK
FIRSTCHECK:
HIGH PORTB.7
PAUSE 500
HIGH PORTB.6
PAUSE 500
HIGH PORTB.5
PAUSE 500
HIGH PORTB.4
PAUSE 500
PORTB=%00000000
GSM_CHECK:
HSEROUT ["AT",13] 'Send AT to modem followed by a CR
HSERIN 5000, GSM_CHECK, [WAIT("OK")] 'Check OK reply, wait 5sec max.
HIGH PORTB.7
PAUSE 1000
HSEROUT ["AT+GMM",13] 'Ask model name
HSERIN 5000, GSM_CHECK, [WAIT("T610 series")] 'Check model name
HIGH PORTB.6
PAUSE 1000
HSEROUT ["AT+IPR=2400",13] 'Set transfer speed
HSERIN 5000, GSM_CHECK, [WAIT("OK")]'Check OK reply, wait 5sec max.
HIGH PORTB.5
PAUSE 1000
HSEROUT ["AT+CMGF=1",13] 'send AT to modem followed by a CR and line feed
HSERIN 5000, GSM_CHECK, [WAIT("OK")]'Check OK reply, wait 5sec max.
HIGH PORTB.4
PAUSE 1000
PORTB=%00000000
BEGIN:
IF PORTB.5=1 THEN ERROR_CALL
IF PORTB.6=1 THEN ERROR_SMS
HIGH PORTB.7
pause 1000
LOW PORTB.7
if PORTD.2 = 0 then SEND_SMS
IF PORTD.3 = 0 THEN CALL_PHONE
PAUSE 1000
GOTO BEGIN
SEND_SMS:
HIGH PORTB.6
HSEROUT ["at+cmgs=",34,"XXXXX",34,13]
PAUSE 1000
HSEROUT ["this is a test message",26]
HSERIN 10000, BEGIN, [WAIT("OK")]'Check OK reply, wait 5sec max.
LOW PORTB.6
GOTO BEGIN
CALL_PHONE:
HIGH PORTB.5
HSEROUT ["atd[XXXXX];",13]
HSERIN 5000, BEGIN, [WAIT("OK")]'Check OK reply, wait 5sec max.
PAUSE 2000
LOW PORTB.5
GOTO BEGIN
ERROR_CALL:
FOR i = 1 to 5
HIGH PORTB.4
PAUSE 500
LOW PORTB.4
PAUSE 500
next i
PORTB=%00000000
GOTO BEGIN
ERROR_SMS:
FOR i = 1 to 5
HIGH PORTB.4
PAUSE 500
LOW PORTB.4
PAUSE 500
next i
PORTB=%00000000
GOTO BEGIN
' END
End
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?