go away spammer

Author Topic: I need four PWM outputs.... 1 or 2 micro controllers?  (Read 2396 times)

0 Members and 1 Guest are viewing this topic.

Offline corrado33Topic starter

  • Supreme Robot
  • *****
  • Posts: 611
  • Helpful? 11
I need four PWM outputs.... 1 or 2 micro controllers?
« on: October 24, 2009, 10:02:43 AM »
So as the title states, I need to drive 4 DC motors, therefore I need 4 PWM outputs.  I'm making a palm powered robot, so I don't need an overly complicated microcontroller cause most of the processing will be done by the palm. 

So should I just buy the cheapest microcontroller that has 4 PWM outputs?  Microcontrollers themselves aren't that expensive, so I really don't care.  I saw one of the higher numbered AtMega#### ones that had 4 PWM outputs.  It was 7 bucks I think?  The only problem is that it was square, and I couldn't find a socket for it.  (Yeah I suck at searching DigiKey)

So, any advice? 

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 99
Re: I need four PWM outputs.... 1 or 2 micro controllers?
« Reply #1 on: October 24, 2009, 10:17:24 AM »
Many processors today are not designed for sockets, they are designed to be soldered to a PCB as a surface mount device. Try to find that processor on some type of breakout or development board. SparkFun has a nice selection of such boards.

PWM output can also be done with software and an internal hardware timer. Most of the time it is better to use one processor.

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: I need four PWM outputs.... 1 or 2 micro controllers?
« Reply #2 on: October 24, 2009, 10:49:24 AM »
Hi,

Even an 8 pin controller can be used for that.
Make the PWM either by a timer interrupt or by simply counting through a loop setting the relevant bits on the relevant times and resetting them in the end or v.v.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline corrado33Topic starter

  • Supreme Robot
  • *****
  • Posts: 611
  • Helpful? 11
Re: I need four PWM outputs.... 1 or 2 micro controllers?
« Reply #3 on: October 24, 2009, 01:22:52 PM »
Gotcha, so specific PWM outputs just make PWM easier.  I understand now.  I thought PWM outputs were REQUIRED for PWM.  THANKS!!

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: I need four PWM outputs.... 1 or 2 micro controllers?
« Reply #4 on: October 27, 2009, 04:46:56 PM »
Hardware PWM comes at no expense (ie it just happens) but requires the number of hardware PWM channels to be available on the chip.

You can 'simulate' PWM by using a timer to generate interrupts to call your code which then flicks the output pins. BUT - bear in mind that with slow PWM frequencies the motors will judder or whine so you need a high'ish frequency. So if you are trying to do it in software then your mcu may spend most of its time in interrupts simulating PWM
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

 


Get Your Ad Here