Hallo,
ich bin leider komplett neu im Bereich des AVR und sitze schon eine
Weile vor einem Problem: Ich bekomme die PWM beim ATTiny26 nicht zum
Laufen.
Was funktioniert:
Direktes Ein- & Ausschalten einer LED am Port PB3 funktioniert.
PWM funktioniert nicht - Die LED an PB3 bleibt immer ein (Ausgang auf
LOW)
Als Clock verwende ich den internen, also ohne Quarz.
Anbei meine Initialisierungsroutine:
1 | // data direction Port A (0..IN/1..OUT)
|
2 | DDRA = 0x00 | (1<<DDA3) | (1<<DDA4) | (1<<DDA5) | (1<<DDA6) | (1<<DDA7);
|
3 |
|
4 | // data direction Port B (0..IN/1..OUT)
|
5 | DDRB = 0x00 | (1<<DDB3) | (1<<DDB4) | (1<<DDB6);
|
6 |
|
7 | // ADC activation - ENABLE | PRESCALER8
|
8 | ADCSR = (1<<ADEN) | (1<<ADPS1) | (1<<ADPS0);
|
9 |
|
10 | // PWM config
|
11 | TCCR1B = (1 << CS10); // start up timer1, no prescaler
|
12 | TCCR1A = ((1 << COM1A0) | (1 << PWM1A));
|
13 | OCR1B = 128;
|
Evtl. kann mir ja wer weiterhelfen.
Danke!!
Stefan