Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
NAND Flash With Software ECC Example

Purpose

This NAND Flash software ECC example show how to read and write data with software ECC 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 by software ECC function.
  • Read the page by software ECC function 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 With Software ECC Example --
    -- xxxxxx-xx
    -- Compiled: xxx xx xxxx xx:xx:xx --
    -I- NAND Flash driver initialized
    -I- Size of the whole device in bytes : 0xxxxxxxx
    -I- Size in bytes of one single block of a device : 0xxxxxx
    -I- Number of blocks in the entire device : 0xxxx
    -I- Size of the data area of a page in bytes : 0xxxx
    -I- Number of pages in the entire device : 0xxx