I want to learn how to work with interrupts and I have done my first try.
I have done a very simple circuit based on ATtiny13.
There's a led in PB1 and a button in PB3. When the button is pressed, PB3 pin change its state from low level to high level, this produces an external interrupt. The code of this interrupt, makes the led turn on for 500ms.
This is my code, what's wrong here? I'm getting this warning:
'PCINT3_vect' appears to be a misspelled signal handler, missing __vector prefix [-Wmisspelled-isr]
What's wrong here?
#define F_CPU 9600000UL
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
ISR(PCINT3_vect)
{
PORTB |= (1<<PB1);
_delay_ms(500);
PORTB &= ~(1<<PB1);
_delay_ms(500);
}
void SystemInit(void)
{
PCMSK |= (1<<PCINT3); // pin change mask: listen to portb, pin PB3
GIMSK |= (1<<PCIE); // enable PCINT interrupt
sei(); // enable all interrupts
}
int main(void)
{
DDRB |= (1<<PB1);
DDRB |= (1<<PB3);
SystemInit();
while (1)
{
}
}
Thanks guys!