AT24C08C

AT24C08C is a 1,024words × 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 AT24C08C.
MCU interface : I2C

CAUTION:Please be sure to refer to the latest version of the Datasheet prior to actual design.

AT24C08C

General description

The AT24C08C provides 8,192 bits of Serial Electrically Erasable and Programmable Read-Only Memory (EEPROM) organized as 1,024 words of 8 bits each. The device’s cascading feature allows up to two devices (AT24C08C) to share a common Two-Wire bus. These devices are optimized for use in many industrial and commercial applications where low‑power and low‑voltage operations are essential. The devices are available in space-saving 8-lead SOIC, 8-lead TSSOP, 8-pad UDFN, 8-lead PDIP, 5-lead SOT23 and 8-ball VFBGA packages. All packages operate from 1.7V to 5.5V.

Feature

  • Low-Voltage Operation : VCC = 1.7V to 5.5V
  • Internally Organized as 1,024 x 8 (8K)
  • Industrial Temperature Range : -40°C to +85°C
  • I2C-Compatible (Two-Wire) Serial Interface : 100 kHz Standard mode, 1.7V to 5.5V, 400 kHz Fast mode, 1.7V to 5.5V, 1 MHz Fast Mode Plus (FM+), 2.5V to 5.5V
  • Schmitt Triggers, Filtered Inputs for Noise Suppression
  • Bidirectional Data Transfer Protocol
  • Write-Protect Pin for Full Array Hardware Data Protection
  • Ultra Low Active Current (3 mA maximum) and Standby Current (6 μA maximum)
  • 16-byte Page Write Mode : Partial page writes allowed
  • Random and Sequential Read Modes
  • Self-Timed Write Cycle Within 5 ms Maximum
  • ESD Protection > 4,000V
  • High Reliability : 1,000,000 write cycles, Data retention 100 years
  • Green Package Options (Lead-Free/Halide-Free/RoHS Compliant)
  • Die Sale Options: Wafer Form and Tape and Reel Available

OSS-ECAL specification

API Function

etSTS oAT24C08C_BYTE_WRITE( etCMP cmp, uint16 mem_adr, uint8 val )

The oAT24C08C_BYTE_WRITE function is an API function that writes the value of val to the specified address mem_adr for AT24C08C. This function returns the return value eSTS_EXE until the time to complete the write (iAT24C08C_WRITE_TIME [ms]) has elapsed.

NOTE :
The iAT24C08C_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 oAT24C08C_WP_DIS function to release write-protection before using this function.

Return valueetSTSOSS-ECAL status code
eSTS_FINCompleted successfully
eSTS_EXEDuring execution
eSTS_ERR_PARAMETERParameter error(Memory address)
eSTS_ERR_I2C_OBJECTI2C object selection error
eSTS_ERR_OTHERS_RUNOther components are executing the process
eSTS_ERR_HAL_OTHERS_RUNOther application is running HAL
eSTS_ERR_HAL_I2CHAL I2C error
Parameter INetCMP cmpOSS-ECAL components code
uint16 mem_adrMemory address0x0000 to 0x03FF
uint8 valData to write
etSTS oAT24C08C_PAGE_WRITE( etCMP cmp, uint16 mem_adr, uint16 len, uint8* buf )

The oAT24C08C_PAGE_WRITE function is an API function that writes the values buf[0] through buf[len-1] for the AT24C08C in order from the specified address mem_adr. This function returns the return value eSTS_EXE until the time to complete the write (iAT24C08C_WRITE_TIME [ms]) has elapsed.

NOTE :
If mem_adr + len > 0bXXXXXX1111, the addresses A4 to A8 are fixed and A0 to A3 are rolled over to 0bXXXXXX0000.
The iAT24C08C_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 oAT24C08C_WP_DIS function to release write-protection before using this function.

Return valueetSTSOSS-ECAL status code
eSTS_FINCompleted successfully
eSTS_EXEDuring execution
eSTS_ERR_PARAMETERParameter error(Memory address)
eSTS_ERR_I2C_OBJECTI2C object selection error
eSTS_ERR_OTHERS_RUNOther components are executing the process
eSTS_ERR_HAL_OTHERS_RUNOther application is running HAL
eSTS_ERR_HAL_I2CHAL I2C error
Parameter INetCMP cmpOSS-ECAL components code
uint16 mem_adrMemory address0x0000 to 0x03FF
uint16 lenNumber of bytes to write (Max 16)
uint8* bufData buffer to write
etSTS oAT24C08C_CURRENT_READ( etCMP cmp, uint8* rlt )

The oAT24C08C_CURRENT_READ function is an API function that reads the value of 1 byte from the last Read or Write address + 1 for the AT24C08C and stores it in rlt.

NOTE :
If mem_adr + len > 0b1111111111, the addresses is rolled over to 0b0000000000.

