Using Teensy++ to control five 8x8 LED matrices

Status
Not open for further replies.

odometer

New member
I am thinking of buying a Teensy-type board (specifically, the Teensy++ 2.0) to control five 8x8 LED matrices. These will be "bare" LED matrices, with resistors and wire connected in such a way as to allow 32 pins to control the whole thing.

I am thinking of following this procedure:
Choose any thirty-two pins available for digital output. Treat these as four sets of eight pins each. I will call these sets A, B, C, and D. I will call the LED matrices 1, 2, 3, 4, and 5.
A and B together control 1
A and C together control 2
A and D together control 3
B and C together control 4
B and D together control 5
(I could squeeze in a sixth matrix, but for my purposes, five is enough.)

Can I use the analog output pins on the Teensy++ 2.0 as digital pins? I know that if I use the digital pins in the middle of the board, I will then have enough outputs, but the analog output pins are easier for me to get at, especially for purposes of breadboarding.

Also, the reason I am doing DIY-style multiplexing is that I am not satisfied with some commercial multiplexed displays: the refresh rate is too slow. I intend to have a refresh rate of several kilohertz (yes, kilohertz), or even tens of kilohertz if I can manage it. Any suggestions?

The purpose of all this is to make a digital clock.
The display matrices will be arranged as 8 rows x 40 columns of LEDs.
There will be at least two buttons for controlling the clock. Do any of the chip's inputs contain pullup resistors so I can save myself some assembly time here?

As it's a clock, does the board contain a crystal or ceramic oscillator? I find that with ceramic oscillators, I get timekeeping accuracy more befitting a mechanical clock.

Lastly, will this thing work with the Arduino Wire library (for a Chronodot), and if so, which pins do I use?

Thank you for your patience.
 
First, the specific questions....

Can I use the analog output pins on the Teensy++ 2.0 as digital pins?

Yes.

I intend to have a refresh rate of several kilohertz (yes, kilohertz), or even tens of kilohertz if I can manage it. Any suggestions?

You'll probably end up using a timer interrupt. If you arrange the display data in memory the right way, so you can just read the next bytes and write them to 8 bit ports directly, it should be very fast. Of course, you'll need to leave some CPU time for the main program to create that data.

Do any of the chip's inputs contain pullup resistors so I can save myself some assembly time here?

All of the digital pins have optional pullup resistors. Use pinMode(pin, INPUT_PULLUP).

As it's a clock, does the board contain a crystal or ceramic oscillator?

Yes, every Teensy has a 16 MHz crystal.

Lastly, will this thing work with the Arduino Wire library (for a Chronodot), and if so, which pins do I use?

Yes, the Chronodot works great. See this page for details (scroll down to the 3rd picture)

http://www.pjrc.com/teensy/td_libs_DS1307RTC.html


Now, with those specific questions out of the way, I see two possible issues. Maybe I just don't understand your plans will enough? Anyway, here's a couple possible issues...

You're probably going to drive each row of LEDs at 1/8th duty cycle? Usually that means you get 1/8th of the brightness, but of course you're using the same current to light up 8X as many LEDs. Some LEDs are still pretty bright, but others really need the current increased to compensate for the loss from driving it only 1/8th of the time. You might try doing some brightness tests with your LEDs?

The recommended maximum current per pin is 20 mA, and the absolute max is 40 mA. The chip also has a total current spec of 200 mA. See page 398.

http://www.pjrc.com/teensy/at90usb1286.pdf

That 200 mA limit really imposes a limit on the total current you can drive to all the LEDs.

Often LED matrix applications use transistors, for much higher current, so the entire display can be very bright.


The one other comment, which might just be my lack of understanding of your plans, is regarding using "B" for both the columns on matrix 1 and the rows on 4 and 5. I don't see how that can work. Maybe you've got something pretty sophisticated in mind? Anyway, you might just double check your plans on that bit?
 
This leads me to a further question. Do the analog pins have the pullup resistors too?

EDIT: from what I can tell from the datasheet, the answer is 'yes.' But, I'm not particularly good at reading datasheets so I wouldn't mind a little confirmation. :D
 
Last edited:
If you arrange the display data in memory the right way, so you can just read the next bytes and write them to 8 bit ports directly, it should be very fast. Of course, you'll need to leave some CPU time for the main program to create that data.
Yes, I was going to arrange the data "packed" into bytes rather than, for example, using booleans.

The one other comment, which might just be my lack of understanding of your plans, is regarding using "B" for both the columns on matrix 1 and the rows on 4 and 5. I don't see how that can work. Maybe you've got something pretty sophisticated in mind? Anyway, you might just double check your plans on that bit?
OOOOOPS!!
I thought it would work the way I had it, but I see now I was mistaken.
I actually had to work it out on paper to see where my mistake lay.
I hate to have to admit to such a huge mistake, but you got me. I made a huge mistake.
Maybe if I use the fifth set of outputs (call it E), and use the scheme AD=1, AE=2, BD=3, BE=4, CD=5, then it will work. But how do I work on that fifth set? It seems it will be hard to breadboard...
I suppose if all else fails, I could just use four sets of outputs.
 
Last edited:
Status
Not open for further replies.
Back
Top