well, i'd guess all of us may be speaking about 'different things' as in the blind men describing an elephant
as for my own observations, I *vaguely* remember playing with different stm32f103c8 'blue pill' boards.
https://stm32-base.org/boards/STM32F103C8T6-Blue-Pill.htmland using stm32duino
https://www.stm32duino.com/https://github.com/rogerclarkmelbourne/Arduino_STM32https://github.com/stm32duino/Arduino_Core_STM32and codes are like such
void setup() {
Serial.begin();
// vrefint
adc_reg_map *regs = ADC1->regs;
regs->CR2 |= ADC_CR2_TSVREFE; // enable VREFINT and temp sensor
regs->SMPR1 = ADC_SMPR1_SMP17; // sample rate for VREFINT ADC channel
}
void loop() {
uint16_t vrefint = adc_read(ADC1, 17);
Serial.print(F("Vref int (1.2v):"));
Serial.print(vrefint);
Serial.println();
uint16_t vtemp = adc_read(ADC1, 16);
Serial.print(F("temp sensor:"));
Serial.print(vtemp);
Serial.println();
uint16_t mv = (1200 * vtemp) / vrefint;
Serial.print(F("mvolt:"));
Serial.print(mv);
Serial.println();
// specs 5.3.19 temp sensor characteristics
// V 25 deg ~ 1.43v
// slope 4.3 mv/C
float temp = (mv - 1430) * 1.0 / 4.3 + 25.0;
Serial.print(F("temp:"));
Serial.print(temp);
Serial.println();
delay(1000);
}
^ note based on this core:
https://github.com/rogerclarkmelbourne/Arduino_STM32it is part of my 'blinky sketch' to blink a led, and 'do something', just to show that 'it is alive'
the codes are run on different 'blue pill' (and maple mini) boards including some with 'clones' chips - not from ST.
it turns out in my different 'batch' of boards I bought from 'online flea market' AliX, I get varied behaviors:
- I've got chip that literally overheat, the finger test say ouch and the temperature reads high > 40 deg C
- I've got chip that are 'well behaved', conform to spec and (not really overheating)
- I've got chip that 'reads high' actually not really like 39 deg C, but the finger test seem to say it is alright, 'nothing is happening' room temperature
- and I've got a chip that when I run it at 100 ms, I get 59 deg C, if I reduce the polling interval i.e. delay(1000) // 1 sec delay in loop()
that becomes 39 deg C
- and I've got chip that calc into a 'wacky wrong temperature' low below room temperature
ambient is mostly betw 28-30 deg C
if these 'casual' observations are taken 'casually', it kind of says that the temperature sensor can vary between chips
it is kind of 'bad' that it makes one wonder if some of the boards could be made with chips that are after all rejects, psst after all it is "online flea markets", or maybe we shouldn't take those temperatures too seriously
as for 'localized' heating, a temperature gradient is often present even with heat transfer from a fin
https://web.mit.edu/16.unified/www/SPRING/propulsion/notes/node128.htmlhence:
wek's findings 33.5deg.C; ambient is 24.5deg, delta T 9 deg C
peter-h's finding 39 dec C, ambient 26 deg C, delta T 13 deg C
my findings 39 deg C, ambient 28-30 deg C, delta T 9-11 deg C
is probably 'within range', i.e. on the die it is 'warmer' and at the surface it is 'cooler' (room temperature)
F4 possibly 'runs hotter'