I set up a Phase and Frequency Correct PWM Mode on my atmega 8 prototype and everything works fine but I wonder how could I switch off OCR1A or OCR1B independently. I want to obtain 0 logic level on one of these pins at any given moment.
One solution which comes to my mind is to unset DDRB to a desired pin but is it the best solution? How would you do it?
//Timer1 Phase & frequency correct TCCR1A|= (1<<COM1A1)|(1<<COM1B1); TCCR1B|= (1<<WGM13); target_timer_count=F_CPU/frequency + 1; OCR1A= (target_timer_count * 9 / 10); OCR1B= (target_timer_count * 5 / 10);