// Name : Interfacing GSM module with PIC Microcontroller
// Purpose : To send SMS from PIC Microcontroller.
// Author : Subham Dutta
// Date : 03-01-14
// Website : www.nbcafe.in sbit LCD_RS at RD2_bit; sbit LCD_EN at RD3_bit; sbit LCD_D4 at RD4_bit; sbit LCD_D5 at RD5_bit; sbit LCD_D6 at RD6_bit; sbit LCD_D7 at RD7_bit; sbit LCD_RS_Direction at TRISD2_bit; sbit LCD_EN_Direction at TRISD3_bit; sbit LCD_D4_Direction at TRISD4_bit; sbit LCD_D5_Direction at TRISD5_bit; sbit LCD_D6_Direction at TRISD6_bit; sbit LCD_D7_Direction at TRISD7_bit; void main() { int a[10]; lcd_init(); Lcd_Cmd(_LCD_CLEAR); lcd_out(1,1,”Send SMS to”);UART1_Init(9600); // Initialize UART module at 4800 bps
UART1_Write_Text(“AT+CMGS=”);
Delay_ms(1000); lcd_out(2,1,”9800220107″); UART1_Write(0x22); //” double qoute
Delay_ms(2000);
UART1_Write_Text(“9800220107″); // Your Telephone Number cd_chr_cp(uart_rd);
UART1_Write(0x22); //” double qoute
UART1_Write(0x0D); // mean Enter
Lcd_Cmd(_LCD_CLEAR);
lcd_out(1,1,”MASSAGE:”); lcd_out(2,1,”WWW.NBCAFE.IN”); Delay_ms(2000);
UART1_Write(0x22);
UART1_Write_Text(“WWW.NBCAFE.IN”); //My Text Test
UART1_Write(0x22); //” double qoute
Delay_ms(2000);
UART1_Write(26); //Ctr +Z
Delay_ms(2000);
UART1_Write(0x0D); // mean Enter
Delay_ms(2000);
Lcd_Cmd(_LCD_CLEAR); lcd_out(1,1,”SEND”); lcd_out(2,1,”SUCCESSFULLY”);
}