Alex Prog

[MC912DG128A] problem with ATD-Converter

Discussion created by Alex Prog on Dec 1, 2007
Latest reply on Dec 1, 2007 by kef
Hello,
 
i would like to use the ATD in Multichannel-Mode. But it does not work. I get for all Channels the same values, but on Channal 2 and 3 are 2.5V and on Channel1 is only 0.25V. And "three1-3" have the value 58, also the right value for Channel1 with 0.25V .
I hope somebody can help me and find the mistake.
 
Thank you!
 
Code:
#include...int one, two,...;
//ATD init: 10Bit, right-justified, enable, SC1=0,ATD0CTL2=0x90; ATD0CTL3=0x00;ATD0CTL4=0xE1;one=0;two=0;void main (void){ATD0CTL5=0%00010000; //MULT=1=onwhile((ATD0CTL0&0x80)!=0x80)); //wait for end of the sequenzone=ADR00H;one=one<<8;two=ADR00L;three=one|two;one1=ADR01H;one1=one1<<8;two1=ADR01L;three1=one1|two1;one2=ADR02H;one2=one2<<8;two2=ADR02L;three2=one2|two2;}}

 

Outcomes