Skip to main content
O K
Associate
July 11, 2018
Solved

Two STM32L0 on I2C and a slave

  • July 11, 2018
  • 1 reply
  • 1263 views
Posted on July 11, 2018 at 11:53

My setup: STm32L053 nucleo and custum board with STm32L0. 

I am running a scan from nucleo borad for all possible I2C slave devices address in order to obtain the address of slave device ds1337.

Both boards are connected on the same line. However, I can not receive the address unless custom boards is being disconnected from SDA and SCL lines.

Using voltmeter I have noticed that:

While both boards are connected SCL and SDA are in logic high.

Custom board is not made by me, moreover I do not have access to it's code. The board is for production and I have to test it's DS1337 clock.

Is it possible to read/write slave in this situation? How?

Best regards,

Ovidijus

    This topic has been closed for replies.
    Best answer by AvaTar
    Posted on July 11, 2018 at 12:27

    I am running a scan from nucleo borad for all possible I2C slave devices address in order to obtain the address of slave device ds1337.

    The slave address is fixed to E0/E1 for the device, no need for a search. See page 13 of the datasheet.

    What the DS calls 'address' is the index (address) of the internal register you want to access. On I2C bus level, this is a data byte.

    Using voltmeter I have noticed that:

    While both boards are connected SCL and SDA are in logic high.

    It is supposed to be so in idle state. I2C has (and needs) pull-up resistors.

    1 reply

    AvaTar
    AvaTarBest answer
    Senior III
    July 11, 2018
    Posted on July 11, 2018 at 12:27

    I am running a scan from nucleo borad for all possible I2C slave devices address in order to obtain the address of slave device ds1337.

    The slave address is fixed to E0/E1 for the device, no need for a search. See page 13 of the datasheet.

    What the DS calls 'address' is the index (address) of the internal register you want to access. On I2C bus level, this is a data byte.

    Using voltmeter I have noticed that:

    While both boards are connected SCL and SDA are in logic high.

    It is supposed to be so in idle state. I2C has (and needs) pull-up resistors.

    O K
    O KAuthor
    Associate
    July 11, 2018
    Posted on July 11, 2018 at 16:02

    Thank you for clarifying me. To make sure, I want to ask. Is it possibile to control DS1337 device despite the second MCU hanging on I2C?

    I2C Lines ar pulled-up by the way.

    AvaTar
    Senior III
    July 12, 2018
    Posted on July 12, 2018 at 07:56

    Is it possibile to control DS1337 device despite the second MCU hanging on I2C?

    Of course, as long as the addresses are not conflicting.

    In the most common 7-bit mode, the I2C bus uses the LSB for read/write distinction, and the addresses 0x00/0x01 and 0xFE/0xFF are reserved.

    This leaves room for 126 slave devices.