Hallo, ich habe einen Attiny2313 und verwende einen 3,6864Mhz Quarz, Fuses sind FD,DF,FF,FF. AVR Studio 4.18, WinAVR 20100110 GCC 4.3.3. Link vom Source-Code ist http://www.a-netz.de/avr-tipps.de.php Ich kriegs ums verrecken nicht hin das es bei PB2 blinkt, freue mich über jede Hilfe. Vielen Dank. #include <avr/io.h> #include <avr/interrupt.h> #define F_CPU 3686400UL #define XTAL 3686400UL ISR(TIMER1_COMPA_vect) { TCCR0A |= _BV(COM0A0); } int main (void) { TCCR0A |= _BV(WGM01); // clear timer on compare match TCCR0B |= _BV(CS00); // timer source is system clock OCR0A = 105; // output compare value for 36kHz @ 8 MHz DDRB |= _BV(PB2); // port PB2 as output PORTB &= ~_BV(PB2); // PB2 is low TCCR1B = _BV(WGM12); // Clear timer on compare match OCR1A = 7049; // ~ 889us @ 8MHz TIMSK |= _BV(OCIE1A); // output compare interrupt enable for timer1a sei(); while(1) { } return 0; }
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.