Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <atmel_start.h>
- #include <avr/interrupt.h>
- #include <util/delay.h>
- #include <usart_basic.h>
- ISR(TIMER1_COMPA_vect)
- {
- PORTD ^= 0xff; // Interrupt 반전신호 통해 LED 점멸
- }
- int main(void)
- {
- atmel_start_init();
- DDRD = 0x0c; // 포트지정
- TCCR1A = 0x00;
- TCCR1B = (1<<WGM12)|(1<<CS11)|(1<<CS10); // 64분주 지정(prescaler)
- TCCR1C = 0x00;
- OCR1AH = (62499 >>8);
- OCR1AL = 62499 & 0xff;
- TIMSK1 = (1<<OCIE1A);
- sei();
- while (1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement