are tri-state transcievers the sosutiion I need? - Page 1
Forum section: electronics / beginners

author: legrady
author_rank: Contributor
timestamp: June 19, 2023, 02:16:44 pm
content: I'm looking for help to selectvely program multiple MCUs on a single eurorack board. I have a single ATTiny20 which is the main controller, communicating bt SPI to a display and DAC outputs and to the other two controllers. A second ATTiny20 handles a rotary controllers and some switches. An AtTiny40 deals with a string of switches and their LEDs.I would like to add 2x3 ISP connectors to each mcu, to program it using the Arduino IDE. I would need a way to disconnect all the MOSI/MISO/SCK/Reset lines (and power & gnd?) so that the mcu is connected to the arduino, but isolated from the local circuit. I'm thinking about tri-state transceiver buffers, but choosing components is stretching my design capabilities I'm assuming I can leave the non-SPI GPIO connected and gnored.Hoping for clear and simple ( and inexpensive ) suggestions & solutions! Are there particular components which are more appropriate for my problem?Tom

author: Infraviolet
author_rank: Super Contributor
timestamp: June 19, 2023, 03:32:41 pm
content: For the power pin you're probably looking at using a diode (if you can afford a voltage drop when in use) or a MOSFET setup (if you can't) between the main circuit's power rail and an independent power rail for the mcu, to allow the MCU to be powered whilst not "back powering" in to the rest of the circuit. When the main rail is powered during use the diode/mosfet lets power from the main rail easily power each mcu's rail, when the mcu's independent rail ispowered during programming it cannot back-power in to the main rail for everything else.The ground pin won't need anything special, just have the same ground broken out to both where it goes in use and to a pad on your ICSP header.The reset pin won't need anything special, it cannot be used as a normal GPIO (without some strange high voltage programming tricks), so you just keep it pulled high with a resistor, 1K, 10K... to your MCU's independent power rail, and break it out to the ICSP header. When programming the board the ISP programmer device will be able to pull down hard enough to overcome this resistor and bring the reset pin low.What to do about the MOSI/MISO/SCLK lines is something I'll await to hear others suggest. Usually I've just avoided using these pins in operation and left them to be connected to the programming header only. If one is careful about what roles they serve in use (as inputs or outputs and what sort of resistances may be connected to them) I think they can simply have the programming pin wired straight to the mcu pin and the mcu pin wired straight to whatever it is connected to in operation. But if one wants full freedom for these pins to each do any of the possible things during operation, then one might need some extra circuitry so that the things they connect to during operation don't affect you ability to program through them.

author: spostma
author_rank: Regular Contributor
timestamp: June 19, 2023, 03:48:15 pm
content: I think that a single microcontroller with enough pins could do this without multiplexing SPI buses.