hello, i want to use all 4 pwm channels of a attiny84. how can i do that? is there any example code for doing that?

here is my code i working on, but it did't work

#define F_CPU 8000000UL #include <avr/io.h> #include <util/delay.h> uint16_t readADC(uint8_t channel) { uint16_t ergebnis = 0; uint8_t i; ADCSRA |= (1 << ADEN) | (1 << ADPS2) | (1 << ADPS1); ADMUX = channel | (0 << REFS1) | (0 << REFS0); ADCSRA |= (1 << ADSC); while (ADCSRA & (1 << ADSC)); for (i=0; i<3; i++){ ADCSRA |= (1 << ADSC); while (ADCSRA & (1 << ADSC)); ergebnis += ADCW; } ADCSRA &= ~(1 << ADEN); ergebnis /= 3; return ergebnis; } void pwm_init(){ DDRA |= (1 << PA6) | (1 << PA7) | (1 << PA5); DDRB |= (1 << PB2); TCCR0A |= (0 << COM0A1) | (0 << COM0A0) | (0 << COM0B1) | (0 << COM0B0) | (0 << WGM02) | (0 << WGM01) | (1 << WGM00); TCCR0B |= (0 << WGM02)| (0 << FOC0A)| (0 << FOC0B)| (0 << CS02) | (0 << CS01) | (1 << CS00); TCCR1A |= (0 << COM1A1) | (0 << COM1A0) | (0 << COM1B1) | (0 << COM1B0) | (1 << WGM11) | (1 << WGM10); TCCR1B |= (0 << WGM13)| (1 << WGM12)| (0 << CS12) | (0 << CS11) | (1 << CS10); } void pwm_OC0A(int adc){ TCCR0A &= ~(1 << COM0B1); TCCR0A |= (1 << COM0A1); OCR0A = adc; } void pwm_OC0B(int adc){ TCCR0A &= ~(1 << COM0A1); TCCR0A |= (1 << COM0B1); OCR0B = adc; } void pwm_OC1A(int adc){ TCCR1A &= ~(1 << COM1B1); TCCR1A |= (1 << COM1A1); OCR1A = adc; } void pwm_OC1B(int adc){ TCCR1A &= ~ (1 << COM1A1); TCCR1A |= (1 << COM1B1); OCR1B = adc; } int main(void){ pwm_init(); pwm_OC0A(255); pwm_OC0B(255); pwm_OC1A(255); pwm_OC1B(255); _delay_ms(2000); while(1){ pwm_OC0A(readADC(2) / 4);// pwm_OC0B(readADC(1) / 4);// pwm_OC1A(readADC(0) / 4);// pwm_OC1B(readADC(3) / 4);// } }

tank you for your help!