- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello everyone,
I started this discussion because I have a question regarding the timings between:
- ADC to memory, using DMA;
- PSoC to computer using USBFS.
The way I want to approach this is: (using 100 2-bytes samples as an example)
1 - ADC sample to memory1, using DMA
2 - Copy those samples from memory1 to memory2
3 - ADC sample to memory1, using DMA & USBFS transfers from memory2 to PC
4 - repeat step 2 to 4 until desired number of samples is acquired.
Is this possible with the PSoC?
I'm struggling with:
- is the process of copying memory1 to memory2 fast enough that I don't loose data?
- how can I pause the DMA for the copy from memory1 to memory2 to happen?
Thank you for your help
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i didn't put the condition to limit the number of samples, because I simply want to send using the ping-pong methodology, so I'll attach my project so that it's easy to see what I've done.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What ADC sampling frequency is required?
/odissey1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Now I'm using a sampling frequency of 25kSPS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
TelmoBarros,
How you plan to transmit the data (bulk transfer mode, or USBUART-type)? What SW on the PC side you are going to use? What ADC type (DelSig or SAR)?
take a look at this post, maybe it already answers your needs
How to configure USBFS in audio IN mode with DMA automatic buffer management ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
At the moment, I'm transmiting the data in Bulk transfer mode.
On the PC side, I'm working with Python to receive the data and perform further analysis.
The ADC that I'm using is DelSig.
I just want to be able to send, for example, 50k samples. The previous way I implemented, does not allow this. Firstly, I stored the Samples on the PSoC, and only after completing the conversion process, I would send all of them by Bulk transfer mode
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
After re-reading the DMA datasheet, I'm sure that I want to implement something similar to the Ping Pong project.
I want to implement it with the USBFS componen.
So, when one array is being filled by the DMA, the data on the other one is being transmitted by the USBFS component.
I think it's not working because the DMA is too fast filling and changing from one buffer to the other.
I attached the project to this post.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Why do you choose ADC_SAR over ADC_DelSig?
I'm going to check your project now, but I just want to know why is it important
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ADC_DelSig allows no more than 48000 SPS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I see.
What I want to be ale to do is to overcome that limit. I'd like to have, for example 200 000 samples.
I chose the ping-pong DMA implementation, but i'm not sure how to check if the program is succesful
- while dma is filling slot of memory 1, the usbfs component should access the slot of memory 2
- after they finish, they should change and keep going until I meet the number of samples I want
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There may be enough counter:
cnt = 200000/64
decrement=1;// start
....
if(Cnt) { USBFS_LoadInEP(USBFS_cdc_data_in_ep, pUSB, 64); cnt=cnt-decrement;}
else decrement=0;// stop
....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content