TC1796
Peripheral Units (Vol. 2 of 2)
General Purpose Timer Array (GPTA)
User’s Manual
24-118
V2.0, 2007-07
GPTA, V2.0
Immediate_Filter()
if (FPCk.Filter_Clock[n]) then
if (FPCk.Timer == 0) then
if (FPCk.Signal_Output.Level != FPCk.Signal_Input[m]) ) then //change detected
generate pulse on FPCk.Signal_Output.Transition
FPCk.Signal_Output.Level = FPCk.Signal_Input[m]
if ( (FPCk.Compare_Value == 0) or
((FPCk.Mode == IMMEDIATE_FILTER_RISING) and !FPCk.Signal_Input[m]) or
((FPCk.Mode == IMMEDIATE_FILTER_FALLING) and FPCk.Signal_Input[m]) )
then //by-pass
FPCk.Signal_Filtered = FPCk.Signal_Output.Level
else //start delay time
FPCk.Timer ++
endif
endif
else
if (FPCk.Timer >= FPCk.Compare_Value) then //delay time is over
FPCk.Timer = 0
FPCk.Signal_Filtered = FPCk.Signal_Output.Level
else //delay time is running
FPCk.Timer ++
if (FPCk.Rising_Edge) then
FPCk.Rising_Edge_Glitch = 1
else
if (FPCk.Falling_Edge) then
FPCk.Falling_Edge_Glitch = 1
endif
endif
endif
endif
endif