Other Parts Discussed in Thread: EK-TM4C1294XL
Hi!
I am trying to make UART echo project for further use.
Receive and transmit functions use both FIFO and interrupts and work fine, except that when i call UART0_Send(); second time immediately after previous call, data from both calls is mixed:
const uint8_t FW_ID[] = {"u0_echo_1f "__DATE__" "__TIME__};
int main(void)
{
system_init();
rxi = 0;
UART0_Send((uint8_t *)FW_ID, strlen((const char *)FW_ID));
UART0_Send("\r\n>\r\n", 5);
like this:
u0_echo_1f Jan 19
>
2016 09:30:37
Obviously this happens because second UART0_Send call manages to insert data into UART TX FIFO before Interrupt finishes sending the previous call data.
To repair this i need to wait for UARTFR register TXFE bit becoming zero. Or even better ho have an interrupt setting a Boolean flag when this happens.
Unfortunately i do not find a Peripheral Driver Library function to do this.
I need something like:
while (UARTFR.TXFE) {};
Or interrupt on UARTFR.TXFE bit going zero.
I use EK-TM4C1294XL board with CCS v.6.1.1,TI compiler v. 5.2.6 and TivaWare_C_Series-2.1.2.111 libraries.
I am attaching the whole project.
Any suggestions?
Thank you.
Dmitri