Gast
#778474
Hallo erstmal!
Ich versuche den Timer 16Bit von dem Atmega 8L zu benutzen. Aber das
funktioniert nicht. Ich benutze Winavr mit kamavr. Hier der C-Code.
#include <stdint.h>
#include <stdlib.h>
#include <avr/eeprom.h>
#include <avr/interrupt.h>
#include <avr/io.h>
#include <avr/pgmspace.h>
#include <avr/sleep.h>
#include <avr/wdt.h>
int main (void)
{
DDRC=1;
PORTC=1;
TCCR1B=0x02;
OCR1AH=20000>>8;
OCR1AL=20000%256;
TIMSK=0x10;
sei();
while(1);
return 1;
}
ISR (TIMER1_COMPA_vect)
{
PORTC=0;
}
Ich will erstmal nur, dass er in die ISR reinkommt.
gruss mc