Hello!
I'm a beginner and I'm trying to implement a simple I2C communication with a DAC AD5675R using a STM32h723zg Nucleo board, I want to first
make the first channel of the DAC output a voltage (say 2V). I have connected +VOUT of DC-DC converter TMR 3-1221E to VDD and VLOGIC of AD5675R,
and connected GAIN to VLOGIC for maximum 5V output.
After setting up the I2C with the CUBEMX, I connected the board's SDA and SCL and GND to the corresponding pins of the AD5675R.
Which function should I use? There are HAL_I2C_Master_Transmit(I2C_HandleTypeDef * hi2c, uint16_t DevAddress, uint8_t* pData,
uint16_t Size, uint32_t Timeout) and HAL_I2C_Mem_Write(I2C_HandleTypeDef * hi2c, uint16_t DevAddress, uint 16_t MemAddress, uint16_t Mem AddSize, uint8_t * pData, uint16_t size, uint32_t timeout)
According to the A0, A1 pin settings, the slave address of this dac should be 0001100, which is 0xC, right?
But I can't detect any reaction from the dac using the HAL_I2C_Master_Transmit function. When I use a logic analyzer to observe the i2c,
only 0x18+NAK appears at the beginning, and there is no waveform after that.
If I use HAL_I2C_Mem_Write function, I am very confused about setting function parameters, I don't know what order slave addr, register addr,
command, data should follow when setting parameters.
Can anyone tell me which function I should use if I want to achieve this simple function, and give a simple and complete example?
I would be very grateful if you could answer me!
我是初学者,我正在尝试使用 STM32h723zg Nucleo 板与 DAC AD5675R 实现简单的 I2C 通信,我想首先让 DAC 的第一个通道输出一个电压(比如 2V)。我已将 DC-DC 转换器 TMR 3-1221E 的 +VOUT 连接到 AD5675R 的 VDD 和 VLOGIC,并将 GAIN 连接到 VLOGIC 以实现最大 5V 输出。
使用 CUBEMX 设置 I2C 后,我将电路板的 SDA 和 SCL 以及 GND 连接到 AD5675R 的相应引脚。
Edit Notes
Translated[edited by: GenevaCooper at 12:25 AM (GMT -4) on 24 May 2023]