/***************************************************************
* ??: UART_Init()
* ??: LPC952
****************************************************************/
void UART_Init()
{
EA=0;
P1M1&=0x10; //TXD?RXD
P1M2&=0xec;
P1=0xff;
//UART0
S0CON=0x50;
S0STAT=0x20; // separate Rx / Tx interrupts
BRGCON_0=0;
BRGR1_0=0x02; //19200
BRGR0_0=0x61;
BRGCON_0=3;
//UART1
P4M1=0x10;P4M2=0xe0;
S1CON=0x50;
S1STAT=0x20; // separate Rx / Tx interrupts
BRGCON_1=0;
BRG1_1=0x01; //38400
BRG0_1=0x29;
BRGCON_1=3;
ES = 1; // enable UART interrupt
EA=1;
}
/************************/ |