I'm currently learning how to use the ADC on a STM32F103RC. One of the parameters for reading the ADC is its sample-time.
Just wondering. What is the reason for being able to set this? Why would one choice a sample-time longer then needed (i.e. 1.5 cycles)?
Cheerio! Kr. Bonne.
Didn't find your answer? Ask the community — no account required.
C
Clifford Heath
The ADC input pin has a certain capacitance, and the source has a certain impedance, so a longer sample time will allow the input more time to stabilise - depending on your accuracy needs.
Tim's answer relates to how often you take a sample, not to how long the sample gate is open for.
Clifford Heath.
T
Tim Wescott
Power consumption & processor budget, mostly -- each sample takes a certain amount of energy, and a certain amount of processing ticks. The fewer samples you take per second, the less power (both meanings) you consume.
Tim Wescott
Wescott Design Services
http://www.wescottdesign.com
K
kristoff
Clifford (and Tim also, of course)
OK. Thanks. The application to use this is a port of the MMDVM (Multi Mode Digital Voice Modem) project. We are looking at sampling audio at 24 Ksamples/second, so this is interesting information. I'll forward it to the guy doing the actual electronic design of the interface.
OK. Got it. :-)
In the mean time, I found another reason: I was testing my code with the onboard temperature sensor. Apparently, that device requires a
I do not if there are other sensors that require a longer sampletime.
Cheerio! Kr. Bonne.
R
Randy Yates
I haven't checked that part, but I believe the parameter you are speaking of, kristoff, is "sample and hold" time. This is the circuit that is just ahead of the ADC that samples the analog signal and holds it long enough for the ADC to convert it accurately.
This is different than sample time, or sample period, is is 1 / sample rate.
Randy Yates
Digital Signal Labs
http://www.digitalsignallabs.com
K
kristoff
Randy,
My source for this is the STM32F10X reference manual: it states "The recommended sampling time for the temperature sensor is 17.1 ?s." (see 234 of the document).
Can you elaburate a little bit on this? I understand there are two parameters: the "sample and hold time" and the sample time (AKA sample periode, i.e. sample-and-hold time + conversion-time).
But if you do not changing the conversion-time (i.e. resolution), does changing the sample-time mean that you actually play with the sample-and-hold time?
Cheerio! Kr. Bonne
O
Olaf Kaluza
Perhaps they should call this a random number generator. :-)
Olaf
U
Uwe Bonnes
But the offset is measured at test time and slope and offset are documented in write-only memory. The user may use these calibration values and corrected values are quite good.
Otherwise I don't see any connection between the two quute from the datasheet you give...