AnsweredAssumed Answered

STM32L0: Problem with adc multichannel

Question asked by urban.danilo on Mar 4, 2015
Latest reply on Mar 4, 2015 by urban.danilo
Hello,

I want to read several voltages with the adc of the STM32L051K8.
If I convert only one channel, then the value is correct, but if it convert several channel is has an incomprehensible behavior.

Sometimes it says every channel has the same value or the assigment of the values to the channels is incorrect.

It seems to be an problem with the channel multiplexing.
Is there something to consider before changing the activ adc channel?

You can find the program code as attachment and an example output below.
(Annotation: The functions UART_sendString and UART_intToString are defined in other files, but works without problems)

Example Output:
Value1: 0xFFFF (it's should be 0x00FF)
Value2: 0x0FFF (correct)
Value3: 0x00FF (it's schould be 0x0FFF)
Value4: 0xFFFF (correct)
Value5: 0x0FFF (it's should be 0xFFFF)

Thanks for your help
Danilo

Attachments

Outcomes