Maker Pro
Maker Pro

Controlling hundreds of LEDs

J

John Fields

If you're doing 5X7 matrix displays, you don't have access to all 70 LED pins
anyway. You have to address them as row/column. If you do it that way, you
will minimize the shift register outputs. But, like the professional displays,
you then have to be concerned about a multiplexing setup where you use
persistence of vision to go across the columns fast enough that they don't
appear to flicker.
 
D

Dominic-Luc Webb

Danny,

I got a break for a few minutes. Maybe I could interest you in some
generalizations and mental models?

My idea regarding utilizing different frequencies is something akin to
tuning into two or more radio stations simultaneously. Some techniques used
for packet radio also come to mind. Some of these ideas are perhaps
complicated given the present exercise, but on a longer term perspective
they may prove helpful. My own efforts relate to homemade robotic
telescopes for amateur astronomy, so there could be a lot of overlap
with your longer term goals. I am having a lot of trouble with my
website, and plan to move it, but here it is (for now)....

http://www.megspace.com/science/stp/

Some of my thinking comes from concepts like ring tone generators that
have vast numbers of combinations. Every time you dial a telephone
number (hopefully) you reach only one telephone, even though there are
many millions (billions) of telephones out there.

Regarding your parallel port, I have always viewed the data stream from
this device as something much more than just sets of 8 bits. My motor
example demonstrates different frequencies on different pins. Indeed,
the motors end up turning at different speeds and also in different
directions. This port operates at 8 MHz. These motors will not respond
(directly) to such high frequency, and even if it could be done, it does
not appear for now that you are trying to get your LEDs to turn on and
off in the MHz frequency. You can in principle generate a series of
frequencies essentially the same as a set of dial tones. Indeed,
actual dial tones, such as on your telephone, are only in the low KHz
range. All of them (and more) could be generated from a single pin on your
parallel port, and we have not even gotten into subharmonics, which could
also be employed. A typical telephone has 12 tones (if you include asterisk
and pound). Using only these, you have now escaped the binary base 2
system and now have a base 12 system. You have gone from 2^8 (256) values
up to 12^8 (nearly 430 million) values. I cannot imagine you are wanting
EVER to control 430 million LEDs, but I hope I have made a compelling
argument to at least consider frequency as a parameter to extract the
maximum number of outputs from a single 8 bit TTL port, especially, the
parallel port which should have a fixed 8 MHz frequency. And yes, I have
used such strategies with success. Right now, this is about you and your
goal, Danny. My sad story some other time.

Back to the laboratory, I go....

:)

Dominic
 
R

Robert Monsen

Danny said:
Sounds easy... But - milliSMOPS? Are you having a laugh? Google doesn't
know what they are either! :p

I thought you were a programmer. It's common knowledge that a SMOP is an
acronym for "Small Matter of Programming". Thus, a mSMOP is a tiny project.

--
Regards,
Robert Monsen

"Your Highness, I have no need of this hypothesis."
- Pierre Laplace (1749-1827), to Napoleon,
on why his works on celestial mechanics make no mention of God.
 
J

John Fields

Danny,

I got a break for a few minutes. Maybe I could interest you in some
generalizations and mental models?

My idea regarding utilizing different frequencies is something akin to
tuning into two or more radio stations simultaneously. Some techniques used
for packet radio also come to mind. Some of these ideas are perhaps
complicated given the present exercise, but on a longer term perspective
they may prove helpful. My own efforts relate to homemade robotic
telescopes for amateur astronomy, so there could be a lot of overlap
with your longer term goals. I am having a lot of trouble with my
website, and plan to move it, but here it is (for now)....

http://www.megspace.com/science/stp/

Some of my thinking comes from concepts like ring tone generators that
have vast numbers of combinations.

---
Then your thinking is flawed. The "ring tone generators" to which you
refer can only generate combinations of two tones out of eight. The
system is called 'Dual Tone Multi-Frequency' (DTMF) signalling, and
for a 12 key kepad can generate only 12 combinations of seven tones,
while a 16 key keypad can generate 16 combinations of eight tones.
---
Every time you dial a telephone
number (hopefully) you reach only one telephone, even though there are
many millions (billions) of telephones out there.

---
Yes, but that has nothing to do with the 'base 12' idiocy you
subscribe to and mention later on in this wonderfully illumination
post.
---
Regarding your parallel port, I have always viewed the data stream from
this device as something much more than just sets of 8 bits.

