I2C EEPROM (24LCxxx)

I2C EEPROM is external memory which can be added to a PICAXE system which keeps its contents even when power is removed.

I2C EEPROM and other I2C devices (DS1307 Real Time Clock) are connected to the PICAXE using a two-wire I2C bus and can be controlled with a range of I2C specific commands.

I2C EEPROM is available in a range of storage sizes.

Related Commands:

Print Page

Share

Schematic

PCB

Read and write to byte addressed eeprom

This program demonstrates reading and writing to byte addressed eeprom

Code Example:
	hi2csetup i2cmaster, %10100000, i2cslow, i2cbyte

main:	hi2cout 0, (b0)		; Write data to eeprom
	pause	20		; Wait for write to complete

	hi2cin 0, (b1)		; Read data from eeprom
	debug			; Show result

	pause 1000		; Wait a short while
	b0 = b0 + 1		; Increment the data to write
	goto main		; And repeat	
Copy Code Submit an Example

Read and write to word addressed eeprom

This program demonstrates reading and writing to word addressed eeprom

Code Example:
	hi2csetup i2cmaster, %10100000, i2cfast, i2cword

main:	hi2cout 0, (b0)		; Write data to eeprom
	pause	20		; Wait for write to complete

	hi2cin 0, (b1)		; Read data from eeprom
	debug			; Show result

	pause 1000		; Wait a short while
	b0 = b0 + 1		; Increment the data to write
	goto main		; And repeat	
Copy Code Submit an Example

Create Module

I2C EEPROM can be connected using two generic terminal block create modules to carry the SDA and SCL signals of the I2C bus.

Bill of Materials

DescriptionCodeQty
24LC512/P 512kb (64KB) EEPROM MIC051 1 Buy Now
8-pin 0.3" DIP IC Socket ICH008 1 Buy Now
4k7 resistor (pack 100) RES4K7 1 Buy Now
100nF minaiature polyester capacitor CAP001 1 Buy Now

Simulation

No Image Selected

Submit Your Own Code!

You must be logged in to submit code examples. Login now.