How to debounce switch on PE within KDS

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

How to debounce switch on PE within KDS

1,750 Views
yarannan
Contributor III

Hi,

1. I am connecting a push button on one gpio pin. I am using high level component on Processor expert. I dont see there is an option that i can enable interrupt on.

->In case someone need the info: In order to add interrupt of GPIO, it has to be added as component of 'ExtInt'.

 

2. When i hold down switch really long time. The u Controller detect the states back and force (0,1,0,1...). How would i make sure this doesnt happen?

3. How do i set a threshold for a short key press?

So i still dont understand the logic of debounce below. My current thought would be capture the duration of interrupt, and compare it to a threshold time. However,

i am not confident about this idea.

 

 

Thanks,

 

Yaran

 

Message was edited by: Yaran Nan

Labels (1)
Tags (2)
0 Kudos
Reply
5 Replies

1,072 Views
BlackNight
NXP Employee
NXP Employee

Hi Yaran,

if you are not using the Kinetis SDK, then there is an open source component which does all the button press handling, with/without interrupts and configurable debouncing (short/long keypress). This project is using it: JoyStick Shield with the FRDM Board | MCU on Eclipse

Erich

1,072 Views
yarannan
Contributor III

Hello Erich,

I figured out how to disable and enable interrupt on KDS now. Thanks for the link above.

Thanks,

Yaran

0 Kudos
Reply

1,072 Views
yarannan
Contributor III

Hi Erich,

Thanks for the attention. I am running on KDS. I didnt see some IRQ option on KDS though. The current biggest issue is that I don't

know how to enable and disable gpio interrupt by using PE template. Please let me know if there is more resources available.

Thanks,

Yaran

0 Kudos
Reply

1,072 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Yaran,

Please provide the information bellow :

1) The version of your KDS;

2) Which chip;

3) Which gpio component of PE, please screenhort ,thank !

BR

Alice

0 Kudos
Reply

1,072 Views
yarannan
Contributor III

Hi Alice,

1) KDS 2.0 haven't update yet

2) MK20DX256VLL10

3) I used BitIO (PTE4) and Init_GPIO component

Thank you.

Yaran

0 Kudos
Reply