Difference between revisions of "PineTime"

From PINE64
Jump to navigation Jump to search
(Inline the development efforts table)
Line 1: Line 1:
== Specifications ==
== Specifications ==
* BODY:
'''Dimensions:''' 37.5 x 40 x 11mm <br>
** Dimensions: 37.5mm x 40mm x 11mm
'''Weight:''' 38 grams <br>
** Weight: 38 grams
'''IP Rating:''' IP67 (waterproof to 1 meter) <br>
** Build: Zinc Alloy and Plastic
'''Display:'''
** IP Rating: IP67 (waterproof to 1 meter)
: '''Size:''' 1.3 inches (33mm) diagonal
 
: '''Type:''' IPS capacitive touchscreen, RGB 65K colors
* DISPLAY:
: '''Resolution:''' 240x240 pixels <br>
** Type: IPS capacitive touchscreen, RGB 65K colors
'''System on Chip:''' Nordic Semiconductor nRF52832 <br>
** Size: 1.3 inches
'''Flash:''' 512KB with additional 4MB SPI NOR <br>
** Resolution: 240x240 pixels, 1:1 ratio
'''RAM:''' 64KB <br>
 
'''Bluetooth:''' 5.0 (including Bluetooth Low Energy) <br>
* PLATFORM:
'''Sensors:''' Accelerometer, Heart rate sensor <br>
** OS: Various open source RTOS such as Zephyr, FreeRTOS, Mbed, Mynewt, or NuttX. See [[PineTime RTOS Comparison]].
'''Feedback:''' Vibration motor <br>
** SoC: NORDIC Semiconductor nRF52832
'''Battery:''' 170-180mAh LiPo
** CPU: 64MHz ARM Cortex-M4F
 
* MEMORY:
** Internal: 512KB Flash, 64KB RAM
** Additional: SPI NOR 4 MB Flash
 
* COMMUNICATION:
** Bluetooth 5 (including Low Energy)
 
* FEATURES:
** Sensors: Accelerometer, PPG Heart Rate Sensor
** Actuator: Vibrator
 
* BATTERY:
** Built-in LiPo 170-180mAh battery
** Charging: Proprietary 2pin 5V 500mA, USB type A plug


== SWD Pinout ==
== SWD Pinout ==
Line 92: Line 76:


