Drop in Measured CSENSE Values During USB Enumeration

We have a device that is using the nrf_drv_csense module to measure a capacitive touch via the event_handler passed to nrf_drv_csense_init(). Unfortunately, due to various limitations and miscommunications, the signal we are detecting is somewhat small. I was able to create a solution that works for us, but I did notice a strange interaction between the USB and this csense module.

Namely, when the USB would reset, I would see a drop in the read values, which would eventually equalize back to their original values after the USB had fully enumerated.

This drop wasn't very large. Maybe 10-15 units. However, since the signal we were detecting was relatively small, this did require us to discard measure values during a USB re-enumeration.

At first, we thought this may be a hardware issue. Perhaps there was some crosstalk between the USB lines and the capacitive sensor. However, after investigating, this seemed unlikely. And I removed the capacitive touch plate from our board, isolated it as best I could, and still observed a distinct drop is measured values after a USB reset, even though I could not visually see any change to the signal from an oscilloscope.

Does anyone know of any potential cause for this behavior?

Thanks.

Parents Reply Children
  • Apologies for the late reply,

    Yes we are using a custom board. And yes, I can duplicate it to some extent on a development kit.

    SDK version 16.0.0 on an nrf52840.

    I did notice a slight mistake in my original phrasing. The values measured are slightly increasing after USB enumeration, not dropping.

  • Hi there,

    Are you using the comparator or the SAADC for the cap sense, and Is there any difference in variation if you switch? Could you share a minimal example that would reproduce it on a development kit?

    Also, note that the cap sense library was made to show use cases for the SAADC and the COMP peripherals. Although not clearly stated in the product specification, the capacitive sense library is not production ready since it hasn't been tested well. In many cases it would be better to use a dedicated capacitive sensor. 

    regards

    Jared

Related