Hi,
I have started to use ChibiOS and find its design is excellent. Yesterday started to try to write some code to use the ADC. I wish to sample analogue audio at a specific sample rate, 48 to 96khz would be nice. The problem is that I do not know or understand how to configure the ADC to run at this sample rate, from what I can tell the ADC is just running in continuous mode performing DMA transfers into the supplied buffer as fast as it can.
My question is, Is there a way to slow down the ADC to the desired sample rate, or am I going about this completely wrong?
ADC Sample Rate
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: ADC Sample Rate
Hi,
There are two ways:
1) You can increase the sampling time for your channels in order to obtain *about* the rate you need.
2) You use an HW triggered mode for the ADC and a timer generating the trigger at the rate you need.
Both solutions require knowledge of the ADC registers in order to setup the ADCConversionGroup structure, the second one also requires setup of a timer. I recommend a careful read of the ADC section in the Reference Manual.
Giovanni
There are two ways:
1) You can increase the sampling time for your channels in order to obtain *about* the rate you need.
2) You use an HW triggered mode for the ADC and a timer generating the trigger at the rate you need.
Both solutions require knowledge of the ADC registers in order to setup the ADCConversionGroup structure, the second one also requires setup of a timer. I recommend a careful read of the ADC section in the Reference Manual.
Giovanni