misc: Github markdown uses underscores to italicize words
[simavr] / tests / atmega48_disabled_timer.c
1 /*
2  * avrtest.c
3  *
4  *  Created on: 1 Dec 2009
5  *      Author: jone
6  */
7
8 #include <avr/io.h>
9 #include <avr/interrupt.h>
10 #include <avr/sleep.h>
11
12 #include "avr_mcu_section.h"
13 AVR_MCU(F_CPU, "atmega48");
14
15 ISR(TIMER0_COMPA_vect)
16 {
17 }
18
19 int main(void)
20 {
21         // Set up timer0 - do not start yet
22         TCCR0A |= (1 << WGM01);                     // Configure timer 0 for CTC mode
23         TIMSK0 |= (1 << OCIE0A);                    // Enable CTC interrupt
24         OCR0A   = 0xAA;                             // CTC compare value
25
26         //TCCR0B |= (1 << CS00) | (1 << CS01);        // Start timer: clk/64
27
28         sei();                                      // Enable global interrupts
29
30         // here the interupts are enabled, but the interupt
31         // vector should not be called
32         sleep_mode();
33
34         // this should not be reached
35         cli();
36         sleep_mode();
37 }