Other Parts Discussed in Thread: ADS1243
Hi
I have designed my own board using TM4C1294NCPDT.
I have checked UART0, UART2 and UART4 interrupts and they are working fine.
But I am facing problem with UART3. program stuck at uart3_init function.
Init function and interrupt handler functions are same as other working UARTs
The functions are as follows:
//******************************************************************
void uart3_init(uint32_t ui32SysClock)
{
//
// PJ0-1 are used for UART3.
//
ROM_GPIOPinConfigure(GPIO_PJ0_U3RX);
ROM_GPIOPinConfigure(GPIO_PJ1_U3TX);
ROM_GPIOPinTypeUART(GPIO_PORTJ_BASE, GPIO_PIN_0 | GPIO_PIN_1);
// already enabled GPIO Port D.
//
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART3);
//
// Configure the UART for 115,200, 8-N-1 operation.
//
ROM_UARTConfigSetExpClk(UART3_BASE, ui32SysClock, 115200,
(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
UART_CONFIG_PAR_NONE));
//
// Enable the UART interrupt.
//
ROM_IntEnable(INT_UART3);
ROM_UARTIntEnable(UART3_BASE, UART_INT_RX | UART_INT_RT);
}
//******************************************************************
void uart4_init(uint32_t ui32SysClock)
{
//
// PA2-3 are used for UART4.
//
ROM_GPIOPinConfigure(GPIO_PA2_U4RX);
ROM_GPIOPinConfigure(GPIO_PA3_U4TX);
ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_2 | GPIO_PIN_3);
// already enabled GPIO Port A.
//
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART4);
//
// Configure the UART for 115,200, 8-N-1 operation.
//
ROM_UARTConfigSetExpClk(UART4_BASE, ui32SysClock, 115200,
(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
UART_CONFIG_PAR_NONE));
//
// Enable the UART interrupt.
//
ROM_IntEnable(INT_UART4);
ROM_UARTIntEnable(UART4_BASE, UART_INT_RX | UART_INT_RT);
}
//******************************************************************
// The UART3 interrupt handler.
void UART3IntHandler(void)
{
uint32_t ui32Status;
//
// Get the interrupt status.
//
ui32Status = ROM_UARTIntStatus(UART3_BASE, true);
//
// Clear the asserted interrupts.
//
ROM_UARTIntClear(UART3_BASE, ui32Status);
//
// Loop while there are characters in the receive FIFO.
//
while(ROM_UARTCharsAvail(UART3_BASE))
{
//
// Read the character from the UART3 and write it to the UART4.
//
ROM_UARTCharPutNonBlocking(UART4_BASE,UARTCharGetNonBlocking(UART3_BASE));
}
}
//******************************************************************
// The UART4 interrupt handler.
void UART4IntHandler(void)
{
uint32_t ui32Status;
//
// Get the interrupt status.
//
ui32Status = ROM_UARTIntStatus(UART4_BASE, true);
//
// Clear the asserted interrupts.
//
ROM_UARTIntClear(UART4_BASE, ui32Status);
//
// Loop while there are characters in the receive FIFO.
//
while(ROM_UARTCharsAvail(UART4_BASE))
{
//
// Read the next character from the UART4 and write it back to the UART4.
//
ROM_UARTCharPutNonBlocking(UART4_BASE,UARTCharGetNonBlocking(UART4_BASE));
}
}
//******************************************************************
int main(void)
{
uint32_t ui32User0, ui32User1, ui32AnimPos, ui32Color;
uint8_t pui8MACArray[8],i;
tRectangle sRect;
//
// Run from the PLL at 120 MHz.
//
g_ui32SysClock = SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 120000000);
//
// Configure the device pins.
//
init_pinconfig();
delay_ms(10);
uart0_init(g_ui32SysClock);
uart2_init(g_ui32SysClock);
uart3_init(g_ui32SysClock);
uart4_init(g_ui32SysClock);
while(1)
{
}
}
//******************************************************************
Also I have initialized required UART peripherals in init_pinconfig() function.
Can any one help for the UART3 communication problem?