X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f Date: Wed, 21 Dec 2011 13:16:54 -0500 Message-Id: <201112211816.pBLIGsaf016475@envy.delorie.com> From: DJ Delorie To: geda-user AT delorie DOT com In-reply-to: (message from Rob Butts on Wed, 21 Dec 2011 12:11:24 -0500) Subject: Re: [geda-user] Design suggestions... References: Reply-To: geda-user AT delorie DOT com Search for "motor controller" on digikey - I keep tripping over i2c/spi motor controllers that do what you want, each time I search for bldc drivers. If that doesn't work out, it's possible to drive the output pins via software (bit bang) in what I call a "pulse dithering modulation" mode. I use it for LED brightness control, it might be good enough for your purposes. In summary: in your timer interrupt, add your "speed" value to a counter. If the counter overflows, turn on the motor, else turn off the motor (i.e. the pin is the carry bit). You need an interrupt frequency only a few times your effective PWM cycle time to get something that "works" (although faster is better :) For more info, see "Bresenham's line algorithm" in Wikipedia :-)