AnsweredAssumed Answered

s12xdp512 ATD1 config for analog inputs

Question asked by sean keys on Nov 21, 2012
Latest reply on Nov 22, 2012 by sean keys

Hi,

I’m using the 112 pin version of the xdp512 mcu and seem to be unable to successfully configure the second ATD module.  All 8 channels of the first module seem to work just fine, but when I try to read a register from the second module I get the same static result.

 

My init code is as follows:

void initADC(){

  

    ATD0DIEN = ZEROS;

    ATD1DIEN0 = ZEROS;

    ATD1DIEN1 = ZEROS;

    /* And configure them all for analog input */

    ATD0CTL0 = 0x07;

    //ATD0CTL1 = 0x07/* Trigger and interrupt configuration, unused for now. */

    ATD0CTL2 = 0xC0;

    ATD0CTL3 = 0x40;

    ATD0CTL4 = 0x73;

    ATD0CTL5 = 0xB0;

 

    /* And configure them all for analog input */

    ATD1CTL0 = 0x07;

    //ATD0CTL1 = 0x07/* Trigger and interrupt configuration, unused for now. */

    ATD1CTL2 = 0xC0;

    ATD1CTL3 = 0x40;

    ATD0CTL4 = 0x73;

    ATD0CTL5 = 0xB0;

}


My code reads it just like this:

result = ATD1DR2;


Any input would be appreciated!

Outcomes