The P2 Edge (#P2-EC) has a 16MB Flash memory (Winbond part W25Q128JV) with a Serial Peripheral Interface (SPI) to the Propeller 2. The first 512K bytes is used for the user’s bootable application and the remaining ~15.5MB may be used for data. The timing with the SPI Flash is fast and deterministic, unlike SD cards.
This Quick Byte is supported by a “Spin2 for Beginners” video from JonnyMac, linked below under Additional Resources.
Three example programs demonstrate reading the contents of the 16MB Flash:
- 02a_jm_flash_reader-Archive (Spin2)
- 02b_jm_flash_reader-Archive (PASM)
- 02c_jm_flash_reader-Archive (smart pins)
The Flash Explorer program (03_jm_flash_explorer-Archive) can write to the Flash starting at $10_0000. This code example has no write-leveling to spread the erase/write cycles across all blocks. Erasure resets bytes to FF. Modifications can be made on this program as desired, but be aware of the ability to overwrite the bootable application in the first 512KB.