i have to design a robot using C18 C compiler library code to move forward
In the code, i dunno wt number should i use in DCPWM1(duty cycle)
***************************************************
For opentimer2 : T2_PS_1_16 & T2_POST_1_8
For openPWM1(255) calculation:
(period+1)*4*Tosc*TMR2 pre scale
(255+1) * 4 * 1µs * 16 = 0.016s, Frequency = 61Hz
The measure value for robot moving forward:
frequency = 56Hz
mark = 1.4ms
space = 16ms
***************************************************
What is the value i should use in DCPWM1(???)
i have done some research on the internet lots of them r using 640. How can i calculate this out?
Thanks,
Dan
In the code, i dunno wt number should i use in DCPWM1(duty cycle)
***************************************************
For opentimer2 : T2_PS_1_16 & T2_POST_1_8
For openPWM1(255) calculation:
(period+1)*4*Tosc*TMR2 pre scale
(255+1) * 4 * 1µs * 16 = 0.016s, Frequency = 61Hz
The measure value for robot moving forward:
frequency = 56Hz
mark = 1.4ms
space = 16ms
***************************************************
What is the value i should use in DCPWM1(???)
i have done some research on the internet lots of them r using 640. How can i calculate this out?
Thanks,
Dan
Last edited: