Yet another L298 based motor controller
May 2, 2009
This came out as a sub project related to my DIY CNC machine "the Beast" because the outputs of the Arduino would not suffice to control the motors. So I chose to use I2C for this purpose and designed my own little guy.
It is based on L298 and an Attiny 2313 to control it, pretty basic stuff.
It is designed to be as generic as possible, here are the current features:
- control bipolar motors with full stepping (half stepping is possible but not implemented now due to code size)
- the enable lines are linked to the pwm pins of the chip -> microstepping possible or dc motor control
- the external interrupts of the attiny are available for usage together with 5v power for end stops or other sensors (not tested yet)
- you can use this guy standalone or controlling other things trough i2c by modifying the software
- power input is stabilized on both 5v and 12v rails
- it is designed to take 12 v as input you need to adapt for more
- power led, led on pin PD5 of the AVR for blinky stuff
- reset switch (seems to work fine)
- oh yeah the pcb is single sided and there should be enough place behind the l298 for a radiator.
- i think that's it :)
The software is using a TWI slave library written by a guy over at avrfreaks.net (Don Blake wrote it, here is the original post on avrfreaks.net http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=48395), the rest of the messy code by myself.
Attached you will find the software and the Eagle files, please feel free to add any improvements/optimizations/features. (Rename usiTwiSlave.h.c to usiTwiSlave.h, not sure why the site does not allow .h files attachments or archives ) see update below.
On last thing: If any one for what ever reason wants to comercialize this guy, I agree but I want a share of the profit :D 5% would be nice :D
Small update: fixed some really bad spelling
Update - 18-Aug-2009
I have posted the updated code on GitHub here: