PWM and Servo motor

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
Mathy
Posts: 333
Joined: Mon Oct 05, 2009 2:39 pm
Has thanked: 30 times
Been thanked: 33 times

PWM and Servo motor

Post by Mathy »

Hello !

I would like to use 8 servomotors and two DC motors. For the DC motors, I would like to use the two PWM output but when I look into the C Code of flowcode, I see that the both use the same register.

I Would like to know if I can use servo and pwm at the same time without any problem, interaction or anything else.

Thank you for your help !

Mathy

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PWM and Servo motor

Post by Benj »

Hello Mathy

The Servo motor component uses the hardware timers that are also used by the PWM so the answer is no you cannot use them both at the same time. However it is possible to use the servo component and a timer interrupt to manually bit bang the PWM signal.

There is an example of bit banging PWM available from here.
http://www.matrixmultimedia.com/mmforum ... =26&t=6732

Post Reply