Jump to content
43oh

UART interrupt doesn't give interrupt for 1 byte while using FIFO


Recommended Posts

Hi I am using tm4c123gh6pz UART. I am getting Interrupt but while I enable FIFO and try to get interrupt using following command,

 

 UARTFIFOLevelSet(UART0_BASE, UART_FIFO_TX1_8, UART_FIFO_RX1_8);

 

for the Receive, I get interrupt after 2 byte. I think Receive FIFO is 12 bit x 16 FIFO. To get interrupt after each byte I have to disable the FIFO.

 

Is there any other way to keep the FIFO and get interrrupt after each Byte.

 

Please let me know

 

Thanks

Link to post
Share on other sites

Reading the docs you should definitely get an interrupt after 1 bytes is loaded in the FIFO.

Are you using the Energia Serial class at all? You might have already done so but you will also need to enable the interrupt.

Below is the snip Energia uses to enable the FIFO.

//
// Set the UART to interrupt whenever the TX FIFO is almost empty or
// when any character is received.
//
ROM_UARTFIFOLevelSet(UART_BASE, UART_FIFO_TX1_8, UART_FIFO_RX1_8);
flushAll();
ROM_UARTIntDisable(UART_BASE, 0xFFFFFFFF);
ROM_UARTIntEnable(UART_BASE, UART_INT_RX | UART_INT_RT);
ROM_IntEnable(g_ulUARTInt[uartModule]);
Link to post
Share on other sites

Hi,

To get UART interrupted every byte (no FIFO) you must use the following pair instructions (and nothing else special besides interrupts):

UARTEnable(...);

UARTFIFODisable(...);

this is because inside UARTEnable silently is enabled also the FIFO (check the driverlib/uart.c file).

L

Link to post
Share on other sites

If you are using the FIFO you cannot get a interrupt at just 1 byte received. The lowest amount to get a interrupt is 2 bytes wich is 1/8 of the 16 FIFO depth.

 

You can only get a interrupt with each received byte if you don't use the FIFO. Like @@Lyon said, you need to use UARTFIFODisable(...);

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...