cancel
Showing results for 
Search instead for 
Did you mean: 

Two STM32L0 on I2C and a slave

O K
Associate II
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

1 ACCEPTED SOLUTION

Accepted Solutions
AvaTar
Lead
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.

View solution in original post

4 REPLIES 4
AvaTar
Lead
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
Associate II
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.

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.

O K
Associate II
Posted on July 12, 2018 at 23:27

Thank you. I have tried to send and read to the address from datasheet instead of searching. It did worked out.