Bangle JS2 (nRF52840) Pin Configuration

Posted on
  • I've been going over the pinouts of the nRF52840 used in the Bangle 2. I've found the definition file in the firmware defines the pin usages. I've noted a couple of issues:

    1. The Hackaday article lists the pins, and include a pin (39) for the accelerometer interrupt. However, the relevant part in BANGLEJS2.py does not list the pin.

    2. After going through all the pins available from the nRF52840 datasheet, there are several pins not listed in BANGLEJS2.py that I presume are unused (9, 10, 11, 12, 18(nRESET), 20, 40, 41, 42, 43, 46). My experience with MSP430s tells me that floating pins can consume a surprising amount of current, and should be either set as outputs or as inputs with pull-up/downs as appropriate.

    3. Pins 4 and 28 are analog inputs. I presume they are configured as such? They're only listed among all the analog input pins at the bottom of BANGLEJS2.py, but in there are also pins clearly used for digital I/O.

    If these apparently unused pins are being configured somewhere else, I can't find it. Perhaps someone who knows more about the firmware can advise?

  • My experience with MSP430s tells me that floating pins can consume a surprising amount of current, and should be either set as outputs or as inputs with pull-up/downs as appropriate.

    with nrf52 they are 'disconnected' by default which is suggested by Nordic to draw less than being set as input or output, so in general it is not needed to configure every pin. Of course it also depends on schematics of specific device so in some special cases configuring pull up or down may make better sense (e.g. to pull SPI device CS high so it can properly sleep).

  • Thanks - I've now learned something new! :-)

  • More info is here https://infocenter.nordicsemi.com/topic/­ps_nrf52840/gpio.html?cp=4_0_0_5_8_1_9#r­egister.PIN_CNF-0-31 , after reset the pin configuration value for all pins is 2 = input with disconnected input buffer

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Bangle JS2 (nRF52840) Pin Configuration

Posted by Avatar for andrewg_oz @andrewg_oz

Actions