Use NFC pin (GPIO 0.9, 0.10, 0.12) as other purpose such as RTC input

configuration information

- use nRF5_SDK_17.1.0_ddde560

- use gcc

- use custom board #1, #2

- use nrf52811 soc

Previously I developed custom board #1 and I reduced the power consumption and it show that in adv mode: 6.8 uA, systemOff mode: 2uA.

And I developed custom board #2. I added new feature that is RTC input for providing time information.

I used NFC pins(GPIO 0.9, 0.10, 0.12) for connecting RTC for GPIO input.

In terms of HW configuration, everything is same between board #1 and #2 but only one difference is RTC input via NFC pin.

For power consumption testing, I did not attach RTC HW parts on the PCB board #2.

after measuring the power consumption for board #2, the result is in adv mode: 350uA, systemOff mode: 60uA

In software level, I added below code in Makefile

CFLAGS += -DCONFIG_NFCT_PINS_AS_GPIOS

and I added below code for disabling GPIO port.

#define RTC_SCK 9
#define RTC_IO 10
#define RTC_CE 12
nrf_gpio_cfg_output(RTC_SCK);nrf_gpio_pin_set(RTC_SCK);
nrf_gpio_cfg_output(RTC_IO);nrf_gpio_pin_set(RTC_IO);
nrf_gpio_cfg_output(RTC_CE);nrf_gpio_pin_set(RTC_CE);

I tried to search in DevZone for resolving issue, I found below suggestions.

A> add CONFIG_NFCT_PINS_AS_GPIOS in Makefile

B> "#define CONFIG_NFCT_PINS_AS_GPIOS" in system_nrf52.h.

C> HW modification

Pin 11 and pin 12 are by default configured to use the NFC antenna, but
if pin 11 and pin 12 are needed as  normal GPIOs, R25 and R26 must be NC
and R27 and R28 must be shorted by 0R.

D> NRF_UICR-> NFCPINS = 0xFFFFFFFE;" in main.c.

I applied A. B is not needed(already A used).

I can't figure out how to apply C.

when I'm trying to add 'NRF_UICR-> NFCPINS = 0xFFFFFFFE' to main.c, I got compile error  'NRF_UICR_Type' has no member named 'NFCPINS'.

How can I remove unnecessary power consumption?

Parents Reply Children
  • Hi Simonr,

    Thank you for reply. I checked it.

    I had a confusion due to different module chip(nrf52811, nrf52832 with same pin to pin mapping) on the same PCB.

    I  find the solution but I don't understand. 

    I changed code and it is used during initialization.

    nrf_gpio_cfg_output(RTC_SCK);nrf_gpio_pin_set(RTC_SCK);
    nrf_gpio_cfg_output(RTC_IO);nrf_gpio_pin_set(RTC_IO);
    nrf_gpio_cfg_output(RTC_CE);nrf_gpio_pin_set(RTC_CE);

    ==>

    nrf_gpiote_int_disable(RTC_SCK);

    nrf_gpiote_int_disable(RTC_IO);

    nrf_gpiote_int_disable(RTC_CE);

    And the power consumption drops as similar as board #1.

     

    As you stated, P0.09, P0.10, P0.12 are general GPIO. 

    But why nrf_gpiote_int_disable() drops current? Currently, there is no part attached for RTC on the PCB. 

    And I need to use nrf52832 also, 

    Will the DCONFIG_NFCT_PINS_AS_GPIOS flag added to Makefile OK for drop current?
    In this case I also don't use NFC and want to use it as GPIO (RTC input)

Related