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!
Solved! Go to Solution.
I think that there is just issue with copy&paste code (see my comment)
ATD1CTL0 = 0x07;
//ATD0CTL1 = 0x07/* Trigger and interrupt configuration, unused for now. */
ATD1CTL2 = 0xC0;
ATD1CTL3 = 0x40;
ATD0CTL4 = 0x73; //please change to ATD1CTL4 = 0x73;
ATD0CTL5 = 0xB0; //please change to ATD1CTL5 = 0xB0;
Thx!
I think that there is just issue with copy&paste code (see my comment)
ATD1CTL0 = 0x07;
//ATD0CTL1 = 0x07/* Trigger and interrupt configuration, unused for now. */
ATD1CTL2 = 0xC0;
ATD1CTL3 = 0x40;
ATD0CTL4 = 0x73; //please change to ATD1CTL4 = 0x73;
ATD0CTL5 = 0xB0; //please change to ATD1CTL5 = 0xB0;