Arduino – Geheugen EEPROM 24LCxxx

Hardware:

EEPROM geheugen 2 Kbit - 256 Byte (24LC02B) chipEEPROM geheugen 128 Kbit - 16 Kb (24LC128) chipEEPROM geheugen 512 Kbit - 64 Kb (24LC512) chip

Ā Ā  BESTEL NU!

De 24LCxxx chips zijn EEPROM geheugens, eenvoudig aan te spreken met het SPI protocol, om zo waarden in het geheugen op te slaan.

De chip kent verschillende uitvoeringen in geheugengrootte:

Chip:Grootte:
24LC0016 bytes
24LC01128 bytes
24LC014128 bytes
24LC02256 bytes
24LC024256 bytes
24LC025256 bytes
24LC04512 bytes
24LC081 kByte
24LC162 kBytes
24LC324 kBytes
24LC648 kBytes
24LC12816 kBytes
24LC25632 kBytes
24LC51264 kBytes
24LC1025128 kBytes
24LC1026128 kBytes

Pinout

EEPROM geheugen 24LCxxx pinout

EEPROM geheugen 2 Kbit - 256 Byte (24LC02B) chip
Pin:Functie:
1A0 (SPI adres instelling)
2A1 (SPI adres instelling)
3A2 (SPI adres instelling)
4Vss (GND)
5SDA (Serial Data)
6SCL (Serial Clock)
7WP (WriteProtect)
8Vcc (+3-5v)

Aansluiten op de Arduino

Sluit het volgende aan via onderstaand schema:

Fritzing LC24xxx EEPROM op Arduino

24LCxxx pin:Arduino pin:
1 / A0 (SPI adres instelling)GND
2 / A1 (SPI adres instelling)GND
3 / A2 (SPI adres instelling)GND
4 / Vss (GND)GND
5 / SDA (Serial Data)A4
6 / SCL (Serial Clock)A5
7 / WP (WriteProtect)GND
8 / Vcc (+3-5v)+5v

WP hoog (+5v) = beveiligd tegen schrijven, laag = schrijven toegestaan.

Ps. het is optioneel om A0, A1 en A2 met GND te verbinden, maar het voorkomt zo “floating” waarden.

Script #1 – Schrijven en lezen

Met dit script kan je een byte schrijven en lezen vanaf de EEPROM.

Script #2 – String schijven

Met onderstaand script kun je regel tekst schrijven en lezen vanuit de EEPROM.

SPI adressen aanpassen

Het SPI adres kan je aanpassen met de pinnen A0, A1 en A2, er kunnen op deze manier 8 chips aangesloten worden op de bus lijn.

24LC256 adres instelling

De SPI adressering van de 24LCxxx chip is als volgt: 1 0 1 0 A2 A1 A0 x

Als je alle pinnen (A0, A1 en A2) met GND verbind is het I2C adres 1010000 = 0x50 in hexadecimaal.
Als je alle pinnen op VCC aansluit dan heb jeĀ 1010111 = 0x57.

A2A1A0adres
GNDGNDGND0x50
GNDGND+ 5V0x51
GND+ 5VGND0x52
GND+ 5V+ 5V0x53
+ 5VGNDGND0x54
+ 5VGND+ 5V0x55
+ 5V+ 5VGND0x56
+ 5V+ 5V+ 5V0x57

Bronnen:
www.hobbytronics.co.uk
www.instructables.com
labdegaragem.com
rweather.github.io
vascoferraz.com
arduino8.webnode.cz