This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

TWI SDA SCL held low during reset when using TWIS

Hi to community!

I have a trouble with nRF52840 when using TWIS. I initialize the peripheral by below code. If the device is reset using default pin 18 by the external controller, SDA and SCL pins are held low, so the communication with other sensors on bus is broken. Is there a way for the mentioned signals to be in Hi-Z during reset? 

nrf_gpio_cfg(26U, NRF_GPIO_PIN_DIR_INPUT, NRF_GPIO_PIN_INPUT_CONNECT, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_S0D1, NRF_GPIO_PIN_NOSENSE);
nrf_gpio_cfg(27U, NRF_GPIO_PIN_DIR_INPUT, NRF_GPIO_PIN_INPUT_CONNECT, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_S0D1, NRF_GPIO_PIN_NOSENSE);
const nrf_drv_twis_config_t config =
{
.addr = {0x0BU, 0U},
.scl = 27U,
.sda = 26U,
.scl_pull = NRF_GPIO_PIN_PULLUP,
.sda_pull = NRF_GPIO_PIN_PULLUP,
.interrupt_priority = APP_IRQ_PRIORITY_HIGH
};
nrf_drv_twis_init(&f_i2c, &config, i2c_event_handler);

It behaves in same way if the first two lines (nrf_gpio_cfg) are omitted.

Thank in advance for any help with this problem.

Parents Reply
  • If the nRF knew about need to reset ahead, there wouldn't be need to issue reset via GPIO pin but will use some sort of SW reset instead. It seem similar to problem described here with UART. The difference here is that UART TX pin is output (push-pull or open-drain), but TWIS SCL and SDA pins should be inputs at least between transactions but during reset the change to outputs. I've never seen such behavior during my carreer before.

Children
Related