TOP Contributors

  1. MIKROE (2653 codes)
  2. Alcides Ramos (352 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136736 times)
  2. FAT32 Library (69950 times)
  3. Network Ethernet Library (55941 times)
  4. USB Device Library (46266 times)
  5. Network WiFi Library (41886 times)
  6. FT800 Library (41170 times)
  7. GSM click (28983 times)
  8. PID Library (26413 times)
  9. mikroSDK (26360 times)
  10. microSD click (25376 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

nvSRAM click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.11

mikroSDK Library: 2.0.0.0

Category: SRAM

Downloaded: 57 times

Not followed.

License: MIT license  

nvSRAM Click is a compact add-on board that contains the most reliable nonvolatile memory. This board features the CY14B101J, a 1-Mbit 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.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "nvSRAM click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "nvSRAM click" changes.

Do you want to report abuse regarding "nvSRAM click".

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


nvSRAM click

nvSRAM Click is a compact add-on board that contains the most reliable nonvolatile memory. This board features the CY14B101J, a 1-Mbit 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.

nvsram_click.png

click Product page


Click library

  • Author : Stefan Ilic
  • Date : Jul 2021.
  • Type : I2C type

Software Support

We provide a library for the nvSRAM 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 nvSRAM Click driver.

Standard key functions :

  • nvsram_cfg_setup Config Object Initialization function.

    void nvsram_cfg_setup ( nvsram_cfg_t *cfg );
  • nvsram_init Initialization function.

    err_t nvsram_init ( nvsram_t *ctx, nvsram_cfg_t *cfg );

Example key functions :

  • nvsram_send_cmd The function sends the desired command to the CY14B101J2 1-Mbit (128K � 8) Serial (I2C) nvSRAM on nvSRAM click board.

    void nvsram_send_cmd ( nvsram_t *ctx, uint8_t cmd );
  • nvsram_memory_write The function writes a sequential data starting of the targeted 17-bit memory address

    void nvsram_memory_write ( nvsram_t *ctx, uint32_t mem_adr, uint8_t *p_tx_data, uint16_t n_bytes );
  • nvsram_memory_read The function read a sequential data starting from the targeted 17-bit memory address

    void nvsram_memory_read ( nvsram_t *ctx, uint32_t mem_adr, uint8_t *p_rx_data, uint16_t n_bytes );

Example Description

This is an example that demonstrates the use of the nvSRAM click board. In this example, we write and then read data from nvSRAM memory. Results are being sent to the Usart Terminal where you can track their changes. All data logs write on USB uart changes approximately for every 5 sec.

The demo application is composed of two sections :

Application Init

Initialization driver enables - I2C, lock Serial Number write, disable Block Protection and enable Memory Write, also write log.


void application_init ( void ) {
    log_cfg_t log_cfg;  /**< Logger config object. */
    nvsram_cfg_t nvsram_cfg;  /**< Click config object. */

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, " Application Init " );
    mem_addr = 1024;

    // Click initialization.
    nvsram_cfg_setup( &nvsram_cfg );
    NVSRAM_MAP_MIKROBUS( nvsram_cfg, MIKROBUS_1 );
    err_t init_flag = nvsram_init( &nvsram, &nvsram_cfg );
    if ( I2C_MASTER_ERROR == init_flag ) {
        log_error( &logger, " Application Init Error. " );
        log_info( &logger, " Please, run program again... " );

        for ( ; ; );
    }


    log_printf( &logger,  "  Serial Number Lock   \r\n" );
    log_printf( &logger, " None Block Protection \r\n" );
    nvsram_reg_write( &nvsram, NVSRAM_MEM_CTL_REG, NVSRAM_SNL | NVSRAM_BP_NONE );
    Delay_ms ( 100 );
    log_printf( &logger, " Enable Memory Write \r\n" );
    nvsram_enable_memory_write( &nvsram, NVSRAM_WRITE_MEMORY_ENABLE );
    Delay_ms ( 100 );

    log_info( &logger, " Application Task \r\n" );
}

Application Task

Writing data to a memory address, then reading it back and logging it onto uart terminal.


void application_task ( void ) {
    log_printf( &logger, "  Write data : %s \r\n", demo_data );
    nvsram_memory_write( &nvsram, mem_addr, &demo_data[ 0 ], 9 );
    log_printf( &logger, "- - - - - - - - - - - - \r\n" );
    Delay_ms ( 100 );

    nvsram_memory_read( &nvsram, mem_addr, &read_data[ 0 ], 9 );
    log_printf( &logger, "  Read data  : %s \r\n", read_data );
    log_printf( &logger, "----------------------- \r\n" );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
}

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.nvSRAM

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. UART terminal is available in all MikroElektronika compilers.


ALSO FROM THIS AUTHOR

PROXIMITY 7 click

0

Proximity 7 click is an advanced proximity and ambient light sensing Click board™. It features the ADPS9930, a digital sensor IC equipped with two photodiodes (PD) and an IR LED, driven by a proprietary LED driver circuit. It allows an accurate proximity detection for a maximum distance of 100mm.

[Learn More]

Stepper 15 click

0

Stepper 15 Click is a compact add-on board that contains a bipolar stepper motor driver. This board features the DRV8889A, an automotive stepper driver with integrated current sense and stall detection from Texas Instruments.

[Learn More]

USB to I2C 2 click

0

USB to I2C 2 Click is a compact add-on board that contains a general-purpose USB to I2C serial interface. This board features the FT201X, a full-speed USB to I2C protocol converter from FTDI. The FT201X converts USB2.0 full-speed to an I2C serial interface capable of operating up to 3.4MBit/s, with low power consumption (typical 8mA). The entire USB protocol is handled on the chip itself, where no USB-specific firmware programming is required. It also has a fully-integrated 2048 byte Multi-Time-Programmable (MTP) memory for storing device descriptors and CBUS I/O user-desirable configuration. This Click board™ includes the complete FT-X series feature set and enables USB to be added into a system design quickly and easily over an I2C interface.

[Learn More]