Hi, Thanks everybody. I did not imagine that audio problem is also involved. I have to check this out. Rgds ramana -----Original Message----- From: Olin Lathrop, Cognvision, 978-772-3129 [mailto:olin_piclist@COGNIVIS.COM] Sent: Thursday, August 24, 2000 4:45 AM To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC]: 10 PWM outputs on PIC16F874 > Hi, I need to control 10 DC motors using DC Voltage control. Can this be > done in Software PWM Only. Any Ideas. I've done similar things a few times doing the PWM in software. There are different approaches to this, depending on how dedicated the processor is to just the PWM task. For example, a single dedicated PIC can do fast PWM by jumping an adjustable amount into a list of PWM "on" instructions, followed by a single PWM "off" instruction. One project I'm currently working on needs to control a DC motor and still do quite a bit of other stuff, like floating point servo computations. There I did the PWM from the interrupt routine. It's a tradeoff between how often you are willing to allow interrupts, how long a PWM period you can tolerate, and how much effective resolution you need. In this case I used a 20MHz PIC with a 500 Hz PWM frequency with the on time in steps of 50uS. This therefore required a regular interrupt every 50uS. We are still playing with how much granularity is really needed to drive the motor. I think we're overdoing it and could therefore decrease the PWM period, but others are investigating that right now. At 500Hz with this motor, you can hear the PWM frequency, but the inertia completely damps it out from a drive point of view. > Another point is that the motors will all be operated in 4 discrete > steps > off, low, medium, high. If this is so does it simplify things. Generally yes, since most software PWM schemes have a finite number of on/off slices per PWM interval. This means you only need 4 slices, which allows shorter periods. > What frequency of PWM would be good for DC Motor control The motors are > small motors taking about 100ma at 13.6 Volts DC You just have to experiment. The motor is a mechanical system that probably can't even "see" 100Hz. The whine at the PWM frequency may be more of a problem than any angular vibration. All things being equal, it's nice to do PWM for mechanical systems above the audible frequency range, but your not going to get that doing it in software. ***************************************************************** Olin Lathrop, embedded systems consultant in Devens Massachusetts (978) 772-3129, olin@cognivis.com, http://www.cognivis.com -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics