From: Jonathan Kirwan
Subject: Re: Roulette Wheel Project
References: <firstname.lastname@example.org> <email@example.com>
X-Newsreader: Forte Agent 1.92/32.572
NNTP-Posting-Date: Sat, 28 Dec 2002 09:58:01 GMT
Organization: AT&T Broadband
Date: Sat, 28 Dec 2002 09:58:01 GMT
On 27 Dec 2002 19:09:18 -0800, firstname.lastname@example.org (Gary
>Sorry again, I wouldn't know where to begin in
>writing a program for it.
The nice thing with dividing function this way, between software
and hardware, is that significant feature changes can be made
without having to change the hardware (or much, anyway.) But
the downside for some is having to write the programs, of
>Actually, I don't even understand your
>simplified schematic very well.
I took a look at it, just now. What he means to imply is a
Just imagine any regular N-gon, but with direct lines connecting
all vertices together -- not just those around the perimeter.
So, for 4 vertices (square), you have the four perimeter lines
and two lines criss-crossing in order to connect 'opposite'
vertices, for a total of 6 lines. A pentagon, with such
interior crossing lines would be a total of 10 lines making all
the connections. In general, you have N*(N-1)/2 lines, with N
being the number of vertices.
In his example, you start out drawing a heptagon and illustrate
all the connecting lines; a total of 21 lines in the picture.
Now, each of these 21 lines is replaced by a reversed diode
pair, instead of a simple wire. This means 42 LEDs total.
Then, each of the vertices are connected to the microcontroller
outputs via a simple, small valued resistor (say, 47 ohms or 100
By setting any one output of the seven to a low impedance +Vcc
(for example) and any other one output of the seven to a low
impedance 0V, with the rest arranged to be a high impedance
input instead of an output (usually possible with most micros
today), any one of those 42 LEDs can be selected and turned on.
Pairs of LEDs (or longer chains) can't turn on because the
selected LED's forward voltage holds the voltage across the
vertices too low for any of the pairs to operate.
If the micro pins can source and sink sufficient current for the
desired brightness as the 'roulette' spins, that is.
The external resistors, from each micro output pin to each
simplex vertex, are there to 'allow' the voltage at the two
active vertices to freely adjust per the LED requirements. But
it doesn't hurt to take into account the output impedance of the
micro's output drivers, when thinking about the need for them.
An MSP430, for example, runs on a maximum of 3.6V for Vcc and
the output drivers provide very close to 60 ohms to Vcc or 60
ohms to ground, with actively driving the output as 'high' or
'low.' A high efficiency red led (garden variety) exhibits a
simplified model of about:
V(forward) = 1.55V + I(forward) * 21 ohms
So we have this equivalent, when an LED is selected and ON:
+3.6V <---/\/\/----|>|----/\/\/---> 0V
The sum of the voltages across those three elements must be
(3.6V-0V) or 3.6V and be equal to: 60*I + 1.55+21*I + 60*I.
That solves to an I of about 14.5mA and an LED voltage of
slightly under 1.9V. Which might be roughly okay for the
Other common micros, such as from Atmel or Microchip, have
similar output impedances -- though perhaps not quite as
balanced as the MSP430 -- usually something between 40 ohms and
150 ohms or so. But they can often operate at higher Vcc
voltages, say easily up to 5.5V or so.
In effect, those external resistors might not even be needed,
due to the output impedances of common micro drivers. If more
current is needed, a micro could be selected for a higher Vcc
voltage and/or lower output driver impedances. (Otherwise,
things get complicated -- an external high current driver array
will need tri-stating control lines, adding packages, cost,
size, and needing more lines from the micro.)
Anyway, that's my attempt at explaining what he was talking