GPIO input capture for both edge

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

GPIO input capture for both edge

818 Views
vincentchou
Contributor IV

Dear support,

We tried your hands on project on our TWR-MK60N512 and came across some strange phenomenon.  Apparently we could capture both edges of SW2 on GPIO2 configuration which links to PTE26 on PORTE.  However, if we tried to modify the code to let SW1 on GPIO1 which links to PTA19 on PORTA and capture both edges, somehow it cannot respond to the pressed button.  When we release the SW1 on the board, then GPIO1_OnPortEvent will be executed twice.  Is there a bug in the setting of GPIO1 which we neglect in the first place?  We even tried to create a GPIO init code to pull up PTA19 but it just keeps generating interrupt.  If you can help us to clarify he issue, that would be wonderful!

Vincent

Labels (1)
0 Kudos
2 Replies

511 Views
injunear1
Contributor IV

Just a hardware thought (and not knowing anything about your configuration): could "switch bounce" cause these symptoms?

G'luck

511 Views
vincentchou
Contributor IV

Yes!  It is possible that the problem originates from board issues.  We tried the same code on SW2 and it worked.  We also tried the code on TWRK60F120M and TWRK70F120M and both boards worked. I started to wonder our TWR-K60N512 has some problems. 

Vincent

0 Kudos