Return valueetSTSOSS-ECAL status code
eSTS_FINCompleted successfully
eSTS_ERR_I2C_OBJECTI2C object selection error
eSTS_ERR_OTHERS_RUNOther components are executing the process
eSTS_ERR_HAL_OTHERS_RUNOther application is running HAL
eSTS_ERR_HAL_I2CHAL I2C error
Parameter INetCMP cmpOSS-ECAL components code
Parameter OUTuint8* rltData to read
etSTS oAT24C08C_RANDOM_READ( etCMP cmp, uint16 mem_adr, uint8* rlt )

The oAT24C08C_RANDOM_READ function is an API function that reads a 1-byte value from a specified address mem_adr for the AT24C08C and stores it in rlt.

NOTE :

Return valueetSTSOSS-ECAL status code
eSTS_FINCompleted successfully
eSTS_ERR_PARAMETERParameter error(Memory address)
eSTS_ERR_I2C_OBJECTI2C object selection error
eSTS_ERR_OTHERS_RUNOther components are executing the process
eSTS_ERR_HAL_OTHERS_RUNOther application is running HAL
eSTS_ERR_HAL_I2CHAL I2C error
Parameter INetCMP cmpOSS-ECAL components code
uint16 mem_adrMemory address0x0000 to 0x03FF
Parameter OUTuint8* rltData to read
etSTS oAT24C08C_SEQ_READ( etCMP cmp, uint16 mem_adr, uint16 len, uint8* buf )

The oAT24C08C_SEQ_READ function is an API function that reads data for len from the specified address mem_adr for the AT24C08C in sequence and stores the data from buf[0] to buf[len-1].

NOTE :
If mem_adr + len > 0b1111111111, the addresses is rolled over to 0b0000000000.

Return valueetSTSOSS-ECAL status code
eSTS_FINCompleted successfully
eSTS_ERR_PARAMETERParameter error(Memory address)
eSTS_ERR_I2C_OBJECTI2C object selection error
eSTS_ERR_OTHERS_RUNError during execution of other components
eSTS_ERR_HAL_OTHERS_RUNHAL running in another application
eSTS_ERR_HAL_I2CHAL I2C error
Parameter INetCMP cmpOSS-ECAL components code
uint16 mem_adrMemory address0x0000 to 0x03FF
uint16 lenNumber of bytes to read
Parameter OUTuint8* bufData to read
etSTS oAT24C08C_WP_EN( etCMP cmp )

The oAT24C08C_WP_EN function is an API function that outputs Write protect enable (write disable) = “Hi” for the AT24C08C.

NOTE :

Return valueetSTSOSS-ECAL status code
eSTS_FINCompleted successfully
eSTS_ERR_GPIO_OBJECTGPIO object selection error
Parameter INetCMP cmpOSS-ECAL components code
etSTS oAT24C08C_WP_DIS( etCMP cmp )

The oAT24C08C_WP_DIS function is an API function that outputs Write protect disable (write enable) = “Low” for the AT24C08C.

NOTE :

Return valueetSTSOSS-ECAL status code
eSTS_FINCompleted successfully
eSTS_ERR_GPIO_OBJECTGPIO object selection error
Parameter INetCMP cmpOSS-ECAL components code

Files

Folder*Filesummary
AT24C08C_HALNAME_VERSION/samplesample.c (.cpp)Sample Application Program
sample.hSample Application Header
AT24C08C_HALNAME_VERSIONoAT24C08C.c (.cpp)OSS-ECAL Program for AT24C08C
oAT24C08C.hOSS-ECAL Header for AT24C08C
AT24C08C_ARDUINO.inoSample application programs for Arduino
oss_ecal.hOSS-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.hHeader of User setting
oHAL_i2c_stm32f4.cHAL Program for STM32Cube FW_F4
oHAL_i2c_stm32f4.hHAL Header for STM32Cube FW_F4
readme.mdReadme
OSS-ECAL Terms of Use.txtOSS-ECAL Terms of Use

* For HALNAME, please refer to HAL Support.

HAL Support List

HALMCU*Development environment*HALNAME
Arduino 1.8.6ATmega2560
ATmega328P
Mega 2560 Rev3
Arduino Pro Mini 3.3V
ARDUINO
ARM Mbed 6.17.0STM32F401RESTM32 Nucleo-64 boardsMBED
Infineon ModusToolbox HAL Cat1 2.4.3CYBLE-416045-02CY8CPROTO-063-BLE PSoC 6 BLE Prototyping KitModusToolbox
NXP MCUXpresso SDK
iMXRT1051B_1052B
ksdk2_0
MIMXRT1052DVL6AIMXRT1050-EVKBiMXRT1051B1052B
STM STM32Cube FW_F4 V1.27.1STM32F401RESTM32 Nucleo-64 boardsSTM32F4
Debian(Linux) v2022.04TI AM335xBeagleBone Black – Rev CLinux

* 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
#define AT24C08C_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 oAT24C08C_PAGE_WRITE( etCMP cmp, uint16 mem_adr, uint16 len, uint8* buf )
etSTS oAT24C08C_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

OSS-ECAL English
error: Content is protected !!