Content originally posted in LPCWare by changwoo Ryu on Mon Nov 03 19:19:58 MST 2014
Hi there
I using the LPC812 MCU based QuickJack board and develping a application with it.
while I using UART0, I can't read UART read from RXDAT.
So, I checked UART0 register and found that UART_STAT_RXRDY is not set 1,
Here is my code and please check it. this code came from NXP_Quick_Jack.c and I just add the test fode for Chip_UART_Send() and UART0_IRQHandler(). When I excute Chip_UART_Send() function, I checked the data output and receive data froom other device. also checked the occured of UART receive interrupt and just failed at Chip_UART_Read() function.
please check it.
thank you
/* ----------------------- UART Test code ------------------------------------*/
const uint8_t RxD[1]={0x0,};
void UART0_IRQHandler(void)
{
Chip_UART_Read(LPC_USART0,(void *)RxD,1);
}
/**
* @briefMain routine for Quick Jack
* @returnFunction should not exit
*/
int main(void)
{
uint8_t FuncProcVal;
const char data_1[1]= {0x80};
SystemCoreClockUpdate();
Board_Init();
/* Init timers */
Chip_MRT_Init();
/* Set MRT timing parameter */
Chip_MRT_SetInterval(LPC_MRT_CH0, ((SystemCoreClock / QUICKJACKCOMMUNICATIONCLK) / QUICKJACKRXCLKSAMPLEBITS));
Chip_MRT_SetInterval(LPC_MRT_CH1, ((SystemCoreClock / QUICKJACKCOMMUNICATIONCLK) >> 1));
Chip_MRT_SetInterval(LPC_MRT_CH2, ((SystemCoreClock >> 9)* 109));
/* Enable MRT Channel 0, 1 and 2 */
Chip_MRT_SetEnabled(LPC_MRT_CH0);
Chip_MRT_SetEnabled(LPC_MRT_CH1);
Chip_MRT_SetEnabled(LPC_MRT_CH2);
NVIC_EnableIRQ(MRT_IRQn);
NVIC_EnableIRQ(UART0_IRQn);
Chip_UART_Send(LPC_USART0,data_1,1);
FuncProcVal = 1;
while(1) {
Function_Init((uint8_t *)&PhoneData, (uint8_t *)&FuncProcVal);
Function_Proc(FuncProcVal);
}
}