Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NRF52810 initializing TWI (I2C)

Hello, I am having problems getting the TWI to work. The NRF52810 needs the TWI to communicate with a EEPROM module.

Thus far ive set:

#include "nrf_drv_twi.h"

#define PIN_SDA	 		25
#define PIN_SCL 		28

/* TWI instance ID. */
#if TWI0_ENABLED
#define TWI_INSTANCE_ID     0
#elif TWI1_ENABLED
#define TWI_INSTANCE_ID     1
#endif

static const nrf_drv_twi_t m_twi = NRF_DRV_TWI_INSTANCE(TWI_INSTANCE_ID);

void InitTWI()
{
	
	const nrf_drv_twi_config_t TWI_CONFIG	=	
	{																 
			.frequency          = NRF_DRV_TWI_FREQ_400K, 																 
			.scl                = PIN_SCL,                                               
			.sda                = PIN_SDA,                                               
			.interrupt_priority = APP_IRQ_PRIORITY_HIGH,                       
			.clear_bus_init     = false	
	};

	nrf_drv_twi_init(&m_twi, &TWI_CONFIG, NULL, NULL);
	nrf_drv_twi_enable(&m_twi);
}

Then I try to do the TWI Scanner example but I get no activity (with scope) on the SCL or SDA line. 

Is there something I forgot?

Parents Reply Children
No Data
Related