Intermediate
30 min

Safeguard sensitive information through reliable flash memory, the W25N01GVZEIG combined with MK64FN1M0VDC12

Where speed meets storage brilliance

Flash 5 Click with Clicker 2 for Kinetis

Published Aug 25, 2023

Click board™

Flash 5 Click

Dev Board

Clicker 2 for Kinetis

Compiler

NECTO Studio

MCU

MK64FN1M0VDC12

Ensure reliable data retention and encryption through our flash memory solution

A

A

Hardware Overview

How does it work?

Flash 5 Click is based on the W25N01GVZEIG/IT (1G-bit) Serial SLC NAND Flash Memory from Winbond. The device operates on a single 3.3V power supply with current consumption as low as 25mA active and 10µA for standby. All W25N SpiFlash family devices are offered in space-saving packages, which were previously impossible to use for the typical NAND flash memory. The W25N01GVZEIG/IT 1G-bit memory array is organized into 65,536 programmable pages of 2,048 bytes each. The entire page can be programmed simultaneously using the data from the 2,048-Byte internal buffer. Pages can be erased in groups of 64 (128KB block erase). The W25N01GVZEIG/IT has 1,024 erasable blocks. The Flash 5 Click uses the standard Serial Peripheral Interface (SPI), supporting SPI clock frequencies of up to 104MHz. Besides that, the W25N01GVZEIG/IT provides a new Continuous Read Mode that allows for efficient access to the entire memory array with a single Read command. This feature is ideal

for code-shadowing applications. Also, it offers the highest performance thanks to the Serial NAND Flash with 104MHz Standard/Dual/Quad SPI clocks and a 50MB/S continuous data transfer rate. Given that it has an efficient “Continuous Read Mode,” it allows direct read access to the entire array. However, the performance depends on the main MCU used with this Click board™. A Hold pin, Write Protect pin and programmable write protection provide further control flexibility. Additionally, the device supports JEDEC standard manufacturer and device ID, one 2,048-Byte Unique ID page, one 2,048-Byte parameter page, and ten 2,048-Byte OTP pages. To provide better NAND flash memory manageability, user-configurable internal ECC and bad block management are also available in W25N01GVZEIG/IT. The W25N01GVZEIG/IT is accessed through an SPI-compatible bus consisting of four signals: Serial Clock (CLK), Chip Select (/CS), Serial Data Input (DI), and Serial Data

Output (DO). Standard SPI instructions use the DI input pin to serially write instructions, addresses, or data to the device on the rising edge of CLK. The DO output pin reads data or status from the device on the falling edge of CLK. For a detailed explanation, please consult the included datasheet. However, MikroElektronika provides a library that contains functions that simplify and speed up working with this device. The provided application example demonstrates the functionality of the library functions. It can be used as a reference for a custom project development. This Click board™ can be operated only with a 3.3V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. Also, it comes equipped with a library containing functions and an example code that can be used, as a reference, for further development.

Flash 5 Click top side image
Flash 5 Click bottom side image

Features overview

Development board

Clicker 2 for Kinetis is a compact starter development board that brings the flexibility of add-on Click boards™ to your favorite microcontroller, making it a perfect starter kit for implementing your ideas. It comes with an onboard 32-bit ARM Cortex-M4F microcontroller, the MK64FN1M0VDC12 from NXP Semiconductors, two mikroBUS™ sockets for Click board™ connectivity, a USB connector, LED indicators, buttons, a JTAG programmer connector, and two 26-pin headers for interfacing with external electronics. Its compact design with clear and easily recognizable silkscreen markings allows you to build gadgets with unique functionalities and

features quickly. Each part of the Clicker 2 for Kinetis development kit contains the components necessary for the most efficient operation of the same board. In addition to the possibility of choosing the Clicker 2 for Kinetis programming method, using a USB HID mikroBootloader or an external mikroProg connector for Kinetis programmer, the Clicker 2 board also includes a clean and regulated power supply module for the development kit. It provides two ways of board-powering; through the USB Micro-B cable, where onboard voltage regulators provide the appropriate voltage levels to each component on the board, or

using a Li-Polymer battery via an onboard battery connector. All communication methods that mikroBUS™ itself supports are on this board, including the well-established mikroBUS™ socket, reset button, and several user-configurable buttons and LED indicators. Clicker 2 for Kinetis is an integral part of the Mikroe ecosystem, allowing you to create a new application in minutes. Natively supported by Mikroe software tools, it covers many aspects of prototyping thanks to a considerable number of different Click boards™ (over a thousand boards), the number of which is growing every day.

Clicker 2 for Kinetis dimensions image

Microcontroller Overview

MCU Card / MCU

default

Architecture

ARM Cortex-M4

MCU Memory (KB)

1024

Silicon Vendor

NXP

Pin count

121

RAM (Bytes)

262144

Used MCU Pins

mikroBUS™ mapper

NC
NC
AN
Write Protect
PB11
RST
SPI Chip Select
PC4
CS
SPI Clock
PC5
SCK
SPI Data OUT/S01
PC7
MISO
SPI Data IN/S00
PC6
MOSI
Power Supply
3.3V
3.3V
Ground
GND
GND
Data Transfer Pause
PA10
PWM
NC
NC
INT
NC
NC
TX
NC
NC
RX
NC
NC
SCL
NC
NC
SDA
NC
NC
5V
Ground
GND
GND
1

