cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1 MCU

Anonymous
Not applicable

Hello everyone,

I'm developing a way to transfer data from the psoc to my pc and, so far I've managed to send 2048 16-bits values.

These values are obtained from an ADC that is directly connected to a DMA, so that I can save them in a buffer.

In order to save more values, I've read many entries, and the Application Notes as well, and I know I have to use TD chaining to obtain my desired result.

The thing is I have a small difference in comparison with the other entries. While they tend to have two or more buffers to save the ADC converted values, I only have one buffer (in my case, it is 16384 bytes long).

I tried to program each address for the TD's in the following manner:

TD[0] - 0...4095      -> destination address :0

TD[1] - 4096...8191   -> destination address :4096

TD[2] - 8192...12287  -> destination address :8192

TD[3] - 12288...16384 -> destination address :12288

My issue was that only the samples sent by the first TD resembled the wave originated from the ADC. Therefore, I'm asking you what could possibly be the mistake I made.

I'm not sure, but I think it's down to the TD properties, especifically, their destination addresses and some of the requests.

Thanks in advance

p.s my project is attached

0 Likes
1 Solution
himam_31
Employee

Hello,

1)Is there any reason for enabling the CY_DMA_TD_AUTO_EXEC_NEXT option.

2)Can you enable TERM out for all TDs and check if the second TD and other TDs are getting executed.

3)Can you use '&' operator and check if you see any difference in behaviour?

    CyDmaTdSetAddress(DMA_TD[0], LO16((uint32)ADC_DEC_SAMP_PTR), LO16((uint32)&samples.u16_buffer[0]));

    CyDmaTdSetAddress(DMA_TD[1], LO16((uint32)ADC_DEC_SAMP_PTR), LO16((uint32)&samples.u16_buffer[4096]));

    CyDmaTdSetAddress(DMA_TD[2], LO16((uint32)ADC_DEC_SAMP_PTR), LO16((uint32)&samples.u16_buffer[8192]));

    CyDmaTdSetAddress(DMA_TD[3], LO16((uint32)ADC_DEC_SAMP_PTR), LO16((uint32)&samples.u16_buffer[12288]));

Thanks,

Hima

View solution in original post

1 Reply
himam_31
Employee

Hello,

1)Is there any reason for enabling the CY_DMA_TD_AUTO_EXEC_NEXT option.

2)Can you enable TERM out for all TDs and check if the second TD and other TDs are getting executed.

3)Can you use '&' operator and check if you see any difference in behaviour?

    CyDmaTdSetAddress(DMA_TD[0], LO16((uint32)ADC_DEC_SAMP_PTR), LO16((uint32)&samples.u16_buffer[0]));

    CyDmaTdSetAddress(DMA_TD[1], LO16((uint32)ADC_DEC_SAMP_PTR), LO16((uint32)&samples.u16_buffer[4096]));

    CyDmaTdSetAddress(DMA_TD[2], LO16((uint32)ADC_DEC_SAMP_PTR), LO16((uint32)&samples.u16_buffer[8192]));

    CyDmaTdSetAddress(DMA_TD[3], LO16((uint32)ADC_DEC_SAMP_PTR), LO16((uint32)&samples.u16_buffer[12288]));

Thanks,

Hima

View solution in original post