---
Like what, for example?
---
My motor
example demonstrates different frequencies on different pins. Indeed,
the motors end up turning at different speeds and also in different
directions. This port operates at 8 MHz. These motors will not respond
(directly) to such high frequency, and even if it could be done, it does
not appear for now that you are trying to get your LEDs to turn on and
off in the MHz frequency. You can in principle generate a series of
frequencies essentially the same as a set of dial tones. Indeed,
actual dial tones, such as on your telephone, are only in the low KHz
range. All of them (and more) could be generated from a single pin on your
parallel port,

---
Would you please explain how?
---
and we have not even gotten into subharmonics, which could
also be employed.

---
Again. LOL!
---
A typical telephone has 12 tones (if you include asterisk
and pound).

---
Really? IME, for a 12 key keypad there are really only seven, which
are encoded into tone pairs which uniquely identify the symbols on the
keypad, like this:



1209 1336 1477 1633
| | | |
| | | |
697---1-----2-----3-----A--
| | | |
| | | |
770 --4-----5-----6-----B--
| | | |
| | | |
852 --7-----8-----9-----C--
| | | |
| | | |
941 --*-----0-----#-----D--
| | | |

When a key is pressed, two tones are generated and summed
algebraically, and that signal used for signalling. For example, if
'1' is pressed, 1209Hz and 697Hz will be added and sent. "A", "B",
"C", and "D" aren't included on a 12 key keypad, but are shown for
your further edification.
 
W

Watson A.Name - \Watt Sun, the Dark Remover\

Dmitri(Cabling-Design.com) said:
Danny T wrote:



sure

Speaking of the scrolling screens, you may want to use the same approach:
use specialized LED controller ICs. Maxim makes a whole line of such
devices (so do other people).
Check out this page at maxim's website:
http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1339
This is only one device of the product line. It controls up to 64
individual LEDs, and can be daisy-chained. You may want to browse through
links on that page to other ICs to see if there is one that suits you
better. Make sure you read through the application notes, they are a
tremendous source of information that pertains to what you are trying to
do, regardless of whether or not you will end up using Maxim's IC.

This IC runs for $10.81 at Digi-Key, but you can also request a sample
from Maxim to play with it and see if it works for you.

I agree with you. But looking at the cost aspect, it's going to cost a
lot to populate a board with several hundred LEDs, considering that
ultrabright red LEDs cost 20 or more cents apiece. And then you have to
figure in your time, which may be considerable.
 
R

R. Steve Walz

Danny said:
Hi All,

I'm trying to control hundreds of LEDs from my parallel port (8 data
pins - will soon be replaced with the output of a programmed PIC, also 8
pins).

I'm not an electronics guy (I'm a software developer), so trying to
control x00's of LEDs from 8 pins looks a bit tricky...

There's no way to change them all at the same time, so I reckon I'll
need some sort of "addressing" system. Using some of the pins to select
which LED I'm controlling, and one for the data.

Trouble is, even using 7 bits as the "address", I've only got 128
channels, but I imagine I'd need a bit for "send" too, so I can set the
address and the data, then have it read in one go.

What are my options? And what components would I need to achieve
something like this (I imagine right down at the end, I'll need a number
of registers for the LEDs. If these come in chips with 8 output legs, I
guess I'll need 38 for 300 LEDs. The bit between my 8 data pins and the
computer isn't my area though, so I'm stuck!

Oh, and this is just a hobby thing, so the cheaper the better. I'm sure
I can already buy scrolling screens, but I don't have the money, and I
want the fun of building one! :)
----------------
"bit tricky"?? Hahahahahah!
"software guy"?? Hahahahahah!
"Just a hobby thing/cheaper the better"?? Hahahahah!

Amazing what software guys think we do here:
http://www.armory.com/~rstevew/Public/Projects/LEDSign/

-Steve
 
R

Rich Grise

Hi All,

I'm trying to control hundreds of LEDs from my parallel port (8 data
pins - will soon be replaced with the output of a programmed PIC, also 8
pins).

I'm not an electronics guy (I'm a software developer), so trying to
control x00's of LEDs from 8 pins looks a bit tricky...

There's no way to change them all at the same time, so I reckon I'll
need some sort of "addressing" system. Using some of the pins to select
which LED I'm controlling, and one for the data.

Trouble is, even using 7 bits as the "address", I've only got 128
channels, but I imagine I'd need a bit for "send" too, so I can set the
address and the data, then have it read in one go.

