cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L051 and VREF out

Laurent S.
Associate
Posted on February 03, 2017 at 11:23

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 #vref
1 ACCEPTED SOLUTION

Accepted Solutions
Jocelyn RICARD
ST Employee
Posted on February 03, 2017 at 13:10

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 select

which pad is connected to VREFINT_ADC when ENBUF_VREFINT_ADC is set.

00: no pad connected

01: PB0 connected

10: PB1 connected

11: PB0 and PB1 connected

Best regards

Jocelyn

View solution in original post

2 REPLIES 2
Jocelyn RICARD
ST Employee
Posted on February 03, 2017 at 13:10

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 select

which pad is connected to VREFINT_ADC when ENBUF_VREFINT_ADC is set.

00: no pad connected

01: PB0 connected

10: PB1 connected

11: PB0 and PB1 connected

Best regards

Jocelyn

Posted on February 03, 2017 at 14:03

Wow, thanks a lot for the reactivity and clearness of answer ! It was really well hidden. Just tested it, and it works.