Skip to content


Atmel – Atmega8 Timer Kullanımı – 1kHz lik kare dalga

timer

#include <avr/io.h>
#include <avr/interrupt.h>
#include <util/delay.h>

ISR(TIMER1_OVF_vect)
{
TCNT1 = 65059;
PORTB^= 0XFF;
}
int main(void)
{
DDRB = 0xFF;
DDRD = 0xFF;
TCNT1 = 65059;
TCCR1B = 0x01;
TIMSK = 0x04;
sei();
for (;;);

}

Posted in Atmel, Elektronik.

Tagged with , .


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.


üç × 5 =