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.

PIC16f88 or pic16f877 interfaced with gsm modem sim900

Status
Not open for further replies.

kiean

Newbie level 5
Joined
Dec 26, 2011
Messages
8
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,349
I just want to ask who knows how to program a PIC16f88 or PIC16f877a that will sends AT commands to GSM modem whenever an input high is send to any PORTA pins. I have here my code but it doesnt work and i dont know whats wrong.Im not really familiar with these programming stuff.here is my source code but any source code suggestion can be a really big help.

#include <pic.h>

//wrapper for sending char in usart TX port
void tx_char (char c) {
TXREG = c; //place character to usart tx register
}

//wrapper for sending a string in usart TX port
void tx_str (char *s) {
while (*s != '\0') {
while (!TXIF);
tx_char (*s);
s ++;
}
}

void main (void) {
signed long int ctr;
ADCON0 = 0x00; //disable adc functionality
INTCON |= 0xC0; //enable global and peripheral-based interrupts
TRISA = 0xFF; //port a is input

//init usart capabilities
TXSTA |= 0b00100100;
RCSTA |= 0b10010000;
SPBRG = 0x19; //9600 baud

while (1) {
for (ctr = 0; ctr < 0xFF; ctr ++);
tx_str("AT\rAT+CMGF=1\rAT+CMGW=\"+63236805800\"\rmy message.\n+CMGW: 1\rAT+CMSS=1\r+CMSS: 20\r" ) ;
}
}
 

hi friends
I want to start to work about SMS by PIC (mikroc pro) please help:oops:
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top