Hi,I am writing a 16bit register 0x3f of i2c device connected at 0x09. After write, if I read the value of 0x3f register it is always '0'. I2C communication is working fine on device.Below is a code.#include "main.h"
#define I2C_ADDRESS 0x09<<...
Hi,I am using STM32L031K6 MCU and SW4STM32 IDE for development. I want to read/write specific register value of i2c slave device from MCU(i2c master)Below is a code I am using.#include "main.h"
#define I2C_ADDRESS 0x3c
#define MASTER_BOARD
#...
Able to get it working using below functions.HAL_I2C_Mem_Write_DMA(&I2cHandle, (uint16_t)I2C_ADDRESS, memAddress, 1, (uint8_t*)(®ister_value),2)HAL_I2C_Mem_Read_DMA(&I2cHandle, (uint16_t)I2C_ADDRESS, memAddress, 1, (uint16_t *)aRxBuffer, 2)and wri...
Slave device is having single memory address for each 2byte register. I am working with BD99954GW charging IC.More details of slave is available at https://www.rohm.com/datasheet/BD99954GW/bd99954xxx-e
Resolved the issue. Actually it was a problem with I2C slave device. It is not allowing me to read the register value. Writing register is working fine using HAL_I2C_Mem_Write_DMA.Thank you for all your help.
Hi,I am trying HAL_I2C_Mem_Read_DMA sample code as mentioned below. HAL_I2C_GetError is returns some value other then HAL_I2C_ERROR_AF (Line no 148)#include "main.h"
#define MASTER_BOARD
#define I2C_ADDRESS 0x78
#define I2C_TIMING 0x00B...