Converting this voltage to an estimated capacity in percent requires a more complicated algorithm, because Lithium-ion batteries have a non-linear discharge curve.
Converting this voltage to an estimated capacity in percent requires a more complicated algorithm, because Lithium-ion batteries have a non-linear discharge curve.
== Datasheets and Schematics ==
=== PineTime Schematics ===
* [http://files.pine64.org/doc/PineTime/PineTime%20Schematic-V1.0a-20191103.pdf PineTime Schematic ver1.0a]
* [http://files.pine64.org/doc/PineTime/PineTime%20Port%20Assignment%20rev1.0.pdf PineTime GPIO Port Assignment ver1.0]
=== Component Datasheets ===
* NORDIC SoC information:
** [http://files.pine64.org/doc/datasheet/pinetime/nRF52832%20product%20brief.pdf NORDIC nRF52832 Product Brief]
** [http://files.pine64.org/doc/datasheet/pinetime/nRF52840%20product%20brief.pdf NORDIC nRF52840 Product Brief]
* PMU (Power Management Unit) information:
** [http://files.pine64.org/doc/datasheet/pinetime/SGM40561.pdf SGMicro SGM40561 Single Cell Charger Datasheet]
** [http://files.pine64.org/doc/datasheet/pinetime/SGMICRO-SGM2036.pdf SGMicro SGM2036 3.3V Low Power Low Dropout RF Linear Regulator Datasheet]
* SPI Flash information:
** [http://files.pine64.org/doc/datasheet/pinetime/MX25L6433F,%203V,%2064Mb,%20v1.6.pdf Macronix 64Mb(8MB) SPI NOR Flash]
** [http://files.pine64.org/doc/datasheet/pinetime/MX25L12835F,%203V,%20128Mb,%20v1.6.pdf Macronix 128Mb(16MB) SPI NOR Flash]
* LCD Panel:
** [http://files.pine64.org/doc/datasheet/pinetime/PineTime%20LCD%20Panel.jpg 1.3" 240x240 IPS LCD Panel Specification for PineTime]
** [https://wiki.pine64.org/images/5/54/ST7789V_v1.6.pdf 11.6" Sitronix LCD Driver/Controller Datasheet]
* Touchpad information:
** [http://files.pine64.org/doc/datasheet/pinetime/PineTime%20Touch%20Panel.jpg Touchpad Specification for PineTimel]
** [http://files.pine64.org/doc/datasheet/pinetime/CST816S数据手册V1.1.pdf 11.6" Hynitron CST816S Capacitive Touch Controller Datasheet in Chinese]
*** [https://wiki.pine64.org/images/5/51/CST816S%E6%95%B0%E6%8D%AE%E6%89%8B%E5%86%8CV1.1.en.pdf English Translation]
* Sensor:
** [http://files.pine64.org/doc/datasheet/pinetime/BST-BMA421-FL000.pdf BOSCH BMA421 Triaxial VAcceleration Sensor Product Brief]
** [http://files.pine64.org/doc/datasheet/pinetime/HRS3300%20Heart%20Rate%20Sensor.pdf TianYiHeXin HRS3300 PPG Heart Rate Sensor Data Sheet]


== Manual / Articles ==
== Manual / Articles ==
Line 132: Line 89:
! Project Homepage
! Project Homepage
! Project Source
! Project Source
! Sponsor
! Language
! PineTime Implementations
! PineTime Implementations


Line 140: Line 95:
|https://www.freertos.org
|https://www.freertos.org
| https://sourceforge.net/projects/freertos/
| https://sourceforge.net/projects/freertos/
| [https://www.freertos.org/RTOS-contact-and-support.html Amazon Web Services]
| C
| [https://github.com/JF002/Pinetime JF002/Pinetime]
| [https://github.com/JF002/Pinetime JF002/Pinetime]
[https://github.com/kaythe/pinetime-os kaythe/pinetime-os]
[https://github.com/kaythe/pinetime-os kaythe/pinetime-os]
Line 149: Line 102:
| https://www.zephyrproject.org
| https://www.zephyrproject.org
| https://github.com/zephyrproject-rtos/zephyr
| https://github.com/zephyrproject-rtos/zephyr
| Linux Foundation
| C/C++
| [https://github.com/najnesnaj/pinetime-zephyr najnesnaj/pinetime-zephyr]
| [https://github.com/najnesnaj/pinetime-zephyr najnesnaj/pinetime-zephyr]
[https://github.com/SuperPrower/pinetime_zephyr_sample_fw SuperPrower/pinetime_zephyr_sample_fw]
[https://github.com/SuperPrower/pinetime_zephyr_sample_fw SuperPrower/pinetime_zephyr_sample_fw]
Line 158: Line 109:
| https://mynewt.apache.org/about/
| https://mynewt.apache.org/about/
| https://github.com/apache/mynewt-core
| https://github.com/apache/mynewt-core
| Apache Foundation
| C
| [https://github.com/lupyuen/stm32bluepill-mynewt-sensor/tree/pinetime lupyuen/stm32bluepill-mynewt-sensor]
| [https://github.com/lupyuen/stm32bluepill-mynewt-sensor/tree/pinetime lupyuen/stm32bluepill-mynewt-sensor]


Line 166: Line 115:
| https://os.mbed.com
| https://os.mbed.com
| https://github.com/ARMmbed/mbed-os
| https://github.com/ARMmbed/mbed-os
| ARM
| C/C++
| [https://github.com/sethitow/awesome-pinetime sethitow/mbed-pinetime]
| [https://github.com/sethitow/awesome-pinetime sethitow/mbed-pinetime]


Line 174: Line 121:
| https://tinygo.org
| https://tinygo.org
| https://github.com/tinygo-org/tinygo
| https://github.com/tinygo-org/tinygo
|
| Go
| [https://github.com/aykevl/go-smartwatch aykevl/go-smartwatch]
| [https://github.com/aykevl/go-smartwatch aykevl/go-smartwatch]
|-
|-
|}
|}
== Datasheets and Schematics ==
=== Schematics ===
* [http://files.pine64.org/doc/PineTime/PineTime%20Schematic-V1.0a-20191103.pdf PineTime Schematic ver1.0a]
* [http://files.pine64.org/doc/PineTime/PineTime%20Port%20Assignment%20rev1.0.pdf PineTime GPIO Port Assignment ver1.0]
=== Component Datasheets ===
* NORDIC SoC information:
** [http://files.pine64.org/doc/datasheet/pinetime/nRF52832%20product%20brief.pdf NORDIC nRF52832 Product Brief]
** [http://files.pine64.org/doc/datasheet/pinetime/nRF52840%20product%20brief.pdf NORDIC nRF52840 Product Brief]
* PMU (Power Management Unit) information:
** [http://files.pine64.org/doc/datasheet/pinetime/SGM40561.pdf SGMicro SGM40561 Single Cell Charger Datasheet]
** [http://files.pine64.org/doc/datasheet/pinetime/SGMICRO-SGM2036.pdf SGMicro SGM2036 3.3V Low Power Low Dropout RF Linear Regulator Datasheet]
* SPI Flash information:
** [http://files.pine64.org/doc/datasheet/pinetime/MX25L6433F,%203V,%2064Mb,%20v1.6.pdf Macronix 64Mb(8MB) SPI NOR Flash]
** [http://files.pine64.org/doc/datasheet/pinetime/MX25L12835F,%203V,%20128Mb,%20v1.6.pdf Macronix 128Mb(16MB) SPI NOR Flash]
* LCD Panel:
** [http://files.pine64.org/doc/datasheet/pinetime/PineTime%20LCD%20Panel.jpg 1.3" 240x240 IPS LCD Panel Specification for PineTime]
** [https://wiki.pine64.org/images/5/54/ST7789V_v1.6.pdf 11.6" Sitronix LCD Driver/Controller Datasheet]
* Touchpad information:
** [http://files.pine64.org/doc/datasheet/pinetime/PineTime%20Touch%20Panel.jpg Touchpad Specification for PineTimel]
** [http://files.pine64.org/doc/datasheet/pinetime/CST816S数据手册V1.1.pdf 11.6" Hynitron CST816S Capacitive Touch Controller Datasheet in Chinese]
*** [https://wiki.pine64.org/images/5/51/CST816S%E6%95%B0%E6%8D%AE%E6%89%8B%E5%86%8CV1.1.en.pdf English Translation]
* Sensor:
** [http://files.pine64.org/doc/datasheet/pinetime/BST-BMA421-FL000.pdf BOSCH BMA421 Triaxial VAcceleration Sensor Product Brief]
** [http://files.pine64.org/doc/datasheet/pinetime/HRS3300%20Heart%20Rate%20Sensor.pdf TianYiHeXin HRS3300 PPG Heart Rate Sensor Data Sheet]

Revision as of 21:11, 24 December 2019

Specifications

Dimensions: 37.5 x 40 x 11mm
Weight: 38 grams
IP Rating: IP67 (waterproof to 1 meter)
Display:

Size: 1.3 inches (33mm) diagonal
Type: IPS capacitive touchscreen, RGB 65K colors
Resolution: 240x240 pixels

System on Chip: Nordic Semiconductor nRF52832
Flash: 512KB with additional 4MB SPI NOR
RAM: 64KB
Bluetooth: 5.0 (including Bluetooth Low Energy)
Sensors: Accelerometer, Heart rate sensor
Feedback: Vibration motor
Battery: 170-180mAh LiPo

SWD Pinout

The devkits have exposed SWD pins for flashing and debugging. The pinout is: PineTime SWD location.jpg

Driving the peripherals

Display

Note: The factory-default software on the PineTime does not auto-detect the display being disconnected when it has already booted. That can cause garbled output, to fix it just restart the PineTime.

The display is driven using the ST7789 display controller. Use the following pins to drive the screen:

PineTime pin ST7789 pin
LCD_SCK (P0.02) SPI clock
LCD_SDI (P0.03) SPI MOSI
LCD_RS (P0.18) Clock/data pin (CD)
LCD_CS (P0.25) Chip select
LCD_RESET (P0.26) Display reset
LCD_BACKLIGHT_{LOW,MID,HIGH} Backlight (active low)

Notes:

  • Chip select must be held low while driving the display. It must be high when using other SPI devices on the same bus (such as external flash storage) so that the display controller won't respond to the wrong commands.
  • SPI must be used in mode 3. Mode 0 (the default) won't work.
  • LCD_DISPLAY_* is used to enable the backlight. Set at least one to low to see anything on the screen.
  • Use SPI at 8MHz (the fastest clock available on the nRF52832) because otherwise refreshing will be super slow.

Battery

Reading whether the PineTime has power attached is easy: simply read the charge indication pin (P0.12). When it is high it is running on battery, when it is low it is charging.

Reading the battery voltage is a bit harder. For that you can use the battery voltage pin on P0.31 (AIN7). The returned value is 12 bits, which means it is 0..4095. You can get the measured voltage with the following formula, assuming a reference voltage of 3.3V (this is configurable in the ADC):

adcVoltage = adcValue / (4095 / 3.3)

The measured voltage is actually half of the actual battery voltage, because the ADC is connected between a voltage divider where both resistors are 1MΩ. This can be corrected by multiplying the value:

batteryVoltage = adcValue * 2 / (4095 / 3.3)

It's often better to avoid floating point values on embedded systems and in this case there is no reason to use float at all, we can just represent the value in millivolts. Therefore the formula can be simplified to:

batteryVoltage = adcValue * 2000 / (4095 / 3.3)
batteryVoltage = adcValue * 2000 / 1241

Converting this voltage to an estimated capacity in percent requires a more complicated algorithm, because Lithium-ion batteries have a non-linear discharge curve.

Manual / Articles

Development efforts

Project Homepage Project Source PineTime Implementations
FreeRTOS https://www.freertos.org https://sourceforge.net/projects/freertos/ JF002/Pinetime

kaythe/pinetime-os

Zephyr https://www.zephyrproject.org https://github.com/zephyrproject-rtos/zephyr najnesnaj/pinetime-zephyr

SuperPrower/pinetime_zephyr_sample_fw

mynewt https://mynewt.apache.org/about/ https://github.com/apache/mynewt-core lupyuen/stm32bluepill-mynewt-sensor
MbedOS https://os.mbed.com https://github.com/ARMmbed/mbed-os sethitow/mbed-pinetime
TinyGo https://tinygo.org https://github.com/tinygo-org/tinygo aykevl/go-smartwatch

Datasheets and Schematics

Schematics

Component Datasheets