Cyril Union

TPM V3 initialisation

Discussion created by Cyril Union on Jun 18, 2009
Latest reply on Dec 1, 2010 by bigmac

Hi evrybody,

 

I use the TPM module version 3 on a 9S08AC60 in PWM edge aligned methode

and i have some trouble with the setup of this module.

 

Here is my code :

  //setup timer for PWM leds
  TPM1MOD=MAX_VALUE_PWM-2;
  TPM1SC=0x08;
 
  //setup timer PWM led by led  
  TPM1C0V=0;
  TPM1C2V=0;
  TPM1C3V=0;
 
  TPM1C0SC=0x24;
  TPM1C2SC=0x24;
  TPM1C3SC=0x24;

and after to change the duty cycle

        TPM1C0V=table_cpt_pwm[0];
        TPM1C2V=table_cpt_pwm[2];
        TPM1C3V=table_cpt_pwm[1];

 

 

My trouble is that when i reset  my CPU, i can see 1 duty cycle

at 0. and after all works fine.

 

Any idea ??

 

Thanks for your help

Outcomes