HI, I am building an instrument that logs the count of pulses coming from four independent sensors. I chose the Mega since it has 6 interrupts. I am using an Adafruit logger/RTC that uses the ICSP connector and a 4 line x 20 LCD (HD44780) using SDA/SCL (pins 20 and 21). Does the logger use 2 of the interrupts and the LCD use 2 more interrupts leaving me with only 2 left for the sensors? Is there a way to free up 2 interrupts for use with the other 2 sensors? I know that I used an UNO before to run that same logger shield and that same display and the UNO only has 2 interrupts. Thank in advance for your response.
Dont forget the Mega has another 21 pin change interrupts.
Thank you for your prompt response. What do you mean by pin change interrupts? How do you change the pins?
The name of the interrupt is "pin change". It is not as simple as the interrupt pins but not too difficult.
Why would an I2C device use up interrupt pins? (I haven't checked but I dont think any analog or I2C pin is also a digital interrupt.)
Yes I2C uses interrupts (for slaves) but that doesn't use up the pins.
Some I2C devices like the ADXL345 do have output pins which are called interrupts but you can put them to regular pins and read them with digitalRead().
Bash11:
Thank you for your prompt response. What do you mean by pin change interrupts? How do you change the pins?
You dont have to.
Try the obvious Google search on 'pin change interrupts' for more infomation.
I chose the Mega since it has 6 interrupts.
In addition to the two dedicated external interrupts on the lowly Uno, every port pin is capable of registering a state change interrupt.
I have never run across an LCD that needed interrupts, and a quick glance at the Adafruit logger/RTC suggests that it doesn't require any interrupts, either.