Also, why is PCINT1_vect undefined for the ATtiny13, is it not a feature on this chip.
I'm using WinAVR btw.
Code: Select all
#define F_CPU 1200000 // clock 1.2MHz, internal oscillator
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#define LED PB4
int main(void) {
PCMSK = _BV (PCINT0); // int - Enable external interrupts PCINT1
MCUCR = _BV (ISC00); // int - PCINT1 is triggered on any change
sei(); // int - Global enable interrupts
DDRB |= (1 << LED); // Set direction register output
for (;;) { // loop (endless)
asm("NOP");
}
return 0;
}
ISR (PCINT0_vect) // Interrupt on PCINT1 vector
{
PORTB ^= (1 << 4); // Toggle LED
_delay_ms (100);
PORTB ^= (1 << 4); // Toggle LED
}