Control-Surface icon indicating copy to clipboard operation
Control-Surface copied to clipboard

Master Host for Slave USB Controllers

Open DylanBrianBenton opened this issue 5 years ago • 15 comments

Hey,

I was wondering if theres a way to "daisy chain" other teensy's to one that is already connected to a PC?

Just thinking in the future I might like to expand with further surfaces and I was wondering if it was possible? Using T4 & 4.1's

Image https://i.imgur.com/RPnICJn.png

DylanBrianBenton avatar Jul 06 '20 09:07 DylanBrianBenton

Why USB? It sounds like complete overkill for a simple single-purpose link between Teensies. I'm sure it could be done, but I don't see the value in it.

My approach would be to set up a UART link instead. You can use the MIDI routing example to merge the MIDI data from multiple slaves.

tttapa avatar Jul 06 '20 10:07 tttapa

Thanks Mate,

Hadn't read into UART in all honesty. Will do reading now :)

DylanBrianBenton avatar Jul 06 '20 10:07 DylanBrianBenton

Why USB? It sounds like complete overkill for a simple single-purpose link between Teensies. I'm sure it could be done, but I don't see the value in it.

My approach would be to set up a UART link instead. You can use the MIDI routing example to merge the MIDI data from multiple slaves.

Hey Mate,

Thats for the direction. Just to clarify.

With this M/S UART setup the slave would be used to detect any presses, turns or inputs on that MCU and then relays it back to the Master which would process the USB Midi?

Sorry I know this isnt exactly library specific.

DylanBrianBenton avatar Jul 07 '20 00:07 DylanBrianBenton

With this M/S UART setup the slave would be used to detect any presses, turns or inputs on that MCU and then relays it back to the Master which would process the USB Midi?

Yes.

Both microcontrollers operate independently, the "slave" registers inputs from switches etc, and sends the appropriate MIDI messages over the UART (there are many possible transports for MIDI). The "master" does the same thing for its switches and other inputs, and sends the appropriate MIDI messages over USB. Additionally, the "master" has a UART MIDI input to receive the MIDI messages from the "slave". It merges the messages it receives on that UART input with its own messages, and sends everything over USB.

For MIDI input (from your computer to the microcontrollers), the "master" simply splits the MIDI stream, sending the messages to both its internal Control Surface input logic, and also sending it over the UART to the "slave".

tttapa avatar Jul 07 '20 10:07 tttapa

Awesome Thanks mate.

Will look more!

DylanBrianBenton avatar Jul 07 '20 13:07 DylanBrianBenton

hello i'm new to the coding world i don't really understand how to make the connection by uart do you have an example?

radiservi avatar Sep 27 '20 17:09 radiservi

if i want to do uart with rs485 it's possible?

radiservi avatar Sep 27 '20 17:09 radiservi

Hi everyone, as I understood, this would work with two atmega32u4 connected by I2C???

pacolop avatar Oct 24 '22 16:10 pacolop

I use SERIAL from this example https://tttapa.github.io/Control-Surface-doc/Doxygen/dd/ddd/Serial-Interface_8ino-example.html and pipes https://tttapa.github.io/Control-Surface-doc/Doxygen/d0/dc4/MIDI_Pipes-Routing_8ino-example.html

master avr <-> usb master avr <-> ser

slv avr <-> ser

Trickster-git avatar Oct 24 '22 17:10 Trickster-git

thanks for your support. I have to put the code to start the i2c communication both in the master and in the slave????

pacolop avatar Oct 28 '22 08:10 pacolop

I can`t help with i2c, but if you want i can share my code 2 mega slave and pro micro master by serial.

Trickster-git avatar Oct 31 '22 17:10 Trickster-git

@Trickster-git Thank you very much, it would be helpful if apart from the code you could help me with the connections because I don't know what you mean by connecting by serial. If you can pass me both things and it solves the problem, I will change my pcb

pacolop avatar Nov 02 '22 19:11 pacolop

addPush.zip there is 3 files 1 is for arduino mega used for 16 encoders and 32 buttons by mux (buttons stop work, i don`t know how) 2 is for arduino mega used for 16 encoders 3 is for pro micro use for usb midi and one pot all boards connect by serial in loop. 1 tr->2rx 2tx->3rx 3tx->1rx fill free with your qestions.

Trickster-git avatar Nov 02 '22 22:11 Trickster-git

THANKS A LOT @Trickster-git I FINISHED SEEING THE FILE YOU SENT ME, THERE IS ONLY THE MEGA WITH 16 ENC. YOU CAN SEND ME THE OTHER TWO TO SEE IF THE COMMUNICATION CODE IS THE SAME.

pacolop avatar Nov 03 '22 06:11 pacolop