Take a closer look

Schematic

Flash 5 Click Schematic schematic

Step by step

Project assembly

Clicker 2 for PIC32MZ front image hardware assembly

Start by selecting your development board and Click board™. Begin with the Clicker 2 for Kinetis as your development board.

Clicker 2 for PIC32MZ front image hardware assembly
Buck 22 Click front image hardware assembly
Prog-cut hardware assembly
Micro B Connector Clicker 2 - upright/background hardware assembly
Necto image step 2 hardware assembly
Necto image step 3 hardware assembly
Necto image step 4 hardware assembly
Necto image step 5 hardware assembly
Necto image step 6 hardware assembly
Flip&Click PIC32MZ MCU step hardware assembly
Necto No Display image step 8 hardware assembly
Necto image step 9 hardware assembly
Necto image step 10 hardware assembly
Debug Image Necto Step hardware assembly

Track your results in real time

Application Output via Debug Mode

1. Once the code example is loaded, pressing the "DEBUG" button initiates the build process, programs it on the created setup, and enters Debug mode.

2. After the programming is completed, a header with buttons for various actions within the IDE becomes visible. Clicking the green "PLAY" button starts reading the results achieved with the Click board™. The achieved results are displayed in the Application Output tab.

DEBUG_Application_Output

Software Support

Library Description

This library contains API for Flash 5 Click driver.

Key functions:

  • flash5_page_read - Function for setting page read

  • flash5_page_load_memory - Function for loading one page

  • flash5_write_status_data - Function for writing status data

Open Source

Code example

This example can be found in NECTO Studio. Feel free to download the code, or you can copy the code below.

/*!
 * \file 
 * \brief Flash5 Click example
 * 
 * # Description
 * This application is for storing mass storage.
 *
 * The demo application is composed of two sections :
 * 
 * ## Application Init 
 * Initializes driver, resets device, erasing one page of memory, tests communication and configures device.
 * 
 * ## Application Task  
 * Writes "MikroE" to device memory and then reads it and sends it to log.
 * 
 * \author MikroE Team
 *
 */
// ------------------------------------------------------------------- INCLUDES

#include "board.h"
#include "log.h"
#include "flash5.h"

// ------------------------------------------------------------------ VARIABLES

static flash5_t flash5;
static log_t logger;
static char write_buf[ 7 ] = { 'M', 'i', 'k', 'r', 'o', 'E', 0 };

// ------------------------------------------------------ APPLICATION FUNCTIONS

void application_init ( void )
{
    log_cfg_t log_cfg;
    flash5_cfg_t cfg;
    uint8_t device_check = 0;

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, "---- Application Init ----" );

    //  Click initialization.

    flash5_cfg_setup( &cfg );
    FLASH5_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    flash5_init( &flash5, &cfg );

    log_printf( &logger, " - Reseting device... \r\n" );
 
    flash5_software_reset( &flash5 );
    Delay_ms( 1000 );
    
    log_printf( &logger, " - Erasing memory... \r\n" );   
    
    flash5_send_cmd( &flash5, FLASH5_CMD_WRITE_ENABLE );
    flash5_erase_page_data( &flash5, 0x0001 );
    
    device_check = flash5_device_id_check( &flash5 );

    if ( device_check == FLASH5_DEVICE_OK )
    {
        log_printf( &logger, " - Device OK \r\n" );  
    }
    else
    {
        log_printf( &logger, " - Device Error \r\n" );  
        for( ; ; );
    }
    Delay_ms( 100 );

    log_printf( &logger, " - Configuring device \r\n" );  

    flash5_write_status_data( &flash5, FLASH5_CMD_WRITE_REG_STATUS1, FLASH5_REG_STATUS_1, FLASH5_RS1_WRITE_PROTECTION_DISABLE | 
                                                                                          FLASH5_RS1_SRP1_ENABLE );
    flash5_write_status_data( &flash5, FLASH5_CMD_WRITE_REG_STATUS1, FLASH5_REG_STATUS_1, FLASH5_RS2_PAGE_READ_MODE );
    Delay_ms( 1000 );
    
    log_printf( &logger, "***** App init ***** \r\n" );
    log_printf( &logger, "------------------- \r\n" );
    Delay_ms( 500 );
}

void application_task ( )
{
    char read_buf[ 6 ];
    uint8_t n_counter;

    flash5_send_cmd( &flash5, FLASH5_CMD_WRITE_ENABLE );
    flash5_page_load_memory( &flash5, 0x000A, &write_buf[ 0 ], 6 );
    flash5_page_read_memory( &flash5, 0x000A, &read_buf[ 0 ], 6 );

    for( n_counter = 0; n_counter < 6; n_counter++ )
    {
        log_printf( &logger, " %c ", read_buf[ n_counter ] );
        Delay_ms( 100 );
    }
    
    log_printf( &logger, " \r\n" );
    log_printf( &logger, "------------------- \r\n" );
    Delay_ms( 5000 );
}

void main ( void )
{
    application_init( );

    for ( ; ; )
    {
        application_task( );
    }
}

// ------------------------------------------------------------------------ END

Additional Support

Resources

Love this project?

'Buy This Kit' button takes you directly to the shopping cart where you can easily add or remove products.