Skip to main content
ASING.91
Associate III
January 22, 2019
Question

Do you have I2C device scanner program (like the one in arduino, esp32 etc) for STM32L053R8T6 ?

  • January 22, 2019
  • 2 replies
  • 767 views

..

This topic has been closed for replies.

2 replies

Pavel A.
January 23, 2019

For scanning you can use the HAL library function HAL_I2C_IsDeviceReady.

This function sends start, then the specified device address and checks for ACK. Then it sends stop.

The device address for it can have the read bit (LSB) set or clear, in case the device you scan for reacts to read and write accesses differently.

-- pa

AvaTar
Senior III
January 23, 2019

> This function sends start, then the specified device address and checks for ACK. Then it sends stop.

Or so, without Cube.

I'm not aware of any such scanner program for STM32, but it's straightforward to code.

Just address every non-broadcast I2C address, and check for an ACK.