How does it work?
Flash 11 Click is based on the AT25SF321B, a 32-Mbit SPI serial Flash memory with Dual I/O and Quad I/O support from Dialog Semiconductor. The AT25SF321A is organized as a 32Mbit (4Mx8 physical block) Flash memory where the memory array can be erased in four levels of granularity, including a full-chip erase, which depending on the blocks, can be done typically in 10 seconds. In addition, the optimized erase architecture allows erasing data in 4kB, 32kB, and 64kB block erase operations. Optimizing the erase blocks’ size can be the most efficient use of memory space. The AT25SF321B specifies a minimum of 100.000 endurance cycles with data retention of a minimum of 20 years, allowing it to handle (almost) unlimited reads/writes to the memory.
Flash 11 Click communicates with MCU through a standard SPI interface supporting the two most common SPI modes, SPI Mode 0 and 3, and a maximum clock frequency of up to 108MHz. Furthermore, this Click board™ provides additional hardware-controlled functions. The configurable Write Protection, marked as WP and routed on the default position of the PWM pin of the mikroBUS™ socket, protects all registers (including status and configuration) from write operations and must be held low to inhibit all the write operations to registers. When this pin is in a low logic state, all memory and register write are prohibited, and the address count is not incremented. In addition, there is software write protection too.
Also, it is possible to use the Reset or Hold function through the RST pin of the mikroBUS™ socket, depending on the state of the HOLD/RESET bit 7 in Status Register 3. In the case of the Hold function, this pin temporarily pauses serial communication without deselecting or resetting the device, while in the case of the Reset feature, a low logic level on the RST pin puts the AT25SF321B into a Reset state. This is a part of the Program and Erase, Suspend, and Resume features of the Flash 11 Click.
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. However, the Click board™ comes equipped with a library containing functions and an example code that can be used, as a reference, for further development.
Specifications
Type
FLASH
Applications
Can be used for storage and data transfer in consumer devices, and industrial applications
On-board modules
AT25SF321B – a 32-Mbit SPI serial Flash memory with Dual I/O and Quad I/O support from Dialog Semiconductor
Key Features
32Mbit (4Mx8 memory organization) flash memory, optimized erase architecture for code and data storage applications, flexible non-volatile block protection, high protection, write protection (both hardware and software), data endurance and retention, low power consumption, and more
Interface
QSPI,SPI
Feature
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 Flash 11 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 |
Flash 11 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | – | 3.3 | – | V |
Memory Size | – | – | 32 | Mbit |
Organization | 4Mx8 | |||
Write Endurance | 100K | – | – | Cycles |
Data Retention | 20 | – | – | Years |
Software Support
We provide a library for the Flash 11 Click as well as a demo application (example), developed using MIKROE compilers. The demo can run on all the main MIKROE development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for Flash 11 Click driver.
Key functions
-
flash11_memory_write
Flash 11 memory write function. -
flash11_memory_read
Flash 11 memory read function. -
flash11_block_erase
Flash 11 block erase function.
Example Description
This example demonstrates the use of Flash 11 Click board™ The demo app writes specified data to the memory and reads it back.
void application_task ( void )
{
uint8_t data_buf[ 128 ] = { 0 };
log_printf( &logger, " Memory address: 0x%.6LXrn", ( uint32_t ) STARTING_ADDRESS_1 );
if ( FLASH11_OK == flash11_block_erase( &flash11, FLASH11_CMD_BLOCK_ERASE_4KB, STARTING_ADDRESS_1 ) )
{
log_printf( &logger, " Erase memory block (4KB)rn" );
}
memcpy( data_buf, DEMO_TEXT_MESSAGE_1, strlen( DEMO_TEXT_MESSAGE_1 ) );
if ( FLASH11_OK == flash11_memory_write( &flash11, STARTING_ADDRESS_1, data_buf, sizeof( data_buf ) ) )
{
log_printf( &logger, " Write data: %srn", data_buf );
Delay_ms( 100 );
}
memset( data_buf, 0, sizeof( data_buf ) );
if ( FLASH11_OK == flash11_memory_read( &flash11, STARTING_ADDRESS_1, data_buf, sizeof( data_buf ) ) )
{
log_printf( &logger, " Read data: %srn", data_buf );
Delay_ms( 3000 );
}
log_printf( &logger, " ----------------------------rn" );
log_printf( &logger, " Memory address: 0x%.6LXrn", ( uint32_t ) STARTING_ADDRESS_2 );
if ( FLASH11_OK == flash11_block_erase( &flash11, FLASH11_CMD_BLOCK_ERASE_4KB, STARTING_ADDRESS_2 ) )
{
log_printf( &logger, " Erase memory block (4KB)rn" );
}
memcpy( data_buf, DEMO_TEXT_MESSAGE_2, strlen( DEMO_TEXT_MESSAGE_2 ) );
if ( FLASH11_OK == flash11_memory_write( &flash11, STARTING_ADDRESS_2, data_buf, sizeof( data_buf ) ) )
{
log_printf( &logger, " Write data: %srn", data_buf );
Delay_ms( 100 );
}
memset( data_buf, 0, sizeof( data_buf ) );
if ( FLASH11_OK == flash11_memory_read( &flash11, STARTING_ADDRESS_2, data_buf, sizeof( data_buf ) ) )
{
log_printf( &logger, " Read data: %srn", data_buf );
Delay_ms( 3000 );
}
log_printf ( &logger, " ----------------------------rn" );
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.Flash11
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. UART terminal is available in all MIKROE compilers.
mikroSDK
This Click board™ is supported with mikroSDK – MIKROE Software Development Kit, that needs to be downloaded from the LibStock and installed for the compiler you are using to ensure proper operation of mikroSDK compliant Click board™ demo applications.
For more information about mikroSDK, visit the official page.