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:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#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,
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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?