• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Connecting multiple I2C Eeproms to PIC

Status
Not open for further replies.

richacm

New Member
Hi,

I am have a few problems using multiple external eeproms with my PIC18F4620. I thought I would first check to make sure I have the hardware correct.

When I connected 1 Eeprom, with I2C, everything worked fine. I set the address of it to be 0 (tied the address bits to GND) and then put pullups on the SCL and SDA lines and it worked fine. I then added a total of 5 Eeproms and made the address bits 0 through 4. I just daisy chained the wires from the first SCL/SDA through the rest of the EEproms with no extra pullups - this is correct isn't it? Now when I go to read from the different EEproms the PIC hangs and the WDT kicks in. Does anyone have a circuit for connecting multiple I2C components on to 1 PIC? Or am I doing it right?

Thanks,

Craig
 

Pommie

Well-Known Member
Most Helpful Member
The way you are connecting them is correct. You don't state which EEPROM you are using, if it is the 1Meg ones then this maybe your problem as you can only have 4 of these on the same bus. Address line A2 has to be held high for it to work. If you require 8 chips then A2 can be used as a chip select to bank in 4 at a time. I assume that your pullups are the correct value - 10k for 100kHz and 2k for 400kHz.

Mike.
 

richacm

New Member
Thanks, I am using the 24FC64 with a 1K pullup since it runs at 1Mhz (is that correct?).
 
Last edited:

Pommie

Well-Known Member
Most Helpful Member
I only have the 24FC1025 datasheet handy and that states 2k for 400kHz and 1MHz.

Another thought, if the problem is intermittent it could be due to being in development. If you happen to stop the pic during a transfer the bus can hang. This happens very easily is you are constantly compiling as this stops the processor in a random position. You can check for this problem at the start of your code, at startup both SCL and SDA should be high. If you find SDA is low then manually clock SCL until SDA goes high.

Mike.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top