Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
NAND Flash Raw Example

Purpose

This NAND Flash raw example shall show how to read and write data from/to a NAND Flash connected to the chip.

Description

The required steps are:

  • Initialize NAND Flash.
  • Find a good block by erase function.
  • Prepare a buffer.
  • Write the buffer into a NAND Flash page data area.
  • Read the page and check data is correct.

Usage

  1. On the computer, open and configure a terminal application (e.g. HyperTerminal on Microsoft Windows) with these settings:
    • 115200 bauds
    • 8 bits of data
    • No parity
    • 1 stop bit
    • No flow control
  2. Start the application.
  3. In the terminal window, the following text should appear:
    -- NAND Flash Raw Example --
    -- xxxxxx-xx
    -- Compiled: xxx xx xxxx xx:xx:xx --
    -I- NAND Flash driver initialized
    -I- Size of the whole device in bytes : 0x10000000
    -I- Size in bytes of one single block of a device : 0x20000
    -I- Number of blocks in the entire device : 0x800
    -I- Size of the data area of a page in bytes : 0x800
    -I- Number of pages in the entire device : 0x40