DMA UART RECEIVE K60

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

DMA UART RECEIVE K60

1,209件の閲覧回数
mdrasool_yadwad
Contributor II

hello,

I am facing problems in receive. I want to receive 4 bytes and store in the buffer but the buffer is loaded with same value. below i have written my code please go through it .

 


//Receive Function

{
DMA_SADDR_REG(dmach , ch) =0;

DMA_SADDR_REG(dmach , ch)|= DMA_SADDR_SADDR(0x4006B007); // CONFIGURING SOURCE ADDRESS
DMA_SOFF_REG(dmach,ch) =0;

DMA_ATTR_REG(dmach , ch) = (DMA_ATTR_SSIZE(0) | DMA_ATTR_DSIZE(0)); //CONFIGURING SOURCE ADDRESS SIZE

DMA_NBYTES_MLNO_REG(dmach , ch) = 0;

DMA_NBYTES_MLNO_REG(dmach , ch)|= (DMA_NBYTES_MLNO_NBYTES(0x04));
DMA_DADDR_REG(dmach , ch) = 0;
DMA_DADDR_REG(dmach , ch) |= DMA_DADDR_DADDR(val); //CONFIGURING DESTINATION ADDRESS ADDRESS


DMA_DOFF_REG(dmach , ch) = DMA_DOFF_DOFF(0x01);


DMA_BITER_ELINKNO_REG(dmach , ch) =0;
DMA_BITER_ELINKNO_REG(dmach , ch) = DMA_BITER_ELINKNO_BITER(0x4); //STARTING MAJOR ITERATION COUNT
DMA_CITER_ELINKNO_REG(dmach , ch) =0;
DMA_CITER_ELINKNO_REG(dmach , ch) = DMA_CITER_ELINKNO_CITER(0x4); // CURRENT MAJOR ITERATION COUNT


DMA_SERQ |= DMA_SERQ_SERQ_MASK;

DMA_CSR_REG(dmach , ch) = DMA_CSR_START_MASK; // START THE DMA

}

ラベル(1)
0 件の賞賛
返信
2 返答(返信)

1,199件の閲覧回数
mjbcswitzerland
Specialist V

Hi

It looks like you are triggering the DMA using the software method which makes it copy the Rx data immediately and therefore it is is not transferring received data but instead just the value that happens to be in the buffer.

Have you set up the DMUX to trigger on Rx data?

Regards

Mark
[uTasker project developer for Kinetis and i.MX RT]
Contact me by personal message or on the uTasker web site to discuss professional training, solutions to problems or product development requirements

 

0 件の賞賛
返信

1,186件の閲覧回数
mdrasool_yadwad
Contributor II

Yes I have DMUX to trigger on Rx data. But i am getting same data again and again. Don't know to do it i am really confused and struck in this.

0 件の賞賛
返信