Detecting Rising & Fallin Edge Interrupts(KBI) on MC68HC908QB8....

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

Detecting Rising & Fallin Edge Interrupts(KBI) on MC68HC908QB8....

1,786 Views
san_jon
Contributor I
Hello,

In My application I am using 3 KBI for Hardware interrupts. But i need to detect both edges o the signal.
So my concept is:
1. Set up KBI for Fallin EDGE.
2. detect the KBI interrupt. And Change the interrupt edge Detectin Polarity of Interrupt Last Registered. Using KBIPR(Interrupt Polarity Setting Register as mentioned in the Datasheet.)

MY problems
A. When i implement the above in Codewarrior 3.1. In the header File, KBIPR is not defined. I defined it myself. but it does not seem to work.

B. If i use Processor Expert, there Only Falling Edge and Low level interrupt type can be defined And if i choose rising edge, it gives an error.

So i need Suggestion/Idea on this Subject.
a). Is it a viable idea to change the setting of the Register in the middle of running aplpication? is it recommended?
b). Does QB8 Support positive EDGE/ LEVEL interrupt on KBI pin.? (Datasheet Says YES, but PE does not).
c). Is there any other method to detct both edges using this 8-bit MCU?

Any Suggestions will be Appreciated.

Thanks in Advance For your Reply
Regards
San_jon

Labels (1)
0 Kudos
3 Replies

355 Views
peg
Senior Contributor IV
Hello and welcome san_jon,
 
Yes your basic concept is sound.
The QB does support either edge KBI interrupts and it is quite normal to flip the polarity "on the fly".
Possibly what you are seeing is poor support for this newer device (relative to CW3.1).
Is there a patch for the QB? have you installed it?
Probably the best thing to do is download the latest free version 6.0 which will no doubt have these issues "ironed out"
 


Message Edited by peg on 2007-09-07 04:38 PM
0 Kudos

355 Views
san_jon
Contributor I
Hello PEG,

Thanks for your Reply.

I assume i was misguided by Processor Expert v3.1. As i  added the KBIPR reg in header file myself and tried it. it seems to work now.

I will download the latest version as suggested by you, to avoid such confusion in Future.

Thanks Again for your Feedback.

regards
San_jon
0 Kudos

355 Views
bigmac
Specialist III
Hello San_jon,
 
When using both positive and negative edge for KBI, a factor to keep in mind is that there will be a pull-up current when negative edge is selected for an input, but this will change to a pull-down current for positive edge.  If you are actively driving the input, this is unlikely to be a problem.
 
However, if you happen to be sensing the closure and release of a switch contact, there is a potential problem.  Since it appears not possible to disable the pull-up/pull-down current when KBI is enabled, you may need to use an external pull-up resistor of a sufficiently low value to over-ride the effect of the pull-down current.
 
An alternative method to trigger an interrupt on either edge or both edges of an input, is to utilize a TIM channel in input capture mode.  Of course, the capture time would be irrelevant in this case.
 
Regards,
Mac
 
0 Kudos