AnsweredAssumed Answered

Scanning Multiple ATD channels with the MC9S12XDP512

Question asked by Kevin Huffman on Jun 6, 2016
Latest reply on Jun 27, 2016 by lama

I'm unable to successfully configure the MC9S12XDP512 for a multiple channel ATD acquisition.  I can scan individual channels and get correct results, but when configured for multiple mode, the results are garbage.  I've used the same code base on the MC9S12C132 chip (for ATD0) and it works correctly (for multiple channel scans).  Is there something specific about the MC9S12X that I'm not catching?  My register settings are as follows:


ATD0CTL2 = 0x80     //normal ATD operation with no fast clear and no external trigger

ATD0CTL3 = 0x40;     //8 conversions per sequence, conversions placed in corresponding registers

ATD0CTL4 = 0x05;     //10 bit resolution, 2 A/D clock periods per conversion, divide by 12; (8HMz bus clock)

ATD0CTL1 = 0x00;     //should not matter, no external trigger used

ATD0CTL0 = 0x01;     //wrap set to AN1; but should not be needed

ATD0CTL5 = 0x90;     //right justified data, multi-channel conversion, start on AN0


The ATD0STAT0 & ATD0STAT1 registers show acquisition complete on all channels.  I typically read 0x03 when I should be reading 0x2000.