Bhavin Maru

TWR-K20D72M can't read the multiple ADC channels from one ADC(ADC0 or ADC1)

Discussion created by Bhavin Maru on Sep 19, 2016
Latest reply on Sep 20, 2016 by xiangjun.rong

I am working with TWR-K20D72M EVM as controller and IAREW(IAR Embedded Workbench) software for programming.i download the sample codes for this board from the below link :


i am working on ADC so i take the reference of those sample above linked sample codes ADC sample code is given on interrupt bases but i want to make the ADC code on polling bases and it works properly with one channel.i attached my code for your this code i select the ADC channel no-19 in board this channel is connected with the this code i continuously read the ADC1_RA and ADC1_RB(ADC Data registers) and it works properly when i change the potentiometer's pot it's readings also changes.but i am facing one problem which i mention below please try to solve my below query:


  • i wants to read continuously two or more channels from one ADC(ADC0 or ADC1).for that in my attached code to change the channel i make the Change_channel() function.i tried this function to change the ADC channel but it not give me suggestion to change the ADC channel and i can read the multiple ADC channels continuously.

Thank You

Original Attachment has been moved to: