0

I have a MCU (nucleo64 L476RG), connected with I2C, and I2C is connected with DS2482-100 (Single-Channel 1-Wire Master), then to a DS28EC20 (20Kb 1-Wire EEPROM). I create project from stm32cubeMX and try to receive data from DS28EC20, there are two functions:

  1. Receive in master mode an amount of data in blocking mode using @ref HAL_I2C_Master_Receive()
  2. Read an amount of data in blocking mode from a specific memory address using @ref HAL_I2C_Mem_Read()

which one I should use? somebody mentions: "HAL_I2C_Master_Receive() used to communicate with those devices that do not have secondary address" so in my situation, does my I2C have a secondary address for DS28EC20?

Dave Tweed
  • 168,369
  • 17
  • 228
  • 393
adam
  • 49
  • 6

1 Answers1

2

As the protocol for DS2482-100 seems not to be register or memory address based but writing commands and reading data, I would not use the Mem functions. What you need to do is to command the DS2482-100 chip ovef I2C to do 1-Wire memory access, which sounds overly complicated as STM32 would be able to talk 1-Wire directly.

Justme
  • 127,425
  • 3
  • 97
  • 261