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

Hello,
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 :

 

http://cache.nxp.com/files/32bit/software/KINETIS_72MHz_SRC.zip?fpsp=1&WT_TYPE=Lab%20and%20Test%20Software&WT_VENDOR=FREESCALE&WT_FILE_FORMAT=zip&WT_ASSET=Downloads&fileExt=.zip

 

i am working on ADC so i take the reference of those sample codes.in 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 reference.in this code i select the ADC channel no-19 in board this channel is connected with the potentiometer.in 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 works.so give me suggestion to change the ADC channel and i can read the multiple ADC channels continuously.


Thank You
Bhavin

Original Attachment has been moved to: ADC.zip

Outcomes