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 ?
"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