After finding out about the situation with pin7 from this tutorial:
https://forum.sparkfun.com/viewtopic.php?f=32&t=35847
void setup(){
EICRB |= (1<<ISC60)|(0<<ISC61); // sets the interrupt type for EICRB (INT6).
// EICRA sets interrupt type for INT0...3
/*
ISCn0 ISCn1 Where n is the interrupt. 0 for 0, etc
0 0 Triggers on low level
1 0 Triggers on edge
0 1 Triggers on falling edge
1 1 Triggers on rising edge
*/
EIMSK |= (1<<INT6); // activates the interrupt. 6 for 6, etc
void loop(){
//do other things here
}
ISR(INT6_vect) {
// interrupt code goes here
}
I have set:
EICRB |= (0<<ISC60)|(0<<ISC61);
Because I need it to be triggered on LOW.
I could still not get it work on the micro. IF I use the pin as regular input pin I can clearly see LOW/HIGHs on pin 7 with digitalread.
I have a sensor attached there which goes LOW in case it is triggered.
I wonder if anybody knows what else can I try to get it work. I already hardwired everything in my circuit board, there are no more free interrupts and no way to change them.