2014-02-19 06:28 AM
Hello,
I'm using STM32L152 64pin MCU and don't know how to enable internal 1,2V Ref voltage for the ADC1.The ADC works well but is seems to use Vref+/- pins (I have ca 2,8V at these) by default.Btw. I'm on Discovery STM32L152C-DISCO board.Thanks in advanceTomasz #stm32l152-reference-voltage-1 #22014-02-19 06:50 AM
Hi
''I'm using STM32L152 64pin MCU and don't know how to enable internal 1,2V Ref voltage for the ADC1.'' What 1.2V internal reference? I do not see such a thing on the block diagram.2014-02-19 07:30 AM
The 1.2V Ref is automagically self enabled. If you wish to read it by converting it, then you need a conversion enable for it.
Cheers, Hal2014-02-19 09:19 AM
Hi!
What I meant was that I wanted the internal 1,2V ref be the reference voltage for the ADC.Indeed I can measure it on ADC_Channel_17 and it reads 1689 (as by default the ADC takes as ref the voltage on Vref +/- pins).From what I see in the ADC block diagram Vrefint can be measured as any ADC_IN but there is no info if Vrefint can be the reference voltage for ADC itself?This is strange to me as what is the use of internal 1,2V ref. voltage to be ''just measured'' by the ADC while in the first place the DSheet should explain how it make it the reference voltage for the ADC...RegardsTomasz2014-02-19 09:30 AM
Hi
''From what I see in the ADC block diagram Vrefint can be measured as any ADC_IN but there is no info if Vrefint can be the reference voltage for ADC itself? This is strange to me as what is the use of internal 1,2V ref. voltage to be ''just measured'' by the ADC while in the first place the DSheet should explain how it make it the reference voltage for the ADC...'' Yes, like you I could not see it on the ADC block diagram. However, it is in one of the other diagrams. It does state that Vintref is selectable as a ADC source. So, yes it is possible, my bad. ''This is strange to me as what is the use of internal 1,2V ref. voltage to be ''just measured'' by the ADC'' It is referenced in the section about measuring the ARMcore temperature. You will have to re-read the section on reading the temperature and see if it makes any more sense.2014-02-20 01:48 AM
Hi
What diagram do you mean? Please advise in which datasheet have you found this?RegardsTomasz2014-02-20 02:02 AM
Hi Tom
Doc : RM0038 Revision : DocID15965 Rev 8 This is the reference manual. Diagram : Figure 22. Routing interface (RI) block diagram for low and medium density devices or Figure 23. Routing interface (RI) block diagram for medium+ density devices (Depends which category the STM32L152 falls into) ''This is strange to me as what is the use of internal1,2V ref. voltage to be ''just measured'' by the ADC while in the firstplace'' I had a thought about this. If the STM32 is being power directly off a battery (unregulated supply) eg a CR2032, and the supply to the ADC is also off the battery, the supply voltage can vary. The internal reference can be used to calibrate the ADC in this case.