How can I use INT0 on ATTiny84

141 Views Asked by At

I have a programm with ATTiny85 running with internal 8MHz to read the impulses from a model railway master, using INT0 for detecting the impulses on rising edge. That works as expected with

#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
...

Init:

void int0_init(void)
{
   GIMSK |= (1<<INT0); // enable external INT0
   MCUCR = (1<<ISC00 | (1<<ISC01)); // raise INT0 on rising edge
}

ISR:

ISR(INT0_vect) 
{
   OSZIATOG; // toggle a pin to watch on the oscilloscope
}

TIMER0 is also used, clock without prescaler. in the timer0-ISR I read the INT0-PIN with PINB and analyse the timing.

Init and sei() in main before while(). The while loop is nearly empty.

Now I am trying to run the code on an ATTiny84. The init is the same on both devices as read in the datasheet. The interruptvector is

ISR(EXT_INT0_vect) 
{
  OSZIATOG;
}

Runnig the code shows no effect of the interrupt.
Triggering the INT0-pin manually is without effect. What is going wrong?

0

There are 0 best solutions below