GSM Output
GSM Output
Roll No:-TYETC229
Program Statement:-Interfacing GSM with LPC2148 for sending and receiving message and
voice call.
Code:
Main.c File
#include "lpc214x.h"
#include "UART.h"
#include "stdio.h"
#include "string.h"
void delay(unsigned int time)
{
unsigned int i,j;
for(i=0;i<time;i++)
for(j=0;j<5000;j++);
}
void GSM_cmd(unsigned char *cmd)
{
printf("\r\ncommand: %s",cmd);
printf("response: ");
UART1_PutS(cmd);
delay(100);
}
int main()
{
unsigned char *msg = "MicroEmbedded Technologies\r";
Uart0Init(9600);
Uart1Init(9600);
printf("GSM program\r\n");
while(1);
return 0;
}
UART.h File
#ifndef UART_H
#define UART_H
#endif
UART.C File
#include "stdio.h"
#include "LPC214x.h"
#include "UART.h"
U1IER = 0x01;
VICVectCntl1 = 0x20 | 7;
VICVectAddr1 = (unsigned int)UART1_isr;
VICIntEnable |= 1<<7;
}