Skip to main content
ABoya.14
Associate III
December 14, 2018
Question

while using I2C, there's any problem if one of the register has the same address than the device ?

  • December 14, 2018
  • 4 replies
  • 1020 views

Hello !

i'm using I2C communication between a Nucleo-STM32F401RE board and a camera in which there a PIC16F1847 MCU. the application is about to write three bytes in a register in order to make a focus adjustment

the thing is, the device address is 0x30 and the register address goes from 0x2F to 0x31.

unfortunately nothing is working but there's no any error like ACK failure ou something like this.

Note that the same software is used to write 2 bytes in another register which address goes from 0x00 to 0x01 and for this case everything work normally.

Do you think the problem for the first case stems from the address ?

thank you for your help.

PS1: You will find the code as an attachment.

PS2: I'm using HAL library.

This topic has been closed for replies.

4 replies

After Forever
Senior III
December 14, 2018

Are you sure you must send just 3 bytes (beside the register byte)? Your comment mentions that you are writing a float value, floats are 4 bytes-long. Maybe the device expectes 5 bytes (1 byte register + 4 bytes float)?

To answer your question, no I2C addresses don't collide with the virtual register addresses.

ABoya.14
ABoya.14Author
Associate III
December 14, 2018

thank for your answer.

i converted the float into char bytes then i'm only sending the most significant three bytes.

ABoya.14
ABoya.14Author
Associate III
December 14, 2018

thank for your answer.

i converted the float into char bytes then i'm only sending the most significant three bytes.