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?

  • Hi

    The reason you see this compile error is because the nRF52811 doesn't have an NFC tag peripheral, so NFCPINS won't be recognized. In the pin assignments section of the nRF52811 PS you can see that P0.09 and P0.10 are only stated as GPIOs, so there is no need for this config in nRF52811 based projects.

    Best regards,

    Simon

  • 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)

  • Hi

    I'm not sure I understand what you mean here. How much does the nrf_gpiote_int_disable() lower the current exactly? It makes sense that it lowers the current consumption as you disable the RTC and GPIOTE. To use these pins as GPIOs on the nRF52832 you have to add the following preprocessor define CONFIG_NFCT_PINS_AS_GPIOS (add under project settings -> "Preprocessor" -> "Preprocessor definitions") in SEGGER Embedded Studios.

    Best regards,

    Simon

  • Hi Simonr,

    The current consumption was 230 uA before applying nrf_gpiote_int_disable().

    After applying nrf_gpiote_int_disable(), it shows 10 uA consumption.

    In this case, there's HW circuit diagram exist for RTC in the PCB board but don't have parts attached on PCB board.

    So I wasn't sure that why it is draining much power as parts not attached.

  • If there are no HW on the board that can draw the current, I assume it is the GPIOTE peripheral that is left running for example until you call the nrf_gpiote_int_disable() which will let the nRF52 go into a low power mode (10µA). I'm not sure I see how this is related with your initial question. I suggest you check out this blog by my colleague Scott on all the most common ways to reduce current consumption if you need lower current consumption, and generally optimizing your power consumption.

    Best regards,

    Simon

Related