nvSRAM 2 Click Board
nvSRAM 2 Click Board
The nvSRAM 2 Click Board™ is a compact add-on board that contains the most reliable nonvolatile memory. This board features the CY14B101Q, a 1Mbit nvSRAM organized as 128K words of 8 bits each with a nonvolatile element in each memory cell from Cypress Semiconductor. The embedded nonvolatile elements incorporate the QuantumTrap technology and provide highly reliable nonvolatile storage of data. Data transfer, initiated by the user through SPI commands, from SRAM to the nonvolatile elements takes place automatically at Power-Down. On the other hand, during the Power-Up, data is restored to the SRAM from the nonvolatile memory. This Click Board™ is suitable for all applications that require fast access and high reliability of stored data, and unlimited endurance.
The nvSRAM 2 Click Board™ is supported by a mikroSDK compliant library, which includes functions that simplify software development. This Click Board™ comes as a fully tested product, ready to be used on a system equipped with the mikroBUS™ socket.
Software Support
We provide a library for the nvSRAM 2 Click Board™ on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
The library covers all the necessary functions to control nvSRAM 2 Click board™. The library performs a standard SPI interface communication.
Key Functions
void nvsram2_set_cmd ( uint8_t cmd )
- Set command function.void nvsram2_burst_write ( uint32_t mem_addr, uint8_t *p_tx_data, uint8_t n_bytes );
- Burst write function.void nvsram2_burst_read ( uint32_t mem_addr, uint8_t *p_rx_data, uint8_t n_bytes );
- Burst read function.
Example Description
The application is composed of three sections :
- System Initialization - Initializes SPI and UART LOG, sets CS and PWM pins as outputs.
- Application Initialization - Initialization driver enables SPI, disables hold, sets write enable latch, targets the memory address at 12345 ( 0x00003039 ) for burst write starting point and writes data which is also displayed on the log.
- Application Task - This is an example that demonstrates the use of the nvSRAM 2 Click board™. In this example, the data is read from the targeted memory address. The results are being sent to the Usart Terminal. This task repeats every 5 sec.
void application_task ( ) { mikrobus_logWrite( "-----------------------", _LOG_LINE ); mikrobus_logWrite( "", _LOG_LINE ); mikrobus_logWrite( "<- Read data : ", _LOG_TEXT ); nvsram2_burst_read( memory_addr, &rx_data[ 0 ], 9 ); mikrobus_logWrite( rx_data, _LOG_LINE ); Delay_ms( 5000 ); }
The full application code, and ready to use projects 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 nvSRAM 2 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.
nvSRAM 2 Click Board
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.