Hallo liebes Forum!
Ich habe letztens dieses Programm geschrieben:
Ich hab gelesen dass ich OCR1A auf 100 lassen soll, als Compare-Wert.Code:#include <avr/io.h> #include <avr/delay.h> #include <stdint.h> #include <avr/signal.h> uint8_t i = 1; static void PWM(void) { DDRB=0xFF; // Port B as output ICR1 = 100; // Set top for timer 1 TCCR1A = (1<<COM1A1)|(1<<COM1B1)|(1<<WGM11); TCCR1B = (1<<WGM13)|(1<<WGM12) | (1<<CS10); OCR1A = 100; // PWM on PB5 OCR1B = 60; // PWM on PB6 OCR1C = 40; // PWM on PB7 } int main(void) { PWM(); return(0); } // main
Auf dem OCR1B kommt auch ein PWM-Signal an, aber komischerweise nichts am OCR1C.
Meine Frage: Wie muss ich das Programm verändern, dass ich auf allen 3 Pins ein frei einstellbares PWM bekomme?
Freue mich auf Eure Antworten!
MfG Mithrandir







Zitieren

Lesezeichen