How to select correct SPI flash for specific micro-controller (pic32mx795f)

flashmemorymicrocontrollerpic

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

specs:

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.

Best Answer

  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).