cancel
Showing results for 
Search instead for 
Did you mean: 

+-10ºC Internal Temperature sensor oscillations :(

Javier1
Principal

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.

 0693W00000BbckyQAB.png

we dont need to firmware by ourselves, lets talk
13 REPLIES 13
MootSeeker
Associate II

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.

Triggering the DMA scan with TIM8, (10Hz)

@MootSeeker​  My settings are :

0693W00000BbclXQAR.png0693W00000BbclSQAR.png0693W00000BbclNQAR.png

we dont need to firmware by ourselves, lets talk

Why do you think the internal temperature can't change from 43 to 35 degrees?

JW

TDK
Guru

There are minimum sampling time requirements on the temperature sensor.

If you feel a post has answered your question, please click "Accept as Solution".

@Community member​ The timescale of the table shown is in seconds, i was expecting the temperature not to swing 10ºC every second

we dont need to firmware by ourselves, lets talk

@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 time0693W00000BbfdCQAR.png

we dont need to firmware by ourselves, lets talk

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

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

we dont need to firmware by ourselves, lets talk
TDK
Guru

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.

If you feel a post has answered your question, please click "Accept as Solution".