LPC2136 UART0 and UART1 not working

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LPC2136 UART0 and UART1 not working

998 次查看
rtoribio
Contributor II

Hello everyone,

I am configuring my LPC2136 to use both UART0 and UART1. When configuring UART0 it works correctly with interruptions. When configuring UART1 does not work, it does not transmit, it does not receive. below the configuration(Keil):

void uart0_init(void) //9600 BAUD pclock 48MHZ
{
PCONP |= 0x00000008;/* PCRTC = 1 */
PINSEL0 |=0x00000005; // Enable RxD0 and TxD0 AND Enable RxD1 and TxD1
//U0FCR=0x07; //enable FIFO
U0LCR=0X83; //8-data bits, 1 Stop bit, Disable Parity and Enable DLAB
U0DLL=0x38; // MULVAL = 0x5 and DIVADDVAL = 14
U0DLM=1;
//U0FDR= 0x00000010; // MULVAL = 1 and DIVADDVAL = 0
U0LCR=0X03; //cleared DLAB
 U0IER= 0x00000001; 
}

void UART0_Interrupt_EN(void)
{
// VICIntSelect = 0x00000000;
VICVectAddr6 = (unsigned) UART0Handler;
VICVectCntl6 = 0x00000020 | 6;
VICIntEnable |=(1UL<<6); 
}

void uart1_init(void) //9600 BAUD pclock 48MHZ
{
PCONP |= 0x00000010;
PINSEL0 |= 0x00050000; /* Enable RxD1 and TxD1*/
U1FCR = 0x07;
U1LCR=0X83; //8-data bits, 1 Stop bit, Disable Parity and Enable DLAB
U1DLL=0x38; // MULVAL = 0x5 and DIVADDVAL = 14
U1DLM=1;
U1LCR=0X03; //cleared DLAB
U1IER= 0x00000001; 
}

void UART1_Interrupt_EN(void)
{
VICVectAddr7 = (unsigned) UART1Handler;
VICVectCntl7 = 0x00000020 | 7;
VICIntEnable |=(1UL<<7);
}

0 项奖励
回复
1 回复

903 次查看
Sabina_Bruce
NXP Employee
NXP Employee

Hello Raul,

In order to provide better support. Please refer to the other post that you have created so we can continue on one thread.

https://community.nxp.com/thread/517100 

Best Regards,

Sabina

0 项奖励
回复