cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F0 reading internal temperature sensor and reference voltage at the same time.

felisleonline
Associate
Posted on August 02, 2016 at 21:25

Hi ,

I interested in measuring STM32F0 temperature and reference voltage using internal sensor of it's processor at the same time using UART. so I used channels like this;

ADC_ChannelConfig(ADC1, ADC_Channel_16 , ADC_SampleTime_55_5Cycles);

ADC_TempSensorCmd(ENABLE);

ADC_ChannelConfig(ADC1, ADC_Channel_Vrefint , ADC_SampleTime_55_5Cycles);

ADC_VrefintCmd(ENABLE);

Now I can measured only one values properly..If I applied to read two channel at the same time.I mixed volues eachother. I also looked for multichannel adc titles in the forum but it didn't work properly again. I think should use dma but I'm not good now.Thank you in advance for your help.

Regards.
2 REPLIES 2
Amel NASRI
ST Employee
Posted on August 22, 2016 at 17:13

Hi felisleo,

I suggest you have a look to the 2 following examples available in the

http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-embedded-software/stm32cubef0.html

package:

- STM32Cube_FW_F0_V1.6.0\Projects\STM32F072RB-Nucleo\Examples_LL\ADC\ADC_MultiChannelSingleConversion

- STM32Cube_FW_F0_V1.6.0\Projects\STM32F072RB-Nucleo\Examples\ADC\ADC_Sequencer

In both examples, the two internal channels (temperature sensor and VrefInt) are converted.

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Posted on August 22, 2016 at 20:41

If you have two channels DMAing into an array in continuous/circular fashion you shouldn't get them mixed up. So I'm assuming you're trying to poll them.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..