LPC1114 UART Sample Code

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC1114 UART Sample Code

1,946 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by xyronne@gmail.com on Tue Dec 04 10:10:58 MST 2012
Hello to all the masters out there.

I am using LPC1114. Can anyone show me a sample code other than the sample given by LPCExpresso about UART?

Here's what I need,

I want to have a program that can do the following
1. using any gpio as input (tact switch)
2. every time this switch is press, it will send a string command to my modem - the command is "AT"
3. it will wait for the response from the device, once it will receive the response "OK", it will then off a led connected to other gpio
4. then it will wait for another press

Hope you guys can help me. Thanks in advance.
0 Kudos
Reply
2 Replies

1,339 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hgc_8421 on Sat Aug 01 11:03:11 MST 2015
Dear,
Can i get the coding that you have done for AT commands as i am also developing the same.
0 Kudos
Reply

1,339 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by xyronne@gmail.com on Sat Dec 15 21:47:48 MST 2012
unsigned char smsFormat[numSmsFormat] = "AT+CMGF=1";//sms format

int g = 0;


/****************************************************************************************************
  * FUNCTION NAME: gsmSmsFormat
  *
  * DESCRIPTION: this function will set sms format to AT+CMGF=1
  ***************************************************************************************************/
void gsmSmsFormat(void)
{
for(g=0;g<numSmsFormat;g++)
{
LPC_UART->IER = IER_THRE | IER_RLS;/* Disable RBR */
while ( !(LPC_UART->LSR & LSR_THRE) );
LPC_UART->THR = smsFormat[g];
LPC_UART->IER = IER_THRE | IER_RLS | IER_RBR;/* Re-enable RBR*/
}
return;
}
0 Kudos
Reply