Sending data between two Teensy 3.2s

Status
Not open for further replies.

Robhilken

Member
Hi,

I need to be able to send some simple data from one teensy 3.2 to another. This will be used to trigger actions, so it's not a stream of data, or very complex data. It could just be simple numbers, but strings would be handy. They would just be sent as a result of other actions, so i don't think speed is particularly important. Latency between sending and recieving - yes, but not a high speed transfer of multiple pieces of data.

I started looking at SPI, but I see that doing master/slave configurations is quite complicated on teensys... I read through this https://forum.pjrc.com/threads/50008-Project-SPI_MSTransfer but I think it's overkill for what I need.

Should I just be using a simple serial transfer, or wire?

Or I2C?

It seems there are probably many many ways to do what I want, but I'm confused as to which is the most fit for my purpose.

Thanks for any advice!
 
Normally Serial1 (or the other serial ports) is the simplest way. The nice thing about serial is you only need 1 signal wire for each data direction, plus GND.

If your data is fairly simple, just use Serial1.write() on the sending side and Serial1.available() and Serial1.read() on the receiving side. For more complicated data, the EasyTransfer library is a popular choice. MIDI is another good way, if your events are simple enough fit into the structure of MIDI messages.
 
Serial or i2c is feasable. But you will need to handle the serial data to parse the data you need, in i2c/spi you can send/receive data as blocks, like an indiced array ordered, 3rd option is CAN, but you would need transceivers to use it
 
I think breadboard + 2x teensys + 3 wires + easytransfer examples straight from arduino ide menu will get you started.
 
Status
Not open for further replies.
Back
Top