2017-02-03 02:23 AM
Hello,
I selected the STM32L051C6T6 for a small project (package LQFP32)
The datasheet states that this microcontroller has a VREFint out pin (PB1, additionnal functions).
I just can't find out how to output the internal analog reference voltage on this pin. There is absolutely no piece of information on how to do this on the datasheets.
I enabled the VREFINT bit in ADC_CCR register (I can actyally read the Vref value with the ADC), I tried differents MODER settings for the GPIOB (alternate mode, analog mode), had a look into PWR_CSR register and the VREFIN
TRDYF is 1.But still no 1.224V on the output.
Does anyone have an idea ?
Thanks,
#stm32l051 #vrefSolved! Go to Solution.
2017-02-03 04:10 AM
Hello Laurent,
you can find this information in the reference manual RM0377
Register to look at is in system configuration chapter 9.2.3: SYSCFG_CFGR3:
Bits 5:4 SEL_VREF_OUT: VREFINT_ADC connection bit
These bits are set and cleared by software (only if REF_LOCK not set). These bits selectwhich pad is connected to VREFINT_ADC when ENBUF_VREFINT_ADC is set.00: no pad connected01: PB0 connected10: PB1 connected11: PB0 and PB1 connectedBest regards
Jocelyn
2017-02-03 04:10 AM
Hello Laurent,
you can find this information in the reference manual RM0377
Register to look at is in system configuration chapter 9.2.3: SYSCFG_CFGR3:
Bits 5:4 SEL_VREF_OUT: VREFINT_ADC connection bit
These bits are set and cleared by software (only if REF_LOCK not set). These bits selectwhich pad is connected to VREFINT_ADC when ENBUF_VREFINT_ADC is set.00: no pad connected01: PB0 connected10: PB1 connected11: PB0 and PB1 connectedBest regards
Jocelyn
2017-02-03 06:03 AM
Wow, thanks a lot for the reactivity and clearness of answer ! It was really well hidden. Just tested it, and it works.