We are using logic pd omap-l138 ZOOM experimental kit. with starterware version AM1808_StarterWare_1_00_02_02 on CCSv5x.
We are facing an unique problem with UART. Once the UART overruns we do not get any interrupt. How to handle this issue ?
Thank you.
static void ConfigureAINTCIntUART2(void)
{
/* Registers the UARTIsr in the Interrupt Vector Table of AINTC. */
IntRegister(SYS_INT_UARTINT2, UART2Isr);
/* Map the channel number 2 of AINTC to UART2 system interrupt. */
IntChannelSet(SYS_INT_UARTINT2, 3);
IntSystemEnable(SYS_INT_UARTINT2);
}
void vInitUART_2()
{
unsigned int intFlags = 0;
unsigned int config = 0;
/* Enabling the PSC for UART2.*/
PSCModuleControl(SOC_PSC_1_REGS, HW_PSC_UART2, PSC_POWERDOMAIN_ALWAYS_ON,
PSC_MDCTL_NEXT_ENABLE);
/* Setup PINMUX */
UARTPinMuxSetup(2, FALSE);
/* Enabling the transmitter and receiver*/
UARTEnable(SOC_UART_2_REGS);
/* 1 stopbit, 8-bit character, no parity */
config = UART_WORDL_8BITS;
/* Configuring the UART parameters*/
UARTConfigSetExpClk(SOC_UART_2_REGS, SOC_UART_2_MODULE_FREQ,
BAUD_115200, config,
UART_OVER_SAMP_RATE_16);
/* Enabling the FIFO and flushing the Tx and Rx FIFOs.*/
UARTFIFOEnable(SOC_UART_2_REGS);
/* Setting the UART Receiver Trigger Level*/
UARTFIFOLevelSet(SOC_UART_2_REGS, UART_RX_TRIG_LEVEL_1);
SetupAINTCInt();
/* Configure AINTC to receive and handle UART interrupts. */
ConfigureAINTCIntUART2();
/* Preparing the 'intFlags' variable to be passed as an argument.*/
intFlags |= (UART_INT_LINE_STAT | \
UART_INT_TX_EMPTY | \
UART_INT_RXDATA_CTI);
/* Enable the Interrupts in UART.*/
UARTIntEnable(SOC_UART_2_REGS, intFlags);
}
static void UART2Isr()
{
unsigned char rxData = 0;
unsigned int int_id = 0;
/* This determines the cause of UART2 interrupt.*/
int_id = UARTIntStatus(SOC_UART_2_REGS);
/* Clears the system interupt status of UART2 in AINTC. */
IntSystemStatusClear(SYS_INT_UARTINT2);
/* Checked if the cause is transmitter empty condition.*/
if(UART_INTID_TX_EMPTY == int_id)
{
//Tx Code
}
/* Check if the cause is receiver data condition.*/
if(UART_INTID_RX_DATA == int_id)
{
//Rx Code
}
/* Check if the cause is receiver line error condition.*/
if(UART_INTID_RX_LINE_STAT == int_id)
{
while(UARTRxErrorGet(SOC_UART_2_REGS))
{
/* Read a byte from the RBR if RBR has data.*/
UARTCharGetNonBlocking(SOC_UART_2_REGS);
}
}
}