cancel
Showing results for 
Search instead for 
Did you mean: 

VREF Output for external IC

Tudi Le Bleis
Associate
Posted on May 07, 2018 at 13:03

I have a STM32L051 microcontroller and use the STM32L0Cube HAL.

I read fom the manual, that the STM32L0 have a possibility to provide a stable reference voltage for external ADC/DAC/... This is the VREF(BUF). If I understand correctly, using the CFGR3 register, I can enable the VREF, as well as check if it is ready. Additionally, I can choose to connect it to the PB0/1 output (SEL_VREF_OUT).

However in the examples provided, the VREF is only used internally for Comparator and ADCs, and not for external ICs.

Should I configure, say PB1, to be a standard DAC pin, and then using CFGR3 to connect it to the VREF?

Could someone give me some pointers on how to output the VREF on a PB1?

#vref #output #stm32l0
2 REPLIES 2
Posted on May 07, 2018 at 15:18

Not a part I'm using, but you should be able to export VREFINT via PB0/PB1 as an analogue output.

You should be able to measure the reference internally via ADC_IN17

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Tudi Le Bleis
Associate
Posted on May 15, 2018 at 07:37

if ( HALD_ADCEx_EnableVREFINT() != HAL_OK )

{

  Error_Handling();

}

HAL_SYSCFG_VREFINT_OutputSelect(SYSCFG_VREFINT_OUT_PB1);

is enough. I had issues due to an alternative use of the STM32L053 discovery board, where PB0 and PB1 are reserved for a sensor. Bridging SB23 and/or SB24 did the trick.