I am using a TM4C1294NCPDT with CCS ccs 6.1.2 and TIRTOS 2.16.0.08.
On the TM4C1294NCPDT, I am using UART0 and would like to use the FIFO and the IRQ to receive data from the RS232 device. In my testing, I see I can enable the IRQ and get an interrupt every time I get a character from the RS232 device if the FIFO is off. If I turn the FIFO on, I see I can set the level of the FIFO to reach before an IRQ is generated. If I set the FIFO to the lowest level using
#define UART_FIFO_TX1_8 0x00000000 // Transmit interrupt at 1/8 Full
I get an IRQ on every other character so if I receive an odd number or chars I will not get an interrupt to know to go read the last character for the RS232 device.
Currently I have it working by disabling the FIFO but by disabling the FIFO I risk missing a char if for any reason the software gets delayed reading the data before the next char is received.
Some code:
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
GPIOPinConfigure(GPIO_PA0_U0RX);
GPIOPinConfigure(GPIO_PA1_U0TX);
ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
ROM_UARTConfigSetExpClk(UART0_BASE, g_ui32SysClock,
ee_prom_rs232GenCfg.baudRate, // 19200, //115200, //9600,
(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));
UARTFIFODisable(UART0_BASE); // this will interrupt every char if FIFO is off.
UARTFIFOLevelSet(UART0_BASE, UART_FIFO_TX1_8, UART_FIFO_RX1_8); // this will interrupt every 2 chars if the FIFO is used.
Error_init(&eb);
Hwi_Params_init(&hwiParams);
myHwi = Hwi_create(INT_UART0_TM4C129, RX232_IrqCallback, &hwiParams, &eb);
UARTIntEnable(UART0_BASE, UART_INT_RX | UART_INT_TX);
What I would prefer is to use the IRQ and the FIFO and be able to get a IRQ on each character received.
Am I missing something?
Thanks,
Doug