How to debounce switch on PE within KDS

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to debounce switch on PE within KDS

2,475 次查看
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

标签 (1)
标记 (2)
0 项奖励
回复
5 回复数

1,797 次查看
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,797 次查看
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 项奖励
回复

1,797 次查看
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 项奖励
回复

1,797 次查看
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 项奖励
回复

1,797 次查看
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 项奖励
回复