Skip to content

Hardware

fanoush edited this page Nov 20, 2018 · 19 revisions

Summary

This is tl;dr summary of findings below, you don't need to read the rest.

  • 128x32 SSD1306 OLED - SPI2 SCK 6 MOSI 5 RST 4 DC 28 CS 29, has 128x64 memory so needs 0xDA, 0x12 init unlike other 128x32 ones
  • PAH8001 HR sensor - TWI0 SCL 7 SDA 8 speed 400kbps, I2C address 0x6b, enable pin 26, i2c bus read hangs if not enabled
  • KX022(?) accelerometer - TWI1 scl 13 sda 14 speed 400kbps, I2C adress 0x1f
  • USB plug data pins 22,23 - configured in DFU bootloader as UART RX(22) TX(23) baud rate 38400
  • motor - pin 25
  • touch button - pin 30, goes low when touched
  • charging power detect - pin 2 as digital or as analog USB power voltage reference (when charging with 5V remember vmul=5/analogRead(D2))
  • pin 3 - battery voltage analog (vmul*analogRead(D3))

Firmware source code strings

strings dsd6-flash.bin | grep -i '\.c' | sort | uniq

..\components\ble\device_manager\device_manager_peripheral.c
..\components\libraries\simple_timer\app_simple_timer.c
..\components\libraries\timer\app_timer.c
..\components\softdevice\common\softdevice_handler\softdevice_handler.c
..\source\HeartRate\HeartRate_PAH8001.c
..\source\src\ds_clock.c
..\source\src\ds_hisdata.c
..\source\src\ds_power.c
..\source\src\ds_spi_master.c
..\source\src\ds_wdt.c
..\source\src\gclock.c
..\source\src\i2cdriver.c
..\source\src\KeyEventHandler.c
..\source\src\kx_gsensor.c
..\source\src\main.c
..\source\src\MainUI.c
..\source\src\MotorEventHandler.c
..\source\src\uartdriver.c
  • PAH8001 HR sensor
  • KX gsensor
  • i2c driver - gsensor and hr sensor?
  • spi driver - OLED?
  • uart - hopefully on USB data pins?

Register dumps

Register dumps made over SWD when rebooted to DFU bootloader (serial enabled!) and later also main app (no serial but rest of HW)

UART https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/uart.html?cp=2_1_0_49_9#topic

0x40002500:	0x00000004	0x00000000	0xffffffff	0x00000017
0x40002510:	0xffffffff	0x00000016	0x00000000	0x00000000
0x40002524:	0x009d5000

rx 0x16 22
tx 0x17 23
no parity
baudrate 38400

SPI https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/spi.html?cp=2_1_0_47_1#topic

0x40023500:	0x00000001
0x4002350c:	0x00000006
0x40023508:	0x00000005
0x40023510:	0xffffffff
0x40023524:	0x80000000
0x40023554:	0x00000000
spi2 master sck 5 mosi 6 miso -1 speed 8mbps config msb,sample leading shift trailing,acthigh

TWI https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/twi.html?cp=2_1_0_48_7#topic

0x40004500:	0x00000005 = ENABLED TWI
0x40004508:	0x0000000d = PSELSCL 13 
0x4000450c:	0x0000000e = PSELSDA 14
0x40004524:	0x06680000 = FREQUENCY 400kbps
TWI1 scl 13 sda 14  speed 400kbps

0x40003500:	0x00000005
0x40003508:	0x00000007
0x4000450c:	0x00000008
0x40003524:	0x06680000
TWI0 scl 7 sda 8 speed 400kbps

GPIO https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/gpio.html?cp=2_1_0_19_2#topic

0x50000514:	0x36000070 DIR
0x50000504:	0x00006190 OUT
0x50000510:	0x41216040 IN no charging
0x50000510:	0x40216044 IN charging
0x50000510:	0x40e16004 IN display on
after using also hr sensor
0x50000504:	0x34806190 00110100100000000110000110010000 OUT
0x50000510:	0x40e17984 01000000111000010111100110000100 IN (charging, display off)
0x50000514:	0x36800070 00110110100000000000000001110000 DIR (1=output,0=input)

inputs:
pin 2 goes high when power is attached to usb
pin 30 touch button, goes low when touched
outputs:
pin 4 when display is on and set to 0 display goes off (RST?)
pin 25 motor
pin 26 enable HR sensor
pin 28 ?
pin 29 ?
Clone this wiki locally