2021-06-21 11:32 PM
Hi im using a stm32f205retx (LQFP64)
I am measuring 3 adc imputs + Vref + internal chip temp sensor.
The temp sensor is the only one wildly oscillating.
2021-06-21 11:41 PM
What are your ADC Settings?
I had the same problem with the STM32F303RET6. Changing the sampling time had helped me.
The right timing you could find in the Rev. datasheet.
2021-06-21 11:46 PM
Triggering the DMA scan with TIM8, (10Hz)
@MootSeeker My settings are :
2021-06-22 04:41 AM
Why do you think the internal temperature can't change from 43 to 35 degrees?
JW
2021-06-22 04:56 AM
There are minimum sampling time requirements on the temperature sensor.
2021-06-22 05:12 AM
@Community member The timescale of the table shown is in seconds, i was expecting the temperature not to swing 10ºC every second
2021-06-22 05:13 AM
@TDK With sampling time you meant how often the ADC reads? or how long the ADC takes to read each time?
I should be sampling at the slowest adc clock with the maximum precision at 10Hz, i couldnt find in the reference manual anything about minimum sampling time.
Only this
The sampling time for the temperature sensor analog pin must be greater than the minimum TS_temp value
specified in the datasheet. When not in use, the sensor can be put in power down mode
4uS is much much quicker than my sampling time
2021-06-22 06:36 AM
10Hz is the repetition rate, not sampling time.
Sampling time is given by value in respective field in ADC_SMPR1/ADC_SMPR2. I don't use Cube/CubeMX, don't know how it's set there.
While 10deg.C/s sounds a bit more than usual, I don't think it's entirely unthinkable, especially if the thermal conductivity of your package is good, the ambient to which the heat is conducted (mostly PCB tracks) is cold, and there was one short spike of consumption which elevated the temperature only briefly before the measurement.
JW
2021-06-22 08:15 AM
My sample time is 15 ADC clock cycles, being ADC clock PCLK2/8, being PCLK2=60Mhz -----> 2us
So it looks like im sampling too fast, ill halve the PCLK2 and try again
2021-06-22 08:30 AM
Why not just increase the sample cycles rather than messing with PCLK2? Max sample time will give you the best accuracy. Can't imagine you need to convert quickly if you're only sampling at 10 Hz.