The ItsyBitsy nRF52840 Express has BAT G USB on the top left, next to the micro USB port
These pins are:
You can always put any voltage you like into BAT and the circuitry will switch between BAT and USB dynamically for you. That means you can have a Battery backup that only gets enabled when USB is disconnected.
If you want to add rechargeable power, a LiPoly backpack can be soldered into these three pins that will let you have a battery that is automatically recharged whenever USB is plugged in, then switches to LiPoly when on the go:
In addition to the three standard power pins, the ItsyBitsy nRF52840 Express has a few more pins available for power sourcing:
- 3V - this 3.3V pin is the regulated output from the onboard regulator. You can draw 500mA whether powered by USB or battery.
- EN - connected to the regulator enable, it will let you shut off power - when running on battery only. But at least you don't have to cut a trace or wire to your battery. This pin does not affect power when using USB
- Vhi - this is a special pin! It is a dual-Schottky-diode connected output from BAT and USB. This means this will always have the higher-of-the-two voltages, but will always have power output. The voltage will be about 5VDC when powered by USB, but can range from 3.5-6VDC when powered from battery. It's not regulated, but it is high-current, great for driving servos and NeoPixels.
The 7 available analog inputs (A0 .. A5 and D10 which is called A6) can be configured to generate 8, 10 or 12-bit data (or 14-bits with over-sampling), at speeds up to 200kHz (depending on the bit-width of the values generated), based on an internal 0.6V reference
The 6 available analog inputs (A0 .. A5) can be configured to generate 8, 10 or 12-bit data (or 14-bits with over-sampling), at speeds up to 200kHz (depending on the bit-width of the values generated), based on either an internal 0.6V reference or the external supply.
The following default values are used for Arduino. See this guide's nRF52 ADC page for details about changing these settings.
- Default voltage range: 0-3.6V (uses the internal 0.6V reference with 1/6 gain)
- Default resolution: 12-bit (0..4096)
- Default mV per lsb (assuming 3.6V and 12-bit resolution): 1 LSB = 0.87890625 mV
CircuitPython uses 1/4 gain with a VDD/4 reference voltage.
Any GPIO pin can be configured as a PWM output, using the dedicated PWM block.
Three PWM modules can provide up to 12 PWM channels with individual frequency control in groups of up to four channels.
I2C pins on the nRF52840 require external pullup resistors to function, which are not present on the Adafruit nRF52840 Itsy Bitsy by default. You will need to supply external pullups to use these. All Adafruit I2C breakouts have appropriate pullups on them already, so this normally won't be an issue for you.
This is the general purpose I/O pin set for the microcontroller. All logic except for pin 5 is 3.3V output and input. You can usually use 3V logic as an input to 5V, but the 3V Itsy pins should not be connected to 5V!
All pins can do PWM output - nRF52840 will assign a PWM to any pin you like
All pins can be interrupt inputs - nRF52840 will assign an IRQ to any pin you like
Since you have PWM/IRQ on any pin, there's not a lot of special pins - they can all pretty much do anything, like connect a PDM microphone or encoder. Here are the somewhat special pins:
- #0 / RX - GPIO #0, also receive (input) pin for Serial1
- #1 / TX - GPIO #1, also transmit (output) pin for Serial1
- SDA and SCL - these are the I2C hardware interface pins. There's no pull up on this pin by default so when using with I2C, you may need a 2.2K-10K pullup on each to 3.3V. PWM output
- #3 - GPIO #3 is connected to the blue LED next to the Reset button - it isn't available on the pin breakouts
- #4 - GPIO #4 is connected to the SW button to the right of the micro USB connector - it isn't available on the pin breakouts
- #5 - GPIO #5. This is a special OUTPUT-only pin that can PWM. It is level-shifted up to Vhi voltage, so it's perfect for driving NeoPixels that want a ~5V logic level input.
- SCK/MOSI/MISO - the hardware SPI port for connecting SPI devices, you can use any pin for CS
These pins are available in CircuitPython under the
board module. Names that start with # are prefixed with D and other names are as is. So #0 / RX above is available as
board.RX for example.
As part of the 'Express' series of boards, this ItsyBitsy is designed for use with CircuitPython.
To make that easy, we have added two extra parts: a mini DotStar (RGB LED) and a 2 MB QSPI (Quad SPI) Flash chip.
The DotStar is connected to pin #6 (clock) and #8 (data) in Arduino, so just use our DotStar library and set it up as a single-LED strand on pins 6 & 8. The DotStar is powered by the 3.3V power supply but that hasn't shown to make a big difference in brightness or color. In CircuitPython, the pins are
The QSPI Flash is connected to 6 pins that are not brought out on the GPIO pads. QSPI is neat because it allows you to have 4 data in/out lines instead of just SPI's single line in and single line out. This means that QSPI is at least 4 times faster. But in reality is at least 10x faster because you can clock the QSPI peripheral much faster than a plain SPI peripheral
We have an Arduino library here which provides QSPI interfacing for Arduino. In CircuitPython, the QSPI flash is used natively by the interpreter and is read-only to user code, instead the Flash just shows up as the writable disk drive!
A tactile switch is provided for use in your projects, which is connected to
Holding this button down coming out of a board reset will also force the device to enter and remain in USB bootloader mode, which can be useful if you lock your board up with bad application code!
RST - this is the Reset pin, tie to ground to manually reset the nRF52840, as well as launch the bootloader manually
SWCLK & SWDIO - These are the debug-interface pins, used if you want to reprogram the chip directly or attach a debugger.