0

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

uint128_t
  • 8,664
  • 6
  • 26
  • 28
Transformer
  • 667
  • 1
  • 7
  • 18
  • Can't you just program the pins in MCU-1 to be tri-stated? – Mark May 28 '16 at 08:29
  • Right now no, so eaistest solution can be remove microcontroller 1 chip, right? – Transformer May 28 '16 at 10:07
  • 1
    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 :-( – SamGibson May 28 '16 at 15:08
  • 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 – Transformer May 28 '16 at 15:19
  • 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. – Mark May 28 '16 at 19:55
  • Another option is to just tie the RESET line low. When RESET is low, all regular I/O pins are tri-stated. That should work on ANY Freescale or Motorola MCU, past, present or future. – Mark May 28 '16 at 19:56
  • Oops, I didn't see that Chris made the same suggestion (about RESET). I gave him a bump. – Mark May 28 '16 at 20:19
  • @Mark Freescale (now owned by NXP) made many different types of MCUs. Some use their various "BDM" pods. Others use SWD, and others presumably need full JTAG, or yet other legacy interfaces. The MCU on the board in question may also have a serial or USB bootloader. The question doesn't identify the specific MCU so we can't know, though for many of these there are indeed cheap solutions - especially if one's only goal is to *erase* the chip and not to program it to do anything useful. – Chris Stratton May 28 '16 at 20:35

2 Answers2

6

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.

Chris Stratton
  • 33,282
  • 3
  • 43
  • 89
  • 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. http://e2e.ti.com/support/logic/f/151/t/118676 – Peter Smith May 28 '16 at 15:02
  • 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. – tcrosley May 28 '16 at 18:28
0

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.

Turbo J
  • 9,969
  • 1
  • 20
  • 28