Discover a solution that guarantees data retention for extended periods, offering peace of mind in critical scenarios and safeguarding valuable information against unforeseen events
A
A
Hardware Overview
How does it work?
EEPROM 4 Click is based on the AT25M02, an SPI serial EEPROM from Microchip, with a memory cell density of 2 Mbits. The EEPROM density is usually expressed in bits, so exactly 2,097,152 bits are organized in units or words of 8 bits, which gives 262,144 bytes of data memory. Furthermore, the EEPROM is organized into so-called pages. One page holds 256 bytes, and there are 1024 pages (1024 pages x 256 bytes = 262,144 bytes total). Having insight into how the memory cells are organized is important for write and erase operations. The SPI pins are routed to the mikroBUS™, making communication easy and straightforward. The SPI can be clocked as high as 5MHz, providing a fast throughput for the data transfer. A dedicated #HOLD pin is routed to the PWM pin of the mikroBUS™. When the communication with the click board™ is initiated by setting the CS pin to a LOW logic state, it is possible to pause the serial data transfer without
resetting the communication if the #HOLD pin (PWM pin on the mikroBUS™) is set to a LOW logic state. To resume the communication, setting this pin to a HIGH logic state while the SCK is still running is enough. Once the HOLD is initiated, the state of the SCK line is irrelevant, and any serial data input will be ignored. This pin is pulled HIGH by the onboard resistor. A dedicated #WP write protect pin puts the device into the hardware write protect mode. This pin is routed to the RST pin of the mikroBUS™. Hardware write-protect works with the Write Protect Enable (WPEN) bit of the Status Register. When this bit is set to 1, and the #WP pin is set to a LOW logic state, the device will ignore any attempt to write to the Status Register and the EEPROM memory regions selected by the Block Write Protect bits of the Status Register (BP0 and BP1). WRSR instruction is used to write to the Status Register (01h). Again, WREN instruction should be executed first before
attempting to write to Status Register. Once the WPEN bit is set to 1 and the RST has been pulled to a LOW logic state, setting the WPEN bit to 0 won’t turn off write protection as long as the #WP pin (RST) stays LOW. WPEN bit and the BP0 and BP1 bits are constructed as EEPROM cells, meaning that they are nonvolatile and will retain their states even after power is off. The #WP pin is pulled HIGH by the onboard resistor. As usual, the onboard SMD jumper labeled as VCCSEL is used to select the operating voltage between 3.3V and 5V. However, there’s the third position for this jumper, which sets the operating voltage to 1.8V. This is achieved thanks to the TC1015, a small 100 mA LDO from Microchip powered by the 5V rail. As always, MikroElektronika provides libraries that simplify and speed up working with this device. The provided application example demonstrates the functionality of the provided libraries and can be used as a reference point for own development.
Features overview
Development board
PIC18F57Q43 Curiosity Nano evaluation kit is a cutting-edge hardware platform designed to evaluate microcontrollers within the PIC18-Q43 family. Central to its design is the inclusion of the powerful PIC18F57Q43 microcontroller (MCU), offering advanced functionalities and robust performance. Key features of this evaluation kit include a yellow user LED and a responsive
mechanical user switch, providing seamless interaction and testing. The provision for a 32.768kHz crystal footprint ensures precision timing capabilities. With an onboard debugger boasting a green power and status LED, programming and debugging become intuitive and efficient. Further enhancing its utility is the Virtual serial port (CDC) and a debug GPIO channel (DGI
GPIO), offering extensive connectivity options. Powered via USB, this kit boasts an adjustable target voltage feature facilitated by the MIC5353 LDO regulator, ensuring stable operation with an output voltage ranging from 1.8V to 5.1V, with a maximum output current of 500mA, subject to ambient temperature and voltage constraints.
Microcontroller Overview
MCU Card / MCU
Architecture
PIC
MCU Memory (KB)
128
Silicon Vendor
Microchip
Pin count
48
RAM (Bytes)
8196
You complete me!
Accessories
Curiosity Nano Base for Click boards is a versatile hardware extension platform created to streamline the integration between Curiosity Nano kits and extension boards, tailored explicitly for the mikroBUS™-standardized Click boards and Xplained Pro extension boards. This innovative base board (shield) offers seamless connectivity and expansion possibilities, simplifying experimentation and development. Key features include USB power compatibility from the Curiosity Nano kit, alongside an alternative external power input option for enhanced flexibility. The onboard Li-Ion/LiPo charger and management circuit ensure smooth operation for battery-powered applications, simplifying usage and management. Moreover, the base incorporates a fixed 3.3V PSU dedicated to target and mikroBUS™ power rails, alongside a fixed 5.0V boost converter catering to 5V power rails of mikroBUS™ sockets, providing stable power delivery for various connected devices.
Used MCU Pins
mikroBUS™ mapper
Take a closer look
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 EEPROM 4 Click driver.
Key functions:
eeprom4_write_status_reg
- Status register write functioneeprom4_write_memory
- Memory array write functioneeprom4_read_memory
- Memory array read function
Open Source
Code example
This example can be found in NECTO Studio. Feel free to download the code, or you can copy the code below.
/*!
* \file
* \brief Eeprom4 Click example
*
* # Description
* This click reads and writes memory.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initializes click driver and configures click that all memory block > is unprotected.
* Also configures that HOLD operation is disabled, and the memory and > status register are writable.
*
* ## Application Task
* Enables writting to memory array, writes data from buffer to memory,
* checks if the part is in a write cycle, and if is not reads data > > from memory array and stores data to buffer.
* Storaged data shows on USB UART.
*
* \author MikroE Team
*
*/
// ------------------------------------------------------------------- INCLUDES
#include "board.h"
#include "log.h"
#include "eeprom4.h"
// ------------------------------------------------------------------ VARIABLES
static eeprom4_t eeprom4;
static log_t logger;
// ------------------------------------------------------ APPLICATION FUNCTIONS
void application_init ( void )
{
log_cfg_t log_cfg;
eeprom4_cfg_t cfg;
/**
* 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.
eeprom4_cfg_setup( &cfg );
EEPROM4_MAP_MIKROBUS( cfg, MIKROBUS_1 );
eeprom4_init( &eeprom4, &cfg );
eeprom4_default_cfg( &eeprom4 );
}
void application_task ( )
{
uint8_t data_write[ 13 ] = { 'M', 'i', 'K', 'r', 'O', 'e', 0 };
uint8_t data_read[ 255 ] = { 0 };
uint8_t cnt;
uint8_t check_state;
eeprom4_send_command( &eeprom4, EEPROM4_SET_WRITE_ENABLE_LATCH_COMMAND );
eeprom4_write_memory( &eeprom4, EEPROM4_FIRST_MEMORY_LOCATION, data_write, 6 );
cnt = eeprom4_check_status_reg( &eeprom4, EEPROM4_READY_BIT );
check_state = eeprom4_send_command( &eeprom4, EEPROM4_LOW_POWER_WRITE_POLL_COMMAND );
while ( cnt | check_state )
{
cnt = eeprom4_check_status_reg( &eeprom4, EEPROM4_READY_BIT );
check_state = eeprom4_send_command( &eeprom4, EEPROM4_LOW_POWER_WRITE_POLL_COMMAND );
}
eeprom4_read_memory( &eeprom4, 0x00000000, data_read, 6 );
for ( cnt = 0; cnt < 6; cnt++ )
{
log_printf( &logger, " %c ", data_read[cnt] );
}
log_printf( &logger, "----- \r\n" );
Delay_ms( 2000 );
}
void main ( void )
{
application_init( );
for ( ; ; )
{
application_task( );
}
}
// ------------------------------------------------------------------------ END