2014-12-15 05:24 AM
hi everyone,
are there any examples how to read individual adc values on more than one channel for the stm32l051/stm32l053 microcontroller. i'm using the stm32l0538 discovery board and i also checked the examples in STM32Cube_FW_L0_V1.1.0 which read adc values only on a single channel. #adc #stm32l0x #stm32l053 #brought-to-you-by-microsoft(tm) #stm32l0 #internal-temperature-sensor2015-01-20 12:17 AM
Hi,
Please find attached an example (from STM32L0 firmware package V1.1.0) showing how to use the ADC sequencer: in this example, 3 channels are converted sequentially (1 channel on external pin, 2 channels on internal measurement path: VrefInt and temperature sensor). This example is running on STM32L053R8-Nucleo, and willbe included in the next STM32L0 firmware package release. Regards, Heisenberg. ________________ Attachments : Example_ADC_Sequencer_STM32L053R8-Nucleo.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HzHJ&d=%2Fa%2F0X0000000bLN%2F9tBKDDxKeD5TfyWRGtI2kfjVW9Vv0druVh0VBqYQOLw&asPdf=false2015-03-07 10:34 PM
2015-03-08 07:17 AM
The forum doesn't support mobile devices, please try again.
2015-04-01 11:48 PM
Hi,
I'm also interested in the ADC sequencer. I have now modified the example to run on my STM32L0538-DISCO (discovery) board. I read channel 0, 4, VREFINT (17) and TEMPSENSOR (18). All channels except the temp sensor shows valid data. The temp sensor channel is stuck at AD value around 5 I have cooled the CPU with cold spray so I'm sure that I should read some other values than 598-600. The only difference that I can see from the example you posted is the ADC clock prescaler: MY CODE: AdcHandle.Init.ClockPrescaler = ADC_CLOCKPRESCALER_PCLK_DIV2; EXAMPLE CODE: AdcHandle.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV1; When using ASYNC_DIV1 I can't calibrate the ADC. As all other channels are working I thought that I would get the temperature sensor working as well, but now I feel I'm a bit stuck. I also tried to configure the system configuration controller. The Reference control and status register (REF_CFGR3) bit 0 shall be used to switch on the VREFINT and temperature sensor. I'm a bit confused why this is not done in the example code, but I assume that it is done by enabling the temperature sensor in the ADC configuration (TSEN=1). So the system configuration controller is not needed to be used? I have also tried with different sampling times but with no success. Do you have any idea why the temperature measurement fails? Thanks ________________ Attachments : Src.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HzNW&d=%2Fa%2F0X0000000bLJ%2FB0jdCMC1tQdXrzKE1RP9lPrd6Vp2i_3VzA_ZoZTm6uo&asPdf=false2017-02-02 04:42 AM
Hi all!
Do you have a solution to measure the correct VDDa with the VrefInt?
Do you find a solution for STM32L0xx?
thanks
2017-02-03 01:27 AM
Hi Guillaume,
Did you tried the suggested examples in this discussion? What is exactly the problem you are facing?
It should be better to create a new discussion where you precise used environment, the tests you made and results you get.
-Amel
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.
2017-03-27 08:14 AM
Hi everyone,
I've tried to read mutliple channels using the same code produced here. But my code struks at HAL_ADC_Start_DMA() this point during initialization. What willl be the reason for the code to hang in Start_DMA ??