My idea is to connect a Chip which doesn't explicitly support external memory but has SPI protocol and I2C. So far I understand I have only 3 pins for SPI. Wasn't able to find an approach (schematics) to connect a flash memory with the 3 pins and should and what other practical problems should I solve to achieve that ?

  • \$\begingroup\$ Finding a fourth pin for the chip select. \$\endgroup\$ – Ignacio Vazquez-Abrams Oct 6 '15 at 22:11
  • \$\begingroup\$ Depending on your requirements, virtually all SD cards support an SPI interface and are a relatively cheap way to add GB's of Flash memory to a project. \$\endgroup\$ – tcrosley Oct 6 '15 at 22:17

Generally the explicit external memory support is for accessing external parallel flash and RAM from within the address space of the executing code. With a chip that supports this, you can run code directly from external memory, create and access pointers in external memory, etc. There is never anything preventing you from using an external memory, you just won't have as clean of a method of accessing it. For SPI/I2C memories, you'll have to call functions to access the memory.

It should be relatively straightforward to connect an SPI flash chip. Just take a look at the flash chip datasheet to see what pins need to be connected where. Generally you'll have MOSI, MISO, clock, and chip select, possibly with some extra control lines such as write protect. The extra lines can usually just be tied high or low. MOSI, MISO, and clock will need to be connected to the chip's SPI controller for maximum performance. Chip select can generally be driven by any I/O pin, though some SPI controllers can also coordinate the chip select line with dedicated pins and possibly an external decoder chip.


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.