I have read a few articles on using a PWM to control a device's voltage but I am having a few difficulties implimenting it. I have a small vibrating motor I removed from a broke cell phone. They run on ~1.2v dc. My circuit (a MC68HC908KX8 MCU) runs on a 5V or 3V dc supply. I don't want the extra expense of a separate voltage regulator for the motor and the MCU. I experimented for a while with different PWM duty cycles and found one that actually worked for this motor. The articles I read mentioned a Low Pass Filter in line with the PWM but none of them explained how to determine the values for the R/C. The only one I found had a 20 page article that I did not understand. I think the author actually proved the existance of aliens in this article. Although I know a lot about digital circuits I never took the opportunity to study low pass filters in depth.
The problem I have is that I know I have just guessed at the values for the PWM and the low Pass filter and I do not want to burn up the motor. I also have trouble now and then with my interrupt routines ONLY when the motor is running. I assume I have created some interference that needs to be corrected. I also have the motor connected directly to the PWM pin port and not thru an opto-isolator.
As always I do not mind research myself. If someone would even point me in the right direction. I am a quick study and very willing to learn.