HCS08 MC13213 ATD does not work

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HCS08 MC13213 ATD does not work

1,231 Views
frusty
Contributor I
I am trieing to convert a sinus signal and modulate it again using the PWM module... But I never get any values from the ATD.

Here is the code:

void Init_PWM (void){
 
  TPM2C2SC = 0x3C;          
  TPM2C2VH = 0x05;                
  TPM2C2VL = 0xD2;                
 
  TPM2MODH = 0x83;
  TPM2C2SC = 0x3C;
 
  TPM2SC = 0x48;
   


}

void Init_ATD (void){
  ATDPE = 0x01;     
  ATDC = 0xB1;
  ATDSC = 0x40;
}


 union DATA
{
   uint8_t Buffer[2];
   uint16_t digit;
} ATDdata;
 

__interrupt void ATD_ISR(void)
{
 
  /*ATDdata.Buffer[0] = ATDRH;
  ATDdata.Buffer[1] = ATDRL;
  */TPM2C2VH = (ATDRH ^0x80);
  TPM2C2VL = ATDRL ;
  ATDSC = ATDSC;
  //TPM2SC = TPM2SC ^0x80;
}

Labels (1)
0 Kudos
1 Reply

247 Views
todorstz
Contributor I

I have the same problem. I suggest that comming from the high consupmation from battery for a very short time. Check this!

 

Message Edited by todorstz on 2009-11-12 09:35 PM
0 Kudos