cancel
Showing results for 
Search instead for 
Did you mean: 

DMA with UART

mohamedmetwally9
Associate II
Posted on June 25, 2013 at 11:28

Hello,

I am using SPC564  MC, I am trying to set the DMATXE but i never responds it's always zero

the UART using DMA always sends 4 bytes and stops sending , I am suspecting the DMATXE bit as it's always zero.

so how to set the DMATXE bits 

#linflex-uart-dma-dmatxe
6 REPLIES 6
Posted on June 25, 2013 at 12:31

Do you mean the TXDMA bit in the eSCI_CR2 register?

You mentioned that the UART sends 4 bytes then stops, apparently this mean that TXDMA is set or the UART would not transmit anything. Could it be a DMA channel setup problem?

Without more info it is hard to give advice.

Giovanni

mohamedmetwally9
Associate II
Posted on June 25, 2013 at 14:19

thanks for your reply.

I meant DMTXE register in linfexD controller and the linflexD controller is configured to work as UART 

I am trying to set the DTE0 bit to one but it's not responding

LINFLEX_1.DMATXE.B.DTE0 = 1;

I checked the DMA by moving buffer to buffer and it's working good

I want also to know, should i trigger the start bit every major loop iteration ?

Posted on June 25, 2013 at 15:05

I think you should set your minor loop to 1 and the major loop to the number of bytes you want to transmit. The UART triggers the (not interrupt-able) minor loop transfer.

The major loop reaching zero would be the event signaling the end of the transfer but not the end of the physical transmission, there could still be frames buffered into the UART.

Giovanni

mohamedmetwally9
Associate II
Posted on June 25, 2013 at 17:06

Thank you for your reply

what about DMATXE Register how to set it because I tried to set the DMATXE and it 's not responding

this is how i am setting it

LINFLEX_1.DMATXE.B.DTE0 = 1;

disirio2
Senior
Posted on June 25, 2013 at 19:30

I think there was a misunderstanding, I thought you was using an SPC564Axx device but since you are mentioning LinFLEX it must be an SPC564Bxx, is that correct?

I don't know LinFlex much but when you program that bit are you in initialization mode or in normal mode?

Giovanni

kopera
Associate
Posted on October 09, 2013 at 15:12

Hello Mohamed,

have you found a problem? I'm experiencing exactly the same issue... 

The first thing I've found is that the DMATXE register in case of LinFlexD_1 is in different place (different base offset) in compare to LinFlexD_0! (I'm using the SPC560B64LS). Check your documentation and uC header file if it differs these two LinFlexes.

But, even if I write to direct address location (DMATXE @ 0xFFE44058)  I'm not able to set other DMA channel enable bit than 0 (so the only value I can write there and correctly verify is 0x0001). Even if I configure DMA0 it still does not work - it seems the major loop is not triggered by linflex hardware - it sends always one byte only (or max 4 if I configure minor loop count to 4)

I think all the rest is fine - I've set up DMA_MUX (DMAMUX.CHCONFIG[DMA_CHANNEL].R = 0x80 | 36;), enabled clock for MUX, configured LinFlexD_1 to use FIFO mode (as required in spec) DMA TCD as in documentation example... still nothing.

Anybody any hint?