CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PWM in control dc motor speed (Both direction)

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
sysysy



Joined: 17 Nov 2010
Posts: 38
Location: 121

View user's profile Send private message

PWM in control dc motor speed (Both direction)
PostPosted: Wed Dec 08, 2010 12:46 pm     Reply with quote

Hi,

I am using 16f877a PIC to control my 2 dc motor via L298 motor driver.(dual channel)

Since 16f877a only got 2 PWM pin, and I've used it for controlling both of my motor speed.

Initially, I use each of the pin to control each of my dc motor speed to running forward. Hence, I have no pins left for controlling the motor speed running reverse.

As we know, we need to set 1 input high and 1 input low to make the motor run.

My question is, can I only use 2 PWM pin but can control 2 of my DC motor speed running forward and backward as well? The concept is when running backward, I make 2 input also high, but one of the input is control by PWM.
Hence, there is a potential different between 2 input and manage to make the moving backward.

When I set my duty cycle for PWM very high, that mean motor will run faster in forward direction but slower in backward direction.

When I set my duty cycle for PWM very low, that mean motor will run slower in forward direction but faster in backward direction.

I try it and it really work. But I just worry is this danger to my circuit or driver?

Hope will get some opinions.

Thanks,

Regards,

sysysy
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group