We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi, i wanna know how to make an external interrupt from falling edge to rising edge, the example on the keil site only works with falling edge.. how can i do that ?
if it be a normal 8051 core you not be ablle to!!
1 - level trigger 2 - edge trigger (fallinging edge)
what i be done think is put output of external xor gate to interruppt, the input too one input of xor and and port pin to other
then you be change port pin to innnvert the inputt and therefour change edge you detecting
simple yes!!??
here circuit i desccribeded:
| CPU IP---|--| | | |---|Interrrupt pin +-|--| | | | +--------|Port pin | |
"the example on the keil site only works with falling edge"
It has nothing to do with Keil software! The standard 8051 architecture has the ability to interrupt on a falling edge; it does not have the ability to interrupt on a rising edge - that's just the way the hardware works!
See chapter 3 of the so-called "bible" for the 8051:
Chapter 1 - 80C51 Family Architecture: www.nxp.com/.../80C51_FAM_ARCH_1.pdf
Chapter 2 - 80C51 Family Programmer's Guide and Instruction Set: www.nxp.com/.../80C51_FAM_PROG_GUIDE_1.pdf Chapter 3 - 80C51 Family Hardware Description: www.nxp.com/.../80C51_FAM_HARDWARE_1.pdf
Check the Datasheet for your particular chip to see if it does add a rising-edge facility; if not, you'll have to add external hardware to invert the signal, as Kalib Rahib has suggested.
thanks alot guys :)
there is one other way (I have used it).
Use a derivative with comparator interrupts. Derivatives such as the SILabs F12x has comparator interrupts for 'gone above' and 'gone below'. setting the reference at 1/2 Vcc gives you one interrupt on rising edge and another on falling edge. One word of warning: the comparator interrupts, typically are a bit slow (microseconds, not immediate)
Erik