Re: Explanation of the whole 300 mA thing
- From: rickman <gnuarm@xxxxxxxxx>
- Date: Sat, 1 Dec 2007 22:06:40 -0800 (PST)
On Dec 1, 7:42 am, Tomás Ó hÉilidhe <no_spam_th...@xxxxxxx> wrote:
Firstly, I'd like to thank all the people who've help me out so far
that contributed to the "300 mA" thread.
I'm doing an embedded systems project for college, I'm a 3rd year
doing Electronic Engineering. It's a Connect4 game consisting of 42 LEDs
(6 rows, 7 columns). Each LED can be either Red, Green or Off.
At the end of this post, I have a link to a PDF of the current
schematic, but please read my description before opening it.
I have two 8-Bit shift registers to decide which column is currently
being lit. When flashing a column, I have to flash the reds, then flash
the greens, because if I flash a column with both red and green at the
same time then there'll be a path from 5 V to 0 V through the LED's and
an entire row will light up -- this is why I've got two 8-Bit shift
registers as opposed to one; the first one flashes the reds while the
second one flashes greens.
Personally, I don't think you need two shift registers at all. To
drive the LED array, you need to drive one side with high/low voltages
and tristate to the other side (high, low voltage or high impedance).
You are using the shift registers and the darlingtons to apply the
high/low/high impedance to the columns. The Cyan box is applying high
or low voltages to the rows.
This approach misses out on the ability of the MCU to drive the output
pins to the three states. As a result you will be using an extra
shift register and a lot more drivers.
If you use a single '164 shift register to drive bipolar transistor
pairs in a standard push pull configuration on each output, this will
drive the columns of the array. There is a part available from
Digikey that should be perfect for this... HBDM60V600W, very small,
very cheap and good for 500 mA of continuous current. The row drivers
can use the same transistor parts in a slightly different
configuration. It is a push pull circuit, but the emitters are tied
together instead of the collectors. This puts both transistors in an
emitter follower configuration which will allow the output to float
when the input floats. So the MCU can directly control the rows as
either High, Low or Open which is what you are doing with the double
shift registers and the darlingtons.
Your MCU should shift all 8 bits into the shift register to drive all
columns at the same time. All of the row outputs should be high
impedance. The MCU writes a one to one of the row outputs and enables
the output drive on that bit for one color. This will allow just that
one row to be controlled by the shift register. Then that output is
disabled and the process repeated writing a zero to the row driver for
the other color. This is repeated for each row.
Is there something you don't like about this arrangement?
You might think my shift register setup is a bit funky as regards the
RC circuits but allow me to explain. The purpose of the RC circuit which
feeds into the master reset of the shift registers is simply to ensure
that the chip starts up will all zeros, and it will have a very fast
charging time. The RC circuit that feeds into the OR gate will have a
very long charging time though, about 50 ms maybe. The reason for this is
as follows:
1: I apply power to the circuit, there's initially a 1 on the input
to the first shift register
2: After 20 ms, the PIC will be operational, and it will clock the 1
onto the shift register
3: About 30 ms later, the RC will have charged and be dragged down to
0 V
4: The microcontroller waits about 20 ms and then begins to just
clock the 1 along in an eternal loop through both shift registers
What's the purpose of all this you might say? It's just to save me
needing to take another pin from the microcontroller for the shift
register input :-D I've twelve pins in all to play with in, and I have
them all used up.
You are using three MCU outputs and a '148 chip to read the switches.
But you can multiplex the switches with the same circuit as the LEDs.
Just connect each switch to one of the shift register outputs through
a resistor to limit the current. Tie the other side of all of the
switches together and bring to an input pin on the MCU with a light
pullup resistor. The MCU shifts in a single zero with the other bits
one and moves it through the register while reading the input pin.
When a zero is read on the input, you have found a pressed switch.
This frees two pins, one of which you can use to drive the data pin on
the shift register.
Anyway, my current boggle is which chip to use for the big cyan
coloured square that says "Driver" in my diagram. Basically, I want to
put 300 mA through each LED (with a duty cycle of one sixteenth). I don't
mean to sound utterly clueless, but I really haven't picked up the knack
yet for reading datasheets. A few of you kindly suggested chips to me,
but when I went to read the datasheets for the chips I didn't really have
a clue of whether I'd found the chip I wanted or not. Up until Thursday I
didn't know what "source and sink" meant, and I was writing it as "source
and sync" :-O But of course, I'm willing to learn.
Source means to drive current to the output from Vcc (Vdd) and sink
means to accept current from the output to ground (Vss).
I say, don't use a chip, use transistors.
My first problem to tackle though is which chip to use for the big
cyan square :D
Here's the diagram:
http://download144.mediafire.com/vtgolalbnsxg/bkx3seejxdc/schematic.PDF
I still say you should use a push pull bipolar transistor pair for all
of the drivers. This will use 15 transistor packages like the 16
darlington parts you are using and you can eliminate the Cyan box and
one of the shift registers. BTW, darlington parts have one
disadvantage when driving high currents... they are never saturated
and so drop nearly a volt, dissipating much more power than a single
transistor. They are normally used when you need a lot of current
amplification which you don't need in this case.
Regardless of which approach you use, you need to be aware that this
multiplexing scheme has a sneak path for the current in the LEDs. If
a row (or column) is disabled, all of the LEDs in that row are
connected between the columns. If any column is high and another low
the current can flow through two LEDs in series to complete the
circuit. With a 5 volt drive this may be enough to turn on two series
connected LEDs. If you use a lower voltage for all of the Vdd
connections to the drivers, this will not happen. You might be able
to use a diode drop or two, but the voltage will vary a bit with the
current. So you might want to use a voltage regulator. I'm not sure
this will be a serious problem since the voltage across the current
limiting resistors will be much lower than when driving a single LED,
but it may be enough to be visible as ghosting.
.
- Follow-Ups:
- Re: Explanation of the whole 300 mA thing
- From: Jim Granville
- Re: Explanation of the whole 300 mA thing
- References:
- Explanation of the whole 300 mA thing
- From: Tomás Ó hÉilidhe
- Explanation of the whole 300 mA thing
- Prev by Date: GNUARM multiple definition of AT91F_AIC_ConfigureIt
- Next by Date: Re: Explanation of the whole 300 mA thing
- Previous by thread: Re: Explanation of the whole 300 mA thing
- Next by thread: Re: Explanation of the whole 300 mA thing
- Index(es):
Loading