2021-07-22 07:45 PM
I followed this example that does i2c communication with TMP102 https://www.digikey.in/en/maker/projects/getting-started-with-stm32-i2c-example/ba8c2bfef2024654b5dd10012425fa23.
In the case of AD7147-1, the module can read up to 13 sensors and I'm trying to use the same with the STM32 Nucleo-F334R8 board. How to frame the bytes? In this case, it has multiple registers and I want to use all the possible sensor readings. This above figure shows multiple stages of CDC conversion and below is the I2C address
Below is the sequential register readback method is given by Analog devices.
I would appreciate any help in this regard.
A simple template to read the sensor data in a sequential manner shall help a lot.
-Prasanna
2021-07-23 05:15 AM
Should be able to find I2C examples for EEPROM and similar devices within the various BSP files for the F3
STM32Cube_FW_F3_V1.10.0\Drivers\BSP\STM32303C_EVAL\stm32303c_eval.c
Should be able to use 16-bit register size, Addr is the Slave, ie (0x54 << 1), and Reg base with the AD7147-1, it can read long runs of data
status = HAL_I2C_Mem_Read(&heval_I2c, Addr, (uint16_t)Reg, RegSize, pBuffer, Length, I2cxTimeout);
Pretty basic stuff by the looks of it. Review descriptions of functions in the HAL library. Grep the examples and BSP directories for "_I2C_" to find other usage
2021-07-28 05:17 PM
Hi Tesla,
Thanks for the answer.
I found the example code and while trying to implement the same for AD7147, I'm facing issues because I'm unable to get PAGE size and number.
#defineEEPROM_ADDRESS0 xA4 /* EEPROM M24M01-HR Address */
#defineEEPROM_PAGESIZE 128 /* EEPROM M24M01-HR used */