LPC1778, Problems with UART Rx DMA Transfer

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LPC1778, Problems with UART Rx DMA Transfer

2,986 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Heikon on Thu Oct 25 02:00:28 MST 2012
hi,

i plan to transmit and receive data from all UARTs via DMA.
The first configurations I started with UART1.

The Tx Channel works fine, from ringbuffer the data was transmitted and could be seen in the HTerm window.
SO the UART Config musst be right concerning the DMA/FIFO settings

But at data reception I have problems. When I send data from HTerm, I can see the data at the Rx Pin and also in the UART peripheral window
at µVision (U1RBR). At the same time the RBR Bit is set during the reception.
But after the data runs through the register window, the RBR Bit is set to "0" and nothing is transmitted through DMA in the ReceptionRingBuffer.

someone with an idea what I did wrong?

heiko
标签 (1)
0 项奖励
回复
3 回复数

2,321 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Daniel Widyanto on Tue Oct 30 20:48:03 MST 2012
Hi,

I'm not sure how do you do it, but here's something that I have:

<code>
DMAReqSel &= ~(1 << 13); /*< Assure that DMA request is connected
                             to UART1 RX */

DMAChannelSourceAddress      = 0x40010000; /*< UART RX FIFO Addr */
DMAChannelDestinationAddress = your_buffer_address;

/* SBSIZE = 16 -> Define BURST size as 16 x 8-bits.
                  Update this according to the UART FCR trigger level
   I = 1       -> Generate DMA interrrupt when the transfer is done
                  (TRANSFERSIZE = 0)
*/
DMAChannelControl = (TRANSFERSIZE = your_buffer_size) | \
                    (SBSIZE = 16) | (SWIDTH = 000) | (SI = 0) | \
                    (I = 1);
DMAChannelConfiguration = ENABLE | \
                         (SRCPERIPHERAL = 13) | (TRANSFERTYPE = 010) | \

NVIC_Enable(DMA_IRQn);

/* Done..Transfer from UART1 RX to memory will be done automatically,
   and will interrupt the MCU once the transfer size is 0.
*/
</code>

For UART settings, there's only 1 additional setting:
<code>
U1FCR = (FIFOEN = 1) | (DMAMODE = 1) \
        (RXFIFORES = 1) | (TXFIFORES = 1) | (RXTRIGLVL = 3);
</code>
0 项奖励
回复

2,321 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Heikon on Tue Oct 30 03:21:29 MST 2012
Hi, i have some new findings:


I tried two different things:
flow controller is the uart, then data will be transmitted to memory, but no transfer size could be set. no interrupt can be generated from DMA. so i have to check manually by polling, if the ringbuffer reaches its end.

flow controller is the dma(my favorite), then nothing happend. one request bit is set in the DMACSoftBReq register but is never cleared.

so what i search for is the configuration with the dma as the flow controller, which lets the DMA transfer data and after the number of transferred data I configured, I get an interrupt to set the next amount of incoming data.

someone any idea? every example I found works with DMA as the flow controller and by polling new data...
0 项奖励
回复

2,321 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Heikon on Thu Oct 25 02:46:46 MST 2012
another advise: when I activate the RBR Interrupt, I´m able to read the received data in the UART ISR.

So only the config of the UART - DMA seems to be not working.

What do I have to set, that the UART informs the DMA to transfer data??

Thanx
0 项奖励
回复