Double Stacking Teensy

Status
Not open for further replies.
Hi there,

I'm presently building a range of MIDI controllers designed specifically for a piece of theatre playback software called Qlab. This consists of a bunch of buttons outputting MIDI via USB using a Teensy as the heart.

One feature do like to add is being able to trigger two computers from the one button. So I thought I'd have two Teensy chips then just wire each button to both, however that will start to get messy, so I thought, what if I wire one Teensy into the other by soldering them together with standard PCB pins...? Then I'd just wire each button to the top chip and the bottom chip would take its identical signal from the top one...

Will this work? Is there a better, neater way I could achieve this? Is there anything I should watch for or avoid in doing this?

Thanks Y'all! :)

-Rory Maguire
 
Hello Rory,

you should not do that. The teensy pins include USB supply and voltage regulator outputs, and connecting those between two teensys can damage your USB host hardware or the teensy's onboard regulators as they will start to fight each other. Same for output pins: if two identical pins are configured as outputs but don't have the same level, this will essentially result in a short and damage the teensy's port hardware.

I'd really recommend just connecting the buttons to the two teensys. How many buttons do you have? imho, two wires from a button to two teensys is not messy, it's actually a lot cleaner than connecting two teensys.

Regards

Christoph
 
Thanks for this,

I had considered that, but what's say I didn't jumper every pin... If I only put the link in for the input pins, and the ground pin. The LED back light on each button would be taken from the "main" Teensy, while just a single status LED will be fed from the backup.

I could easily just split the outputs from each button, but I was looking for a way to shrink the whole circuit down to fit into a tighter enclosure.

Thanks!

-Rory Maguire
 
You can of course just connect those two pins (button signal and ground), but stacking two boards that way won't be very robust. Make sure they have sufficient mechanical support. What are your space constraints?

I'm actually not sure if it's accepted practice to connect the ground of two USB devices, maybe someone else can elaborate on this.
 
but what's say I didn't jumper every pin... If I only put the link in for the input pins, and the ground pin.

That sounds fine to me.

However, you must be careful to only program those pins as INPUT or INPUT_PULLUP mode. If both are programmed as OUTPUT mode, they can conflict and damage each other. But the same would be true even if the boards aren't stacked, since the electrons don't "know" if the boards are sitting side-by-side or on top of each other. Only the common connections matter.

Also be aware that this system will only work if both boards are powered. If either board loses power, the weak pullup resistor from the other boards will attempt to power it, conducting through the diodes inside the chip which normally help protect the pins from static shocks. (some chips have a feature where the pins appear as disconnected when the chip doesn't have power, but Teensy is not one of them) Not enough current will be available through the pullup resistor, so the pin on the powered Teensy will go to a low voltage. In other words, if one Teensy loses power, because they're connected in common, the other with power will likely believe the button has been pressed. Again, this doesn't matter if the boards are stacked or arranged in any other way.

If you want one board to work (and not incorrectly see a button press) while the other doesn't have power, you'll need to add at least 2 diodes.
 
Last edited:
maybe you could also wire all the buttons to one teensy, and then have the two communicate through i2c and tell the second controller to send out identical midi messages.
 
Thanks everyone!

So what you are telling me is that in my current configuration, I.e just wiring the switches to two boards, we will run into issues if we only power a single Teensy?

What would be required to alleviate this? And how would this change if I were to wire one Teensy from the NO contact on the switch, and the other from the NC contact? Obviously still wiring the ground connection to both... Please be as specific as you like! As you can tell, I'm an audio operator, not an electronics guru! :p
 
^^^ this ^^^

Thanks,

I possibly should have clarified... The idea behind having two Teensys triggering two computers is for a level of redundancy, where as one computer can fail (assume a total power fail) and the other can resume uninterrupted.


I'm assuming connecting them with some kind of serial connection would also fail with one machine going down?
 
A little bit more background perhaps... Let's scrap the double stacking idea, after assembling pre wiring, we will have loads of space for the two chips side by side...

So I've got 6 buttons each with an LED, plus a "status" LED to be wired to the backup Teensy to provide a visual indication the backup is both active and firing cues.

Ideally I would like to be able to use it either with a single machine, or with two.

Thanks!
 
I'd suggest using 2 diodes, like this:

diodes.jpg

Both boards should use INPUT_PULLUP mode. With these diodes, if either board loses power, the diode will prevent it from interfering with the other board.

The cathode (the side with the stripe printed on the diode) faces towards the pushbutton.
 
Hi Paul,

That's perfect thanks! That's what I assumed, but it does help to hear it from someone like yourself!

Would the same need to be done for the ground as well? Or shouldn't there be too many issues grounding the boards together?
 
The grounds need to be connected directly.

Usually computers have their grounds connected to earth ground through their power cords. Or if they're laptops running from battery power, they have no ground connection to the rest of the world. Both are fine to connect together.

Of course, if some piece of equipment has a "hot" ground, which is dangerous and generally not done, of course it could be bad when it's connected to another computer through the 2 Teensy boards. There's not much you can do about that, other than touching the shells of the 2 USB connectors together (without Teensy at all) and watching for a spark or other really bad stuff. Those types of problems are very rare, especially for 2 computers located close together and plugged into the same power.
 
Just reporting back... Everything works like a charm! No issues with running one while the other is power cycled or anything like that! Even faked a couple of computer failures and not a glitch!

Thank you all for your efforts! :)
 
Note that those diodes are Schottky - so the the Vin low is about 0.3 volts. Non-Schottky will have too little margin to sustain a good logic 0.
 
Note that those diodes are Schottky - so the the Vin low is about 0.3 volts. Non-Schottky will have too little margin to sustain a good logic 0.


That is true... I did have to substitute for a 59 rather than a 57 as my local electronic retailer didn't stock the 57... But it seems to be working fine!
 
Status
Not open for further replies.
Back
Top