Title: Issue with I2C (TWI) Communication on nRF52840 (SDK 16, Segger 8.2a)
Description:
I am working with the nRF52840 using nRF SDK 16 in Segger Embedded Studio 8.2a. As I am new to the SDK, I started with an I2C (TWI) scanner code to detect my sensor (HTU with address 0x40). However, I am facing an issue where no devices are detected.
Observations & Debugging Attempts:
Hardware Setup:
I am using P0.26 for SDA and P0.27 for SCL.
I have verified the connections, and the sensor is powered correctly.
Oscilloscope Observations:
When probing the SDA and SCL lines, both remain at 3.3V (high state).
There is no clock signal on the SCL line, meaning communication is not being initiated.
Software Modifications & Issues:
Initially, I encountered an error related to vprintf, which was resolved by removing the related file.
The program now compiles and flashes successfully, but no devices are detected during scanning.
Questions:
Why is the SCL line not toggling?
Do I need to configure any additional settings in sdk_config.h or modify my TWI initialization?
Are external pull-up resistors required on the SDA and SCL lines for proper operation?
Is there anything else I should check to establish proper I2C communication?
Any guidance on resolving this issue would be greatly appreciated.