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.

[SOLVED] ATmega 8, insufficient Interrupt Inputs

Status
Not open for further replies.

yokohama

Member level 3
Joined
Dec 29, 2010
Messages
55
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,288
Location
Algeria
Activity points
1,659
Hi All,
My problem is:
I've 4 inputs that I would to make interrupt with, and we know that on Atmega 8 we have only 2 external interrupt sources INT0 and INT1.
Is there any cheap solution to resolve this.
Thank's for your help.
 

This MCP23017 it look like the PCF8574. I don't know if this MCP is available here in my country. Is mega88 have all pins generate interrupt ?
 

In some cases you can expand the external interrupt capability with simple logic gates like with an NAND, AND, NOR or OR gate.

Of course, once the interrupt has been triggered these inputs must be analyzed to determine which in fact has changed.


Concerning the ATmega88, besides the two external interrupts, INT0 and INT1, it also offers three pin change interrupts, PCINT0, PCINT1 and PCINT2, which are triggered when a level change occurs on up to 24 I/O pins.

Reference: ATmega48/88/168 Complete Datasheet, Section: 13. External Interrupts, Page: 71
13. External Interrupts

The External Interrupts are triggered by the INT0 and INT1 pins or any of the PCINT23...0 pins. Observe that, if
enabled, the interrupts will trigger even if the INT0 and INT1 or PCINT23...0 pins are configured as outputs. This
feature provides a way of generating a software interrupt. The pin change interrupt PCI2 will trigger if any enabled
PCINT[23:16] pin toggles. The pin change interrupt PCI1 will trigger if any enabled PCINT[14:8] pin toggles. The
pin change interrupt PCI0 will trigger if any enabled PCINT[7:0] pin toggles. The PCMSK2, PCMSK1 and PCMSK0
Registers control which pins contribute to the pin change interrupts. Pin change interrupts on PCINT23...0 are
detected asynchronously. This implies that these interrupts can be used for waking the part also from sleep modes
other than Idle mode.

BigDog
 
Another option is the 74HC148 priority encoder, which encodes up to eight interrupt lines to a prioritized three-bit binary value. The GS pin goes low if any interrupt is active, and can trigger one of your external interrupts; which can then read two bits of the value using GPIO pins, to determine which of your four interrupts have occurred.
 
Changing the ATmega8 with ATmega88 is the cheapest way, also using the 74HC148 seems to be a good solution.
I think I'll try the two way and decide after what solution is the best for me. Thank's to all.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top