Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

SetDCPWM1 help

Status
Not open for further replies.

daisordan

New Member
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
 
Last edited:
Status
Not open for further replies.

Latest threads

Back
Top