Mixing fast & slow i2c devices on one bus - what happens ?

Buzby

Senior Member
Hi All,

I want to add a DS1307 to a circuit that already uses 24LCxxx running at 'fast', and it needs to be, so I can't drop to 'slow' permanently.

( The choice of DS1307 is because I've got some, so no need to buy a DS1338. )

Two ideas :

1 - Stick it on the bus and hope it works. Has anybody tried this ?. What does happen ?

2 - Power the Vcc pin of the DS1307 from a PICAXE output, and only powerup when I need to do clock work. Will the 24LCxxx have problems ?


Any suggestions ?

Cheers,

Buzby
 

hippy

Ex-Staff (retired)
2 - Power the Vcc pin of the DS1307 from a PICAXE output, and only powerup when I need to do clock work. Will the 24LCxxx have problems ?
The powered down DS1307 may affect the bus, but also the bus voltages may exceed the DS1307 maximum electrical specifications.

You'd have to read the data sheet to find what that says and if prepared to risk it then trying it is the only way to assess if it seems to work.
 

Buzby

Senior Member
Hi hippy,

The powered down DS1307 may affect the bus
Hmm ?. I hadn't thought a great deal about that.

Using a PICAXE output to power Vcc will effectively connect Vcc to Gnd when the output is Low, because the outputs are source/sink.

A closer read of the Maxim datasheet finds that the SDA/SCL pins are open drain, and 'The (SDA/SCL) pullup voltage can be up to 5.5V regardless of the voltage on VCC'.

So it looks like the bus will be OK, and will not be affected by the powered-down DS1307.

The 24LCxxx will still recognise the 'slow' comms intended for the DS1307, but as the address will be different it should ignore them.

( From reading other I2C literature it seems the problem is when 'slow' devices get confused by 'fast' buses, not the other way round. )

When I next get 'on the beach' I'll try it.

Cheers,

Buzby
 

papaof2

Senior Member
There's an I2C "bus isolator" chip that allows you to drive multiple I2C device chains. You enable the bus you want to use and disable the other.

Sorry, I don't remember the part designation.

John
 

Buzby

Senior Member
Hi papaof2,

A cool idea, but if I need to buy another chip I'll just buy the DS1338, which is a 'fast' version of the DS1307 !.

Cheers,

Buzby
 

inglewoodpete

Senior Member
I want to add a DS1307 to a circuit that already uses 24LCxxx running at 'fast', and it needs to be, so I can't drop to 'slow' permanently.
Did you resolve this? "i2cSlow" is still 100kbits/s which is still pretty snappy. Is there really a need or is it just a desire to run i2cFast?

(On dry land, about 32S 116E and a long walk!)
 

Buzby

Senior Member
Hi,

I want to add a DS1307 to a circuit that already uses 24LCxxx running at 'fast', and it needs to be,
I've not tried it at 'slow' yet.

My code spends a fair amount of it's time getting numbers from the EEPROM, and it's fundamental to the operation, so I started with 'fast'.

When I get a chance I'll try 'slow'. If it doesn't cause a problem then I'll just put the DS1307 straight on the bus.

It's a 40X2 running at 64MHz, reading two bytes per access from the EEPROM using code like hi2cin epromaddr, ( b51, b52 )

If anyone has a setup like this it would be easy to determine the execution time for reads at each speed.

It's going to be eleven days, weather permitting, before I can try it myself !.

Cheers,

Buzby
 

g6ejd

Senior Member
As all the devices are on the same bus and individually addressed, isn't it up to the programmer to vary the access command between slow and fast depending on the device being worked-on! Am I missing something here?
 

nick12ab

Senior Member
As all the devices are on the same bus and individually addressed, isn't it up to the programmer to vary the access command between slow and fast depending on the device being worked-on! Am I missing something here?
The individual address is exactly why! If the data is too fast and one device misses a bit or otherwise reads the address wrong because of the speed it could think that some data was for it when it wasn't and when the device tries to send data back at the same time as the intended recipient there'll be a clash.

I think this might have been explained in the PICAXE Manual.
 

g6ejd

Senior Member
Well, I'm using the 1307 and a 24LC512 on the same bus, when I write or read to the 1307 I use the slow command and when accessing the 24LC512 I use the fast command. I don't use one common command (e.g. fast) for reading and writing, I'm device specific. I'm struggling to see what the issue is as there is no bus interaction - see later response from Buzby.

If you look at the PICAXE Datalogger axe110 (I think) circuit, your will see an example of the two devices on the same bus (i.e. a mix of slow and fast). The power consumption of the RTC is so low as to be negilible, so no need to power it down IMO.

All the devices are synchronous BTW, no asynchronous operation in their designs.
 

nick12ab

Senior Member
Im my experience, i2c devices can be overclocked and still work to some extent, including the DS1307, but there's no guarantee that all DS1307s can work properly at i2cfast.
 

g6ejd

Senior Member
The DS1307 is a 100KHz (max) part, so has to be used with the slow command.
The 24LXX parts have no minimum (stated) speed, but a maximum speed of 400KHz, so can use either slow or fast commands.
As the devices are synchronous, they could be clocked at really slow speeds, perhaps a couple of weeks between each clock cycle and they would still work (that's what the data sheet says no-maximum clock duration time)
 

Buzby

Senior Member
The 24LXX parts have no minimum (stated) speed,
Correct, but they do have a timeout, ( 25 mS if I remember ), which limits the minimum speed they can run at.
 

g6ejd

Senior Member
Well, I just checked the microchip data sheets for the 24LC64 and 24LC512 devices and neither show any time- outs and both are shown as synchronous to the clock with no minimum clock frequency and no maximum high or low times for any of the inputs as expected. They are static devices running from DC To 400Khz.
 

hippy

Ex-Staff (retired)
Well, I'm using the 1307 and a 24LC512 on the same bus, when I write or read to the 1307 I use the slow command and when accessing the 24LC512 I use the fast command. ... I'm struggling to see what the issue is as there is no bus interaction
The problem is that as the DS1307 cannot keep up with the fast bus it doesn't see exactly what is on the bus but some 'random noise'.

Normally you will be okay because the 'random noise' won't activate the DS1307 but there is a possibility that the 'random noise' does match what the DS1307 expects causing it to activate. If it's active at the same time as you are accessing something else the DS1307 may then corrupt the bus causing data to or from the device to be wrong.
 
Top