Reply
Old 12-13-2011, 04:37 PM   #1 (permalink)
 
Status: Junior Member
Posts: 1



Default SMS receive from GSM to PIC using MicroC Usart?

char rxarray[200], i=0;
void interrupt(void)
{
char rxchar;
rxchar = RCREG;
rxarray[i]=rxchar;
i = (i + 1) % 200;
PIR1.RCIF = 0;
}

void SendATcmd(char *ATcmd)
{
while(*ATcmd)
{
Usart_Write(*ATcmd++);
delay_ms(100);
}
Usart_Write(13);
delay_ms(500);
}
char ReadText()
{
}
void initThis(void)
{
RCON.IPEN = 0;
INTCON = 0xC0;
PIE1.RCIE = 1;
PIR1.RCIF = 0;

delay_ms(1000);
TRISB=0;
PORTB=0xff;
Usart_Init(9600);
memset(rxarray,0,200);
SendATcmd("AT");
SendATcmd("AT+CMGF=1");
delay_ms(1000);
}

void main (void)
{
initThis();
SendATcmd("AT+CMGL=\"ALL\"");

while(1)
{
if(newSMSFlag==1)
{
PORTB=0b01010101; // extract message
newSMSFlag=0;
}
}
}



/////////////////////////////////////////////////////////////////////////////////////////////////////////
Hi there programmers... please help.. im trying to create a program that would read the newly receive SMS from GSM and store it in a buffer.. so far, the codes above can receive the reply of the GSM from an AT commands.. I need an algorithm that monitors the text messages that i receive and store it in a buffer for other usage....
Airbytes is offline   Reply With Quote

Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why can't I receive UDP packets? GlennH Computer Programming 0 02-20-2014 03:05 PM
programming in microC? expeshoj Programming 0 04-02-2013 01:03 PM
What does it mean when i receive mails? cabron92 Coding 1 12-13-2012 07:06 AM
Is there a way to receive all the internet..? Unknown_User Programming 2 08-21-2012 01:36 PM
Sending signals to FT232 USB/USART from JAVA? Unknown_User Coding 1 02-26-2012 07:08 AM