I am checking VREF on an STM32F103C8T6 using this word:
: adc-vcc ( -- mv ) \ return estimated Vcc, based on 1.2V internal bandgap
3300 1200 17 ADC1-SQR3 ! adc-once */ ;
however it does not produce values anywhere close to 3.3 V which it should be?
I am using this instead and it returns 'expected' values:
: adc-vcc ( -- mv) \ return estimated Vcc, based on 1.2V internal bandgap
1200 4096 * 17 ADC1-SQR3 ! adc-once / ;
it is based on the 'C' code from here: http://www.stm32duino.com/viewtopic.php?t=707
which works too.
So it the embello-master/explore/1608-forth/flib/stm32f1/adc.fs adc-vcc code wrong or is there something I am missing?