Hallo Leute,
ich bekomme es nicht gebacken. Möchte die 1-Wire Routine von Peter auf
einen ATTiny25 portieren (ohne Serial unterstützung) aber scheitere
schon am Timer1 vom Tiny. Er läuft einfach nicht los..
Bisher habe ich folgendes, wo steckt mein Fehler?
1 | void init_timer( void )
|
2 | {
|
3 | // PLLCSR =(1<<PCKE);
|
4 | TCCR1 = (1<<CS10)|(1<<CTC1); // divide by 1
|
5 | OCR1A = 0;
|
6 | TCNT1 = -1;
|
7 | second = 0;
|
8 | prescaler = 0;
|
9 |
|
10 | TIMSK = 1<<OCIE1A;
|
11 | }
|
Ich dachte immer wenn der Teiler >0 dann rennt der Timer los...nix tut
sich.
Zumindest in AVR Studio. Wenn ich die Original-Routine nehme (Mega8)
rennt er sofort los und zählt. Das mit PLLCSR war nur ein versuch, ich
weiß das man damit die Taktquelle umschaltet...
Gruß
Harry