PWM and DC motor
Posted: Sat Apr 26, 2014 9:51 pm
Hello,
I want to create a control for DC motor using PWM via buttons and adjust the duty cycle. I read the post http://sfcompiler.co.uk/phpBB3/viewtopi ... 55&start=0 and I noticed that the settings are based on 2 frequencies, 40 and 48 MHz.
I want to use an internal oscillator to 32 MHz or 20MHz quartz which settings to use ?
I have to use a mini drill to 20,000 rpm at 12V, a MOSFET SSP2N60A what PWM frequency do you recommend?
I want to create a control for DC motor using PWM via buttons and adjust the duty cycle. I read the post http://sfcompiler.co.uk/phpBB3/viewtopi ... 55&start=0 and I noticed that the settings are based on 2 frequencies, 40 and 48 MHz.
I want to use an internal oscillator to 32 MHz or 20MHz quartz which settings to use ?
Code: Select all
#if (_clock = 48)
const TIMER_RELOAD_VALUE as word = 65380 + TIMER_RELOAD_OVERHEAD
#elseif (_clock = 40)
const TIMER_RELOAD_VALUE as word = 65406 + TIMER_RELOAD_OVERHEAD
#else
#error "compute timer value for clock freq"
#endif