i'm interesting on how to correctly select SPI flash for microcontroller.


High-Performance 32-bit RISC CPU:

  • MIPS32® M4K® 32-bit core with 5-stage pipeline
  • • 80 MHz maximum frequency
  • • 1.56 DMIPS/MHz (Dhrystone 2.1) performance at zero Wait state Flash access
  • • Single-cycle multiply and high-performance divide unit
  • • MIPS16e® mode for up to 40% smaller code size
  • • Two sets of 32 core register files (32-bit) to reduce interrupt latency
  • • Prefetch Cache module to speed execution from Flash

Following are some of the key features of SPI module:

  • Master and Slave modes support
  • Four different clock formats
  • Enhanced Framed SPI protocol support
  • User-configurable 8-bit, 16-bit and 32-bit data width
  • Separate SPI FIFO buffers for receive and transmit
  • FIFO buffers act as 4/8/16-level deep FIFOs based on 32/16/8-bit data width
  • Programmable interrupt event on every 8-bit, 16-bit and 32-bit data transfer
  • Operation during CPU Sleep and Idle mode
  • Fast bit manipulation using CLR, SET and INV registers

Complete Datasheet

my concerns:

  1. How many bits/pins SPI interface would be the most optimal (32, 16, 8) ?

  2. What is the maximum speed can I get for read/write ?

  3. Should I consider any other interfaces(PMP, Serial, I^2C, etc.) or memory types for best performance?

    Purpose: possible code execution , storing audio files ( badgering from network ). I was looking for about 256-512 mb Thank you.

  • \$\begingroup\$ What are the specs on the MCU's SPI module? \$\endgroup\$ Commented Aug 16, 2013 at 1:03
  • \$\begingroup\$ i have added datasheet link , page 143 describe SPI \$\endgroup\$
    – vveliev
    Commented Aug 16, 2013 at 1:08
  • \$\begingroup\$ What is the purpose of this flash device? Code storage? Parameter storage? High volume data storage? What is the required size? For code storage and execution you rather connect a device to the data/address bus, SPI, being a serial bus will have quite a performance impact on your program execution speed. \$\endgroup\$
    – Lior Bilia
    Commented Aug 16, 2013 at 5:47
  • \$\begingroup\$ I'm not sure if I will need extra memory for the code execution , I suppose if I only need 1-4 mb I should use pmp with parallel memory that are more expensive. I will definitely need some storage memory for files. And I want them to make minimum effect on cpu speed. My biggest concern is that cpu have 5 stage pipeline so the actual clock speed is 16 Mhz. So I do not think that I can read faster then that. \$\endgroup\$
    – vveliev
    Commented Aug 16, 2013 at 14:13

1 Answer 1

  1. How many bits.... if you're using an SPI Flash IC then the internal data width doesn't matter from your MCU's point of view.
  2. How fast... read the appropriate section of the datasheet for your MCU; timing information for PIC I/O and peripherals is in the technical specs near the end of the document.
  3. Should I consider other interfaces... depends on your requirements; for most non-volatile memory requirements, SPI is perfectly adequate and it has many advantages (small physical size and minimal usage of MCU I/O pins are key examples).
  • \$\begingroup\$ So you are saying that regardless if I use 16 or 32 bit I can read and write in minimum clock cycle ? \$\endgroup\$
    – vveliev
    Commented Aug 16, 2013 at 13:07
  • 1
    \$\begingroup\$ @vveliev it does not seem that you understand that spi is a serial interface, 1 bit wide. \$\endgroup\$ Commented Aug 16, 2013 at 13:43
  • \$\begingroup\$ I agree .... I confused it with parallel .... \$\endgroup\$
    – vveliev
    Commented Aug 16, 2013 at 14:22

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.