How does it work?
The Flash 6 click based on the W25Q128JV array is organized into 65,536 programmable pages of 256-bytes each. Up to 256 bytes can be programmed at a time. Pages can be erased in groups of 16 (4KB sector erase), groups of 128 (32KB block erase), groups of 256 (64KB block erase) or the entire chip (chip erase). The W25Q128JV has 4,096 erasable sectors and 256 erasable blocks respectively. The small 4KB sectors allow for greater flexibility in applications that require data and parameter storage.
The Flash 6 Click uses the standard Serial Peripheral Interface (SPI), supporting SPI clock frequencies of up to 133MHz Single, Dual/Quad SPI clocks. Besides that, the W25Q128JV provides a 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 133MHz Standard/Dual/Quad SPI clocks and a 66MB/S continuous data transfer rate. Given the fact it has a efficient “Continuous Read Mode”, it allows direct read access to the entire array. However, the performance also 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 and SFDP, and a 64-bit Unique Serial Number and three 256-bytes Security Registers.
The W25Q128JV 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 is used to read data or status from the device on the falling edge of CLK.
For the detailed explanation, please consult the included datasheet. However, MikroElektronika provides a library which 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™ is designed to be operated only with 3.3V logic level. A proper logic voltage level conversion should be performed before the Click board™ is used with MCUs with logic levels of 5V.
Specifications
Type
FLASH
Applications
A storage solution for systems with limited space, pins and power, code shadowing to RAM, executing code directly from Dual/Quad SPI (XIP) and storing voice, text and data.
On-board modules
W25Q128JV (128M-bit) Flash Memory from Winbond
Key Features
Highest Performance Serial Flash, Efficient “Continuous Read”, Advanced Security Features
Interface
QSPI,SPI
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
S (28.6 x 25.4 mm)
Input Voltage
3.3V
Pinout diagram
This table shows how the pinout on the Flash 6 Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | – | Power LED Indicator |
Software Support
We provide a library for the Flash 6 Click on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
Library contains function for write in memory and read from memory.
Key functions:
void flash6_erase_memory_segment( uint8_t segment, uint32_t start_addr );
– Function for eraseing segmentvoid flash6_write_memory_data ( uint32_t addr, uint8_t *data_buf, uint16_t buf_size );
– Function used for writing in memoryvoid flash6_read_memory_data ( uint32_t addr, uint8_t *data_buf, uint16_t buf_size );
– Function used for reading from memory
Examples description
The application is composed of three sections :
- System Initialization – Initializes SPI module
- Application Initialization – Initializes driver, resets device and tests communication.
- Application Task – Clears the memory sector, writes “MikroE” to device memory and then reads it and sends it to log every 2 sec.
void application_task ( ) { uint32_t start_addr; uint8_t read_buff[ 50 ]; uint8_t cnt; start_addr = 0x002000; mikrobus_logWrite( " >>>> Erase sector <<<< ", _LOG_LINE ); flash6_erase_memory_segment( FLASH6_CMD_SECTOR_ERASE_4KB, start_addr ); Delay_ms( 500 ); mikrobus_logWrite( " >>>> Write in memory <<<< ", _LOG_LINE ); mikrobus_logWrite( " >>>> ............... <<<< ", _LOG_LINE ); flash6_write_memory_data( start_addr, &write_buf[ 0 ], 6 ); mikrobus_logWrite( " >>>> Read from memory <<<< ", _LOG_LINE ); flash6_read_memory_data( start_addr, &read_buff[ 0 ], 6 ); mikrobus_logWrite( " >>>> ", _LOG_TEXT ); for( cnt = 0; cnt < 6; cnt++ ) { mikrobus_logWrite( &read_buff[ cnt ], _LOG_BYTE ); mikrobus_logWrite( " ", _LOG_TEXT ); Delay_ms( 100 ); } mikrobus_logWrite( " <<<< ", _LOG_LINE ); mikrobus_logWrite( "---------------------------", _LOG_LINE ); Delay_ms( 2000 ); }
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- SPI Library
- Conversions Libray
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
mikroSDK
This Click board™ is supported with mikroSDK – MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.