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

LPComp events triggers by other inputs

Hi

I am currently doing a project based on the nRF52840 MCU and evaluation board

as part of my project, I have used the LPComp module, and set it up to trigger on rising voltage

#define LPCOMP_REF				NRF_LPCOMP_REF_EXT_REF0			//AIN0
#define AUD_DET					NRF_LPCOMP_INPUT_1				//AIN1

    nrf_drv_lpcomp_config_t config = NRF_DRV_LPCOMP_DEFAULT_CONFIG;
	nrf_lpcomp_config_t		hal_config;

	hal_config.reference	= LPCOMP_REF;
	hal_config.detection	= NRF_LPCOMP_DETECT_UP;
	hal_config.hyst			= NRF_LPCOMP_HYST_NOHYST;

	config.hal		= hal_config;
	config.input	= AUD_DET;

	// initialize LPCOMP driver, from this point LPCOMP will be active and provided
	// event handler will be executed when defined action is detected
	errorCode = nrf_drv_lpcomp_init(&config, lpcomp_event_handler);
	APP_ERROR_CHECK(errorCode);

	nrf_drv_lpcomp_enable();

I have done so by following the LPComp example of the 15.3 SDK, which my project uses

I have tested the module and it seems to work

however, I am also recording LPComp events triggering when other modules are used (for example, when using LEDs or other GPIOs)

I have tried connecting both references together, grounding both, yet I still get LPComp events

I have also tested on two evaluation boards, so I know that the one I normally use isn't just faulty (unless both are faulty somehow)

Is there any reason for this behavior? anything I could test to try and figure out the cause?

if there is any more information I can provide to help with solving this, please let me know and I'll do my best to provide it

thanks in advance

Parents
  • You might consider ground bounce or Vdd dip; should the LPCOMP input level be near to the switching threshold, such bounce or dip occurring as a result of a change in applied load to Gnd and Vcc - such as turning an LED on or off - can push the sampled pin (actually maybe not the pin but internal circuit) to the threshold unexpectedly. A simple test is to run the same code and disconnect in turn anything that changes the current, typically the LEDs. If that changes the issue, then solutions involve signal routing, eg supply the LED from the battery but isolate the nRF via a schottcky or ideal diode with a local capacitor, or synchronously suppress the LPCOMP during LED transitions. Posting the circuit would allow more suggestions.

  • thanks for the suggestion

    currently the project is working on the nRF52840 evaluation board, so the circuit should be that of the evaluation board

    if the issue is indeed caused by sudden changes to the ICs, it is either an issue with the two evaluation boards I have, or with the HW in general, though I hope it is something I did wrong in the code

    I will keep your suggestions in mind and relay them to our HW team if we determine the issue is in fact HW related

Reply
  • thanks for the suggestion

    currently the project is working on the nRF52840 evaluation board, so the circuit should be that of the evaluation board

    if the issue is indeed caused by sudden changes to the ICs, it is either an issue with the two evaluation boards I have, or with the HW in general, though I hope it is something I did wrong in the code

    I will keep your suggestions in mind and relay them to our HW team if we determine the issue is in fact HW related

Children
No Data
Related