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
}
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
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.