UART4 DMA on K66

cancel
Showing results for 
Search instead for 
Did you mean: 

UART4 DMA on K66

Jump to solution
505 Views
alexstefan
Contributor III

Hi,

Am using a Kinetis K66 on a custom board where the UART we want to use is routed to PTC14 and PTC15 (UART4). Data is transmitted asynchronously, so it means both TX and RX could be active at the same time. While writing the firmware I noticed that DMA only has one trigger source for UART4 that's common for both TX and RX. I am not very experienced with DMA, but from my understanding of things, I won't be able to receive data at the same time as I'm sending it, presuming I use DMA for both TX and RX. Any way I could get around this?

Thank you,

Alex

0 Kudos
1 Solution
191 Views
mjbcswitzerland
Specialist V

Hi Alex

Unfortunately you can use DMA on either tx or rx, and not both on UART4 of the K66.
If you connect the source to a DMA channel with both rx and tx DMA triggers enabled either of them will trigger a DMA transfer, which means that rx will disturb tx and tx will disturb rx.

On the K64 both UARTs 4 and 5 have this restriction!

The K66 does in fact have a free (marked reserved) DMA source number that could have been used for UART4 receive due to the fact that its 6th UART is a LPUART, which has its own rx and tx source elsewhere. Presumably giving UART4 its own rx source would have disrupted the standard MUX layout in some way and it was decided to keep it shared (for compatibility), which is a shame in your case. I think that you will need to decide on the direction to use DMA on and use interrupt on the other.

Regards

Mark

UARTs: http://www.utasker.com/docs/uTasker/uTaskerUART.PDF

uTasker developer and supporter (+5'000 hours experience on +60 Kinetis derivatives in +80 product developments)
Kinetis: http://www.utasker.com/kinetis.html

View solution in original post

0 Kudos
2 Replies
192 Views
mjbcswitzerland
Specialist V

Hi Alex

Unfortunately you can use DMA on either tx or rx, and not both on UART4 of the K66.
If you connect the source to a DMA channel with both rx and tx DMA triggers enabled either of them will trigger a DMA transfer, which means that rx will disturb tx and tx will disturb rx.

On the K64 both UARTs 4 and 5 have this restriction!

The K66 does in fact have a free (marked reserved) DMA source number that could have been used for UART4 receive due to the fact that its 6th UART is a LPUART, which has its own rx and tx source elsewhere. Presumably giving UART4 its own rx source would have disrupted the standard MUX layout in some way and it was decided to keep it shared (for compatibility), which is a shame in your case. I think that you will need to decide on the direction to use DMA on and use interrupt on the other.

Regards

Mark

UARTs: http://www.utasker.com/docs/uTasker/uTaskerUART.PDF

uTasker developer and supporter (+5'000 hours experience on +60 Kinetis derivatives in +80 product developments)
Kinetis: http://www.utasker.com/kinetis.html

View solution in original post

0 Kudos
191 Views
alexstefan
Contributor III

Thanks a lot, Mark! Your contributions to the community are very helpful, I've learned a lot about the DMA functioning on the Kinetis and solutions to various use cases, from the messages you've posted.

Fortunately, we've been able to find an easy way to swap the pins with a debug UART that was assigned to UART0 and where we only need TX functionality.

Alex

0 Kudos