LIS2DH interrupt and power reduction

Hello. 

I try to reduce current consumption in my battery (CR2032) power device. I used LIS2DH to save energy and turn off advertising after while and turn on when move was detected. Everything works good, but i think it could be better. In the first step I used latched interrupt pin in accelerometer and I read nRF52832 pin periodic. Works fine, but internal pull-up (10k-16k) has too much influence on current.

if(gpio_pin_get_dt(&lisint1_pin)==0)	
{
.....
}

In the next step i used SESNE field and PORT event: 

	gpio_pin_interrupt_configure_dt(&lisint1_pin, GPIO_INT_TRIG_LOW | GPIO_INT_MODE_EDGE);
	gpio_init_callback(&lisint1_cb_data, lis_interrupt, BIT(lisint1_pin.pin)); 	
	gpio_add_callback(lisint1_pin.port, &lisint1_cb_data);

But this time I didn't turn on pull-up. Part od dts file:

   	inputs {
	   	compatible = "gpio-keys";
	   	lisint1: lisint1 {
			gpios = <&gpio0 28 (GPIO_ACTIVE_LOW)>;   
		   	label = "LISINT1";
	   	};

&gpio0 {
	status = "okay";
	sense-edge-mask = <0x30000000>;					//mask on p0.28 & p0.29
};

Works fine, but I have doubt about floating input. In other hand, there is push-pull output on LIS2DH.

My question is:

Do I have to turn on pull-up on input when I use PORT event and SENSE field?     

Best regards 

P_WE

Parents
  • Works fine, but I have doubt about floating input. In other hand, there is push-pull output on LIS2DH.

    My question is:

    Do I have to turn on pull-up on input when I use PORT event and SENSE field?

    I recently had another thread almost with the same question. 

    Yes, the internal pull(s) + external pulls can have significant current for some use cases. But the logic here is that the input needs to be at a predictable state. If you remove the internal pull setting (keep it to no-pull) and if there is proper push-pull output on the external sensors/Circuits, then we have seen that that works fine for most of the cases. But how can we guarantee the timings of the push-pull from the external circutis? How do we know the rise times that the external circuits manage to pull. There are many other variables that come into picture and hence our recommendation of factoring our all those variables and bring the input logic at a guaranteed predictable state. That guaranteed state has a cost as you can see, and that cost is increase current due to pull ups. 

    Now to answer your question

    Do I have to turn on pull-up on input when I use PORT event and SENSE field?   

    The detect signal is level triggered and if your pin is used for interrupt then I am guessing it is not toggling too fast. Then probably it should be ok to have no internal pull, but we cannot give an official recommendation on that.

Reply
  • Works fine, but I have doubt about floating input. In other hand, there is push-pull output on LIS2DH.

    My question is:

    Do I have to turn on pull-up on input when I use PORT event and SENSE field?

    I recently had another thread almost with the same question. 

    Yes, the internal pull(s) + external pulls can have significant current for some use cases. But the logic here is that the input needs to be at a predictable state. If you remove the internal pull setting (keep it to no-pull) and if there is proper push-pull output on the external sensors/Circuits, then we have seen that that works fine for most of the cases. But how can we guarantee the timings of the push-pull from the external circutis? How do we know the rise times that the external circuits manage to pull. There are many other variables that come into picture and hence our recommendation of factoring our all those variables and bring the input logic at a guaranteed predictable state. That guaranteed state has a cost as you can see, and that cost is increase current due to pull ups. 

    Now to answer your question

    Do I have to turn on pull-up on input when I use PORT event and SENSE field?   

    The detect signal is level triggered and if your pin is used for interrupt then I am guessing it is not toggling too fast. Then probably it should be ok to have no internal pull, but we cannot give an official recommendation on that.

Children
Related