Multichannel ATD in mc9s12xep100

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Multichannel ATD in mc9s12xep100

338 Views
mrunaljoshi
Contributor II

Hi !

I am working on the Demoboard for MC9S12XEP100 . I need 3 atd channels for my project but the results of conversion for all three seem to be getting stored in ATD0DR0 i.e the result register for channel 0 only. I have tried the sequence storage of the results but doesnt seem to work .  Can someone please help ?

Thanks

Labels (1)
0 Kudos
1 Reply

237 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Mrunal,

I wonder you didn't select the correct channel before getting value from ATD.

for example, to get the correct value from channel 1, we need:

/* Run measurement of channel 1 with set wait for result */

    err = AD2_MeasureChan(TRUE,1U);

    /* Get result of channel 1 justified to left*/

    err = AD2_GetChanValue16(1U,&Value1);

I suggest you check sample code under

{CW5.1 install folder}\ProcessorExpert\Projects\Test projects\ADC

can this help?


Have a great day,
Zhang Jun

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos