ATtiny461 PWM CTC mode help I am a beginner at AVR and programming. I am using ATtiny461 and asked to make code to use timer in PWM and CTC mode and use interrupts and pin toggle, this code worked for me with normal timer and toggle but I don't know how to make it work with CTC and PWM:

#include &lt;avr/io.h&gt;
#include &lt;avr/interrupt.h&gt;

//Init PD6 pin as output
void InitPort(void)
{
    PORTB&amp;=~(1&lt;&lt;PB1);//initial value 0
    DDRB|=(1&lt;&lt;PB1);
}
//Initialize Timer0
void InitTimer0(void)
{
    //Enable Timer0 overflow Interrupt
    TIMSK|=(1&lt;&lt;TOIE0);
    //Set Initial Timer value
    TCNT1=5;
}
void StartTimer0(void)
{
    //Set prescaller 64 and start timer
    TCCR0B|=(1&lt;&lt;CS01)|(1&lt;&lt;CS00);
    //Enable global interrupts
    sei();
}
//Timer0 Overflow ISR
ISR(TIMER0_OVF_vect)
{
    //Reset Initial Timer value
    TCNT1=5;
    //toggle PD6 pin
    PINB=(1&lt;&lt;PB1);
}

int main(void)
{
    InitPort();
    InitTimer0();
    StartTimer0();
    while(1)
    {
        //doing nothing
    }
}


and I know those commands for setting fast PWM and CTC:

TCCR1D |= (0&lt;&lt;WGM10)|(0&lt;&lt;WGM11);
TCCR1A |= (1&lt;&lt;PWM1A)|(1&lt;&lt;COM1A0)|(0&lt;&lt;COM1A1);
PWM is only supported for timer1 on the ATTiny461. Not in timer0.

Look at TCCR1A; specifically the COM1xn bits.