trigger KBI when press down or pull up button - MC1321x and Codewarrior6.1.

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

trigger KBI when press down or pull up button - MC1321x and Codewarrior6.1.

1,580 次查看
Beijing2008
Contributor I
Dear freescale expert:
 
  I'm using MC1321x and Codewarrior6.1.

  On my PCB,there is a button that connect with PTAx port.Enable the KBI and add interrupt routine KBI_IRQ() function in C language code.

  Now,if I pressed down the button ,then KBI_IRQ() was triggered.
  But I hope that the KBI_IRQ() will be called,whether the button was pressed down or pulled up.
  How to implement it? How to config the register?
 
 
Thanks for your reply.
 
Best regards,
Charly
 
 
 
Added p/n to subject.


Message Edited by NLFSJ on 2008-07-18 09:11 AM
标签 (1)
0 项奖励
回复
1 回复

716 次查看
bigmac
Specialist III
Hello Charly,
 
The inputs PTA4 through to PTA7 are capable of having their triggering edge selected for either negative or positive transitions.  You do not say which pin you are attempting to use.  However, you will need to use an external pullup resistor, and disable the internal pull device.  This is because, when the triggering edge polarity is changed from negative to positive, the internal pullup becomes a pulldown.
 
Your code will also need to allow a debounce timeout period (perhaps 20 to 50ms) following each switch transition, and before changing the trigger edge, otherwise the results will be very confusing in the event of contact bounce occurring.
 
Regards,
Mac
 
0 项奖励
回复