0
\$\begingroup\$

The attached circuit block diagram shown in the rectangular box is my development board. It has microcontroller 1, which communicates with a SPI slave device (4 SPI line + 3 IO). 3.3V power goes to microcontroller 1 via a 0 ohm resistor.

Now I need to isolate this microcontroller 1 and make my slave device to communicate with the other microcontroller 2 . I do not want to cut tracks or remove microcontroller 1. So I think I can remove the 0 ohm resistor from microcontroller 1 section (see image). Now as per diagram I have two masters and one slave, but one master is not powered on, will this scheme work or not?

enter image description here

\$\endgroup\$
8
  • \$\begingroup\$ Can't you just program the pins in MCU-1 to be tri-stated? \$\endgroup\$
    – Mark
    May 28 '16 at 8:29
  • \$\begingroup\$ Right now no, so eaistest solution can be remove microcontroller 1 chip, right? \$\endgroup\$ May 28 '16 at 10:07
  • 1
    \$\begingroup\$ Based on what you have said e.g. MCU1 is on your development board, then the answer to "Can't you just program the pins in MCU-1 to be tri-stated?" seems to be technically "Yes" because you decide the program on your development board. But you said "no" so there must be extra information / constraints which you are not telling us. I see several places where more info could be supplied e.g. What is the main objective? Why connect the SPI device to MCU2 leaving the power-on? Overall, this smells like an XY-problem situation, where you may not get the best answer, due to missing info :-( \$\endgroup\$
    – SamGibson
    May 28 '16 at 15:08
  • \$\begingroup\$ Mcu 1 is freescale miceocontroller, that dev baras was in spare , we dont use this controller , even we dont have any software tool available for it, mcu 2 is our regular controller. Else we have to order programming tool for mcu 1 \$\endgroup\$ May 28 '16 at 15:19
  • \$\begingroup\$ I use Freescale microcontrollers, and as far as I've seen, all recent Freescale MCUs use the BDM interface for development. You can buy a BDM interface for $20. \$\endgroup\$
    – Mark
    May 28 '16 at 19:55
6
\$\begingroup\$

No, removing power is not generally a workable solution. While there are exceptions, most current ICs cannot tolerate voltages on their ordinary I/O pins outside of the range of their supplies (the situation is a little more complicated for 5v tolerant 3.3v parts). To protect against this, they have diodes from the inputs to the internal supplies. If you subject an unpowered chip to an active SPI bus, you will end up at least partially powering the chip through the I/O lines and these protection diodes. That loads the bus likely to the point of failure, and it puts more ongoing stress on the protection diodes than they are designed to handle. (While there are exceptions, without specific identification of the MCU you want to get out of the way as one of them, you have to assume that this usual constraint may apply.)

One thing that usually would work would be to to change the program of the "undesired" MCU to configure the I/O pins as tri-state inputs. In many cases it may even be enough to simply erase the MCU, without loading a new valid program.

Another, quite simple one could be to hold the "undesired" MCU in reset - generally that will tri-state its I/O's. However, do not do this to something like an ATmega which is itself programmed over the SPI pins, as traffic on the SPI bus while those parts are held in reset can end up accidentally reprogamming them with nonsense.

\$\endgroup\$
2
  • \$\begingroup\$ Just a note on this sort of situation, When I am designing circuits where I expect to power one side down, I use interface components that have an Ioff parameter. e2e.ti.com/support/logic/f/151/t/118676 \$\endgroup\$ May 28 '16 at 15:02
  • \$\begingroup\$ I don't know about Freescale, but Microchip grounds the reset lline of the PIC installed on a development to keep it tri-stated while a second PIC is plugged into a plugin module (PIM) socket which share the same I/O lines, This of course assumes the resets of the two microcontrollers are not connected together. \$\endgroup\$
    – tcrosley
    May 28 '16 at 18:28
0
\$\begingroup\$

I have two master and one slave , but one master is not powered on, Should this scheme work

This will not work as intended. Microcontroller pins have (almost) always diodes to both GND and VCC, thus the unpowered MC would draw current through the SPI pins, with possible damage to both MC1 and MC2.

On a dev board you should be able to put a program into MC1 that just does not use these SPI pins with power applied normally.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.