Skip to main content
jonathannakache9
Associate
July 6, 2012
Question

Conflict with two EEPROM

  • July 6, 2012
  • 27 replies
  • 3837 views
Posted on July 06, 2012 at 10:02

Hi,

With a STM32, I have a problem

to select

either

EEPROM

(

M24LR64-R and M24M02-DR)

on the same bus

I2C

.

Here are the

''device

select

code

'':

For

M24LR64

-R:  1 0 1 0     X 1  1 X

In the order

:  1 0 1 0 = Device type identifier   X = E2   1 1 = E1 E0 ( chip enable)   X = RW

For

M24M02

-DR:

1 0 1

0   1

X

X

X

In the order

: 1 0 1 0 = Device type identifier   1 = E2 ( chip enable)   X X = A17 A16 (MSB address bits )    X = RW

The two

address bits

A17

and

A16

for

M24M02

-DR

can not be

used

because they would

pose

a conflict with the

R

-

M24LR64

there is

there a way

around the problem

?

Thank you for your

response

,

#pounds-head-on-desk
    This topic has been closed for replies.

    27 replies

    jonathannakache9
    Associate
    July 10, 2012
    Posted on July 10, 2012 at 17:24

    in fact

    ,

    my problem

    is not from

    here

    :

    even by disconnecting

    the EEPROM

      M24LR64 , I

    still can

    '

    t access the

    address

    bit

    A17 on the M24M02

    however A16

    is ok...

    emalund
    Associate III
    July 10, 2012
    Posted on July 10, 2012 at 19:26

    in fact

    ,

    my problem

    is not from

    here

    :

    even by disconnecting

    the EEPROM

      M24LR64 , I

    still can

    '

    t access the

    address

    bit

    A17 on the M24M02

    has a look at the datasheet, now I totally I do not understand

    8192 bytes in I

    2

    C mode

    what does A17 have to do with 8k bytes?

    also there are 2 strappable address pins, why the address conflict?

    Erik

    John F.
    Associate III
    July 11, 2012
    Posted on July 11, 2012 at 10:30

    M24M02 Memory array : 2 Mb (

    256 KBytes

    ) of EEPROM

    2^18 = 262144 Address lines 0..17 required.

    John F.
    Associate III
    July 11, 2012
    Posted on July 11, 2012 at 10:30

    M24M02 Memory array : 2 Mb (

    256 KBytes

    ) of EEPROM

    2^18 = 262144 Address lines 0..17 required.

    jonathannakache9
    Associate
    July 11, 2012
    Posted on July 11, 2012 at 14:21

    So

    my problem

    is I can

    use bit

    A16

    but

    i can't use

    the bit

    A17:

    i use the STM32 library and after the send:

    I2C_Send7bitAddress(I2C1, device_select , I2C_Direction_Transmitter);

    the program gets stuck on:

    I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED));

    only

    with the address bit

    A17

    =

    1

    John F.
    Associate III
    July 11, 2012
    Posted on July 11, 2012 at 14:54

    Your problem does not make sense. Are you sure you are addressing an M24M02 device? The A17 bit is simply part of the intrinsic operation of the device. (Also note it is not recommended to drive the hardware input pin E2 dynamically - is it hardwired high or low?)

    jonathannakache9
    Associate
    July 11, 2012
    Posted on July 11, 2012 at 15:28

    E2 is hardwired high

    but A17 bit and A16 bit are selected in the device_selected... when i do:

    I2C_Send7bitAddress(I2C1, device_select , I2C_Direction_Transmitter);

    when device select is set: 1010 1000 and 1010 1010 are ok

     but 1010 1100 or 1010 1110 aren't ok...

    emalund
    Associate III
    July 11, 2012
    Posted on July 11, 2012 at 15:44

    but A17 bit and A16 bit are selected in the device_selected

     

    so you have 4 devices on the bus? if not the above makes no sense

    Erik
    jonathannakache9
    Associate
    July 11, 2012
    Posted on July 11, 2012 at 16:22

    I have

    just

    two

    EEPROM...

     

    A17

    and

    A16

    are

    sent

    during 

    the

    device

    _select code

    but

    are used to

    select

    a

    memory location

    in EEPROM

    because

    the M24M02 EEPROM

    may contain

    2M bit

    John F.
    Associate III
    July 11, 2012
    Posted on July 11, 2012 at 16:49

    Your test device select codes have bit 0 low which is a write. The data sheet suggests,

    In I2C products, the device does not respond (NoAck) when a programming operation is in

    progress. Data polling thus consists in sending a Device Code in a loop mode and tracking

    the EEPROM acknowledgement. It is recommended to poll the device with a Write

    instruction.

    I'm not sure that helps! I still recommend writing your own bit bashed I2C - the ST implementation is very awkward and unforgiving.