This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

A fundamental question of L137 UART operating mode

I have a fundamental question about L137 UART operating modes.  This is what I want to do:

 

I want UART to trigger an interrupt when it receives certain byte of data.  Within this Interrupt Service Routine (ISR), the UART calls EDMA to read and/or transmit data.  Is it feasible on L137 UART0 and UART1?  The user’s guide says the chip supports both interrupt and EDMA.  But I don’t know if it can combine them together.  Thank you.

  • Sean,

    This is possible by enabling just the interrupt mode.  You can configure/launch EDMA data transfers for UART from within the ISR.

    The EDMA event mentioned in the user guide allows the UART to indirectly launch user pre-configured (hardware-mapped) EDMA transfers without CPU intervention.

    -Tommy

  • Tommy, thank you for the response.  I didn't realize EDMA can be launched inside FIFO Interrupt mode. I always thought you have to choose EITHER FIFO interrupt OR EDMA. Are you talking about Section 2.9 (page 20) of SPRUFM6A? Specifically, use RXFIFTL bit of FCR to send receiver event to EDMA controller?

    Do you have any example code that you might be able to share?  Thanks.

  • Sean,

    The UART is designed to be single-serviced by either CPU or EDMA.  What I mentioned before was actually a klugy approach of using the CPU servicing mode, but kicking off a one-shot data block transfer between UART & memory.

    The EDMA mode (described in Sec 2.9), is a more efficient method with an allocated EDMA event for UART so that the EDMA can immediately service the UART, then the EDMA can generate an interrupt to the CPU letting it know that the UART has been serviced.  The EDMA user guide has an example of how to configure the PARAMs under Section 3 Transfer Examples -> Peripheral Servicing Example.

    The BIOS and Linux UART drivers should also have support for both CPU and EDMA servicing.

    -Tommy