This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Problem in writing data to a register of my bmp388 sensor using I2C.

I am facing an issue in writing data to a register of my bmp388 sensor using I2C.

If I fill my transmit buffer of 2 bytes in following way , tx_buf[] = {register_address , value}, where both are of uint8_t data types then register address is taken properly but in case of value only half byte is transmitted. 

Can you please help me with my problem?

Thanks in advance.

Parents
  • Hello,

    register address is taken properly but in case of value only half byte is transmitted. 

    That sounds very strange. Do you have access to a logic analyzer, so we may see what is actually happening on the pins?
    Seeing a logic analyzer trace of the communication would be very helpful.

    If not; how have you verified that only half the value byte is being written to the slave?
    It is not really an option of the SPI protocol to send half a byte, so I do not see this happening without an error being returned.
    It would be helpful if you could share the code for this as well, so I may have a look.

    Looking forward to resolving this issue together!

    Best regards,
    Karl 

Reply
  • Hello,

    register address is taken properly but in case of value only half byte is transmitted. 

    That sounds very strange. Do you have access to a logic analyzer, so we may see what is actually happening on the pins?
    Seeing a logic analyzer trace of the communication would be very helpful.

    If not; how have you verified that only half the value byte is being written to the slave?
    It is not really an option of the SPI protocol to send half a byte, so I do not see this happening without an error being returned.
    It would be helpful if you could share the code for this as well, so I may have a look.

    Looking forward to resolving this issue together!

    Best regards,
    Karl 

Children
Related