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;
}
}
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;
}