I am trying to send uart4 interrupt
I have initialized uart4 , but do not get transmit interrupt
My code for above is given below:
//-------------------------------------------------------------------------------------------------------------------------------------------------
//==============================================================================
// UART Initialize
//==============================================================================
void UART_INIT(void)
{
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART4);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
GPIOPinConfigure(GPIO_PA2_U4RX);
GPIOPinConfigure(GPIO_PA3_U4TX);
GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_2 | GPIO_PIN_3);
UARTConfigSetExpClk(UART4_BASE, ui32SysClock, 115200,
(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
UART_CONFIG_PAR_NONE));
IntEnable(INT_UART4);
UARTIntEnable(UART4_BASE, UART_INT_TX);
}
//==============================================================================
// UART 4 interrupt
//==============================================================================
void UART4_IntHandler(void)
{
uint32_t ui32Status;
ui32Status = UARTIntStatus(UART4_BASE, true);
UARTIntClear(UART4_BASE, ui32Status);
if(ui32Status & UART_INT_RX)
{
while(UARTCharsAvail(UART4_BASE))
{
COMM[COMM_232].RxD_TIMEOUT_CNT = 0;
COMM[COMM_232].RxD_BUF[COMM[COMM_232].RxD_BUF_PTR] = UARTCharGetNonBlocking(UART4_BASE);
if(++COMM[COMM_232].RxD_BUF_PTR >= 100) COMM[COMM_232].RxD_BUF_PTR = 0;
}
}
else if(ui32Status & UART_INT_TX)
{
while(UARTSpaceAvail(UART4_BASE))
{
if(COMM[COMM_232].TxD_BUF_PTR > COMM[COMM_232].TxD_END_PTR)
{
COMM[COMM_232].TxD_BUF_PTR = 0;
UARTIntDisable(UART4_BASE, UART_INT_TX);
UARTIntEnable(UART4_BASE, UART_INT_RX);
}
else UARTCharPutNonBlocking(UART4_BASE, COMM[COMM_232].TxD_BUF[COMM[COMM_232].TxD_BUF_PTR++]);
}
}
}
//==============================================================================
// Main
//==============================================================================
int main(void)
{
ui32SysClock = SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
SYSCTL_OSC_MAIN |
SYSCTL_USE_PLL |
SYSCTL_CFG_VCO_480), 20000000);
UART_INIT();
COMM[COMM_232].TxD_BUF[0] = 0x1;
COMM[COMM_232].TxD_BUF[1] = 0x3;
COMM[COMM_232].TxD_BUF[2] = 0x0;
COMM[COMM_232].TxD_BUF[3] = 0x0;
COMM[COMM_232].TxD_BUF[4] = 0x0;
COMM[COMM_232].TxD_BUF[5] = 0xa;
COMM[COMM_232].TxD_BUF[6] = 0x9d;
COMM[COMM_232].TxD_BUF[7] = 0xd1;
COMM[COMM_232].TxD_END_PTR = 7;
COMM[COMM_232].TxD_BUF_PTR = 0;
//UARTCharPutNonBlocking(UART4_BASE, COMM[COMM_232].TxD_BUF[COMM[COMM_232].TxD_BUF_PTR++]);
UARTCharPut(UART4_BASE, COMM[COMM_232].TxD_BUF[COMM[COMM_232].TxD_BUF_PTR++]);
while(1)
{
}
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
I am not sure where I am going wrong. Help needed seriously.
-karls