I have been playing with an idea of having multiple Arduino (e.g. ATmega328) with different purposes running on a circuit.
The intention would be to enable the FTDI programmer such as the FT232RL or FT231X chip to communicate to a specific circuit by switching these digital pins to one Arduino at a time to accomplish this programming.
The FT232RL or FT231X chip would be routed to a USB host whilst the programming pins would only be enabled on the selected Arduino.
My initial design idea was AND gates before I truly understood that Arduino Programming is a bi-directional communication process -- this would never work.
My next logical step is working with relays, this seems overkill for what I am attempting to accomplish considering cost and space on a board alone.
My specific implementation of this doesn't require any special considerations such as signal noise or loss. The Arduinos could be assumed to be on the same PCB operating over traces.
Does anyone have any other component suggestions that could accomplish this direct bidirectional connection whilst being switched on and off using a 5 V pin?
1 Answer 1
Sounds like you need a tri-state buffer for each of the lines between the Arduino and the FTDI FT232RL or FT231X, such as the 74LS244 Octal Tri-state Buffer
74LS244 Octal Tri-state Buffer
You would have one of these for each Arduino, and connect the relevant IO pins to each of the buffers in the appropriate direction:
- Arduino outputs to the An inputs of the buffer
- Arduino inputs to the Qn outputs of the buffer
- The same would apply to the IO pins of the FTDI IC
Assuming that there are a maximum of four lines in each direction between the Arduino and the FTDI IC (which I believe to be the case), then only one buffer IC would be needed per Arduino.
The fact that the buffer is tri-state means that you can isolate the Arduinos that are not needing to communicate with the FTDI IC, by disabling their buffers via the CA
and CB
inputs. Then enable the CA
and CB
inputs only on the buffer(s) connected to the Arduino that needs to communicate with the FTDI IC.
Clearly, only one set of buffers should be enabled at any one time.
You would also need to consider to enable and disable the buffers. That is to say, consider how these CA
and CB
pins, for each buffer, are managed. You could either manually control each one with a switch or, automatically, with an additional μController, with the appropriate glue logic. You could also have each Arduino manage their own buffers, but that would require some negotiation between the Arduinos to ensure that no conflict occurs - however, this seems to be adding unnecessary complexity.
Note that, if you have any bi-directional lines (although the FTDI ICs don't have any of those), then a bus transceiver, such as the TTL 74LS245, should be used.
Note that the term Arduino usually refers to the Arduino boards (such as the Uno, Nano, etc.). These boards already have a FTDI IC on them, so this would complicate matters.
However, if by Arduino, you actually mean an actual ATmega328P μController IC, then this method, as described above, should work.
My initial design idea was AND gates before I truly understood that Arduino Programming is a bi-directional communication process -- this would never work.
... why would it not work? ... the transmit and receive lines are separate \$\endgroup\$