nPM1300 buck control GPIO not working as active low

Hi,

I am using an nPM1300 together with an nRF5340 and an LIS2DW12 accelerometer. The nRF is powered from VOUT1 on the PMIC, and after some time of inactivity it is turned off by disabling BUCK1. Upon movement, BUCK1 should be enabled again by a latched interrupt from the accelerometer routed to GPIO0 on the PMIC.

However, when configuring the interrupt and GPIO input to active low, the signal does not respond to movement, it just stays at the higher voltage level. If I instead set it to active high, the interrupt comes in as expected, but when the nRF wakes up, it clears the interrupt before I can disable the GPIO control on BUCK1, so the negative edge turns it off again.

I am powering the PMIC VDDIO from an external source and have removed the jumper on P18. The accelerometer interrupt is configured as push-pull.

The overlay options for BUCK1 are the following:

npm1300_buck1: BUCK1 {
				regulator-min-microvolt = <1000000>;
				regulator-max-microvolt = <3300000>;
				retention-microvolt = <1000000>;
				enable-gpios = <&npm1300_gpio 0 GPIO_ACTIVE_LOW>; 
			};

How can I either get the active low interrupt to work on the PMIC or make sure that an active high interrupt does not clear when the nRF wakes up?

Thanks,

Silvia

Edit: I have found a third option where I also run into a road block. The idea is to configure the accelerometer interrupt as pulsed and active high, and the buck control GPIO as active low so that the negative edge of the pulse will enable BUCK1. Only INT2 on the LIS2DW12 can generate sleep change interrupts which is what would be required for this to work. INT2 is also routed to the nRF and used when it is awake, so I would have to enable and disable the GPIO control of the buck accordingly. The problem I found is that after GPIO control has been enabled by writing to register BUCKENCTRL of the PMIC, it is not possible to disable it by writing to the same register again, everything just crashes. Why is it not possible to disable GPIO control this way?

Edit 2: I found a solution based on the third option but instead of trying to enable/disable the buck control, I instead reconfigure the accelerometer to route all INT2 interrupts to INT1 before disabling BUCK1 so that the sleep change pulse can enable it again. So problem solved (I hope), but I'm still curious why none of the other options worked. 

Parents
  • Hello,

    Sorry for the late reply. I am trying to understand what you are doing. Have you connected the interrupt pin from the accelerometer both to the PMIC and the nRF5340? And you are trying to detect on wakeup whether it was the accellerometer that woke it up? If that is the case, wouldn't it be safe to assume that if it was woken up by the PMIC, that this was triggered from the accelerometer?

    Best regards,

    Edvin

  • Now I have one interrupt pin (INT2) connected to the nRF and the other (INT1) to the PMIC. The problem I've been having was even getting the accelerometer to wake up the nRF properly. Detecting the wake up reason is no issue.

  • sillvi said:
    If the interrupt is latched and active high, the voltage level on the GPIO does go high upon movement, which enables BUCK1, which in turn wakes up the nRF5340. The problem there is that upon waking up, the nRF somehow clears the latched interrupt. This is seen as a negative edge on the PMIC GPIO and therefore BUCK1 is disabled again, cutting the power to the nRF.

    Isn't the issue that the BUCK1 is disabled? This is probably a stupid question, but if you don't want to cut the power to the nRF, why do you disable it? I believe there is something here that I don't understand.

  • I do want to cut the power to the nRF when the device should be in a power saving state. This i do by calling regulator_disable().

    The issue with the approach you're referring to is that after the positive edge from the accelerometer interrupt has enabled BUCK1, it gets disabled again after just a few seconds. I want it to wake up on the interrupt and stay awake.

    BR,

    Silvia

  • So how do you decide when you want to cut the power to the nRF? After some time without activity? If so, perhaps you can use a timer in the application for the nRF, and when the timeout occurs, then you can disable the BUCK1. And if you receive some more activity, then you could restart your timer.

  • This is exactly the idea. There is a timer in the application and when it runs out the buck is disabled, cutting the power to the nRF. Then, after receiving activity, the nRF should be powered again and the timer should start again.

    The problem is that I either cannot get the nRF to power up at all on activity, or it does power up but is then promptly powered off again before the application has even started running.

    BR,

    Silvia

  • But if you remove regulator_disable() altogether, is it then powered up?

Reply Children
No Data
Related