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] URGENT! please suggest any GSM modem to interface with PI16f877a Microcontroller.

Status
Not open for further replies.

HammadLakhani

Junior Member level 2
Joined
Oct 7, 2013
Messages
20
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Location
Karachi, Pakistan, Pakistan
Activity points
261
HI there. I have tried tC5i of sainsmart gsm modem but something went wrong and I need to change the modem urgent. Please suggest as possible Thank u
 

Thanx bro what happened actually I ordered another TC35i Modem of Sainsmart.. It is written that it Supports Arduino. What I am using is PIC microcontroller. I was wondering is fine for my controller as though it still is a AT commands control GSM modem? well yeah I already used the same modem 2 times before and both of them worked at beginning but randomly stoped communicating. I think is that the crystal frequency of modem should be = to crystal Freq of Controller. but they were not. Am I right if thats the problem? Thanx alot in advance....
 

What do you mean by Crystal freq of modem? Only baudrate of GSM modem should match with UART baudrate of MCU (PIC, AVR, ARM, 8051...). If GSM modem has 5V TTL interface then interface it to UART pins of MCU directly (MCU 5V type). If GSM has RS232 DB9 connector then you need MAX232 between MCU and GSMs DB9 connector. If GSM has 3.3V TTL interface then MCU should be 3.3V type. If MCU is 5V type and GSMs TTL is 3.3V type then you need voltage level translator.
 
Thanx alot bro for such a good knowledge. What happened was that my modem stopped communicating. I ordered another which worked great but the next day same thing happened and stopped working even. I am using rs232 Interface board with MAX232. My communication was working great with MCU and Modem both. But I was confused what went wrong to both modems. And yeah your write the crystal frequency is no concern over here. I have ordered my third modem which is another version of same modems. just dont know why modems are'aren't going fine
 

Hi there.. I have made my C programming code on MikroC which is able to communicate between Modem and Microcontroller PIC16f877a. It is successfully sending AT commands to modem and modem responds ok which is indicated by LED lights connected. I need some assistance on how I will program it to receive an SMS and control respective LEDs. IF we receive AT command response from AT+CMGR=1 it will give sms date ,time etc along with SMS. How will I make it read ONLY the sms and control an LED with that. I am going to update my code here. Please assist as possible SO MANY THANKS IN ADVANCE
 

receive data and store - then process later

void recieve() //Function to recieve data serialy from RS232
{
unsigned char k;
for(k=0;k<=87;k++)
{
while(RI==0);
card_id[k]=SBUF;
RI=0;
}
}
 
very thanks for the good knowledge... can you please let me know how can we define RI and SBUF in your post...

Im not acutally cleared with how to do it... I am using mikroC and my code goes something like:

#include "LCDdrive.h"
char uart_rd;
char output;



void main() {

LCD_initialise();
UART1_Init(9600); // Initialize UART module at 9600 bps
Delay_ms(100); // Wait for UART module to stabilize

TRISD=0x00;
TRISC6_bit = 0;
TRISC7_bit = 1;
//PORTC=0;
PORTD=0;
// U1MODEbits.ALTIO = 1; // un-comment this line to have Rx and Tx pins on their alternate
// locations. This is used to free the pins for other module, namely the SPI.



UART1_Write_Text("AT");
UART1_Write(10);
UART1_Write(13);
UART1_Read(); // read the received data,
UART1_Read_Text(output, "OK", 10); // reads text until 'OK' is found
UART1_Write_Text(output); // sends back text
PORTD=0x01;
LCD_putch(output); // Print the character. It can show a character or string typed in Send window on Receive window and LCD

UART1_Write_Text("AT+CMGF=1");
UART1_Write(10);
UART1_Write(13);
UART1_Read(); // read the received data,
UART1_Read_Text(output, "OK", 10); // reads text until 'OK' is found
UART1_Write_Text(output); // sends back text
PORTD=0x02;
LCD_putch(output); // Print the character. It can show a character or string typed in Send window on Receive window and LCD

UART1_Write_Text("AT+CMGD=1");
UART1_Write(10);
UART1_Write(13);
UART1_Read(); // read the received data,
UART1_Read_Text(output, "OK", 10); // reads text until 'OK' is found
UART1_Write_Text(output); // sends back text
PORTD=0x04;
LCD_putch(output); // Print the character. It can show a character or string typed in Send window on Receive window and LCD

UART1_Write_Text("AT+CMGR=1");
UART1_Write(10);
UART1_Write(13);
UART1_Read();

while (1) { // Endless loop
if (UART1_Data_Ready()) { // If data is received,
uart_rd = UART1_Read(); // read the received data,
UART1_Write(uart_rd); // and send data via UART
PORTD=0xFF;
LCD_putch(uart_rd); // Print the character. It can show a character or string typed in Send window on Receive window and LCD
}


}



}
#include"LCDdrive877A.c"

- - - Updated - - -

It does send and recieve AT commands from modem to PIC16f877a. but not able to know how it will read and control a specific SMS. Example: I send sms to modem "1", so it should turn on light 1. PLEASE ASSIST AS POSSIBLE SO THANKS IN ADVANCE
 

RI and SBUF are UART receive interrupt bit and UART buffer of 8051. In PIC equivalent for RI is RCIF_bit (mikroC) and for SBUF is RCREG.
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top