EEPROM2 Click
EEPROM2 Click
Share
EEPROM2 click provides 2 Mbit (2,097,152 bits) of Electrically Erasable and Programmable Read Only Memory, organized in bytes. In other words, this Click board™ is an EEPROM memory medium with the capacity of 256 KB. The used EEPROM module has an impressive endurance of 4,000,000 write cycles and data retention period of over 200 years. EEPROM module on this click features an ESD protection. It also contains a memory page of 256 bytes, which can be permanently locked, once it is written. The Error Correction Code logic section ensures a reliable data output from the device.
EEPROM2 click is aimed towards industrial and commercial applications, which require secure and reliable data storage. It can be used for any kind of temporary or permanent data storage for various embedded electronic devices, simple data logging, storing various working parameters of a module or device, sensitive data retention in case of a power cycle, and other similar applications where reliable EEPROM memory is needed.
HOW DOES IT WORK?
The EEPROM module used on the EEPROM2 click is the M95M02, an SPI serial EEPROM from STMicroelectronics, with the memory cell density of 2 megabits (Mbit). The EEPROM density is 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 in memory 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™ so the communication is easy and straightforward. The M95M02 IC supports clock frequency up to 5MHz.
This Click board™ uses the SPI communication protocol. To ensure reliable data transaction and to avoid accidental write to the memory array, the device employs certain protection mechanisms. When the M95M02 IC is powered up and when the power supply voltage reaches a certain threshold, the device will reset itself, setting up the internal logic in a known state. In addition, before writing any data to the IC which modifies registers or the array itself, the WEL bit must be set. This bit is cleared after or during every memory modification instruction. Therefore every memory modification instruction must be prefixed with the Write Enable instruction that sets this bit. This mechanism ensures that only the intended write instruction will be executed.
Communication with the device is initiated by the host MCU, which drives the chip select pin (#S on the schematic) to a LOW logic level. This pin is routed to the mikroBUS™ CS pin. The next byte of information can be either command or data. Usually, the first byte is the instruction (command) followed by the memory address. Depending on the command that has been sent, either the memory is written to, or read from the specific memory address. Memory address on this device is 18 bit (0x00000 to 0x3FFFF) and therefore it is sent by 3 bytes.
There are several instruction codes, which can be sent after the CS pin being driven to a LOW logic level. These include Write Enable and Disable, Write and Read from memory array, Read and Write to Status register, and so on. For a full list of commands, please refer to the datasheet of the M95M02 IC.
When using the Write to array instruction, it is possible to write up to 256 bytes in one write cycle. The internal address pointer is increased with each received byte. If attempting to write more than 256 bytes of data, a rollover will happen, writing the data from the beginning of the page. This is due to page organization of the memory array; only one full page can be written within a single write cycle.
The M95M02 includes a write protection of the specific parts or the whole memory array. The write protection consists of two bits in the Status Register (B0, B1), and the SRWD bit. The Status Register Write instruction can be used to set or reset these bits. B0 and B1 bits control the write-protect status of the memory array (from one quarter to full memory array protection). While the SRWD bit of the Status Register is set to 1, it is not possible to change the B0 and B1 bits. These bits are non-volatile and their state is retained between the power cycles.
One of the key features of the M95M02 IC is the Error Correction Code logic (ECC), which allows error correction by utilizing six additional bits, internally assigned to a group of four bytes. This protection scheme is capable of correcting some types of bit errors, staying transparent to the end user. The bit comparison and error correction are done internally.
Another feature of the M95M02 IC is an identification memory page, 256 bytes long. This page can be used to store an ID or other sensitive data, and once written, it can be permanently locked. The IC supports a set of instructions, used to perform the write, read and lock operation over this memory page.
EEPROM2 click offers a selection between 3.3V and 5V operation, with the onboard SMD jumper, labeled as PWR SEL. This allows both 3.3V and 5V MCUs to be interfaced with this Click board™.
SPECIFICATIONS
Type | EEPROM |
Applications | EEPROM 2 click is an excellent choice for storing initialization and configuration data of your device |
On-board modules | ST’s M95M02-DR DIP-8 socket EEPROM chip with 256 KB of memory |
Key Features | 256 KB of memory. Write speed within 10 ms (byte/page) |
Interface | SPI |
Compatibility | mikroBUS |
Click board size | S (28.6 x 25.4 mm) |
Input Voltage | 3.3V or 5V |
PINOUT DIAGRAM
This table shows how the pinout on EEPROM2 click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
ONBOARD SETTINGS AND INDICATORS
Label | Name | Default | Description |
---|---|---|---|
JP1 | PWR.SEL. | Left | Logic voltage level selection: left position 3V3, right position 5V |
LD1 | PWR | Power indication LED |
SOFTWARE SUPPORT
We provide a library for EEPROM2 click on our Libstock page, as well as a demo application (example), developed using MikroElektronika compilers and mikroSDK. The provided click library is mikroSDK standard compliant. The demo application can run on all the main MikroElektronika development boards.
Library Description
This library provides generic functions enough to have complete control over the EEPROM 2 click.
Key functions:
-
void eeprom2_writeBytes(uint32_t memoryAddress, uint8_t *value, uint8_t count)
- Writes the function to EEPROM. -
void eeprom2_readBytes(uint32_t memoryAddress, uint8_t *value, uint8_t count)
- Reads the function from EEPROM. -
void eeprom2_memoryEnable()
- Enables the write function.
Examples Description
The application is composed of three sections:
- System Initialization - CS GPIO as the output pin, initializes SPI and UART for logging.
- Application Initialization - Initializes EEPROM 2 driver.
- Application Task - writing data to EEPROM, reading that data and displaying it via UART.
void applicationTask() { eeprom2_memoryEnable(); eeprom2_writeBytes(0x01, &text[0], 6); mikrobus_logWrite("Writing Mikroe to EEPROM 2 click", _LOG_LINE); Delay_ms(1000); eeprom2_readBytes(0x01,&memValue[0],6); mikrobus_logWrite("Data read:", _LOG_LINE); mikrobus_logWrite(memValue, _LOG_LINE); Delay_ms(1000); }
The full application code, and ready to use projects can be found on our Libstock page.
Other mikroE Libraries used in the example:
- I2C
- UART
Additional notes and information
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. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
MIKROSDK
This click board is supported by 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.
Featured collection
-
Crazyflie 2.1+
Vendor:Regular price Rs. 26,499.00Regular priceUnit price / per -
Getting Started Bundle
Vendor:Regular price Rs. 26,399.00Regular priceUnit price / per -
Happy hacker bundle
Vendor:Regular price Rs. 33,599.00Regular priceUnit price / per -
STEM ranging bundle
Vendor:Regular price Rs. 43,999.00Regular priceUnit price / per -
Crazyradio 2.0
Vendor:Regular price Rs. 4,399.00Regular priceUnit price / per -
Lighthouse explorer bundle
Vendor:Regular price Rs. 89,999.00Regular priceUnit price / per -
Lighthouse positioning deck
Vendor:Regular price Rs. 9,899.00Regular priceUnit price / per -
Lighthouse V2 base station
Vendor:Regular price Rs. 30,349.00Regular priceUnit price / per -
Lighthouse swarm bundle
Vendor:Regular price Rs. 425,899.00Regular priceUnit price / per -
Loco explorer bundle
Vendor:Regular price Rs. 187,999.00Regular priceUnit price / per -
Loco positioning deck
Vendor:Regular price Rs. 9,899.00Regular priceUnit price / per -
Loco positioning node
Vendor:Regular price Rs. 18,699.00Regular priceUnit price / per -
Loco Swarm Bundle
Vendor:Regular price Rs. 529,609.00Regular priceUnit price / per -
Active marker deck
Vendor:Regular price Rs. 16,499.00Regular priceUnit price / per -
Motion capture marker deck
Vendor:Regular price Rs. 659.00Regular priceUnit price / per -
AI-Deck 1.1
Vendor:Regular price Rs. 27,999.00Regular priceUnit price / per -
AI-Deck Color Camera Module
Vendor:Regular price Rs. 2,199.00Regular priceUnit price / per -
AI-deck monocrome camera module
Vendor:Regular price Rs. 2,199.00Regular priceUnit price / per -
Flow deck v2
Vendor:Regular price Rs. 5,499.00Regular priceUnit price / per -
Crazyflie Bolt
Vendor:Regular price Rs. 21,999.00Regular priceUnit price / per -
Thrust upgrade bundle for Crazyflie 2.X
Vendor:Regular price Rs. 1,949.00Regular priceUnit price / perSold out -
Qi 1.2 wireless charging deck
Vendor:Regular price Rs. 3,849.00Regular priceUnit price / per -
7 mm DC-motor
Vendor:Regular price Rs. 439.00Regular priceUnit price / per -
Male long deck connector
Vendor:Regular price Rs. 219.00Regular priceUnit price / per -
250mAh LiPo battery
Vendor:Regular price Rs. 659.00Regular priceUnit price / per