Debouce IRQ switch on M52233Demo

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Debouce IRQ switch on M52233Demo

2,271件の閲覧回数
WOLF
Contributor I
What is the best way to debouce the switch on the demo board in software? does anyone have code that i can throw into the interrupt routine for this IRQ?
 
thanks
ラベル(1)
0 件の賞賛
返信
3 返答(返信)

855件の閲覧回数
WOLF
Contributor I
Thanks for your help everyone.  I will Try both a an RC delay for debouncing as well as try the delay of edge detection.
 
Thanks again.
0 件の賞賛
返信

855件の閲覧回数
RickN
Contributor I
Hi,
 
    You can put a small delay loop inside the IRQ before you clear the Edge Port Flag Bit in the Edge Port Flag Register.  This is not very elegant, but will get the job done. 
 
 
    Thanks,
 
     Rick
 
ISR ()
{
   volatile int idx;
 
   for (idx=0; idx<200; idx++)  // you will need to tune the exit condition, 200 is just a guess.
          ;   // spin
 
   do some work..
  
   clear the Edge Port Flag Bit for the specific ISRx
 
}
0 件の賞賛
返信

855件の閲覧回数
admin
Specialist II
Check the 52233 manual, if IRQ pin has Shmitt trigger. If yes, you can resolve the issure by pure hardware: insert integrating RC chain between the dry switch and the IRQ pin. For typical tiny relay with bounce time 5 ms, select Rohm*Cfarad=3*0.005s.
 
0 件の賞賛
返信