Go Down

Topic: How to set Range for PWM Duty (Read 69 times) previous topic - next topic

TniaZ

Hello as I working on Buck Converter project using Arduino

I already set the Output Frequency for PWM to 50kHz as code here



TCCR1A = 0b10100011;   
TCCR1B = 0b00010001;
OCR1A=160; //From equation f=(systemclock)/2N*OCR1A



So now the duty cycle range for PWM is now 0-160

My question is how can I set the range from 0-160 to 0-1000 for easier to read and write the duty

Thanks in advance.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy