AnsweredAssumed Answered

STM32L152RC CubeMX multi-channel ADC with interrupt problem

Question asked by Mahendra Sondagar on Oct 17, 2017
Latest reply on Oct 25, 2017 by Mahendra Sondagar

Hello Geeks

I'm new bie with at STM, I need to read at-least 3 adc channel of STM32L152RC having interrupt

I've used Cubemx and generate the code having property of

scan->Enable

No of Conversion->3

Global interrupt ->Enable

Rank from 1-3->48 cycle Sampling rate

 

 

Now the problem is when i compile and load the code on MCU then it's working and shows 4095 Samples for 3.3V attached at  IN0 but this result is same for all first 3 channel! it means all remaining 2 configured channel shows 4095 samples even they are floating!

 

here is the debug logs

 

ADC_raw[0]--->4095 ADC_raw[1]--->4095 ADC_raw[2]--->4095
-----------------------------------------------
ADC_raw[0]--->4095 ADC_raw[1]--->4095 ADC_raw[2]--->4095
-----------------------------------------------
ADC_raw[0]--->4095 ADC_raw[1]--->4095 ADC_raw[2]--->4095
-----------------------------------------------
ADC_raw[0]--->4095 ADC_raw[1]--->4095 ADC_raw[2]--->4095
-----------------------------------------------
ADC_raw[0]--->4095 ADC_raw[1]--->4095 ADC_raw[2]--->4095

 

In short I'm not Sensing individual channel and result remain same for all 3 configured channel!

 

 

 

 

here I'm attaching CubeMX project with Keil  MDK5

any one help me here?

All Suggestions welcomes 

Thanks

Outcomes