Stefan Mardale

Problems with ATD ch7 conversion -  HCS12C32

Discussion created by Stefan Mardale on Jan 27, 2008
Latest reply on Feb 6, 2008 by Stefan Mardale

        Hello,

I want to make a conversion using the 7th channel but it will not work, please tell me what is wrong. It works fine using ch 0 :


 ATDCTL2 = 0x80;          
 ATDCTL3 = 0x08; 
 ATDCTL4_SRES8=1;
 
 ATDCTL3_S4C=0;
 ATDCTL3_S2C=0;    
 ATDCTL3_S1C=1;
 
 ATDCTL4_SMP1=0;
 ATDCTL4_SMP0=0;
 
 ATDCTL4_PRS0=0;/
 ATDCTL4_PRS1=0;
 ATDCTL4_PRS2=0;
 ATDCTL4_PRS3=0;
 ATDCTL4_PRS4=0;
 
 
 
 ATDCTL5_SCAN = 1;             
 ATDCTL5_MULT=0;
 
 ATDCTL5_CA=1; 
 ATDCTL5_CB=1;
 ATDCTL5_CC=1;

x=ATDDR7H;
     PORTB=x; //the LED's from PORTB should start blinking

x- never changes it's value (it is always 0). The same in the the debugger: x=0......:smileysad:

If I select channel 0, it works fine, the LED's are blinking..x changes it's value.
I would use ch0, but it is ocupied by a potentiometer .

Thank you

 

 

 

 

Added p/n to subject.




Message Edited by NLFSJ on 2008-01-29 03:31 PM

Outcomes