1
\$\begingroup\$

I'm looking to make a system that can be upgraded by a customer in the field and I need to know some conceptual thing before I try implementing my current strategy.

Say I have a USB to SPI bridge, some FTDI chip, and I want to be able to program an SPI flash using that. Cool no problem BUT my controller has to boot from the same SPI flash using SPI lines. So would I be able to just connect everything together?

Concept connection diagram

Here is a picture since I'm not good at explaining these things.

There is a typo on the picture. The controller isn't being programmed, the SPI flash is. The controller will boot from the spi flash

\$\endgroup\$

2 Answers 2

4
\$\begingroup\$

It should be possible to connect two masters to the same SPI bus provided that

  • Neither device tries to drive SCK, MOSI, or SS when the other device wants to use it (though SS should be weakly pulled up when idle, and other pins weakly pulled to some defined level).

  • The devices have some means of staying out of each other's way.

I don't know whether the FTDI bridge expects to be a master or slave; if it expects to be a master but floats its wires except when told by the PC to feed data, and if it has some means of holding the main processor in reset, a direct connection should work out very nicely. If it expects to be an SPI slave, then the microcontroller firmware will have to talk to the bridge, read data from it, and feed that data to the flash itself.

\$\endgroup\$
0
2
\$\begingroup\$

Usually this will work if the output drivers from your controllers are disabled in reset state.

What we've done in the past to ensure the desired behaviour under certain circumstances is to use a Mux e.g. an ADG794 to be absolutely sure. You can also add 0R resistors on the lines once you have verified the correct behaviour and do not require a switch.

Make sure, you are also able to drive any required configuration pins on the FPGA (e.g. PROGRAM_B on Zylinx devices) and on your controllers (e.g. some RESET pin on your USB bridge).

\$\endgroup\$
1
  • \$\begingroup\$ Thanks for the suggestion of a switch! I'll use that one if I need to \$\endgroup\$
    – Funkyguy
    Commented Jan 14, 2014 at 20:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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