cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F303RB Vrefint

Mikk Leini
Senior
Posted on October 01, 2015 at 08:16

 

 

The original post was too long to process during our migration. Please click on the attachment to read the original post.
5 REPLIES 5
Mikk Leini
Senior
Posted on October 07, 2015 at 21:52

I took another board with same MCU and same code and it also gives 0xFFF's for Vrefint.

Then i took STM32F3 discovery kit SW package ADC sample code, modified it to sample Vrefint and still got the same bad result. Same code running on STM32F3 Discovery gave feasible result.

It's also strange that the custom boards give 0xFFF for Vbat and Temp channels as well while discovery board gives normal values.

Of course discovery board has another MCU so it's not 100% comparable but it's the same family...

I also checked the option bytes and they seemed ok (everything enabled). Then i tried gettting ADC clock from PLLCLK and from HCLK. I also found that OPAMP's have some kind of Vref test option so i tried to enable that from OPAMP1 and sample it's output with ADC but got zero as sample value. Maybe i didn't activate OPAMP correctly.

This is getting absurd. I've checked the schematics and footprint pins twice and all voltages are ok.

PS.

Datasheet says that DAC and ADC share VREF+. So i checked DAC output and ensured that it has correct VREF+. So i expect ADC also to have correct VREF+.

I tried sampling Vrefint with ADC3 also without luck.
jpeacock
Associate II
Posted on October 07, 2015 at 22:51

The datasheet seems to imply Vrefint, ADC_IN17, can be used with and ADC.  Most other parts it's only connected to ADC1, so try converting it on ADC1.  Maybe there's an errata about it.

  Jack Peacock

srdjan
Associate II
Posted on October 08, 2015 at 01:04

I have the same issue on STM32F0. I cannot get the thing to work with VRefint and Tempsensor. Any help with this would be appreciated...

Mikk Leini
Senior
Posted on October 08, 2015 at 21:33

My previous code was built with Keil MDK-ARM v5.14 and i used StdPerihLib v1.2.3.

Now i took HAL library (STM32CubeF3 v1.3.0) and used Ac6 (OpenSTM32) with some basic ADC example code. And still - Vrefint raw value is 0xFFF. Normal external ADC channel values are ok.

Mikk Leini
Senior
Posted on October 28, 2015 at 09:01

Problem solved!

The issue was in HW. Pins PC0, PC2 and PB11 had external 1k pull-up resistors to 5V. However these pins are not 5V tolerant, instead they are ''TTa'' which means ''3.3 V tolerant I/O directly connected to ADC''. Probably the 5V leaked into the ADC circuit through protection diodes and that screwed up the voltages inside chip. That also explains why the Vrefint ADC samples had maximum value - it was just over the VDDA.