Enjoy lightning-fast data access and fail-safe protection with our SRAM memory backed by EEPROM technology
A
A
Hardware Overview
How does it work?
EERAM 5V 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 5V 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 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 5V 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 5V 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
EasyPIC v8 is a development board specially designed for the needs of rapid development of embedded applications. It supports many high pin count 8-bit PIC microcontrollers from Microchip, regardless of their number of pins, and a broad set of unique functions, such as the first-ever embedded debugger/programmer. The development board is well organized and designed so that the end-user has all the necessary elements, such as switches, buttons, indicators, connectors, and others, in one place. Thanks to innovative manufacturing technology, EasyPIC v8 provides a fluid and immersive working experience, allowing access anywhere and under any
circumstances at any time. Each part of the EasyPIC v8 development board contains the components necessary for the most efficient operation of the same board. In addition to the advanced integrated CODEGRIP programmer/debugger module, which offers many valuable programming/debugging options and seamless integration with the Mikroe software environment, the board also includes a clean and regulated power supply module for the development board. It can use a wide range of external power sources, including a battery, an external 12V power supply, and a power source via the USB Type-C (USB-C) connector.
Communication options such as USB-UART, USB DEVICE, and CAN are also included, including the well-established mikroBUS™ standard, two display options (graphical and character-based LCD), and several different DIP sockets. These sockets cover a wide range of 8-bit PIC MCUs, from the smallest PIC MCU devices with only eight up to forty pins. EasyPIC v8 is an integral part of the Mikroe ecosystem for rapid development. Natively supported by Mikroe software tools, it covers many aspects of prototyping and development thanks to a considerable number of different Click boards™ (over a thousand boards), the number of which is growing every day.
Microcontroller Overview
MCU Card / MCU
Architecture
PIC
MCU Memory (KB)
32
Silicon Vendor
Microchip
Pin count
40
RAM (Bytes)
2048
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
This Click board can be interfaced and monitored in two ways:
Application Output
- Use the "Application Output" window in Debug mode for real-time data monitoring. Set it up properly by following this tutorial.
UART Terminal
- Monitor data via the UART Terminal using a USB to UART converter. For detailed instructions, check out this tutorial.
Software Support
Library Description
This library contains API for EERAM 5V Click driver.
Key functions:
eeram5v_generic_read
- This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.eeram5v_status_write
- Status register contains settings for write protection and auto-store function. Use this function to configure them.eeram5v_status_read
- Returns the state of the status register.
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 EERAM5V 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 initialization.
*
* ## 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 "eeram5v.h"
// ------------------------------------------------------------------ VARIABLES
static eeram5v_t eeram5v;
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. */
eeram5v_cfg_t eeram5v_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.
eeram5v_cfg_setup( &eeram5v_cfg );
EERAM5V_MAP_MIKROBUS( eeram5v_cfg, MIKROBUS_1 );
err_t init_flag = eeram5v_init( &eeram5v, &eeram5v_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:" );
eeram5v_write( &eeram5v, 0x0150, &wr_data, 9 );
log_info( &logger, "Reading 9 bytes of SRAM memory, from address 0x0150:" );
eeram5v_read( &eeram5v, 0x0150, &rd_data, 9 );
log_info( &logger, "Data read: %s", rd_data );
Delay_ms( 1000 );
}
void main ( void ) {
application_init( );
for ( ; ; ) {
application_task( );
}
}
// ------------------------------------------------------------------------ END