How to configure to wake up from SYSTEM_ON and SYSTEM_OFF using RTC2 (periodically) and from GPIO pin change

Hi,

I need to configure an nRF52832 to wake up periodically from SYSTEM_ON and SYSTEM_OFF and, also, when a GPIO pin changes.

Where can I find sample code and docs for this?

I'm using nRF Connect SDK version 1.9.1 and Visual Studio Code.

BR

  • Hi

    These are spikes caused by noise from the USB port. 

    You have two options, either unplug the USB cable and power the DK with a clean supply on the power supply header. Then you can measure current going through the current measurement header with the PPK2 in ampere meter mode.

    Alternatively you can leave the USB plugged in, but then you will have to power the nRF52 from the PPK using source meter mode. Connect the GND from PPK to GND on the DK, and VOUT from the PPK to the nRF52 side of the current measurement header (the pin closest to the debug out header). Then you need to adjust the PPK2 output voltage to match the VDD voltage on the DK exactly. I believe it should be around 2.7V.

    Best regards,

    Simon

  • Hi,

    I'm starting to think on the possibility of PPK/DK not working properly for some reason (maybe me).

    Here are how I connected the PPK-II and the nRF52 DK for Source Meter mode. One with the USB connected to the DK, the other without.

    DK with USB connected DK without USB connected

    Here attached are also the ppk capture files.

    I have SB9 open in the DK and uploaded same project I attached previously.

    I configured VOUT for 2.75V in the PPK, but I've seen a strange bahaviour, the SoC is not reset when powered from the PPK only. I tested from 2.0V to 3.2V with same results: I needed to power from USB with the PPK VOUT active, then remove the USB plug. After doing this the app behaved like expected, wake up on pressing BTN1, then going to "low power".

    I didn't check voltage across P0.21/RESET, but I think the nRF is not been reset when the SAM (U2) is not powered.

    Enabling and disabling power output from the PPK did enable and disable the PPK voltage output, checked with voltmeter at DC4 pin (C10 in the DK) and had 1.24V, and also had the same VOUT voltage at VDD pin (C9 in the DK).

    Is the PPK-DK wiring correct? Am I missing something? Is there any need to change anything the compiler/project options for the board so anything else is initialised in the silicon?

    BR

    data-logger-source meter - 2750mV + USB.zip

    data-logger-source meter - 2750mV.zip

  • Hi

    If you have matched the voltage for the PPK and DK (~2.7V) in the first image that measurement should be correct, but it looks very strange indeed, and there shouldn't be any current measurements looking like this, so it does indeed look like the PPK might have some issue with it. To confirm, can you try with the PPK2 in Ampere mode as well, using a clean supply to power the DK as I explained in my last reply.

    You can't power the DK just from the PPK like in image 2, that won't result in a correct current measurement or behavior. 

    Best regards,

    Simon

  • Hi, let's see if it is better now.

    I inserted the coin cell battery, PPK-II in Ampere meter mode and connected like below:

    I started capturing data and pressed BTN1 for taking the SoC out from POWER_OFF.

    Here is how it looks like (full data set and close-up):

    The spikes are periodic, and in between them the current seems to fall to what is expected. I suppose the noise originates in the PPK's current sense signal-chain and the long sensing wires, as expected.

    The full dataset is attached here.

    According to your experience/knowledge, what's the origin of those peaks? They have a fast rise time and a slow exponential-like decay, like in a low-ESR capacitor charge discharge cycle.

    Thanks again.

    BR

    ppk-20220504T160437-data-logger.zip

  • Hi

    This looks much better. The spikes look like the auto-controlled refresh mode being active, where the frequency depends on the current being drawn on the regulator output. In system OFF mode the refresh interval is at 100-150ms.

    The current consumed during refresh modes are documented hereNote that the numbers in the PS are typical numbers only, and there will be device to device variations.

    Best regards,

    Simon

Related