Bad code for ATmega8

Timer Calculator is a free software development tool used for easier calculation of timer interrupts.
Post Reply
Author
Message
graymal.phone@gmail.com
Posts: 1
Joined: 28 Dec 2023 10:42

Bad code for ATmega8

#1 Post by graymal.phone@gmail.com » 05 Jan 2024 18:38

Hi, i set settings 1ms 8mhz for ATmega8 and Timer0 & i get following code:
//Timer0 Prescaler = 64; Preload = 124; Actual Interrupt Time = 1 ms

//Place/Copy this part in declaration section
void InitTimer0()
{
SREG_I_bit = 1;
OCR0 = 124;
TCCR0 = 0x28;
TCCR0 |= 0x03;
OCIE0_bit = 1;
}

void Timer0Overflow_ISR() org IVT_ADDR_TIMER0_COMP
{
//Enter your code here
}
But ATmega8 hasn't Compare Match interrupt vector for Timer0. Check these please

User avatar
IvanJeremic
mikroElektronika team
Posts: 316
Joined: 05 Sep 2022 14:32

Re: Bad code for ATmega8

#2 Post by IvanJeremic » 23 Jan 2024 14:58

Hi,

Sorry for the delay.

Thank you for your input, you are correct, there is no Compare Match interrupt for TImer 0.

We will update this as soon as possible.

Regards,

Ivan.

Post Reply

Return to “Timer Calculator”