This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

twi_scanner for nRF52840DK + nRF Connect SDK

Hello!

I have a nRF52840DK with a custom board. I have installed nRF 1.9.1. I have read about the twi_scanner but I don't find that code in my installation! Did I do anything wrong? How can I develop a twi_scanner for my nRF Connect environment?

Regards,

David.

Parents
  • Hi there!

    Moving forward, I have compiled a version that seems to work (initially). However, I get stuck:

    - I execute a successful nrfx_twim_xfer(&i2c_instance, &xdesc, 0)

    - My evt_handler doesn't get invoked

    nrfx_twim_is_busy(&i2c_instance) is always true

    So i cannot invoke nrfx_twim_xfer any more.

    As this is a twim_scanner it is very likely that the address I'm polling doesn't belong to any device (so nobody will never reply), so, my questions:

    1. If I poll an address with no device, will the library stay on busy forever?

    2. Is there a way to check for a timeout, clear the busy state and run more transfers?

    Regards,

    David.

  • Hi,

    Have you remembered to enable the interrupts by calling IRQ_DIRECT_CONNECT() and irq_enable() in your init routine?

    Something like this:

    	IRQ_DIRECT_CONNECT(SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQn, 0, nrfx_twim_0_irq_handler, 0);
    	irq_enable(SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQn);

    The callback handler won't be invoked if this hasn't been done already.

    regards

    Jared 

  • Hi Jared:

    No, I didn't know it. I will try later and come back here.

    Thank you,

    David.

Reply Children
No Data
Related