What are my options? And what components would I need to achieve
something like this (I imagine right down at the end, I'll need a number
of registers for the LEDs. If these come in chips with 8 output legs, I
guess I'll need 38 for 300 LEDs. The bit between my 8 data pins and the
computer isn't my area though, so I'm stuck!

Oh, and this is just a hobby thing, so the cheaper the better. I'm sure
I can already buy scrolling screens, but I don't have the money, and I
want the fun of building one! :)

I saw an 8 x 16 thing or so in Byte Magazine, mumble-mumble years ago.
If I were doing a project like that, I'd make it up as I go along. It's
going to take forever to solder in all those LEDs anyway, so start with
one bank of either 8 PNPs or 8 NPN drivers, and put in one row, or column,
of LEDs. Make them do stuff. Then when you start adding more LEDs, decide
which will be rows and which will be columns. I'd probably drive rows
with high-side drivers, and bus all of the anodes, and put Rs in the Ks
and use either latched shift registers or latches on a data bus, depending
on how much bus you have and what kind of MUXing you want to do.

Dang! Now _I_ want to do one! ;-)

Cheers!
Rich
 
R

Rich Grise

This is entirely possible. I've never played with the parallel port
before, so my first step today was to connect the 8 data pins up to
LEDs, all connected back to port 25 (ground) and see if I could send
data. (this worked - I have tacky dancing lights!)

I didn't touch the status ports, because I wasn't entirely sure if I
could use them in the same way as the data pins, or if they're
"special". Currently I'm using a horrible interop DLL (I'm writing
managed .NET code in C#) and writing to the dataports is simply a call like:

Output(888, 0); // All off
Output(888, 255); // All on

888 being the address of pin1. If I change this number, I don't know
what will happen - maybe the status ports are the same, maybe not. I'll
look it up tomorrow when I'm a little more awake :)
888 is the decimal address of pins 2 through 9, which is the data port.
Pin 1 is the strobe, which they say is active low; I'm guessing that they
mean that that one's inverted.
http://ee.cleversoul.com/parallel_port.html
http://www.galeon.com/jcgr/
http://www.infonewsindia.com/pinout/Index.html#6A

According to this chart, they've got LPT1 at 3BCh - that's wrong. It's
378h. 890d = 37Ah is the control port. You write to it to control pins
1, 14, 16, and/or 17. 889d = 379h is the status port, which reads in
pins 10, 11, 10, 13, and 15.

So, theoretically, you could set, say, pin 14 and use it as a "chip
select" for an 8-bit latch, or register. Write the data to 888,
read the memory byte where you've stashed your memory of the last
byte written, (where C1 is high) AND it with FEh to send the strobe
pulse, output that to 890 decimal, OR the byte with 1, send it, and
send 01 to turn off the pin 14 chip select. Now you've latched a
byte. You can use that to create chip selects to capture output
from the data port to any other latch - but you'd have to write
a 1 to, say, C2 (04h) to enable your "data" latch, write the
data to whichever of the other bank of latches has been selected
by the control latch. Or you could just pick either/or with one
of the other control bits - you could address 8 different ports
by manipulating 3 of the control bits. And you could decode one
8-bit port to address one of up to 256 outputs. :)

Have Fun!
Rich
 
R

Rich Grise

In the latching mode (used to control the individual LEDs), you
use the A0, A1, and A2 input pins to select the chip output pin
you want to set high or low. You set the D data pin on the chip
at 0v for the chosen output pin to output 0v, or set the D pin to
+5v for the output pin to output +5v. Then you clock the LE pin
with +5v to latch the output pin in the desired state (0v or
+5v). The same A0, A1, A2, and D control lines can be connected
to all the 259 chips. You clock the LE input on the individual
chip you want to control. The As and the D can be done using four
of the output pins on the parallel port. The other parallel port
pins can be used for clocking theindividual chips You can use two
of the 259 chips in the demultiplex mode to clock the individual
259 chips used in the latching mode. Using the eight parallel
port data pins and 17 259 chips (2 in demultiplex and 15 in latch
mode), you could individually control 120 LEDs.

With three 74HC373
http://www.ortodoxism.ro/datasheets/HitachiSemiconductor/mXqqsxt.pdf
and
one ULN2808
http://www.allegromicro.com/sf/2801/
you can control 128 LEDs if you don't mind multiplexing them.

Cheers!
Rich
 
R

Rich Grise

