Driving a DC motor using PWM with AVR ATmega

This library is an update of the software PWM driver you can find here:
http://davidegironi.blogspot.it/2013/03/controlling-dc-motor-speed-and_6.html
For DC motor information please look at the above link.
This update implements also progressive start / stop features using hardware timer.
The PWM frequency have to be selected in the way that the switch frequency is much higher than the dynamics of the motor.
To avoid noise from the motor, the choosen PWM frequency is 20Khz.
So, with this one, you can drive up to 4 motors independently controlling:
 

Driving a DC motor using PWM with AVR ATmega

  • speed
  • direction
  • slow start / stop
Setup parameters are contained in dcmotorpwm.hThis library was developed on Eclipse, built with avr-gcc on Atmega8 @ 8MHz.
Code https://sourceforge.net/projects/davidegironi/files/avr-lib/avr_lib_dcmotorpwm_02.zip/download 

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top