Hello, All!
When I initialize Timer0/1, how can I check amount of time spent by timer ticking, for example, if timer is configured for 10ms, how can I verify that
10ms really have gone. I suppose, I can attach probe of oscilloscope to pin1 of ATmega162 (according to datasheet it's OC0), but I don't see anything. Here is my code:...
// ISR for Timer0 SIGNAL(SIG_OUTPUT_COMPARE0) { LED0_blink(); //my function
/* Timer/Counter0 initialization CLock source: system clock Prescaler value: 8 Clock value: Mode: increment CTC top=OCR0 Interrupt: enable
*/ void Timer0_Init(void) { TCCR0 = 0x00; //stop timer TCNT0 = 0x00; TCCR0 = _BV(CS01) | _BV(WGM01); OCR0 = 0xFF; TIMSK = _BV(OCIE0); }int main(void) { Timer0_Init(); sei();
while (1) { ......... }
return 1; }
With best regards, Roman Mashak. E-mail: snipped-for-privacy@tusur.ru