For general Bangle.js information, try the Bangle.js 1 or the Bangle.js 2 pages
This page contains detailed information on Bangle.js's 1's internals. Click here for Bangle.js 2. If you're just writing JS then you should have no need for this information, but if you plan on modifying the Bangle.js firmware it might be of interest.
Where mentioned in the source code or filenames, Q3
references Bangle.js 2, and F18
references Bangle.js 1.
The Espruino version for Bangle.js has a few specific modifications:
jswrap_bangle.c
contains
all Bangle.*
functions and pretty much all Bangle.js functionality.BANGLEJS.py
describes the buildSPIFLASH
device causes SPIFLASH_BASE
to be defined, which enables external SPI flash memory support in jshardware.c
0x7A000
(4k less than the standard SDK12 bootloader) because it was originally an SDK11 deviceWant to get inside? Check out the Bangle.js Disassembly page
As above the GPS is a UBlox UBX-M8130
On boot, it reports: ROM CORE 3.01, PROTVER=18.00*11
Espruino handles reception and parsing of NMEA data from the GPS UART when Bangle.setGPSPower(1)
is called.
However it is possible to also send UBLOX UBX commands to configure the GPS - see https://github.com/espruino/BangleApps/blob/master/testing/GPS-comms.js
There's IO connected to the nRF52, plus an IO expander to provide power to some other things.
Pin | Name | Notes |
---|---|---|
D0 | LCD_D0 | Bits 0-7 all set together via (char*)P0_OUT |
D1 | LCD_D1 | Bits 0-7 all set together via (char*)P0_OUT |
D2 | LCD_D2 | Bits 0-7 all set together via (char*)P0_OUT |
D3 | LCD_D3 | Bits 0-7 all set together via (char*)P0_OUT |
D4 | LCD_D4 | Bits 0-7 all set together via (char*)P0_OUT |
D5 | LCD_D5 | Bits 0-7 all set together via (char*)P0_OUT |
D6 | LCD_D6 | Bits 0-7 all set together via (char*)P0_OUT |
D7 | LCD_D7 | Bits 0-7 all set together via (char*)P0_OUT |
D8 | LCD_DC | |
D9 | LCD_CLK | |
D10 | LCD_CS | |
D11 | TOUCH RIGHT | inverted |
D12 | Battery charging when low | Input pullup |
D13 | VIBRATE - active high | |
D14 | I2C SCK | |
D15 | I2C_SDA | |
D16 | TOUCH LEFT | inverted |
D17 | Flash D3 (RST - connect to VCC) | |
D18 | Speaker (if included), otherwise inverted output on HRM PCB | |
D19 | Flash SCLK | |
D20 | Flash D1 (MISO) | |
D21 | Flash CS | |
D22 | Middle button | inverted |
D23 | Top button | inverted |
D24 | Bottom button | inverted |
D25 | GPS RX | |
D26 | GPS TX | |
D27 | Flash D0 (MOSI) | |
D28 | IO expander reset | |
D29 | HRM Analog | |
D30 | Battery Level | 0.51=low, 0.62=good |
D31 | Flash D2 (WP - connect to GND) |
Mask | Description | Default value |
---|---|---|
0x01 | GPS | 0 |
0x02 | NC | |
0x04 | NC | |
0x08 | NC | |
0x10 | NC | |
0x20 | LCD backlight | 1 |
0x40 | LCD reset | 1 |
0x80 | HRM | 1 |
Click on the pictures above for more zoomed in information. Also check out this excellent forum post for even more detailed reverse engineering.
You can completely reprogram (and even debug) the nRF52 chip inside Bangle.js with the SWD pins. These are on the circuit board under the LCD.
You can carefully pull up the LCD and cut/tear through the foam tape holding it on. Underneath that you'll find 4 pins, labelled as follows:
You only need GND
, SWDID
and SWDCLK
(VDD is not required).
See Advanced Debug for more information on programming via SWD.
On the bottom right of the PCB (by the label R6
) are the two
pads for the speaker. The one labelled +
goes directly to 3.3v
,
and the one next to it goes to pin D18
via a transistor.
As such, D18
is inverted, and can only be used as an output - however
it is powered (pulldown via MMDT3904) so is able to drive reasonably high loads (up to ~100mA).
The heart rate monitor itself is powered from the IO expander, and
has just a single analog output, which is D29
.
The two circular gold pads interface with the charging circuit. The right-hand
one (with them at the top of the watch) is connected to GND
, and the left-hand
one goes to the charging circuitry.
SCK=D14, SDA=D15
This page is auto-generated from GitHub. If you see any mistakes or have suggestions, please let us know.