Skip to content

Three-Wire Serial EEPROM Access Library for RaspberryPi

License

Notifications You must be signed in to change notification settings

nopnop2002/Raspberry-93Cx6

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raspberry-93Cx6

Three-Wire Serial EEPROM Access Library for RaspberryPi.

I used this as a reference.


Interface

It look like SPI.
But CS is ACTIVE HIGH.
And data bit is not always 8bit.


Memory size vs Organization

The 93Cx6 memory is organized either as bytes (x8) or as words (x16).
If Organization Select (ORG) is left unconnected (or connected to VCC) the x16 organization is selected.
When Organization Select (ORG) is connected to Ground (VSS) the x8 organization is selected.

Device Number of Bits Number of 8-bit Bytes Number of 16-bit Words
93C46 1024 128 64
93C56 2048 256 128
93C66 4096 512 256
93C76 8192 1024 512
93C86 16384 2048 1024

Software requirement

WiringPi Library


Build

for 93C46
cc -o main main.c 93Cx6.c -lwiringPi -DC46 [-DWORD/-DBYTE]

for 93C56
cc -o main main.c 93Cx6.c -lwiringPi -DC56 [-DWORD/-DBYTE]

for 93C66
cc -o main main.c 93Cx6.c -lwiringPi -DC66 [-DWORD/-DBYTE]

for 93C76
cc -o main main.c 93Cx6.c -lwiringPi -DC76 [-DWORD/-DBYTE]

for 93C86
cc -o main main.c 93Cx6.c -lwiringPi -DC86 [-DWORD/-DBYTE]

sudo ./main


API

// Open Memory Device
// model:EEPROM model(46/56/66/76/86)
// org:Organization Select(1=8Bit/2=16Bit)
int eeprom_open(int model, int org, int pCS, int pSK, int pDI, int pDO, struct eeprom *dev);

// Erase/Write Enable
void eeprom_ew_enable(struct eeprom *dev);

// Erase/Write Disable
void eeprom_ew_disable(struct eeprom *dev);

// Check Erase/Write Enable
bool eeprom_is_ew_enabled(struct eeprom *dev);

// Erase All Memory
void eeprom_erase_all(struct eeprom *dev);

// Erase Byte or Word
void eeprom_erase(struct eeprom *dev, uint16_t addr)

// Write All Memory with same Data
void eeprom_write_all(struct eeprom *dev, uint16_t value)

// Write Data to Memory
void eeprom_write(struct eeprom *dev, uint16_t addr, uint16_t value)

// Read Data from Memory
uint16_t eeprom_read(struct eeprom *dev, uint16_t addr)

Wireing for x8 Organization

Raspberry-93cx6-byte

Wireing for x16 Organization

Raspberry-93cx6-word

It's insufficient in 3.3V Power supply.
You have to supply 5V.
So you have to shift level about MISO line.


93C46

93c46-byte

93c46-word

93C56

93c56-byte

93c56-word

93C66

93c66-byte

93c66-word

93C76

93c76-byte

93c76-word

93C86

93c86-byte

93c86-word

Releases

No releases published

Packages

No packages published

Languages