How does it work?
SRAM 4 Click is based on the CY14B512Q, a 512Kbit nvSRAM memory organized as 64K words of 8 bits each from Infineon. The nvSRAM specifies one million endurance cycles for nonvolatile cells with data retention of a minimum of 20 years. All the reads and writes to nvSRAM happen to the SRAM, which gives nvSRAM the unique capability to handle infinite writes to the memory. The embedded nonvolatile elements incorporate the QuantumTrap technology, making this Click board™ an ideal choice for secure data storage creating the world’s most reliable nonvolatile memory.
The CY14B512Q communicates with MCU through a standard SPI interface that enables very high clock speeds up to 40MHz with zero cycle delay read and write cycles. It also supports the two most common modes, SPI Mode 0 and 3, and 104 MHz SPI access speed with special instruction for the read operation. Besides, the SRAM 4 Click also has an additional HOLD signal, routed to the PWM pin of the mikroBUS™ socket labeled as HLD, used to suspend the serial communication without resetting the serial sequence.
The CY14B512Q uses the standard SPI opcodes for memory access. In addition to the general SPI instructions for reading and writing, also provide four special instructions: STORE, RECALL, AutoStore Disable, and AutoStore Enable. The significant benefit of this memory over serial EEPROMs is that all reads and writes to nvSRAM are performed at the speed of the SPI bus with zero cycle delay. Therefore, no wait time is required after any of the memory accesses. Only the STORE and RECALL operations need finite time to complete, and all memory accesses are inhibited during this time.
This Click board™ can be operated only with a 3.3V logic voltage level. The board must perform appropriate logic voltage level conversion before use with 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
SRAM
Applications
Can be used for all applications requiring fast access, high reliability of stored data, and unlimited endurance
On-board modules
CY14B512Q – 512Kbit nvSRAM memory organized as 64K words of 8 bits each from Cypress Semiconductor, now part of Infineon
Key Features
Low power consumption, high reliability, QuantumTrap technology, infinite read write and RECALL cycles, high-speed interface, HOLD feature, and more
Interface
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 SRAM 4 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 |
SRAM 4 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | – | 3.3 | – | V |
Memory Size | – | – | 512 | Kbit |
Write Endurance | 1.000.000 | – | – | Write Cycles |
Data Retention | 20 | – | – | Years |
Operating Temperature Range | -40 | +25 | +85 | °C |
Software Support
We provide a library for the SRAM 4 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for SRAM 4 Click driver.
Key functions:
sram4_cfg_setup
– Config Object Initialization function.sram4_init
– Initialization function.sram4_default_cfg
– Click Default Configuration function.
Example description
This example application showcases ability of device ability to manipulate with memory( writing and reading data ).
void application_task ( void ) { char read_buf[ 100 ] = { 0 }; char click_name[ ] = "SRAM 4"; char company_name[ ] = "MikroE"; char product_name[ ] = " Click board"; static const uint16_t START_ADR = 0x0001; uint16_t mem_adr = START_ADR; //Write Data sram4_memory_write( &sram4, mem_adr, click_name, strlen( click_name ) ); mem_adr += strlen( click_name ); sram4_memory_write( &sram4, mem_adr, product_name, strlen( product_name ) ); mem_adr += strlen( product_name ); sram4_memory_write( &sram4, mem_adr, company_name, strlen( company_name ) ); //Read Data mem_adr = START_ADR; sram4_memory_read( &sram4, mem_adr, read_buf, strlen( click_name ) + strlen( product_name ) ); log_printf( &logger, " > Read Data from 0x%.4X memory address: %srn", mem_adr, read_buf ); memset( read_buf, 0, strlen( read_buf ) ); mem_adr += strlen(click_name) + strlen( product_name ); sram4_memory_read( &sram4, mem_adr, read_buf, strlen( company_name ) ); log_printf( &logger, " > Read Data from 0x%.4X memory address: %srn", mem_adr, read_buf ); log_printf( &logger, "**********************************************************************rn" ); Delay_ms( 3000 ); }
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.SRAM4
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.