Microcontroller › PIC › problem while compiling program of pic 18f4550 interfacing with gsm
- This topic has 7 replies, 5 voices, and was last updated 11 years ago by Ian.
Viewing 8 posts - 1 through 8 (of 8 total)
-
AuthorPosts
-
October 30, 2012 at 11:48 am #3908eveningParticipant#include<p18f4550.h>#define FREQ 12000000#define baud 9600#define spbrg_value (((FREQ/64)/baud)-1)#define rs LATA.F0#define rw LATA.F1#define en LATA.F2#define lcdport LATBvoid tx_data(unsigned char);unsigned char rx_data();void lcd_ini();void lcdcmd(unsigned char);void lcddata(unsigned char);void gsm_cmd(unsigned char *);void output(void);unsigned char value=0;int i=0,j,k,temp,flag,choice;unsigned char *starting_text="Enter choice=";unsigned char *dial_text="Dialing…";unsigned char *at_cmd="AT";unsigned char *imei_cmd="AT+GSN";unsigned char *call_cmd="ATD9xxxxxxxxx;"; // Provide a 10-Digit Mobile Numberunsigned char *sms_format="AT+CMGF=1";unsigned char *sms_write="AT+CMGS="xxxxxxxxxx""; // 10-Digit Mobile Numberunsigned char *sms="Hello";unsigned char *sms_report="SMS Sent…";unsigned char sms_terminate=0x1A;unsigned char enter=0x0D;unsigned char *data;void main(){TRISB=0; // Set Port B as output portLATB=0;TRISA=0;LATA=0;TRISD=0xFF;LATD=0;SPBRG=spbrg_value; // Fill SPBRG register to set the baud rateRCSTA.SPEN=1; // To activate serial port (Tx and Rx pins)TXSTA.TXEN=1; // Activate TransmissiomRCSTA.CREN=1; // Activate ReceptionPIE1.RCIE=1; // Enable Reception interruptINTCON.GIE=1; // Enable Global interruptINTCON.PEIE=1; // Enable Peripheral interruptlcd_ini();while(1){k=0;lcdcmd(0x80);while(starting_text[k]!='