Right, I think I understand - except for what you've labelled as SQ8 on
your diagram. Does this hold the "last" bit that's about to be dropped?
(and does this work based on the clock pin, and not the latch?) So if I
sent 16 bits (clocking active in between each), and *then* latch, would
I get 16 unique outputs, which I can then redraw before the next latch?

Yes:
http://www.semiconductors.philips.com/acrobat_download/datasheets/74HC_HCT595_4.pdf
page 5, Fig. 5.

Cheers!
Rich
 
R

Rich Grise

If you're just clocking bits through a bank of shift registers, there's
no multiplexing _possible._ You have to be able to control rows and
columns 8 bits at a time. This does reduce the chip count dramatically -
2 vs. 8 for 64 LEDs.

Cheers!
Rich
 
D

Dominic-Luc Webb

Speaking of the scrolling screens, you may want to use the same approach:
use specialized LED controller ICs. Maxim makes a whole line of such
devices (so do other people).
Check out this page at maxim's website:
http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1339

Dmitri,

As per my remarks about using frequency to get more permutations, one
concept I hoped someone might "latch" into is that LED brightness
should be possible to control by changing duty cycle. By changing the
rate at which 0's and 1's change, one can obtain such effects. So my
thoughts on utilizing frequency were not only directed towards selection
of LEDs and large numbers of permutations, but also brightness control.
I am curious if any of the controllers you know of permit brightness control
by duty cycle (as opposed to voltage) that would have a much wider dynamic
range than just two, like "bright" or "normal" intensities?

I guess one could envision a frequency-to-voltage converter to control
brightness by voltage, but I suspect changing duty cycles would be
energetically more efficient.

I guess one could also consider that frequency modulation and analog
circuitry has a lot of parallels with biological processes. Danny did
mention a long term goal of robotics. I am rather impressed with the
analog robots I have seen.

Dominic
 
D

Dmitri

Dominic-Luc Webb said:
As per my remarks about using frequency to get more permutations, one
concept I hoped someone might "latch" into is that LED
brightness
should be possible to control by changing duty cycle. By changing the
rate at which 0's and 1's change, one can obtain such effects. So my
thoughts on utilizing frequency were not only directed towards
selection
of LEDs and large numbers of permutations, but also brightness control.
I am curious if any of the controllers you know of permit brightness
control
by duty cycle (as opposed to voltage) that would have a much wider
dynamic
range than just two, like "bright" or "normal"
intensities?
I guess one could envision a frequency-to-voltage converter to control
brightness by voltage, but I suspect changing duty cycles would be
energetically more efficient.
I guess one could also consider that frequency modulation and analog
circuitry has a lot of parallels with biological processes. Danny did
mention a long term goal of robotics. I am rather impressed with the
analog robots I have seen.

Well, as a matter of fact, brightness control is one of the major reasons
people get to use specialized ICs (second after multiplexing, of course).
All (I know of) of them would allow you to control brightness either
digitally for selected segments or analog for overall brightness of the
module. As far as I know, all use PWM for digital brightness control.

--
Dmitri Abaimov, RCDD
http://www.cabling-design.com
Cabling Forum, color codes, pinouts and other useful resources for
premises cabling users and pros
http://www.cabling-design.com/homecabling
Residential Cabling Guide
-------------------------------------



##-----------------------------------------------##
Article posted with Cabling-Design.com Newsgroup Archive
http://www.cabling-design.com/forums
no-spam read and post WWW interface to your favorite newsgroup -
sci.electronics.basics - 8240 messages and counting!
##-----------------------------------------------##
 
J

John Fields

If you're just clocking bits through a bank of shift registers, there's
no multiplexing _possible._

---
Of course. That, however, doesn't change the validity of my statement.
---
You have to be able to control rows and
columns 8 bits at a time. This does reduce the chip count dramatically -
2 vs. 8 for 64 LEDs.

---
Yes, but if you have even a modest 8 character 5X7 marquee array, like
this:

| 1 | | 2 | | 3 | | 4 | | 5 | | 6 | | 7 | | 8 |
................................................
................................................
................................................
................................................
................................................
................................................
................................................
| 1 || 2 || 3 || 4 || 5 || 6 |

and you're broadsiding columns and multiplexing 48:1, you'll need 7
row and 48 column drivers, with your row drivers needing to source or
sink 48 times the current needed by a single lamp, and your column
drivers needing to sink or source seven times that, a whopping 336
times the requirement of a single lamp for the eqivalent brightness of
a static display. For 20mA LEDs, that comes to 960mA for the row
drivers and 6.72A for the column drivers!!!

