5282604
Full Member level 4
i have problem with nxp arm lpc uart :sad:
i use this code from nxp . to print "Philips LPC"
**broken link removed**
this my simple code( i only put Initialize() in main) but the code not work give me another value not "Philips LPC" . i use proteus for simulation:lol:
i'm new in arm world
i use this code from nxp . to print "Philips LPC"
**broken link removed**
this my simple code( i only put Initialize() in main) but the code not work give me another value not "Philips LPC" . i use proteus for simulation:lol:
Code:
#include <LPC21xx.H> /* LPC21xx definitions */
/* Macro Definitions */
#define TEMT (1<<6)
#define LINE_FEED 0xA
#define CARRIAGE_RET 0xD
/************************* MAIN *************************/
int i;
char c[]="Philips LPC";
int main()
{
/* Initialize Pin Select Block for Tx and Rx */
PINSEL0=0x5;
/* Enable FIFO's and reset them */
U0FCR=0x7;
/* Set DLAB and word length set to 8bits */
U0LCR=0x83;
/* Baud rate set to 9600 */
U0DLL=0x10;
U0DLM=0x0;
/* Clear DLAB */
U0LCR=0x3;
/* Keep Transmitting until Null character('\0') is reached */
while(c[i])
{
U0THR=c[i];
i++;
}
U0THR=LINE_FEED;
U0THR=CARRIAGE_RET;
/* Wait till U0THR and U0TSR are both empty */
while(!(U0LSR & TEMT)){}
}
i'm new in arm world