pca10059 device won't pair with TWIM enabled, except in debug mode

I've based my code upon the HIDS keyboard example and added code to support an attached polled sensor with I2C interface. The device will pair with the Android phone just fine when using the debugger through a JTAG mini, but I need to disable the TWIM interface if I want the device to pair outside the debugger. Do I need to change priority settings somehow?

Parents
  • The primary problem was an issue with the I2C hardware, deceptive because this interface is so "simple". Turns out the sensor manufacturer used a strong pullup for the I2C lines and probably because the sensor was also being powered from the NRF supply from the dongle, the sensor could not pull the open-collector lines down quite low enough to satisfy Vil of the nRF52840. This was wreaking havoc on all sorts of things, including pairing. The connection to the J-Link was somehow ameliorating this, perhaps by providing another ground path to sink the current. I altered the supply source for the pullups from Vdd_nrf to an arbitrary GPIO pin configured as a high-drive output high, and disabling the UICR dongle fix by completely erasing the flash (clearing the UICR) and setting the board type to PCA10056. Now with the pullups going only to a 1.8V rail instead of a 3V rail the sensor could now satisfy the Vil and things started making sense in the world again. There were a number of other complicating factors, such as my driver for the sensor itself wasn't quite right, uninitialized pointers and a couple of other things that made it difficult to see the trees from the forest. In any case it's working now, and I'm on to the next task.

Reply
  • The primary problem was an issue with the I2C hardware, deceptive because this interface is so "simple". Turns out the sensor manufacturer used a strong pullup for the I2C lines and probably because the sensor was also being powered from the NRF supply from the dongle, the sensor could not pull the open-collector lines down quite low enough to satisfy Vil of the nRF52840. This was wreaking havoc on all sorts of things, including pairing. The connection to the J-Link was somehow ameliorating this, perhaps by providing another ground path to sink the current. I altered the supply source for the pullups from Vdd_nrf to an arbitrary GPIO pin configured as a high-drive output high, and disabling the UICR dongle fix by completely erasing the flash (clearing the UICR) and setting the board type to PCA10056. Now with the pullups going only to a 1.8V rail instead of a 3V rail the sensor could now satisfy the Vil and things started making sense in the world again. There were a number of other complicating factors, such as my driver for the sensor itself wasn't quite right, uninitialized pointers and a couple of other things that made it difficult to see the trees from the forest. In any case it's working now, and I'm on to the next task.

Children
No Data
Related