2020-06-12 06:03 AM
Hello,
i want to communicate with an AD7998, to convert 8 analog to digital channels. The communication i use is I2C. I am using the HAL library.
According to the adc manual i need a repeated start, after writing to the address pointer byte. So i had tried to use HAL_I2C_Mem_Read, but that isn't working.
Are there other functions in the i2c HAL library to implement a repeated start?
Thanks.
Solved! Go to Solution.
2020-06-12 11:14 AM
Yes, HAL_I2C_Mem_Read does a repeated start. If it doesn't work, check parameters. Use a logic analyzer.
-- pa
2020-06-12 11:14 AM
Yes, HAL_I2C_Mem_Read does a repeated start. If it doesn't work, check parameters. Use a logic analyzer.
-- pa
2020-06-12 09:19 PM
So, your approach is, if something doesn't work, then:
And, as you can see, that careless approach doesn't work... Instead there are two other approaches that actually work - either you carefully check everything or take an oscilloscope or logic analyzer and debug it.
2020-06-12 11:57 PM
Hi,
thanks for your reply. It works now. My ADC just didn't transfer the register values correctly. I disconnected it from the supply for a while, now it works as it should.
@ Pavel A. Good to know that, thank you.