[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
Visit site
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

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

Cookies are required to use this site. You must accept them to continue using the site. Learn more…