Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How can interrupt when rising or falling edge in 8051 ?

Status
Not open for further replies.

jergen

Junior Member level 1
Junior Member level 1
Joined
Sep 24, 2001
Messages
17
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
51
Dear all,

Who can help me,The 8051 have two ext inerrupt,you can set falling or level trigger,So you can interrupt when the PIN from high state step low state,but How can let the MCU responsed the interrupt when the PIN from low step high state at the same time?

Thanks in advanced

-----+ +-----------
| |
| |
+----------------------------------------------------+
falling can responsed How can ?
interrupt in 8051
 

Hi jergen,

There are some 8051 derivative chips which support interrupts on leading edge. If you don't have one among those, you can place an additional ordinary invertor for external interrupt and drive the pin with falling edge signal through invertor.
 

You cant. the 8051 cannot be configured to respond to rising edge interrupt. You can use an external invertor to reverse polarity and then feed to 8051 pin to trigger interrupt.
 

As inverter you can use 1-gate IC from TI: SN74AHC1G14 (Schmitt trigger inverter) in small SOT23-5 package.
 

you can use one BJT(npn) and two resistors to design a simple inverter. Detail describe in Smith's Book. You can reference it.

Best Regards

Bear Chang
 

Thanks all,It's seem the way is can't find,some chip can be setted by some register let the chip response interrupt on rising or falling,but the 8051 cann't,because I want let the chip responsed the interrupt at rising or falling,if you convert the sign before the ext pin I thinks is not a good way,because another state will be convert to incorrect state. :(
 
  • Like
Reactions: zeel

    zeel

    Points: 2
    Helpful Answer Positive Rating
Hi

WHat you should do is to generate single falling edge pulse towards interrupt port for leading edge and falling edge input when these will be occured . The pulse duration must be enough to handle interrupt .


--------
| |
| | your input

-- --
| | | |
| |----| | interrupt port input
 

Hi jergen,

Please correct me if I'm wrong:

You want to trigger INT0 of 8051 with only one square wave signal, first on leading edge, then for falling, again for leading and so on, following the square shape.
If yes, you can do that setting the 8051 trigger on falling edge and then apply your signal through a circuit built as follows:
- one NXOR gate with two inputs
- your signal straight to one input of the gate
- your signal through a resistor toward the second input of the gate
- last required item is a capacitor fitted with one pin toward ground and the second pin fitted to the above resistor lead that goes toward the second input of the gate
The resistor and capacitor builds up a small delay circuits (we can talk about the delay time if you'll mention the XTAL frequency and what 8051 you have).
Thus you get short falling pulses at the NXOR gate at each edge of your square wave signal.

Regards,
Silvio
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top