Go Down

Topic: How external EEPROM work (Read 144 times) previous topic - next topic

Bassusour

I have read and watched a few videos regarding this topic, but there is still some stuff I do not understand. This is based on the I2C series of EEPROM.

So the EEPROM consists of 8 pins, whereas two of them is for 5 volt and ground. However, I do not understand the adresse pins function, neither the use of the SCL and SDA pins.

Is adresse pins used to specify a location in the EEPROM? And is the SCL and SDA pins there, to change to the next adresse, if an adresse is already full? And why is it that the SCL and SDA pins only can connect to analog pins 4 and 5?

I know this is basic stuff, but please bare with me.

sterretje

#1
Sep 13, 2017, 05:44 pm Last Edit: Sep 13, 2017, 05:47 pm by sterretje
I2C is a bus and you can connect multiple devices on that bus. Each device needs to have an unique address on the bus (like a house number in the street). You can influence the address of the house using the address pins; with e.g 3 address pins you can have a base address plus 0..7 (e.g. 0x20..0x27; this assumes a base address of 0x20).

I2C uses two pins for communication. SDA is the data that is transferred from master to slave or vice versa. SCL is the clock that clocks the data.

//PS
The 328 processor has a built-in I2C functionality that is connected to A4 and A5; with most Unos, the same processor pins are also available as SDA and SCL at the other side of the board.
If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

Grumpy_Mike

Quote
And why is it that the SCL and SDA pins only can connect to analog pins 4 and 5?
Because the hardware that talks to I2C protocol is only connected to those two pins.

You can use another pair of pins but then you will have to bit bang the I2C protocol which by comparison to the hardware is quite slow.

Jiggy-Ninja

#3
Sep 15, 2017, 06:24 pm Last Edit: Sep 15, 2017, 06:25 pm by Jiggy-Ninja
Chips tend to have data sheets that explain how all their pins work, and any digital protocols they use. Try reading one. Search Google or something for "<chip name> datasheet".
Hackaday: https://hackaday.io/MarkRD
Advanced C++ Techniques: https://forum.arduino.cc/index.php?topic=493075.0

Go Up