CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Conflict between 24C04 and PCF8563 on i2c bus

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
diegonet



Joined: 13 Sep 2005
Posts: 4

View user's profile Send private message

Conflict between 24C04 and PCF8563 on i2c bus
PostPosted: Wed Oct 05, 2005 11:29 pm     Reply with quote

People:

I don't know why, but I can't put this two devices together over the i2c bus, they interfere between.

If you look the address of each one, you get:
PCF8563: write address: 0xA2
read address: 0xA3

24C04: M24C04 Select Code: 1 0 1 0 E2 E1 A8 RW
The first four bit's are the same, but I connect E2 and E1 to "1",
so the address are different.
I also look at the CCS driver file for this memory's, that say's to
left unconnected the enable pin's...this so add more confusion to my confusion!!!

Anyone has an idea?
Thank's!

Code:

Library for a MicroChip 24LC04B                                 ////
////                                                                   ////
////   init_ext_eeprom();    Call before the other functions are used  ////
////                                                                   ////
////   write_ext_eeprom(a, d);  Write the byte d to the address a      ////
////                                                                   ////
////   d = read_ext_eeprom(a);  Read the byte d from the address a     ////
////                                                                   ////
////   b = ext_eeprom_ready();  Returns TRUE if the eeprom is ready    ////
////                            to receive opcodes                     ////
////                                                                   ////
////   The main program may define EEPROM_SDA                          ////
////   and EEPROM_SCL to override the defaults below.                  ////
////                                                                   ////
////                            Pin Layout                             ////
////   -----------------------------------------------------------     ////
////   |                                                         |     ////
////   | 1: NC   Not Connected | 8: VCC   +5V                    |     ////
////   |                       |                                 |     ////
////   | 2: NC   Not Connected | 7: WP    GND                    |     ////
////   |                       |                                 |     ////
////   | 3: NC   Not Connected | 6: SCL   EEPROM_SCL and Pull-Up |     ////
////   |                       |                                 |     ////
////   | 4: VSS  GND           | 5: SDA   EEPROM_SDA and Pull-Up |     ////
////   ----------------------------------------------------------- 

PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Oct 06, 2005 1:10 am     Reply with quote

Quote:
M24C04 Select Code: 1 0 1 0 E2 E1 A8 RW

Are you really using the M24C02 from ST ? Not all 24C02 chips
are the same. Different manufacturers provide different features.
What are the markings on the chip ?

Quote:
I also look at the CCS driver file for this memory's, that say's to
left unconnected the enable pin's.

The 24LC02B from Microchip does not use pins 1, 2, and 3. They
are "no connects".


Quote:
The first four bit's are the same, but I connect E2 and E1 to "1",
so the address are different.

So this means you connected pins 2 and 3 to +5v. Can you check
your board to make sure the connections really exist ?
diegonet



Joined: 13 Sep 2005
Posts: 4

View user's profile Send private message

Memory is from Microchip...
PostPosted: Thu Oct 06, 2005 8:05 am     Reply with quote

Hi.
The memory is a 24LC04B. from microchip.

In his data sheet, is stated:
The control byte
consists of a four bit control code, for the 24XX04 this
is set as 1010 binary for read and write operations.
The next three bits of the control byte are the block
select bits (B2, B1, B0). B2 and B1 are ‘don’t care’s’ for
the 24XX04
.


And:
Operation Control
Code Block Select R/W
Read 1010 Block Address 1
Write 1010 Block Address 0

So, i can guest that B0, as something to do in setting the address...but:
(page 11)

A0, A1, A2
These pins are not used by the 24XX04. They may be
left floating or tied to either VSS or VCC.


Thank's for any help!!!
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Thu Oct 06, 2005 8:25 am     Reply with quote

It appears that the 24LC04B has only one address and cannot be configured to respond to a different one. The part has two 256 word blocks where data can be stored. B0, in the command byte, simply tells it which one you want to look at. Leave A0, A1 and A2 unconnected since there are no internal connections. WP needs to be pulled low in order to Write any data to memory. Some people like to control this pin to keep accidental Write's to memory from happening.

Hope this helps a bit.

Ronald

You know you're a parent when you realize you're brushing your teeth with your child's acne [spam]. Shocked
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

Re: Memory is from Microchip...
PostPosted: Thu Oct 06, 2005 8:58 am     Reply with quote

diegonet wrote:
Hi.
The memory is a 24LC04B. from microchip.

In his data sheet, is stated:
The control byte
consists of a four bit control code, for the 24XX04 this
is set as 1010 binary for read and write operations.
The next three bits of the control byte are the block
select bits (B2, B1, B0). B2 and B1 are ‘don’t care’s’ for
the 24XX04
.


And:
Operation Control
Code Block Select R/W
Read 1010 Block Address 1
Write 1010 Block Address 0

So, i can guest that B0, as something to do in setting the address...but:
(page 11)

A0, A1, A2
These pins are not used by the 24XX04. They may be
left floating or tied to either VSS or VCC.


Thank's for any help!!!


B0, B1, B2 do not relate to A0, A1, A2 for this device. The A's are usually address lines. This device is not addressable. It only has 2 - 256 byte blocks and thus B1 & B2 are not used. Therefore the device's address is
1010000 = 0xA0 &
1010010 = 0xA2


See your problem yet?
An easy solution would be to use an AT24C04 which has address lines. You can tie one or both of the address lines high so as to not interfere with the other device.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group