UART in DMA mode.

cancel
Showing results for 
Search instead for 
Did you mean: 

UART in DMA mode.

Jump to solution
980 Views
darcy_cavanagh
Contributor I

Hi i'm currently working with the PNEV5180b development board, which has the LPC 1769. I am in the MCUXpresso IDE.

My project is currently set up with UART0 in order to communicate with a VB app running in Visual Studio.

The VB app currently needs to send a lot data to the app on the board which I have had to handle by polling for more data after every 16 Bytes since the Receive FIFO capacity on the LPC 1769 is also 16 Bytes.

LPC_IOCON->PINSEL[0] |= (1<<4) | (1<<6);

Chip_UART_SetBaud(LPC_UART0, 115200);

Chip_UART_ConfigData(LPC_UART0, UART_LCR_WLEN8 | UART_LCR_SBS_1BIT | UART_LCR_PARITY_DIS); /* 8 bits, 1 Stop bit, no Parity*/


Chip_UART_SetupFIFOS(LPC_UART0, (UART_FCR_FIFO_EN | UART_FCR_RX_RS | UART_FCR_TX_RS | UART_FCR_DMAMODE_SEL));

Chip_UART_DisableDivisorAccess(LPC_UART0);

This is my UART0 configuration using the lpc_chip_175x_6x library which is working well.

The issue is this causing the communication to be quite slow as the board app needs to handle these bytes, then poll for more. Meanwhile, VB's side is just waiting until it gets a confirmation message that it can send the next 16 Bytes.

I have been looking to do this UART receive using DMA mode which from my understanding, allows the data being received to skip the cpu(and FIFO) and get directly stored in memory, thus also leaving the CPU free to handle the bytes and not requiring polling. (Please correct me if my understanding is wrong)

I am very new to setting up UARTs and am having a tough time fully understanding the lpc_chip_175x_6x library and how to properly set up the DMA mode for use. 

I've been trying to implement the gpdma functions found in gpdma_17xx_40xx.c to set it up and am getting lost.

Does anyone know how to set up the DMA for my intended purpose? Or even a simpler way to get round my issue?

Also if you suggest using interrupt driven UART, I also don't know how to set this up lol

I just need it to be able to receive all the data being sent by the VB app without having this 16 Byte FIFO slowing down the process.

Thanks in advance!

Labels (3)
0 Kudos
1 Solution
694 Views
jeremyzhou
NXP TechSupport
NXP TechSupport

Hi Darcy Cavanagh,

Thank you for your interest in NXP Semiconductor products and
the opportunity to serve you.
To provide the fastest possible support, I'd attach a UART DMA demo project, please check the attachment.

Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post

0 Kudos
1 Reply
695 Views
jeremyzhou
NXP TechSupport
NXP TechSupport

Hi Darcy Cavanagh,

Thank you for your interest in NXP Semiconductor products and
the opportunity to serve you.
To provide the fastest possible support, I'd attach a UART DMA demo project, please check the attachment.

Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post

0 Kudos