Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define F_CPU 16000000UL
- #include
- void timer1_init(); //initialize timer
- int main(void)
- {
- DDRC|= 1<<PINC0;
- while(1)
- {
- if(TIFR &(1<<OCF1A))
- {
- PORTC^=1<<PINC0;
- }
- TIFR|=1<<OCF1A;
- }
- void timer_init()
- {
- TCCR1B|=(1<<WGM12)|(1<<CS11)|(1<<CS10);
- TCNT1=0; // initialize counter
- OCR1A=24999;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement