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