Author Topic: PWM  (Read 5405 times)

0 Members and 1 Guest are viewing this topic.

Offline AleyTopic starter

  • Beginner
  • *
  • Posts: 1
  • Helpful? 0
PWM
« on: May 13, 2006, 07:31:34 AM »
Hi

I was wondering if anyone could help me.Im using the 8051 microcontroller and programming it in C using keil compiler i was wonderin if anyone could tell me how to give PWM to my motors and something about timers and flags in C a sample code with details in it would be great.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,694
  • Helpful? 173
    • Society of Robots
Re: PWM
« Reply #1 on: May 14, 2006, 07:19:55 AM »
This is how you control motors:
http://www.societyofrobots.com/schematics_h-bridgedes.shtml

If your motor is small enough, you can also get a motor driver IC. It does not require you to PWM it.

To PWM, all you do is this:

bring a digital port high
wait 1 milisecond (or whatever time)
bring a digital port low
wait 1 milisecond (or whatever time)
loop

Chances are you have sample code to turn on/off an LED? Its exactly the same code, just the loop goes really really fast.

Offline vash

  • Beginner
  • *
  • Posts: 2
  • Helpful? 0
Re: PWM
« Reply #2 on: December 18, 2006, 12:03:24 AM »
Hey dude,

hows you ?

What exactly is the application of your robo.

I'm into making of a demining robo and i feel we could help each other.

what say ?

if you think so do contact me on :  [email protected]

bye

ciyaa

Offline Hal9000

  • Supreme Robot
  • *****
  • Posts: 338
  • Helpful? 0
"The truth is, you can't hide from the truth, cos the truth is all there is" - Handsome Boy Modeling School

 


Get Your Ad Here