Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[PIC] Interfacing GSM SIM900A module with PIC16F877A (mikroC lang)

Status
Not open for further replies.

4innovation

Newbie level 1
Joined
Feb 20, 2015
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
14
Hello everyone..
As a part of my project, I want to take input from sensor and send it to PIC16F877A MC,which sends an SMS through GSM SIM900A to another GSM module at the other side.Another PIC MC at the receiving GSM module turns ON an LED , which is the output required. I am a newbie to GSM modules and hence I tried sending an SMS to a mobile phone basing on the codes in mikroC and circuits that are available in the internet, but failed in making the circuit work. The code was built without any errors though. I cross-checked the hardware connections, but I was unable get a single clue on how to proceed further... Well, I have some questions now and I will be glad to get all kinds of suggestions.

Used mikroC lang and mikroC PRO for PIC.
1.I have used a 4Mhz crystal for PIC.. Is it sufficient or should I replace it?

2. Is the code correct? this is my code.. actually the one I took from the opensource sites.
Code:
void main() {
//
//Negotiate baud rate
UART1_Write_Text("AT");   // Send "AT" string then wait for a short delay
UART1_Write(0x0D);         // Termination by CR (ASCII value of Enter in Hex)
Delay_ms(100);            // 100 ms delay
//Disable Command echo
UART1_Write_Text("AT0");   // Send "AT0" string then wait for a short delay
UART1_Write(0x0D);         // Termination by CR (ASCII value of Enter in Hex)
Delay_ms(100);            // 100 ms delay
//Set message type as TEXT
UART1_Write_Text("AT+CMGF=1");   // Send "AT+CMGF=1" string to set SMS mode
UART1_Write(0x0D);         // Termination by CR (ASCII value of Enter in Hex)
Delay_ms(100);            // 100 ms delay
//
//Send message
UART1_Write_Text("AT+CMGS=\"mobileno.\"");   // Send SMS to cell number
UART1_Write(0x0D);         // Termination by CR (ASCII value of Enter in Hex)
UART1_Write_Text("Hello World");   // Send "Hello World" text message
UART1_Write("0x1A");   // Cntrl+Z (0x1A ASCII value of Cntrl+Z in Hex
UART1_Write(0x0D);         // Termination by CR (ASCII value of Enter in Hex)            // 100 ms Delay_ms(100);
}

3. Am I supposed to give connections for serial communication between SIM900A and PIC other than the ones specified in the circuit diagram?
hardware connections gsm pic.png
As, I am using a GSM module which has inbuilt converters, I have ignored the connections of voltage converter between the SIM900A and PIC MC.
 

Here I am attaching Tx code. Tomorrow I will post Rx code.

Pressing the button will send the SMS. Change mobile number and compile the code.
 

Attachments

  • Tx.rar
    33.1 KB · Views: 173
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top