Our SRAM memory with non-volatile EEPROM backup ensures your data is safe and ready when you need it
A
A
Hardware Overview
How does it work?
EERAM 3.3V Click is based on the 47L16, an I2C serial chip with 16 Kbit and EEPROM backup, from Microchip. The memory cells are organized into 2048 bytes, each 8bit wide. The data is read and written by the I2C serial communication bus, routed to the respective pins of the mikroBUS™ (SCL and SDA pins). To access the device, the first byte sent from the host MCU should be the I2C slave address. In most cases, the master I2C device will be the host MCU itself. The slave IC2 address depends on the state of the hardware address pins on the EERAM 3.3V click. These pins are routed to the onboard SMD jumpers, labeled as A1
and A2, so they can be pulled either to a HIGH or to a LOW logic level. Besides the address pins, the I2C slave address is determined by the section of the device that needs to be accessed. There are two sections, accessed by a different slave address: SRAM section and the CONTROL REGISTER section. The datasheet of the 47l16_3v3 contains more information on these addresses and how to access certain groups of registers. However, provided click library functions allow easy and transparent operation with the EERAM 3.3V click. The provided example application demonstrates the usage of these library functions, and it can be
used as a reference for future custom application development. The store to EEPROM/backup function will not be executed if the SDRAM content has not been changed since the last time it was written to EEPROM. This is tracked by the AN bit of the status register. This Click board™ can be operated only with a 3.3V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. Also, it comes equipped with a library containing functions and an example code that can be used as a reference for further development.
Features overview
Development board
Curiosity PIC32 MZ EF development board is a fully integrated 32-bit development platform featuring the high-performance PIC32MZ EF Series (PIC32MZ2048EFM) that has a 2MB Flash, 512KB RAM, integrated FPU, Crypto accelerator, and excellent connectivity options. It includes an integrated programmer and debugger, requiring no additional hardware. Users can expand
functionality through MIKROE mikroBUS™ Click™ adapter boards, add Ethernet connectivity with the Microchip PHY daughter board, add WiFi connectivity capability using the Microchip expansions boards, and add audio input and output capability with Microchip audio daughter boards. These boards are fully integrated into PIC32’s powerful software framework, MPLAB Harmony,
which provides a flexible and modular interface to application development a rich set of inter-operable software stacks (TCP-IP, USB), and easy-to-use features. The Curiosity PIC32 MZ EF development board offers expansion capabilities making it an excellent choice for a rapid prototyping board in Connectivity, IOT, and general-purpose applications.
Microcontroller Overview
MCU Card / MCU
Architecture
PIC32
MCU Memory (KB)
2048
Silicon Vendor
Microchip
Pin count
100
RAM (Bytes)
524288
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Click board™ Schematic
Step by step
Project assembly
Track your results in real time
Application Output via Debug Mode
1. Once the code example is loaded, pressing the "DEBUG" button initiates the build process, programs it on the created setup, and enters Debug mode.
2. After the programming is completed, a header with buttons for various actions within the IDE becomes visible. Clicking the green "PLAY" button starts reading the results achieved with the Click board™. The achieved results are displayed in the Application Output tab.
Software Support
Library Description
This library contains API for EERAM 3.3V Click driver.
Key functions:
eeram3v3_generic_write
- This function writes a desired number of data bytes starting from the selected register by using I2C serial interfaceeeram3v3_generic_read
- This function reads a desired number of data bytes starting from the selected register by using I2C serial interfaceeeram3v3_status_write
- Status register contains settings for write protection and auto-store function. Use this function to configure them
Open Source
Code example
The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.
/*!
* @file main.c
* @brief EERAM3v3 Click example
*
* # Description
* This example show using EERAM click to store the data to the SRAM ( static RAM ) memory.
* The data is read and written by the I2C serial communication bus, and the memory cells
* are organized into 2048 bytes, each 8bit wide.
*
* The demo application is composed of two sections :
*
* ## Application Init
* EERAM driver nitialization.
*
* ## Application Task
* Writing data to click memory and displaying the read data via UART.
*
* @author Jelena Milosavljevic
*
*/
// ------------------------------------------------------------------- INCLUDES
#include "board.h"
#include "log.h"
#include "eeram3v3.h"
// ------------------------------------------------------------------ VARIABLES
static eeram3v3_t eeram3v3;
static log_t logger;
static char wr_data[ 20 ] = { 'M', 'i', 'k', 'r', 'o', 'E', 13, 10, 0 };
static char rd_data[ 20 ];
// ------------------------------------------------------ APPLICATION FUNCTIONS
void application_init ( void ) {
log_cfg_t log_cfg; /**< Logger config object. */
eeram3v3_cfg_t eeram3v3_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 " );
// Click initialization.
eeram3v3_cfg_setup( &eeram3v3_cfg );
EERAM3V3_MAP_MIKROBUS( eeram3v3_cfg, MIKROBUS_1 );
err_t init_flag = eeram3v3_init( &eeram3v3, &eeram3v3_cfg );
if ( I2C_MASTER_ERROR == init_flag ) {
log_error( &logger, " Application Init Error. " );
log_info( &logger, " Please, run program again... " );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
void application_task ( void ){
log_info( &logger, "Writing MikroE to SRAM memory, from address 0x0150:" );
eeram3v3_write( &eeram3v3, 0x0150, &wr_data, 9 );
log_info( &logger, "Reading 9 bytes of SRAM memory, from address 0x0150:" );
eeram3v3_read( &eeram3v3, 0x0150, &rd_data, 9 );
log_info( &logger, "Data read: %s", rd_data );
Delay_ms( 1000 );
}
void main ( void ) {
application_init( );
for ( ; ; ) {
application_task( );
}
}
// ------------------------------------------------------------------------ END