1. Core Functionality & Overview:
️· What it is: This document describes an SPI NAND Flash memory device. NAND Flash is a type of non-volatile memory, meaning it retains data even when power is off.
️· SPI Interface: It communicates with a host system using the SPI (Serial Peripheral Interface) protocol. This is a common protocol for connecting peripherals to microcontrollers.
️· Block Organization: NAND Flash is organized into blocks, pages, and bytes. The documented device has a specific page size and a block size of 128KB.
️· Read/Write Limitations: There's a limited number of erase/program cycles (endurance) due to the nature of NAND Flash technology.
2. Command Set (Key Commands & their Functions):
️· Enable/Disable Operations:
- WREN (06H) - Write Enable: Must be sent *before* any programming (writing) or erasing operations.
- WRDI (04H) - Write Disable: Disables further writes (programming/erasing) – resets the Write Enable Latch (WEL).
️· Reading Data:
- PAGE READ (13H): Transfers data from the NAND Flash array to the internal cache register. Requires a 24-bit address. Data is then read out via subsequent commands.
- READ FROM CACHE (03H/0BH): Reads data from the cache register.
- READ FROM CACHE x2 (3BH): Reads data from the cache register at a faster rate (x2).
- READ FROM CACHE x4 (6BH): Reads data at the fastest rate (x4). Requires the Quad Enable (QE) bit to be set in the features register.
- READ FROM CACHE Dual IO (BBH): Reads with dual I/O.
- READ FROM CACHE Quad IO (EBH): Reads with quad I/O.
️· Programming/Writing:
- PROGRAM LOAD (02H): Loads data into an internal buffer, preparing it for programming. Multiple PROGRAM LOAD commands can be used to load a large amount of data.
- PROGRAM LOAD x4 (32H): Loads data into a buffer faster (x4).
- PROGRAM EXECUTE (10H): Programs the data from the buffer into the NAND Flash array.
- PROGRAM LOAD Random Data (84H / C4H/34H): For loading random data into the buffer, with variations for speed.
- PROGRAM LOAD Random Data Quad IO (72H): Loads random data with quad I/O.
️· Erasing:
- BLOCK ERASE (D8H): Erases an entire block (128KB) of NAND Flash.
️· Status & Control:
- GET FEATURES (0FH): Reads the status of the device and its features.
- SET FEATURES (1FH): Modifies the device's features (e.g., enabling Quad IO, OTP protection).
- RESET (FFH): Resets the device.
- READ ID (9FH): Reads the manufacturer ID (MID) and device ID (DID).
3. Important Considerations and Features:
️· Address Wrap: When reading data, the device has an address wrap functionality. It means that after reading the last byte in the defined memory space, the addressing starts again from the beginning.
️· Data Transfer Speed: Commands like 'Read from Cache x2' and 'Read from Cache x4' provide faster data transfer rates. Using Quad IO (x4) is the fastest.
️· Feature Control: The GET/SET FEATURES commands allow adjusting the device's behavior.
️· Error Correction: The device likely has some form of error correction (ECC), though it's not explicitly detailed.
️· OTP (One-Time Programmable) functionality: There are OTP-related features that can be configured, although details are not fully specified.
️· HOLDB/RST: This feature is specific to WSON8 packages and offers hold/reset functionality.
4. Sequence of Operations:
A typical read/write sequence would generally follow these steps:
️· Read:
1. Send `WREN` (if not already enabled).
2. Send `PAGE READ` command with the appropriate address.
3. Monitor status with `GET FEATURES`.
4. Send `READ FROM CACHE` (or x2/x4) to retrieve data.
️· Write:
1. Send `WREN`.
2. Send `PROGRAM LOAD` multiple times (if needed) to load the data.
3. Send `PROGRAM EXECUTE`.
4. Send `WRDI` to disable further writes.
5. Send `RESET` to clear status registers.
In essence, this documentation provides a comprehensive guide to interacting with this specific NAND Flash device using the SPI interface. Careful attention to command sequences, addressing, and feature control is essential for reliable operation.