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

Not able to scan TWI sensors when pins are changed

Hello,

I am using nRF52832, SDK_15.3.0, S132 SoftDevice and Segger for flashing the image.

I am using "twi_scanner" example code on Development kit. I connected HDC2010 sensor and I got 0x40 as address.

Since "Production specification" says any GPIO can be used, I just changed settings as below so that SCL is on P0.21 and SDA is on P0.22.

#define ARDUINO_SCL_PIN 21//27 // SCL signal pin
#define ARDUINO_SDA_PIN 22//26 // SDA signal pin

With this changes, never code executes and hangs in nrf_twim_event_check(). Any reason behind this ? Do I need to configure any other settings ?

Thanks & Regards

Vishnu Beema

Parents
  • Hi Vishnu

    The RESET pin of the chip is multiplexed with P0.21, and if you enable pin reset in the project you can not use P0.21 as a GPIO. 

    By default the twi_scanner example (and many others) enable pin reset by default, so I would either try to disable this by removing the CONFIG_GPIO_AS_PINRESET define from your project settings, or try to move the SCL signal to a different pin. 

    Best regards
    Torbjørn

  • Hi,

    I am fine with any other fine. Just trying to understand the concept. I am using nRF2832 development kit. As per DK specifications, P0.26 & P0.27 are used along with I/O expander signal. I thought SCL and SDA are used directly with gpio pins.

    So to my understanding I can use only P0.26 & P0.27 with nRF2832 development kit, but with my board I can design any GPIO pin. Please correct me if I am wrong.

    Thanks & Regards

    Vishnu Beema

  •  I thought SCL and SDA are used directly with gpio pins

    Not quite sure what you mean by that?

    I can use only P0.26 & P0.27 with nRF2832 development kit

    No, that's not true - you can use other pins provided there isn't stuff on the DK that's going to interfere with it.

    Again, look at the schematics to check.

    In most cases, the stuff on the DK can be disconnected by "breaking" the solder bridges.

    with my board I can design any GPIO pin

    Correct - subject to any limitations imposed by the chip itself. 

Reply Children
No Data
Related