Tableau de clic Flash
Tableau de clic Flash
Overview
Introduisez une mémoire flash supplémentaire dans votre conception avec la carte Flash Click Board™ . Cette petite carte accessoire offre une solution simple et fiable pour stocker en externe de grandes quantités de données à utiliser dans le projet. La carte est dotée d'une mémoire flash série EN25F80 de 8 mégabits avec une architecture de secteur uniforme de 4 Ko. Conçue pour les applications nécessitant des performances élevées et une faible consommation d'énergie, elle prend en charge une fréquence d'horloge jusqu'à 75 MHz. Le module EN25F80 est fourni avec une protection en écriture logicielle et matérielle qui permet à l'utilisateur de protéger en écriture tout ou partie de la mémoire via un logiciel. La mémoire est divisée en 16 secteurs, chacun contenant 256 pages ; chaque page a une largeur de 256 octets. La carte Flash Click Board™ communique avec le microcontrôleur de la carte cible via l'interface SPI. La carte est conçue pour utiliser uniquement une alimentation 3,3 V. La diode LED verte indique l'état de l'alimentation.
Le Flash Click Board™ est un choix idéal pour une option de stockage de masse dans les appareils multimédias, les lecteurs, les périphériques optiques et d'impression.
The Flash Click Board™ contains 8,388,608 bits (8 Mbit) of Flash memory organized into 1,048,576 bytes (1 MB). In other words, the Flash Click Board™ is a flash memory medium with the capacity of 1 MB. The used flash module has very good endurance and it can withstand up to 100,000 write cycles, with the data retention period of about 20 years. The flash memory IC used on this Click board™, features Serial Flash Discoverable Parameters (SFDP) mode, used to retrieve the advanced information from the device, such as the operating characteristics, structure and vendor specified information, memory size, operating voltage, timing information, and more.
Due to the high data transfer speed via the standard SPI interface, as well as the improved reliability of the stored information, the Flash Click Board™ can be used as a mass storage option in multimedia devices, data drives, non-volatile data storage in embedded applications, and similar applications that require reliable permanent storage of data blocks. Addition of 512 bytes of one-time programmable (OTP) memory can be useful for building secure storage devices and similar secure storage applications.
How Does The Flash Click Board™ Work?
The flash memory module used on the Flash Click Board™ is the EN25Q80B, an 8 Mbit serial flash memory with 4 KB Uniform Sector, from EON Silicon Solutions. The flash memory density is usually expressed in bits, so exactly 8,388,608 bits are organized in units of 8 bits (bytes), which gives 1,048,576 bytes of data memory. This memory module contains 256 sectors of 4 KB, each, as well as 16 blocks of 64 KB, each. Furthermore, the memory is organized in pages. One page holds 256 bytes and there are 4096 pages (4096 pages x 256 bytes = 1,048,576 bytes total). Having insight into how the memory cells are organized, is very important for understanding the Write and Erase operations. The SPI pins are routed to the mikroBUS™ so the interfacing with the microcontroller unit (MCU) is easy and straightforward. The EN25Q80B communication consists of sending the instruction from the host MCU, followed by either an address, data, or both.
Before attempting any write operations to the flash memory, the Write Enable bit (WEL) of the Status Register needs to be set to 1. This bit is automatically set to 0 after some instructions, as well as during the Write operation itself, preventing accidental damage to the memory content. There are special instructions used to set and clear the WEN bit of the Status Register. Usually, every write operation will be prefixed with the WREN instruction.
Page Program instruction allows up to 256 bytes to be written during one write cycle. After the initial command, three more address bytes are sent, followed by the data that needs to be written. It is possible to write less than 256 bytes, which will be written at the starting address, not affecting the rest of the data on the same page. After successful write cycle, the state of the Write in Progress (WIP) bit is set to 0 automatically, and the device is ready to accept another erase or write instruction. Therefore, the status register can be polled for the status of the WIP bit, in order to shorten the wait time for the next operation.
Data can be read by the Read Data Bytes instruction. This instruction is followed by an address, from which the data is shifted to the output register and read by the host MCU. The address increment is automatically executed, making it possible to read the entire memory by a single Read Data command. HIGH logic level on the chip select pin (CS) will terminate the operation.
An interesting fact is that Page Program instruction can only reset the bits to 0. Therefore, a segment of memory needs to be erased prior to programming, or in this case - filled with 1s (0xFF). The EN25Q80B IC allows erasure of one sector at a time (Sector Erase instruction, 0x20), half a block at a time (Half Block Erase instruction, 0x52), block at a time (Block Erase instruction, 0xD8), and the entire memory (using the Chip Erase instruction, 0x60). The same mechanism applies here too: polling the WIP bit helps to shorten the wait for the total time for the next operation.
A dedicated #WP write protect pin is used to put the device into the hardware write protect mode. This pin is routed to the RST pin of the mikroBUS™. A LOW logic level on this pin allows locking down of the Block Protect bits and the Status Register Protect (SRP) bit. Locking down the Status Register will block changes of the WEN bit, which is required for the Write and Erase operations, effectively preventing the memory content changes. The Write Protect disable (WPDIS) non-volatile bit is used to control the function of the #WP pin: if set to 1, the #WP pin function is disabled.
Besides working in SPI mode, the EN25Q80B IC is capable of working in Dual SPI and Quad SPI modes. There are special Dual and Quad SPI instructions, which utilize these two additional modes, allowing several times faster data transfer speeds. When using Quad SPI instructions, the SDI and SDO pins become DQ0 and DQ1, while the WP and HLD pins become DQ2 and DQ3, respectively. All other operations use the standard SPI interface with single output signal. Due to a small number of MCUs that support Dual and Quad SPI, MikroElektronika offers library functions which work only with the standard SPI communication, ensuring the absolute compatibility with all the supported MCUs.
There are 512 bytes of OTP memory, which can be used to store various security data. Once programmed, this memory can be permanently locked, without a possibility to reprogram it ever again. This feature utilizes the OTP_LOCK bit. Until this bit is 0, the OTP memory block can be freely programmed, just like any other block. When this bit is set to 1, this block won't be programmable anymore. Once set, the OTP_LOCK bit cannot be reset.
EN25Q80B features Serial Flash Discoverable Parameters (SFDP) mode. Host MCU can retrieve the operating characteristics, structure and vendor specified information such as identifying information, memory size, operating voltage and timing information of this device by sending the SFDP Read command (0x5A), followed by 3 bytes of address and one dummy byte. This will initiate a cyclic transfer from the SFDP memory table, which can be stopped at any moment by driving the chip select pin (CS) to a HIGH logic level.
For the detailed commands explanation and more in-depth information, 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.
SPECIFICATIONS
Type | FLASH |
Applications | The Flash Click Board™ is a mass storage option in multimedia devices, data drives, non-volatile data storage in embedded applications, secure storage, and similar applications that require reliable permanent storage of digital information. |
On-board modules | EN25Q80B, an 8 Mbit serial Flash memory with 4 KB Uniform Sector, from EON Silicon Solutions. |
Key Features | High durability of 100,000 write cycles, data retention of 20 years, secure OTP memory block, high transfer speed, SFDP mode for easy retrieval of IC-specific information. |
Interface | SPI |
Compatibility | mikroBUS |
Click board size | S (28.6 x 25.4 mm) |
Input Voltage | 3.3V |
PINOUT DIAGRAM
This table shows how the pinout of the Flash Click Board™ corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Notes | Pin | Pin | Notes | ||||
---|---|---|---|---|---|---|---|
NC | 1 | AN | PWM | 16 | WP | Write Protect/QSPI D2 | |
Not Used/QSPI D3 | HLD | 2 | RST | INT | 15 | NC | |
Chip Select | CS | 3 | CS | RX | 14 | NC | |
SPI Clock | SCK | 4 | SCK | TX | 13 | NC | |
SPI Data OUT/QSPI D1 | SDO | 5 | MISO | SCL | 12 | NC | |
SPI Data IN/QSPI D0 | SDI | 6 | MOSI | SDA | 11 | NC | |
Power supply | +3.3V | 7 | 3.3V | 5V | 10 | NC | |
Ground | GND | 8 | GND | GND | 9 | GND | Ground |
ONBOARD SETTINGS AND INDICATORS
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | - | Power LED indicator |
Software Support
We provide a library for Flash click on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers and mikroSDK. The provided click library is mikroSDK standard compliant. The demo application can run on all the main MikroElektronika development boards.
Key Functions
uint8_t flash_WriteArray(uint32_t address, uint8_t* pData, uint16_t nCount);
- The function writes data to successive addresses.void flash_ReadArray(uint32_t address, uint8_t* pData, uint16_t nCount)
- The function reads the data to successive addresses.
Example Description
The application is composed of three sections:
- System Initialization - CS GPIO and SPI module initialization.
- Application Initialization - Flash click driver and click initialization.
- Application Task - (code snippet) - Writing data to click memory and displaying the read data via UART.
void applicationTask() { flash_SectorErase(0x015015); mikrobus_logWrite("Writing MikroE to Flash memory, from address 0x015015:",_LOG_LINE); flash_WriteArray (0x015015, &wrData[0], 9); mikrobus_logWrite("Reading 9 bytes of Flash memory, from address 0x015015:",_LOG_LINE); flash_ReadArray (0x015015,&rdData[0],9); mikrobus_logWrite("Data read: ",_LOG_TEXT); mikrobus_logWrite(rdData,_LOG_LINE); Delay_ms(1000); }
The full application code, and ready to use libraries can be found on our Libstock page.
Other mikroE Libraries used in the example:
- SPI
- UART
Additional Notes and Information
Depending on the development board you are using, you may need a 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
The Flash Click Board™ is supported by 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.
Software Support
We provide a library for Flash click on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers and mikroSDK. The provided click library is mikroSDK standard compliant. The demo application can run on all the main MikroElektronika development boards.
Key Functions
uint8_t flash_WriteArray(uint32_t address, uint8_t* pData, uint16_t nCount);
- The function writes data to successive addresses.void flash_ReadArray(uint32_t address, uint8_t* pData, uint16_t nCount)
- The function reads the data to successive addresses.
Example Description
The application is composed of three sections:
- System Initialization - CS GPIO and SPI module initialization.
- Application Initialization - Flash click driver and click initialization.
- Application Task - (code snippet) - Writing data to click memory and displaying the read data via UART.
void applicationTask() { flash_SectorErase(0x015015); mikrobus_logWrite("Writing MikroE to Flash memory, from address 0x015015:",_LOG_LINE); flash_WriteArray (0x015015, &wrData[0], 9); mikrobus_logWrite("Reading 9 bytes of Flash memory, from address 0x015015:",_LOG_LINE); flash_ReadArray (0x015015,&rdData[0],9); mikrobus_logWrite("Data read: ",_LOG_TEXT); mikrobus_logWrite(rdData,_LOG_LINE); Delay_ms(1000); }
The full application code, and ready to use libraries can be found on our Libstock page.
Other mikroE Libraries used in the example:
- SPI
- UART
Additional Notes and Information
Depending on the development board you are using, you may need a 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
The Flash Click Board™ is supported by 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.
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.