On top of that, in order to avoid flicker, the array would need to be
refreshed at about 30 Hz, which means exercising the columns at 1440Hz
while doing the scrolling, so the software overhead for a one-off has
grown considerably over that for a simple static scrolling marquee and
RFI problems may be rearing their ugly heads.

Bottom line is, for a one-off, muxing may not be as cheap as it looks,
even with the saving of 41 chips (about $8) and the 656 pads and real
estate needed to mount them to a PCB ($?) for the array above.
 
D

Danny T

Robert said:
I thought you were a programmer. It's common knowledge that a SMOP is an
acronym for "Small Matter of Programming". Thus, a mSMOP is a tiny project.

LOL!!!

I've never heard that term before... Guess I'm only really a wannabe
programmer ;-(
 
D

Danny T

Dominic-Luc Webb said:
Danny,

I got a break for a few minutes. Maybe I could interest you in some
generalizations and mental models?

My idea regarding utilizing different frequencies is something akin to
tuning into two or more radio stations simultaneously.
<snip>

I'm confused now... By frequency, do you mean I can output things
distinguishably different than just the +5v I@m currently sending??
 
D

Dominic-Luc Webb

I'm confused now... By frequency, do you mean I can output things
distinguishably different than just the +5v I@m currently sending??


Hi Danny,

Yes. On the one hand, there is the absolute value 0 or 1, which could
be interpreted as "digital" off or on, respectively. As in my stepper
motor example, there is also the relative rate at which 0's and 1's are
changing. The coils on a stepper motor respond to these changes and
the shaft turns faster or slower. A speaker would be another example,
also operated by a coil. Passing pulses (sets of 0's and 1's) at
different rates (frequencies) could in principle yield different tones,
much like what happens when you hit different buttons on your telephone,
although, let us not get bogged down in details of how the registered
trademark "Touch-tone" works. Just note that different frequencies are
being generated when you hit different buttons. Choosing different
combinations of buttons in a series could play different tunes, for
instance. There is no reason a single pin from your parallel port could
not do something similar. Consider what would happen if you sent 20 0's
and then 20 1's, and repatedly this loop continuously and the output was
a speaker.

Distinguishing these two concepts: Feeding a counter IC, like a Johnson
4017 at different rates from a pin of the parallel port would simply
make the 4017 cycle through the stages faster or slower. Connecting LEDs
to each of the stages would cycle through each LED, but would not
necessarily change the brightness of each LED. If instead, you connected
more directly from the port to an LED (using an appropriate resistor),
you could not only turn it on, the rate at which you switch between 0's
and 1's would dictate brightness. I think it ends up working similar to
a diac/triac circuit that controls the brightness of a bulb by chopping
up the current.

For starters:

Try this, since you can program your parallel port; with whatever language
you are programming in, you can have for/while loops that cycle between
the 0 and 1 states. Add a pause between the instructions for setting 0 and
1. Below is a code fragment I once wrote in C (for Linux). You can change
frequency by changing the value of usleep. This would cause stepper motors
to turn faster or slower. It could presumably also change the tone of a speaker
or the brightness of an LED, etc. Taking this to a further level of
complexity, one could split the outgoing signal from each data pin
(voltage or current divider, logic circuits, etc) to take advantage of both
absolute 0 and 1 states, as in loading registers, etc and also the
frequency information (direct pulse modulation of LED brightness) or
via a frequency-to-voltage conversion (voltage dictates brightness). It
represents one means of sending serial information via a parallel port.
Similarly, a Morse code scheme sent from a single pin could also be used.


step_function()
{
for(i=1; i<=step_value1; i++) {

/* Set the data signals (D0-7) of the port */
outb(0, BASEPORT);

/* Sleep for a while */
usleep(10000);

outb(direction1, BASEPORT);
usleep(10000);

}

for(i=1; i<=step_value2; i++) {
outb(0, BASEPORT);
usleep(10000);
outb(direction2, BASEPORT);
usleep(10000);
}
}



Dominic
 
J

John Fields

Hi Danny,

Yes. On the one hand, there is the absolute value 0 or 1, which could
be interpreted as "digital" off or on, respectively. As in my stepper
motor example, there is also the relative rate at which 0's and 1's are
changing. The coils on a stepper motor respond to these changes and
the shaft turns faster or slower. A speaker would be another example,
also operated by a coil. Passing pulses (sets of 0's and 1's) at
different rates (frequencies) could in principle yield different tones,
much like what happens when you hit different buttons on your telephone,
although, let us not get bogged down in details of how the registered
trademark "Touch-tone" works. Just note that different frequencies are
being generated when you hit different buttons. Choosing different
combinations of buttons in a series could play different tunes, for
instance.

---
The ratios of frequencies between adjacent notes on the equally
tempered scale is the twelfth root of two. No such relationship
exists between the tones used to generate touch-tone DTMF. Moreover,
the only outputs available from a normal touch-tone keypad are seven
two-note chords, so calling what you can get out of a touch-tone
keypad a 'tune' might be stretching it.
---
There is no reason a single pin from your parallel port could
not do something similar.

---
There's a very good reason why you can't: Without some interesting
filtering on the single pin, it would be impossible (I think) to
generate two sine waves with different frequencies simultanously.
---
Consider what would happen if you sent 20 0's
and then 20 1's, and repatedly this loop continuously and the output was
a speaker.

---
No big deal; you'd be feeding the speaker with a square wave.
---
Distinguishing these two concepts: Feeding a counter IC, like a Johnson
4017 at different rates from a pin of the parallel port would simply
make the 4017 cycle through the stages faster or slower. Connecting LEDs
to each of the stages would cycle through each LED, but would not
necessarily change the brightness of each LED.

---
Since the duty cycle would be constant, the brightness would remain
constant as well, once the persistence of vision fused the on-off
changes.
---
If instead, you connected
more directly from the port to an LED (using an appropriate resistor),
you could not only turn it on, the rate at which you switch between 0's
and 1's would dictate brightness.

---
No. the brightness would be determined by the ratio of time on to time
off, more particularly what we call the 'duty cycle', which is the
ratio of the time on to the time of the entire cycle.
---
I think it ends up working similar to
a diac/triac circuit that controls the brightness of a bulb by chopping
up the current.

---
In the sense that the TRIAC can control where in the cycle the lamp
can turn on, that's correct.
---

For starters:

Try this, since you can program your parallel port; with whatever language
you are programming in, you can have for/while loops that cycle between
the 0 and 1 states. Add a pause between the instructions for setting 0 and
1. Below is a code fragment I once wrote in C (for Linux). You can change
frequency by changing the value of usleep. This would cause stepper motors
to turn faster or slower. It could presumably also change the tone of a speaker
or the brightness of an LED, etc.

---
If it changes the frequency of the signal coming out of the port it
will change the tone of a speaker and the rotational soeed of a
stepper, but it _won't_ change the brightness of an LED. To do that
you'd need to change the duty cycle of the signal feeding the LED.
---
Taking this to a further level of
complexity, one could split the outgoing signal from each data pin
(voltage or current divider, logic circuits, etc) to take advantage of both
absolute 0 and 1 states, as in loading registers, etc and also the
frequency information (direct pulse modulation of LED brightness) or
via a frequency-to-voltage conversion (voltage dictates brightness). It
represents one means of sending serial information via a parallel port.
Similarly, a Morse code scheme sent from a single pin could also be used.

---
You need to understand why pulse-width modulation, (PWM) not
frequency, can change the brightness of an LED before you start
advocating the use of more complex hare-brained schemes.

Here:

If you start with a signal that looks like this:
_______________________________________________________
ledon__|

The LED will initially be off, but when ledon goes high it will turn
on and stay on for as long as ledon remains high.


Now, let's make ledon generate this squarewave signal continuously:
___________________ __________...
ledon__| |___________________|
|<------Ton-------->| |
|<------------------T------------------>|

Since the LED will be on 1/2 the time and off for the remainder of the
cycle (which is twice as long as Ton), if the frequency (or what we
call, in this case, the 'repetition rate' or 'rep rate') is high
enough so that our eyes can't distinguish between the on and off
states of the LED, the LED will appear to be half as bright as when it
was on all the time. Similarly:

____________________________ __________...
ledon__| |__________|
|<------------Ton----------->| |
|<------------------T------------------>|

will make the LED seem 75% as bright as it would be if it were on all
the time, and:

_________ _________
ledon__| |_____________________________| |___...
|<--Ton-->| |
|<------------------T------------------>|

would make it seem 1/4 as bright.

Our eye has a logarithmic response to light intensity, so the numbers
I gave aren't exactly right, but you get the idea...
 
J

John Fields

On Thu, 23 Dec 2004 15:34:59 -0600, John Fields

A little different notation under the timing, just for the sake of
clarity...
 
Top