I want to obtain 1hz interrupt with 8bit timer on atmega88.
attached are the calculations made by k avrcalc by Mr M. Rosenberg Kevin
On arduino, (just for compilation test since 16mhz clock with give me 488.28125 times more than the intended speed) I get the error
wiring.c.o (symbol from plugin): In function `__vector_16':
(.text+0x0): multiple definition of `__vector_16'
sketch\sketch_jun24a.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino Nano.
for the code
int ledState = LOW;
int count=0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(LED_BUILTIN, OUTPUT);
TCCR0A = 0x00;
TCCR0B = B00000101;TIMSK0 = B00000010;
OCR0 = 0xFF;
sei();
Serial.write("0");
}void loop() {
// put your main code here, to run repeatedly:}
ISR (TIMER0_OVF_vect) // timer0 overflow interrupt
{
if ((count%60) == 0)
{Serial.println(count);
}
digitalWrite(LED_BUILTIN, ledState);
ledState=!ledState;
count++;
}