AnsweredAssumed Answered

[MC9S12C64]  Input Capture issue

Question asked by Pogo Lin on Dec 12, 2011
Latest reply on Dec 13, 2011 by kef

Hi All,


I want to capture one input signal for both edge. But how can I distinguish between rising edge and falling edge when interrupt in?

Currently I read the input pin's state, if the input pin is in high, then this incoming interrupt is rising edge. If the input pint is in low, then \ this incoming interrupt is falling edge. The following code is my example.

interrupt void ISR_Timer3(void){    TFLG1 = 0x08; // Clear flag    if( (PTIT & 0x08) ) //rising edge    {     ...    }    else   // falling    {      ...    }}

 Does anyone have other method to distinguish bwteen rising edge and falling edge? Thanks a lot.