Connecting two Teensy

Status
Not open for further replies.

Niakoi

New member
Hello,

Has anyone tried connecting two Teensy to exchange some data?
If yes please share your experience.

Many Thanks
Nia
 
Easiest way: UART to UART, TX->RX, RX->TX, GND->GND
First UART is in software, Serial1.begin(115200) or some such
 
Has anyone tried connecting two Teensy to exchange some data?

There are several ways to do this, varying with complexity. The easiest approach is the Serial approach mentioned above, it requires three wires. I have managed to have AVRs talking to each other at 1MBit/s, though they were both mounted on the same PCB, with a very short transmission line. I see no reason why you shouldn't be able to achieve very high speeds serially, though your serial monitor will likely not be able to 'listen in' on non-standard baud rates - plus if that is something you want to do, read up on how to electrically connect the two Teensy's - Bill porter has a good article on that.

Other options include using the I2C, SPI, or bit-banging your own custom protocol. These options are much more complex to implement than a serial one. One helpful program/library I have used a lot is EasyTransfer from Bill Porter. EasyTransfer works across Serial and I2C connections, performs CRC, and so on, simplifying the whole experience for the user. The only downside to EasyTransfer is having to know exactly what you intend to send.
 
Many people have done this using serial, and also I2C.

I agree with Steve and Constantin, serial is the easiest way if you're connecting 2 boards. For more than 2, I2C might be simpler.
 
Thank you guys - apreciated fast responses!

Waitiing for my second Teensy to give it a try for the prototype I am building.
(the distributor in Germany is not very fast)

Have a nice day,
Nia
 
(the distributor in Germany is not very fast)

Where are you ordering? Watterott is usually very fast. If you have a credit card and order more than one teensy and can wait a few days, order directly from PJRC, as that will turn out cheaper.
 
exp-tech.de cheaper and fast, paypal, max two days or oshpark two weeks ( don´t like the green design ;-) )
 
Hello,
The one I found in prjc.com is: http://www.hitechstore.de/produkte/3/
Now more than a week after I have made the bank transfer. Already called them one time and they promissed to check. Tomorrow will follow up again.

Thank you for both web sites which are ~25% lower than the price I paid ...
Any way will use one of the two in future.

Many thanks
Nia
 
Just checked my email used for ordering and had a nice surprise - hitechstore has confirmed that they have sent me the Teensy today :)
 
Hi - just came across this and wondered if I could use a 2nd Teensy 3.6 to basically run 8 rotary encoders (as I've totally run out of I/O on my first unit).

Apart from using the connections above (ie Easiest way: UART to UART, TX->RX, RX->TX, GND->GND) how do I actually transfer the data bewteen Teensy's?
Would really appreciate some pointers pls.
 
It depends on how you organize your code and what all you wish to do communicate...

Depending on what all I am doing and the frequency of query... I might do things different.

Soon I will be playing with my RPI (more likely up board or Odroid) to Teensy communications where I will have the teensy controlling motors and sensors...

Currently the code uses USART to do all of this. The Host sends a packet, which is of some known format, where the Teensy sees the data and either forwards the data to the servos or it
intercepts the command and generates it's own response again with a know packet format...

But I am thinking of doing some of this different using I2C. I will have the Teensy as the I2C slave to the host. I will have the slave Teensy act like a several different devices, where the
host can issue a write, request where the host specifies the starting logical register and the data, which I will simply save away into an array. I may also do some post processing of the command as some registers will interact with hardware (like turn on LED, maybe set IO pin state....). Or the Host may issue a read request where again they specify the starting register number and how many bytes to return...

I would then setup the logical registers something like:
<encoder 1 low>
<encoder 1 high>
<encoder 2 low>
<encoder 2 high>
...
<button 1>
<button 2>
<led 1>
<led 2>
...
 
Status
Not open for further replies.
Back
Top