24xx256 series(24AA256, 24LC256, 24FC256) is a 32,768words × 8 bits EEPROM(Electrically Erasable and Programmable Read-Only Memory) chip manufactured by Microchip Technology. This posting will provide the OSS-ECAL(Open Source Software for Electronic Components Abstraction Layer) for 24xx256 series.
MCU interface : I2C
CAUTION:Please be sure to refer to the latest version of the Datasheet prior to actual design.
24xx256 series
General description
The Microchip Technology Inc. 24xx256 is a 32K x 8 (256-Kbit) Serial Electrically Erasable PROM (EEPROM), capable of operation across a broad voltage range (1.7V to 5.5V) It has been developed for advanced, low-power applications such as personal communications or data acquisition. This device also has a page write capability of up to 64 bytes of data.
This device is capable of both random and sequential reads up to the 256K boundary Functional address lines allow up to eight devices on the same bus, for up to 2 Mbit address space.
Part Number | Vcc Range | Maximum Clock Frequency | Temperature Ranges | Available Packages |
---|---|---|---|---|
24AA256 | 1.7~5.5V | 400kHz(1) | I, E | CS, MF, MS, P, SN, SM, MNY, ST |
24LC256 | 2.5~5.5V | 400kHz | I, E | MF, MS, P, SN, SM, MNY, ST |
24FC256 | 1.7~5.5V | 1Mhz(2) | I, E | MF, MS, P, OT, SN, SM, MNY, ST |
Note
1: 100 kHz for Vcc < 2.5V
2: 400kHz for Vcc < 2.5V
Feature
- Single Supply with Operation Down to 1.7V for 24AA256 and 24FC256 Devices, 2.5V for 24LC256 Devices
- Low-Power CMOS Technology
Write current 3mA, maximum
Standby current 1μA maximum (I-temp.) - Two-Wire Serial Interface,I2C Compaitble
- Cascadable up to Eight Device
- Schmit Trigger Inputs for Noise Suppression
- Output Slope Control to Eilminate Ground Bounce
- 100 kHz, 400 kHz and 1MHz Compaitbility
- Page Write Time 5ms, maximum
- Self-Timed Erase/Write Cycle
- 64-Byte Page Write Buffer
- Hardware Write-Protect
- ESD Protection >4000V
- More than One Million Erase/Write Cycles
- Data Retention >200 years
- Factory Programming Available
- RoHS Compliant
- Temperature Ranges
Industrial (I): -40°C to +85°C
Extended (E): -40°C to +125°C - Automotive AEC-O100 Qualified
OSS-ECAL specification
API Function
etSTS o24xx256_BYTE_WRITE( etCMP cmp, uint16 mem_adr, uint8 val )
The o24xx256_BYTE_WRITE function is an API function that writes the value of val to the specified address mem_adr for the 24xx256 series (24AA256, 24LC256, 24FC256). This function returns the return value eSTS_EXE until the time to complete the write (i24xx256_WRITE_TIME [ms]) has elapsed.
NOTE :
The i24xx256_WRITE_TIME [ms] elapsed measurement is calculated from the Thread period that calls this function, so set the Thread period to THREAD_OSS_ECAL_PERIOD [ms].
Please use the o24xx256_WP_DIS function to release write-protection before using this function.
Return value | etSTS | OSS-ECAL status code | |
eSTS_FIN | Completed successfully | ||
eSTS_EXE | During execution | ||
eSTS_ERR_PARAMETER | Parameter error(Memory address) | ||
eSTS_ERR_I2C_OBJECT | I2C object selection error | ||
eSTS_ERR_OTHERS_RUN | Other components are executing the process | ||
eSTS_ERR_HAL_OTHERS_RUN | Other application is running HAL | ||
eSTS_ERR_HAL_I2C | HAL I2C error | ||
Parameter IN | etCMP cmp | OSS-ECAL components code | |
uint16 mem_adr | Memory address | 0x0000 to 0x7fff | |
uint8 val | Data to write |
etSTS o24xx256_PAGE_WRITE( etCMP cmp, uint16 mem_adr, uint16 len, uint8* buf )
The o24xx256_PAGE_WRITE function is an API function that writes the values buf[0] through buf[len-1] for the 24xx256 series (24AA256, 24LC256, 24FC256) in order from the specified address mem_adr. This function returns the return value eSTS_EXE until the time to complete the write (i24xx256_WRITE_TIME [ms]) has elapsed.
NOTE :
If mem_adr + len > 0bXXXXXXXXX111111, the addresses A6 to A14 are fixed and A0 to A5 are rolled over to 0bXXXXXXXXX000000.
The i24xx256_WRITE_TIME [ms] elapsed measurement is calculated from the Thread period that calls this function, so set the Thread period to THREAD_OSS_ECAL_PERIOD [ms].
Please use the o24xx256_WP_DIS function to release write-protection before using this function.
Return value | etSTS | OSS-ECAL status code | |
eSTS_FIN | Completed successfully | ||
eSTS_EXE | During execution | ||
eSTS_ERR_PARAMETER | Parameter error(Memory address) | ||
eSTS_ERR_I2C_OBJECT | I2C object selection error | ||
eSTS_ERR_OTHERS_RUN | Other components are executing the process | ||
eSTS_ERR_HAL_OTHERS_RUN | Other application is running HAL | ||
eSTS_ERR_HAL_I2C | HAL I2C error | ||
Parameter IN | etCMP cmp | OSS-ECAL components code | |
uint16 mem_adr | Memory address | 0x0000 to 0x7fff | |
uint16 len | Number of bytes to write (Max 64) | ||
uint8* buf | Data buffer to write |
etSTS o24xx256_CURRENT_READ( etCMP cmp, uint8* rlt )
The o24xx256_CURRENT_READ function is an API function that reads the value of 1 byte from the last Read or Write address + 1 for the 24xx256 series (24AA256, 24LC256, 24FC256) and stores it in rlt.
NOTE :
If mem_adr + len >0x7fff, the addresses is rolled over to 0x0000.
Return value | etSTS | OSS-ECAL status code | |
eSTS_FIN | Completed successfully | ||
eSTS_ERR_I2C_OBJECT | I2C object selection error | ||
eSTS_ERR_OTHERS_RUN | Other components are executing the process | ||
eSTS_ERR_HAL_OTHERS_RUN | Other application is running HAL | ||
eSTS_ERR_HAL_I2C | HAL I2C error | ||
Parameter IN | etCMP cmp | OSS-ECAL components code | |
Parameter OUT | uint8* rlt | Data to read |
etSTS o24xx256_RANDOM_READ( etCMP cmp, uint16 mem_adr, uint8* rlt )
The o24xx256_RANDOM_READ function is an API function that reads a 1-byte value from a specified address mem_adr for the 24xx256 series (24AA256, 24LC256, 24FC256) and stores it in rlt.
NOTE :
Return value | etSTS | OSS-ECAL status code | |
eSTS_FIN | Completed successfully | ||
eSTS_ERR_PARAMETER | Parameter error(Memory address) | ||
eSTS_ERR_I2C_OBJECT | I2C object selection error | ||
eSTS_ERR_OTHERS_RUN | Other components are executing the process | ||
eSTS_ERR_HAL_OTHERS_RUN | Other application is running HAL | ||
eSTS_ERR_HAL_I2C | HAL I2C error | ||
Parameter IN | etCMP cmp | OSS-ECAL components code | |
uint16 mem_adr | Memory address | 0x0000 to 0x7fff | |
Parameter OUT | uint8* rlt | Data to read |
etSTS o24xx256_SEQ_READ( etCMP cmp, uint16 mem_adr, uint16 len, uint8* buf )
The o24xx256_SEQ_READ function is an API function that reads data for len from the specified address mem_adr for the 24xx256 series (24AA256, 24LC256, 24FC256) in sequence and stores the data from buf[0] to buf[len-1].
NOTE :
If mem_adr + len > 0x7fff, the addresses is rolled over to 0x0000.
Return value | etSTS | OSS-ECAL status code | |
eSTS_FIN | Completed successfully | ||
eSTS_ERR_PARAMETER | Parameter error(Memory address) | ||
eSTS_ERR_I2C_OBJECT | I2C object selection error | ||
eSTS_ERR_OTHERS_RUN | Other components are executing the process | ||
eSTS_ERR_HAL_OTHERS_RUN | Other application is running HAL | ||
eSTS_ERR_HAL_I2C | HAL I2C error | ||
Parameter IN | etCMP cmp | OSS-ECAL components code | |
uint16 mem_adr | Memory address | 0x0000 to 0x7fff | |
uint16 len | Number of bytes to read | ||
Parameter OUT | uint8* buf | Data buffer to read |
etSTS oAT24C08C_WP_EN( etCMP cmp )
The o24xx256_WP_EN function is an API function that outputs Write protect enable (write disable) = “Hi” for the 24xx256 series (24AA256, 24LC256, 24FC256).
NOTE :
Return value | etSTS | OSS-ECAL status code | |
eSTS_FIN | Completed successfully | ||
eSTS_ERR_GPIO_OBJECT | GPIO object selection error | ||
Parameter IN | etCMP cmp | OSS-ECAL components code |
etSTS oAT24C08C_WP_DIS( etCMP cmp )
The o24xx256_WP_DIS function is an API function that outputs Write protect disable (write enable) = “Low” for the 24xx256 series (24AA256, 24LC256, 24FC256).
NOTE :
Return value | etSTS | OSS-ECAL status code | |
eSTS_FIN | Completed successfully | ||
eSTS_ERR_GPIO_OBJECT | GPIO object selection error | ||
Parameter IN | etCMP cmp | OSS-ECAL components code |
Files
Folder* | File | summary |
---|---|---|
24xx256_HALNAME_VERSION/sample | sample.c (.cpp) | Sample Application Program |
sample.h | Sample Application Header | |
24xx256_HALNAME_VERSION | o24xx256.c (.cpp) | OSS-ECAL Program for 24xx256 series (24AA256, 24LC256, 24FC256) |
o24xx256.h | OSS-ECAL Header for 24xx256 series (24AA256, 24LC256, 24FC256) | |
24xx256_ARDUINO.ino | Sample application programs for Arduino | |
oss_ecal.h | OSS-ECAL Common Header (Ver 01.00.00 or later, AUTOSAR is Ver 01.01.07 or later) | |
user_setting.c (.cpp) | Const and Table of User setting | |
user_setting.h | Header of User setting | |
oHAL_i2c_stm32f4.c | HAL Program for STM32Cube FW_F4 | |
oHAL_i2c_stm32f4.h | HAL Header for STM32Cube FW_F4 | |
readme.md | Readme | |
OSS-ECAL Terms of Use.txt | OSS-ECAL Terms of Use |
* For HALNAME, please refer to HAL Support.
HAL Support List
HAL | MCU* | Development environment* | HALNAME |
---|---|---|---|
Arduino 1.8.6 | ATmega2560 ATmega328P | Mega 2560 Rev3 Arduino Pro Mini 3.3V | ARDUINO |
ARM Mbed 6.17.0 | STM32F401RE | STM32 Nucleo-64 boards | MBED |
Infineon ModusToolbox HAL Cat1 2.4.3 | CYBLE-416045-02 | CY8CPROTO-063-BLE PSoC 6 BLE Prototyping Kit | ModusToolbox |
NXP MCUXpresso SDK iMXRT1051B_1052B ksdk2_0 | MIMXRT1052DVL6A | IMXRT1050-EVKB | iMXRT1051B1052B |
STM STM32Cube FW_F4 V1.27.1 | STM32F401RE | STM32 Nucleo-64 boards | STM32F4 |
* MCU and development environment at the time of development. Even if the same HAL is used, different MCUs and development environments may not work together.
OSS-ECAL Download Contact
Please login before contacting us for downloads.
To register as a new user, click here.
Built-in How to
Please refer to the following to incorporate API functions into your user program.
Pin A2 should be set with the following code in user_setting.h.
// Device address Code bit2:A2 bit1:A1 bit0:A0
#define M24xx256_1 0b00000000
For Infineon ModusToolbox HAL, set the I2C Timeout setting with the following code in user_setting.h. For details, see cyhal_i2c_master_write(), cyhal_i2c_master_read() Parameters timeout.
#define I2C_TIMEOUT 10U // Timeout[ms]
For STM32Cube FW_F4 HAL, I2C Timeout time is 25ms.
Note :
For the following command API functions, the Timeout time varies depending on the Read/Write data length len.
etSTS o24xx256_PAGE_WRITE( etCMP cmp, uint16 mem_adr, uint16 len, uint8* buf )
etSTS o24xx256_SEQ_READ( etCMP cmp, uint16 mem_adr, uint16 len, uint8* buf )
How to incorporate OSS-ECAL into user programs
How to incorporate multiple OSS-ECALs in a user program (same MCU function)
How to incorporate multiple OSS-ECALs in a user program (different MCU function)
How to incorporate multiple identical electronic components into a user program
How to reduce the impact on user programs by replacing electronic components
CAUTION
The sample version of OSS-ECAL is not intended to be used with Threads (Tasks) or interrupts of different priority. Please do not use it as in the example below.
Example: If each sensor is assigned to the same ADC group and the OSS-ECAL API is executed in processes with different priorities, correct values may not be obtained.
ADC Gr0 Ch0 Temperature sensor AD22100A 100ms cycle Thread (low priority) to take in temperature
ADC Gr0 Ch1 Pressure sensor MPX5999D Event interrupts (high priority) to take pressure