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,581件の閲覧回数
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 返信

717件の閲覧回数
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 件の賞賛
返信