I am on the work of a quick prototype of inverter and I trying for a complimentary PWM. By searching in different forum threads I reached the below code .The below code is for 30Hz and 122Hz or higher. But I want a 50-60Hz pulse . Please help me to change it into a 50hz pulse.
word ADC_val=100; word val;
TCCR1A = (TCCR1A & 0x0F) | 0xB0 ; TCCR1B = _BV(CS00) | _BV(CS02); TCCR1B = (TCCR1B & 0xF8) | 5;//6-122Hz,5-30hz analogWrite (9, ADC_val) ; analogWrite (10, 255-ADC_val) ;