void main() {
//
//Negotiate baud rate
UART1_Write_Text("AT"); // Send "AT" string then wait for a short delay
UART1_Write(0x0D); // Termination by CR (ASCII value of Enter in Hex)
Delay_ms(100); // 100 ms delay
//Disable Command echo
UART1_Write_Text("AT0"); // Send "AT0" string then wait for a short delay
UART1_Write(0x0D); // Termination by CR (ASCII value of Enter in Hex)
Delay_ms(100); // 100 ms delay
//Set message type as TEXT
UART1_Write_Text("AT+CMGF=1"); // Send "AT+CMGF=1" string to set SMS mode
UART1_Write(0x0D); // Termination by CR (ASCII value of Enter in Hex)
Delay_ms(100); // 100 ms delay
//
//Send message
UART1_Write_Text("AT+CMGS=\"mobileno.\""); // Send SMS to cell number
UART1_Write(0x0D); // Termination by CR (ASCII value of Enter in Hex)
UART1_Write_Text("Hello World"); // Send "Hello World" text message
UART1_Write("0x1A"); // Cntrl+Z (0x1A ASCII value of Cntrl+Z in Hex
UART1_Write(0x0D); // Termination by CR (ASCII value of Enter in Hex) // 100 ms Delay_ms(100);
}