|
[DPRG] So close, AVR pain...
Subject: [DPRG] So close, AVR pain...
From: Clem Taylor
clem.taylor at gmail.com
Date: Sat Nov 24 17:57:34 CST 2007
I've been working on a 3-phase brushless DC motor controller for my
latest timesponge project, an autonomous quad rotor helicopter.
I'm using the AT90PWM3B which is designed for motor and lighting
control. The part seemed perfect. It has a really nice PWM module and
plenty of ADC channels. After a bunch of attempts trying to get the
AVR, 6 FETs, regulator, back EMF sense and current limiting to fit in
a <1.5" x 1.5" 2 layer board, I'm mostly finished with the layout. So
tonight I started looking into the design of the main controller board
and I realized a critical *OOPS* in the motor control board...
The AT90PWM3 doesn't have I2C, so was going to use SPI and the
MISO_A/MOSI_A/SCK_A pins are also used for programming, so I could get
away with only one connector (board space is tight). The problem is
that I forgot the chip select, which isn't needed for programming. It
turns out that the SS_A pin is shared with the PSCOUT00 pin, so I
can't use the 6 PWM outputs and the SPI interface at the same time.
You can't even use the non _A SPI pinout, because that also overlaps
with the PWM pins.
So now I'm trying to decide what is the lowest overhead software
option. I really didn't want to do I2C or SPI in software because the
MCU will already be pretty busy controlling a high RPM BLDC motor. The
UART pins are available, but I don't have enough UARTs available on
the host processor to control 4 motors, so I would have to implement
some sort of multidrop serial protocol.
I spent all the time working on getting the layout to fit, I'm tempted
to just have a few boards made so I can make some forward progress and
just worry about the control protocol problem in the future. But then
I'd be responsible for re-enforcing a running theme in my work life,
having to fix broken hardware with software.... Happy, happy...
Nothing is ever easy...
--Clem
More information about the DPRG mailing list
|