SQI FLASH Click Board
SQI FLASH Click Board
Overview
The SQI FLASH Click Board™ is based on the SST26VF064B, a 64 Mbit Serial Quad I/O flash device from Microchip. The chip utilizes a 4-bit multiplexed I/O serial interface to boost the performance. The Click Board™ is a very fast solid-state, non-volatile data storage medium, that can be electrically erased and reprogrammed. Operating at 104 MHz, the SST26VF064B enables minimum latency execute-in-place (XIP) capability, without the need for code shadowing.
Features like the high performance and reliability, make the SQI Flash Click Board™ the ideal choice for network appliances, DSL and cable modems, wireless network devices, automotive and any other applications, where high-speed reliable data storage is needed. Further benefits are achieved with its proprietary, high-performance CMOS SuperFlash™ technology, which significantly improves the performance and reliability and lowers the power consumption.
How Does The SQI Flash Click Board™ Work?
Flash memory architecture includes a memory array, stacked with a large number of flash cells. A basic flash memory cell consists of a storage transistor with a control gate and a floating gate, which is insulated from the rest of the transistor by a thin dielectric material or oxide layer. The floating gate stores the electrical charge and controls the flow of the electrical current.
The SQI Flash Click Board™ features a 4-bit I/O interface, that allows for low-power and high-performance operation. SST26VF064B also supports full command-set compatibility to traditional Serial Peripheral Interface (SPI) protocol. System designs using the SQI flash devices, occupy less board space and ultimately lower the system costs. The SST26VF064B device is configured as a regular SPI device after the power-on, keeping the backward compatibility with the SPI interface. Once started by using the regular SPI interface, the device can be configured to work in the Serial Quad Interface mode by setting the config registers.
SQI requires four data lines to be connected to the MCU for a proper operation. Compared to the conventional SPI module, the main difference is that during one clock cycle, the SQI is capable of delivering four bits at the same time, where the SPI can deliver only one bit per cycle. This makes transfer four times faster than with the conventional SPI interface, for the same clock speed. Since not many MCUs support hardware SQI mode, SQI mode is often implemented by the firmware, which toggles a group of four GPIO pins. This method is also known as the bit-banging method. MikroElektronika software libraries offer an easy way to access all of the important functions of this device.
When configured to work in a regular SPI mode, the SQ2 and the SQ3 pins will become Write Protect function and Hold function pins:.
SQ2 - Setting this pin to a LOW logic state and the WPEN bit to 1, enables hardware write-protection. To disable hardware write protection, either the SQ2 pin should be set to a HIGH logic level, or the WPEN bit to should be set to 0.
SQ3 - Setting this pin to a LOW logic state will temporarily hold the serial communication, while the device is selected by the CE pin. When using this feature during the memory transfer, access times can be significantly reduced, since the device does not have to wait cycles to be addressed by the CE pin, which is the case when it is fully stopped. Once selected by the CE, the transfer can be started or stopped instantaneously at any moment. This pin must be pulled up HIGH while not in use.
There are several more features on this device used to protect and manage data, such as the factory programmed serial ID number, which can not be changed. This can be used for an identification or building various kinds of security devices. On a top of the factory serial number, it is possible to define a second, custom serial ID number, which can be locked by a protection bit. The device also has several non-volatile memory locations for storing protection/lock bits - so the device wont change the protection status when restarted.The SST26VF064B is manufactured with proprietary, high-performance CMOS SuperFlash technology. The split-gate cell design and thick oxide tunneling injector attain better reliability and manufacturability, compared with alternative approaches. Thanks to that, the SST26VF064B device significantly improves performance and reliability, while lowering the power consumption.
The SQI Flash Click Board™ is powered by a single power supply from the 3.3V rail. The total energy consumed is a function of the applied voltage, current, and time of application. Since for any given voltage range, the SuperFlash technology uses less current to program and has a shorter erase time, the total energy consumed during any Erase or Program operation is less than alternative flash memory technologies.
Software Support
We provide an example for the SQI FLASH Click Board™ on our LibStock page and a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
The library carries all the necessary functions for the SQI Flash Click Board™.
Key Functions
void SQIFLASH_WriteArray(uint32_t address, uint8_t* pData, uint16_t number)
- Writes an array of data to the address specified
void SQIFLASH_ReadArray(uint32_t address, uint8_t* pData, uint16_t num)
- Reads array of data from the address specified
void SQIFLASH_SectorErase(uint32_t address)
- Erases sector where provided address belongs to
Example Description
The application is composed of three sections :
- System initialisation - Initializes pins, SPI peripheral, and UART used for logging.
- Application initialisation - Initializes driver and configures module but also checks the communication by reading the chip ID.
- Application task - (Code snippet) Sequentially writes and reads data from the SQI FLASH Click Board™. Written and read data must match because they are at the same address. Information about the current reading and writing will be logged to UART.
The example uses the SQIFLASH_WriteByte function to write the value to a 32bit address, forwarded as the parameter to the write function. The value and the address are derived from the same variable - counter, which is increased at the end of the application task function. This value is printed at the UART terminal.
After that, the SQIFLASH_ReadByte function is used to read from the address of the SQI Flash module, and it is stored in a separate variable, labelled - result. This value gets converted and it gets printed at the UART terminal. The application task function is executed inside the while loop
void applicationTask() { SQIFLASH_WriteByte(counter, counter); UART1_Write_Text( "rnValue Written : " ); ByteToStr( counter, txt ); UART1_Write_Text( txt ); Delay_ms( 100 ); result = SQIFLASH_ReadByte(counter); UART1_Write_Text( "rnValue Read : " ); ByteToStr( result, txt ); UART1_Write_Text( txt ); Delay_ms( 100 ); counter++; if (counter == 256) { counter = 0; } Delay_ms( 2000 ); }
The complete application code and ready-to-use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- UART Conversions
Additional Notes and Information
Depending on the development board you are using, you may need USB UART Click Board™, USB UART 2 Click Board™ or RS232 Click Board™ 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 SQI FLASH Click Board™ board is supported with mikroSDK, the MikroElektronika Software Development Kit.
Software Support
We provide an example for the SQI FLASH Click Board™ on our LibStock page and a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
The library carries all the necessary functions for the SQI Flash Click Board™.
Key Functions
void SQIFLASH_WriteArray(uint32_t address, uint8_t* pData, uint16_t number)
- Writes an array of data to the address specified
void SQIFLASH_ReadArray(uint32_t address, uint8_t* pData, uint16_t num)
- Reads array of data from the address specified
void SQIFLASH_SectorErase(uint32_t address)
- Erases sector where provided address belongs to
Example Description
The application is composed of three sections :
- System initialisation - Initializes pins, SPI peripheral, and UART used for logging.
- Application initialisation - Initializes driver and configures module but also checks the communication by reading the chip ID.
- Application task - (Code snippet) Sequentially writes and reads data from the SQI FLASH Click Board™. Written and read data must match because they are at the same address. Information about the current reading and writing will be logged to UART.
The example uses the SQIFLASH_WriteByte function to write the value to a 32bit address, forwarded as the parameter to the write function. The value and the address are derived from the same variable - counter, which is increased at the end of the application task function. This value is printed at the UART terminal.
After that, the SQIFLASH_ReadByte function is used to read from the address of the SQI Flash module, and it is stored in a separate variable, labelled - result. This value gets converted and it gets printed at the UART terminal. The application task function is executed inside the while loop
void applicationTask() { SQIFLASH_WriteByte(counter, counter); UART1_Write_Text( "rnValue Written : " ); ByteToStr( counter, txt ); UART1_Write_Text( txt ); Delay_ms( 100 ); result = SQIFLASH_ReadByte(counter); UART1_Write_Text( "rnValue Read : " ); ByteToStr( result, txt ); UART1_Write_Text( txt ); Delay_ms( 100 ); counter++; if (counter == 256) { counter = 0; } Delay_ms( 2000 ); }
The complete application code and ready-to-use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- UART Conversions
Additional Notes and Information
Depending on the development board you are using, you may need USB UART Click Board™, USB UART 2 Click Board™ or RS232 Click Board™ 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 SQI FLASH Click Board™ board is supported with mikroSDK, the MikroElektronika Software Development Kit.
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.