Other Parts Discussed in Thread: EK-TM4C123GXL
Tool/software: Code Composer Studio
I am developing firmware for a board that contains 1 TM4C129 and 6 TM4C123 MCUs. They are connected through UART1 on all devices and we would like to use 9 bit addressing mode. I am trying to simulate our setup using a DK-TM4c129X and a EK-TM4C123GXL.
Using the uart_echo example for both boards, I added UART1 and connected U1RX and U1TX between the two boards. I echo data from the 129 UART0 to the 123 UART0 and this works in non 9 bit addressing but when I enable 9 bit addressing the 123 does not generate an interrupt.
129 setup:
//
// Configure the UART1 for 115,200, 8-N-1 operation.
//
ROM_UARTConfigSetExpClk(UART1_BASE, ui32SysClock, 115200,
(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
UART_CONFIG_PAR_NONE));
ROM_UART9BitAddrSet(UART1_BASE, 0x14, 0xFF);
ROM_UART9BitEnable(UART1_BASE);
ROM_UART9BitAddrSend(UART1_BASE, 0x33);
129 interrupt
while(ROM_UARTCharsAvail(UART0_BASE))
{
//
// Read the next character from the UART and write it back to both UART.
//
data = UARTCharGetNonBlocking(UART0_BASE);
ROM_UARTCharPutNonBlocking(UART0_BASE, data);
if (data >= 0x30 && data <= 0x39) {
ROM_UART9BitAddrSend(UART1_BASE, (uint8_t)data);
} else
ROM_UARTCharPutNonBlocking(UART1_BASE, data);
}
123 setup
//
// Configure the UART for 115,200, 8-N-1 operation.
//
ROM_UARTConfigSetExpClk(UART1_BASE, ROM_SysCtlClockGet(), 115200,
(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
UART_CONFIG_PAR_NONE));
ROM_UART9BitAddrSet(UART1_BASE, 0x33, 0xFF);
ROM_UART9BitEnable(UART1_BASE);
123 interrupt
while(ROM_UARTCharsAvail(UART1_BASE))
{
//
// Read the next character from the UART and write it back to the UART.
//
ROM_UARTCharPutNonBlocking(UART0_BASE,
ROM_UARTCharGetNonBlocking(UART1_BASE));
//
// Blink the LED to show a character transfer is occuring.
//
GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2, GPIO_PIN_2);
//
// Delay for 1 millisecond. Each SysCtlDelay is about 3 clocks.
//
SysCtlDelay(SysCtlClockGet() / (1000 * 3));
//
// Turn off the LED
//
GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2, 0);
}