In looking at the reference manual I see you can run all the ADC at the same time, although from what I see I don't think that specific use case is supported in the drivers for ChibiOS. Is that the case?
What I am trying to understand is in that use model, is the expectation one callback after all 2 or 3 ADC are done with a conversion pass?
Which brings me to my second question, if I setup more than one ADC, do they just run at the same time and each call their own respective callbacks when they have data to process?
And this is more chip specific, but on the STM32F4 series, when running multiple ADC, do they suffer from less accurate results?
In my specific case I have some inputs I'd like to read more often than others, so I thought dividing them into two different ADC so I can sample them faster on one might be the way to go.
Rick
Multiple ADC usage
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Multiple ADC usage
ADC drivers are independent from each other, they can call the same callback if you use the same configuration structure but each driver passes a pointer to itself as first parameter.
Giovanni
Giovanni
-
Rick Burnett
- Posts: 150
- Joined: Tue Jan 08, 2013 2:20 pm
Re: Multiple ADC usage
1)What happens if both drivers point to the same ADC channel, does one block while the other one is obtaining? I have a hard time knowing which information should be derived from the reference manual and which things are specific to ChibiOS.
2) In the ADCConversionGroup, we have a member called num_channels that states "Number of the analog channels belonging to the conversion group", but we also set this ADC_SQR1_NUM_CH(ADC_GRP1_NUM_CHANNELS) as well (or at least, that's what many of the examples I've seen show)
Is one of them the actual number of channels (unique) that you are doing and the second the number of conversions you are doing? (In case you are doing successive conversions on the same exact channel)
2) In the ADCConversionGroup, we have a member called num_channels that states "Number of the analog channels belonging to the conversion group", but we also set this ADC_SQR1_NUM_CH(ADC_GRP1_NUM_CHANNELS) as well (or at least, that's what many of the examples I've seen show)
Is one of them the actual number of channels (unique) that you are doing and the second the number of conversions you are doing? (In case you are doing successive conversions on the same exact channel)
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Multiple ADC usage
1) Likely a conversion glitch because double sampling on the same source. It is not matter of SW at that level. If it is not specified in RM or DS then you should ask in ST forums.
2) The first field is the logical number of channels (number of conversions per row), the second is a register initialization, the two values must be equal.
Giovanni
2) The first field is the logical number of channels (number of conversions per row), the second is a register initialization, the two values must be equal.
Giovanni