Transaction I2C [SOLVED]

Ian0

Joined Aug 7, 2020
13,132
I've looked the datasheets for the EEPROM, and while it seems to follow a similar sequence as the DS1307 for I2C communication, I'm having trouble identifying the specific memory locations where data should be stored. I want to understand the start and end addresses for data storage.

Can you help clarify this in the datasheet?
Start address = 0
Finish address = number of bytes minus 1 (which equals the number of bits divided by 8)
 

Thread Starter

MTech1

Joined Feb 15, 2023
181
Start address = 0
Finish address = number of bytes minus 1 (which equals the number of bits divided by 8)
There are three different clock speed modes for I2C:

1. Standard Mode (SM) - 100 kbps
2. Fast Mode (FM) - 400 kbps
3. High-Speed Mode (HS) - 3.4 Mbps

I'm uncertain about how to choose the best mode for our any requirements. In our case, we're considering interfacing the RTC DS1307 and EEPROM 24C02 with a microcontroller. I would go for maximum speed, but I'm interested about your preference for the clock speed.

What would be your choice of clock speed for this setup? What's the reason behind your selection?

Edit Note : I don't know why the thread was moved from the embedded forum to the homework forum. This isn't a homework assignment.
 
Last edited:

Ian0

Joined Aug 7, 2020
13,132
There are three different clock speed modes for I2C:

1. Standard Mode (SM) - 100 kbps
2. Fast Mode (FM) - 400 kbps
3. High-Speed Mode (HS) - 3.4 Mbps

I'm uncertain about how to choose the best mode for our any requirements. In our case, we're considering interfacing the RTC DS1307 and EEPROM 24C02 with a microcontroller. I would go for High-Speed Mode, but I'm interested about your preference for the clock speed.

What would be your choice of clock speed for this setup? What's the reason behind your selection?
See page 3 of the datasheet: "SCL frequency 100kHz max"

It is an open-collector bus structure, so it relies on the pullup resistor to provide the logic-high voltage.
The time constant of the pull-up resistor and the bus capacitance limits the maximum speed. f=1/(10τ) is a rule.
There is a lower-limit to the pull-up resistor value governed by the output current limit of the drivers.
With I2C it is best to run it as slowly as you can!

Newer ICs tend to be able to go faster, but the DS1307 is no spring chicken.

If you want an EEPROM that you can read quickly, don't choose I2C, use SPI.
 

Thread Starter

MTech1

Joined Feb 15, 2023
181
With I2C it is best to run it as slowly as you can!
I still don't understand. I'm trying to grasp why one option might be more suitable than the others. If Low-Speed is appropriate for a scenario, under what circumstances would you choose either Fast Mode or High-Speed Mode?

I'd like to better understand the considerations for selecting the speed mode.
 

Ian0

Joined Aug 7, 2020
13,132
I still don't understand. I'm trying to grasp why one option might be more suitable than the others. If Low-Speed is appropriate for a scenario, under what circumstances would you choose either Fast Mode or High-Speed Mode?

I'd like to better understand the considerations for selecting the speed mode.
If you want it to work - don't try run it faster than its maximum frequency!

I2C modes:
1. Standard Mode (SM) - 100 kbps
2. Fast Mode (FM) - 400 kbps
3. High-Speed Mode (HS) - 3.4 Mbps

page 3 of the DS1307 datasheet: "SCL frequency 100kHz max"

So what happens if you try to run it in Fast Mode at 400kHz? It doesn't work, because its maximum frequency is 100kHz!

If you have a device that will run in Fast Mode or High-Speed mode, it will say so in its datasheet.
Don't forget that higher frequencies will use more current.
 

Thread Starter

MTech1

Joined Feb 15, 2023
181
So what happens if you try to run it in Fast Mode at 400kHz? It doesn't work, because its maximum frequency is 100kHz!
I got your point. If the EEPROM supports a maximum of 400 KHz and the RTC supports a maximum of 100 KHz, it would be best to configure the I2C bus to operate at 100 KHz to ensure compatibility with both devices.
 

Ian0

Joined Aug 7, 2020
13,132
I got your point. If the EEPROM supports a maximum of 400 KHz and the RTC supports a maximum of 100 KHz, it would be best to configure the I2C bus to operate at 100 KHz to ensure compatibility with both devices.
Exactly, and because of clock-stretching, the slower device might just slow it down to 100kHz. Or maybe it might misread things and mess up the bus.
 

BobaMosfet

Joined Jul 1, 2009
2,211
I've looked the datasheets for the EEPROM, and while it seems to follow a similar sequence as the DS1307 for I2C communication, I'm having trouble identifying the specific memory locations where data should be stored. I want to understand the start and end addresses for data storage.

Can you help clarify this in the datasheet?
The reason you don't understand it, is because you don't understand the jargon (wording) used to describe working with memory. A key section in the document you provided, being this:

1698691667500.png

Bytes, Pages, etc.
 
Top