{"product_id":"mikroe-3191","title":"Flash 4 click","description":"\u003cp\u003eThe S25FL512S module can withstand up to 100,000 program cycles, with the data retention period of minimum 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.\u003c\/p\u003e\n\u003cp\u003eFeaturing both normal and double data rates over the standard, Dual\/Quad SPI interface, the improved reliability of the stored information by utilizing the hardware Error Correction Code (ECC) generation, One-Time Programmable (OTP) memory block of 1024 bytes, an advanced sector protection, AutoBoot, and much more, this Click board™ is a perfect solution for the mass storage option in various embedded applications. Due to its fast performance, Flash 4 click can also be used for the code shadowing, execute-in-place (XIP), and data storage. An additional level translator IC allows Flash 4 click to be used with a wide range of MCUs, operating both with 3.3V or 5V logic levels.\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eHow does it work?\u003c\/strong\u003e\u003c\/p\u003e\n\u003cp\u003eThe Flash memory module used on this Click board™ is the \u003ca href=\"https:\/\/download.mikroe.com\/documents\/datasheets\/S25FL512S%20Datasheet.pdf\"\u003eS25FL512S\u003c\/a\u003e, a 512 Mbit SPI Flash memory module, from \u003ca href=\"http:\/\/www.cypress.com\/\"\u003eCypress\u003c\/a\u003e. The Flash memory density is usually expressed in bits, so 512 Mbit of memory aligned in 8 bits long words, translates to a capacity of 64 megabytes (MB). This memory module contains 256 sectors of 256 KB each. Furthermore, the memory is organized in 256KB sectors that alow user to erase whole sector only and write up to 512byte at a time. \u003cbr\u003e \u003cimg src=\"https:\/\/www.mikroe.com\/img\/cms\/flash-4-click-inner-img.jpg\" alt=\"\"\u003e\u003cbr\u003e The advanced MirrorBit® technology allows storing of two data bits in each memory array transistor (memory cell), effectively doubling the capacity of a single storage cell this way. The Eclipse™ architecture is responsible for the greatly improved erase and programming performance, compared to other Flash modules of the previous generation. Due to a higher speed, an execute-in-place (XIP), as well as the data shadowing is possible with the Flash 4 click.\u003c\/p\u003e\n\u003cp\u003e \u003c\/p\u003e\n\u003cp\u003eThe S25FL512S flash module supports the standard SPI interface, but it can also optionally use the Dual and Quad SPI interface, allowing the full data transfer rate of 80MB\/sec to be achieved. In addition, the flash module supports DDR read commands in all SPI modes, using both clock edges to transfer the data (data transfer is performed on both the rising and the falling edge of the clock). A typical communication procedure consists of sending a proper instruction (command) from the host MCU via the SPI interface, followed by either an address, data, or both, and a response from the S25FL512S flash module, which can be either a stream of data or a single byte, depending on the command received.\u003c\/p\u003e\n\u003cp\u003eOne of the key features of the S25FL512S is certainly the AutoBoot feature. It allows the module to automatically initiate the memory transfer from the predefined location (memory read operation) after the reset cycle. Considering a typical communication scenario, where READ command followed by the one or more address bytes need be used, AutoBoot allows the host MCU to pull down the #CS (Chip Select) pin and start receiving a data stream over the SPI interface for as long as the #CS pin is held LOW, without any wasted cycles. As soon as the #CS pin is released, the S25FL512S returns to a normal operation.\u003c\/p\u003e\n\u003cp\u003eThe Advanced Sector Protection (ASP) is a powerful protection model that incorporates a set of various software and hardware methods to enable or disable programming or erase operations within a sector or an entire memory. A specialized ASP OTP register offers a password protection mode or a persistent protection mode, allowing an increased flexibility of the protection. Using the OTP memory allows the protection mode to remain in place for the whole life-cycle of the device.\u003c\/p\u003e\n\u003cp\u003eThe #WP write protect pin is used to put the device into the hardware write protect mode. A LOW logic level on this pin prohibits write operations to the Block-Protection bits of the Status register. Locking down the Status Register will block changes of the Status Register Write Disable (SRWD) bit, which is required for the Write and Erase operations, effectively preventing the memory content changes. The pin is multiplexed with the IO2 function, therefore it is not available when Quad SPI is used\u003c\/p\u003e\n\u003cp\u003eThe #HOLD pin is used to hold the data transfer. When the Chip Select pin (#CS, routed to the mikroBUS™ CS pin) is set to a LOW logic level, the data transfer will be put on hold when the LOW logic level of the serial clock coincides with the falling edge of the #HOLD pin. Similarly, resuming the data transfer will happen when the LOW logic level of the serial clock coincides with the rising edge of the #HOLD pin. The pin is multiplexed with the IO3 function, therefore it is not available when Quad SPI is used\u003c\/p\u003e\n\u003cp\u003eThe SPI interface pins are routed to the mikroBUS™ so that the interfacing with the microcontroller unit (MCU) is easy and straightforward. Additional pins routed to the mikroBUS™ include the #WP\/IO2 pin routed to the mikroBUS™ PWM pin and labeled as IO2, and #HOLD\/IO3 pin routed to the mikroBUS™ INT pin and labeled as IO3. There is also the RESET pin, routed to the RST pin of the mikroBUS™, which performs a reset of the Flash module, initiating an AutoBoot sequence if enabled.\u003c\/p\u003e\n\u003cp\u003eThere is 1 KB of OTP memory, which can be used to store security data, such as the unique serial number, and similar information. Some security-related registers, such as the password for the ASP, registers for selecting the ASP mode, and similar, are in this memory block. Once programmed, this memory can be permanently locked, without the possibility to reprogram it ever again.\u003c\/p\u003e\n\u003cp\u003eFlash 4 click incorporates an additional IC, labeled as the TXB0108PWR, an 8-bit bidirectional voltage level translator with auto-direction sensing, from Texas Instruments. This allows the Click board™ to be used with a much wider range of MCUs since the S25FL512S flash module operates with logic levels up to 3V. At the same time, the TXB0108PWR protects the flash module from the Electrostatic Discharges (ESD) up to ±15 kV, making Flash 4 click a very robust and reliable embedded mass storage solution. An onboard SMD jumper labeled as VCC SEL can be used to configure the logic voltage level.\u003c\/p\u003e\n\u003cp\u003eFor 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.\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eSpecifications\u003c\/strong\u003e\u003c\/p\u003e\n\u003ctable\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003eType\u003c\/td\u003e\n\u003ctd\u003eFlash\u003c\/td\u003e\n\u003c\/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eApplications\u003c\/td\u003e\n\u003ctd\u003eMass 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.\u003c\/td\u003e\n\u003c\/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eOn-board modules\u003c\/td\u003e\n\u003ctd\u003eS25FL512S, a 512 Mbit SPI Flash memory module, from Cypress\u003c\/td\u003e\n\u003c\/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eKey Features\u003c\/td\u003e\n\u003ctd\u003eHigh durability of 100,000 write cycles, Advanced Sector Protection (ASP), secure OTP memory block, high transfer speed, SFDP mode for easy retrieval of IC-specific information, AutoBoot function for improved startup performance\u003c\/td\u003e\n\u003c\/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eInterface\u003c\/td\u003e\n\u003ctd\u003eQSPI,SPI\u003c\/td\u003e\n\u003c\/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eInput Voltage\u003c\/td\u003e\n\u003ctd\u003e3.3V or 5V\u003c\/td\u003e\n\u003c\/tr\u003e\n\u003c\/tbody\u003e\n\u003c\/table\u003e\n\u003cp\u003e \u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003ePinout diagram\u003c\/strong\u003e\u003c\/p\u003e\n\u003cp\u003eThis table shows how the pinout on the \u003cstrong\u003eFlash 4 click\u003c\/strong\u003e corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).\u003c\/p\u003e\n\u003ctable style=\"width: 549px;\"\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003cth\u003eNotes\u003c\/th\u003e\n\u003cth\u003ePin\u003c\/th\u003e\n\u003cth colspan=\"4\"\u003e\u003ca href=\"http:\/\/www.mikroe.com\/mikrobus\/\"\u003e\u003cimg src=\"https:\/\/cdn.mikroe.com\/img\/mikrobus\/mikroBUS-logo-black.png\" alt=\"Mikrobus logo.png\"\u003e\u003c\/a\u003e\u003c\/th\u003e\n\u003cth\u003ePin\u003c\/th\u003e\n\u003cth\u003eNotes\u003c\/th\u003e\n\u003c\/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e \u003c\/td\u003e\n\u003ctd\u003eNC\u003c\/td\u003e\n\u003ctd\u003e1\u003c\/td\u003e\n\u003ctd\u003eAN\u003c\/td\u003e\n\u003ctd\u003ePWM\u003c\/td\u003e\n\u003ctd\u003e16\u003c\/td\u003e\n\u003ctd\u003e\u003cstrong\u003eIO2\u003c\/strong\u003e\u003c\/td\u003e\n\u003ctd\u003eWrite Protect\/IO2\u003c\/td\u003e\n\u003c\/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eReset\u003c\/td\u003e\n\u003ctd\u003e\u003cstrong\u003eRST\u003c\/strong\u003e\u003c\/td\u003e\n\u003ctd\u003e2\u003c\/td\u003e\n\u003ctd\u003eRST\u003c\/td\u003e\n\u003ctd\u003eINT\u003c\/td\u003e\n\u003ctd\u003e15\u003c\/td\u003e\n\u003ctd\u003e\u003cstrong\u003eIO3\u003c\/strong\u003e\u003c\/td\u003e\n\u003ctd\u003eHold\/IO3\u003c\/td\u003e\n\u003c\/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eChip Select\u003c\/td\u003e\n\u003ctd\u003e\u003cstrong\u003eCS\u003c\/strong\u003e\u003c\/td\u003e\n\u003ctd\u003e3\u003c\/td\u003e\n\u003ctd\u003eCS\u003c\/td\u003e\n\u003ctd\u003eRX\u003c\/td\u003e\n\u003ctd\u003e14\u003c\/td\u003e\n\u003ctd\u003eNC\u003c\/td\u003e\n\u003ctd\u003e \u003c\/td\u003e\n\u003c\/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eSPI Clock\u003c\/td\u003e\n\u003ctd\u003e\u003cstrong\u003eSCK\u003c\/strong\u003e\u003c\/td\u003e\n\u003ctd\u003e4\u003c\/td\u003e\n\u003ctd\u003eSCK\u003c\/td\u003e\n\u003ctd\u003eTX\u003c\/td\u003e\n\u003ctd\u003e13\u003c\/td\u003e\n\u003ctd\u003eNC\u003c\/td\u003e\n\u003ctd\u003e \u003c\/td\u003e\n\u003c\/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eSPI Data OUT\/SO1\u003c\/td\u003e\n\u003ctd\u003e\u003cstrong\u003eSDO\u003c\/strong\u003e\u003c\/td\u003e\n\u003ctd\u003e5\u003c\/td\u003e\n\u003ctd\u003eMISO\u003c\/td\u003e\n\u003ctd\u003eSCL\u003c\/td\u003e\n\u003ctd\u003e12\u003c\/td\u003e\n\u003ctd\u003eNC\u003c\/td\u003e\n\u003ctd\u003e \u003c\/td\u003e\n\u003c\/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eSPI Data IN\/SO0\u003c\/td\u003e\n\u003ctd\u003e\u003cstrong\u003eSDI\u003c\/strong\u003e\u003c\/td\u003e\n\u003ctd\u003e6\u003c\/td\u003e\n\u003ctd\u003eMOSI\u003c\/td\u003e\n\u003ctd\u003eSDA\u003c\/td\u003e\n\u003ctd\u003e11\u003c\/td\u003e\n\u003ctd\u003eNC\u003c\/td\u003e\n\u003ctd\u003e \u003c\/td\u003e\n\u003c\/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003ePower supply\u003c\/td\u003e\n\u003ctd\u003e\u003cstrong\u003e3V3\u003c\/strong\u003e\u003c\/td\u003e\n\u003ctd\u003e7\u003c\/td\u003e\n\u003ctd\u003e3.3V\u003c\/td\u003e\n\u003ctd\u003e5V\u003c\/td\u003e\n\u003ctd\u003e10\u003c\/td\u003e\n\u003ctd\u003e\u003cstrong\u003e5V\u003c\/strong\u003e\u003c\/td\u003e\n\u003ctd\u003ePower supply\u003c\/td\u003e\n\u003c\/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eGround\u003c\/td\u003e\n\u003ctd\u003e\u003cstrong\u003eGND\u003c\/strong\u003e\u003c\/td\u003e\n\u003ctd\u003e8\u003c\/td\u003e\n\u003ctd\u003eGND\u003c\/td\u003e\n\u003ctd\u003eGND\u003c\/td\u003e\n\u003ctd\u003e9\u003c\/td\u003e\n\u003ctd\u003e\u003cstrong\u003eGND\u003c\/strong\u003e\u003c\/td\u003e\n\u003ctd\u003eGround\u003c\/td\u003e\n\u003c\/tr\u003e\n\u003c\/tbody\u003e\n\u003c\/table\u003e\n\u003cp\u003e\u003cbr\u003e \u003cstrong\u003eOnboard settings and indicators\u003c\/strong\u003e\u003c\/p\u003e\n\u003ctable\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003cth\u003eLabel\u003c\/th\u003e\n\u003cth\u003eName\u003c\/th\u003e\n\u003cth\u003eDefault\u003c\/th\u003e\n\u003cth\u003eDescription\u003c\/th\u003e\n\u003c\/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eLD1\u003c\/td\u003e\n\u003ctd\u003ePWR\u003c\/td\u003e\n\u003ctd\u003e-\u003c\/td\u003e\n\u003ctd\u003ePower LED indicator\u003c\/td\u003e\n\u003c\/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eJP1\u003c\/td\u003e\n\u003ctd\u003eVCC SEL\u003c\/td\u003e\n\u003ctd\u003eLeft\u003c\/td\u003e\n\u003ctd\u003eLogic voltage level selection: left position 3.3V, right position 5V\u003c\/td\u003e\n\u003c\/tr\u003e\n\u003c\/tbody\u003e\n\u003c\/table\u003e\n\u003cp\u003e\u003cstrong\u003eSoftware support\u003c\/strong\u003e\u003c\/p\u003e\n\u003cp\u003eWe provide a library for the Flash 4 Click on our \u003ca href=\"https:\/\/libstock.mikroe.com\/projects\/view\/2603\/flash-4-click\"\u003eLibStock page \u003c\/a\u003e, as well as a demo application (example), developed using MikroElektronika \u003ca href=\"https:\/\/www.mikroe.com\/compilers\"\u003ecompilers\u003c\/a\u003e. The demo can run on all the main MikroElektronika \u003ca href=\"https:\/\/www.mikroe.com\/development-boards\"\u003edevelopment boards\u003c\/a\u003e.\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eLibrary Description\u003c\/strong\u003e\u003c\/p\u003e\n\u003cp\u003eThe library contains all the necessary functions for working with Flash 4 click.\u003c\/p\u003e\n\u003cp\u003eKey functions:\u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003e\n\u003ccode\u003evoid flash4_writeCommand(uint8_t cmd)\u003c\/code\u003e - Functions for write command\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cul\u003e\n\u003cli\u003e\n\u003ccode\u003evoid flash4_4ReadFlash(uint8_t *outData, uint32_t addr, uint8_t nData)\u003c\/code\u003e - Functions for read Flash, with 4 byte address\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cul\u003e\n\u003cli\u003e\n\u003ccode\u003evoid flash4_4PageProgram(uint8_t *inData, uint32_t addr, uint8_t nData)\u003c\/code\u003e - Functions for write data in Flash, with 4 byte address\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp\u003e\u003cstrong\u003eExamples description\u003c\/strong\u003e\u003c\/p\u003e\n\u003cp\u003eThe application is composed of the three sections :\u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003eSystem Initialization - Initializes SPI Module and sets RST pin and CS pin as OUTPUT\u003c\/li\u003e\n\u003cli\u003eApplication Initialization - Initialization driver init and reset device\u003c\/li\u003e\n\u003cli\u003eApplication Task - (code snippet) - Erases memory at 0x00001234. Writes a message (MikroElektronika) to address 0x00001234. Then reads the data from the address 0x00001234.\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cpre\u003evoid applicationTask()\n{\nflash4_writeCommand(_FLASH4_CMD_WRITE_ENABLE_WREN);\nmikrobus_logWrite(\"--- Erase chip --START--\", _LOG_LINE);\nflash4_4sectorErase(0x00001234);\nwhile(flash4_checkWIP());\nmikrobus_logWrite(\"--- Erase chip --DONE--\", _LOG_LINE);\n\nflash4_writeCommand(_FLASH4_CMD_WRITE_ENABLE_WREN);\nflash4_4PageProgram(\u0026amp;dataBuffer[0], 0x00001234, 16);\nwhile(flash4_checkWIP());\nDelay_100ms();\n\nflash4_4ReadFlash(\u0026amp;readBuffer[0],0x00001234, 16);\nwhile(flash4_checkWIP());\nmikrobus_logWrite(\"--- Read buffer : \", _LOG_TEXT);\nmikrobus_logWrite(readBuffer, _LOG_LINE);\n\nDelay_ms( 7000 );\n}\u003c\/pre\u003e\n\u003cp\u003e\u003cbr\u003e The full application code, and ready to use projects can be found on our \u003ca href=\"https:\/\/libstock.mikroe.com\/projects\/view\/2577\/flash-4-click\"\u003eLibStock \u003c\/a\u003epage.\u003c\/p\u003e\n\u003cp\u003eOther mikroE Libraries used in the example:\u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ccode\u003eSPI\u003c\/code\u003e\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp\u003e\u003cstrong\u003eAdditional notes and information\u003c\/strong\u003e\u003c\/p\u003e\n\u003cp\u003eDepending on the development board you are using, you may need \u003ca href=\"https:\/\/shop.mikroe.com\/usb-uart-click\"\u003eUSB UART click\u003c\/a\u003e, \u003ca href=\"https:\/\/shop.mikroe.com\/usb-uart-2-click\"\u003eUSB UART 2 click\u003c\/a\u003e or \u003ca href=\"https:\/\/shop.mikroe.com\/rs232-click\"\u003eRS232 click\u003c\/a\u003e to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika \u003ca href=\"https:\/\/shop.mikroe.com\/compilers\"\u003ecompilers\u003c\/a\u003e, or any other terminal application of your choice, can be used to read the message.\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003emikroSDK\u003c\/strong\u003e\u003c\/p\u003e\n\u003cp\u003eThis click board is supported with \u003ca href=\"https:\/\/www.mikroe.com\/mikrosdk\"\u003emikroSDK\u003c\/a\u003e - MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant click board demo applications, mikroSDK should be downloaded from the \u003ca href=\"https:\/\/libstock.mikroe.com\/projects\/view\/2249\/mikrosdk\"\u003eLibStock\u003c\/a\u003e and installed for the compiler you are using.\u003c\/p\u003e\n\u003cp\u003e \u003c\/p\u003e","brand":"MikroElektronika","offers":[{"title":"Default Title","offer_id":47400898887963,"sku":"MIKROE-3191","price":2629.0,"currency_code":"INR","in_stock":false}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0676\/3325\/0587\/products\/flash-4-click-thickbox_default-2wfkzOwMSSz2By.jpg?v=1701963614","url":"https:\/\/mgsl.in\/products\/mikroe-3191","provider":"MG Super Labs","version":"1.0","type":"link"}