S9S08SG16 ICS TPM error

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

S9S08SG16 ICS TPM error

453 Views
duffytang
Contributor I

Hello,

        I use the 9S08SG16 and  only configured   ICS  TPM  GPIO to confirm my ICS .   

        But the output is different from what I expected.

        My code is very simple.      

       

        void Init_ICS(void)
           {
              ICSC1 = 0x04; 
             ICSC2 = 0x00; 
           }

         void Init_TPM1(void)
         {
             TPM1SC =0x4c; 
             TPM1CNTH =0; 
         }    

interrupt VectorNumber_Vtpm1ovf void TPM1_OVF_ISR(void)
{
if((TPM1SC & 0x80)==0x80)
{
TPM1SC_TOF = 0; //溢出标志位

IC1_Toogle;

}
}

pastedImage_1.bmp


   

0 Kudos
1 Reply

373 Views
vicentegomez
NXP TechSupport
NXP TechSupport

Hi 

I am not sure if the problem is the way that you are cleaning the flag

I normally use


void interrupt VectorNumber_Vtpm1ovf TPM1ovfISR (void)
{
//Clear interrupt flag
(void)TPM1SC;
TPM1SC_TOF = 0;
PTBD_PTBD6 ^= 1;


}

0 Kudos