USER GUIDE. SAML21 Wearable Demo (ATULPC-DEMO) ATSAML21G18B. Preface

Similar documents
AT14973: Wearable Demo Reference Design. Preface SAM L21 USER GUIDE

AT03975: Getting Started with SAM L21. Descripton. Features. SMART ARM-Based Microcontroller APPLICATION NOTE

This user guide describes how to run the Atmel ATWINC3400 Bluetooth Low Energy (BLE) Provisioning demo from out-of-box conditions.

AT06467: Getting started with SAM D09/D10/D11. Features. Description. SMART ARM-based Microcontrollers APPLICATION NOTE

AT60142H/HT. Rad-Hard 512Kx8 Very Low Power CMOS SRAM ERRATA-SHEET. Active Errata List. Errata History. Abbreviations. 1.

AVR42789: Writing to Flash on the New tinyavr Platform Using Assembly

USER GUIDE. Atmel QT6 Xplained Pro. Preface

Smart RF Device Family - Getting Started Guide. Features. Description. References ATAN0115 APPLICATION NOTE

AT11512: SAM L Brown Out Detector (BOD) Driver. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

ATAES132A Firmware Development Library. Introduction. Features. Atmel CryptoAuthentication USER GUIDE

EDBG. Description. Programmers and Debuggers USER GUIDE

QT3 Xplained Pro. Preface. Atmel QTouch USER GUIDE

ATtiny817 QTouch Moisture Demo User Guide. Description. Features. AVR 8-bit Microcontrollers USER GUIDE

AT09381: SAM D - Debugging Watchdog Timer Reset. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

QT2 Xplained Pro. Preface. Atmel QTouch USER GUIDE

APPLICATION NOTE. Atmel QT4 Xplained Pro User Guide ATAN0114. Preface

Ethernet1 Xplained Pro

APPLICATION NOTE. AT6486: Using DIVAS on SAMC Microcontroller. SMART ARM-Based Microcontroller. Introduction. Features

ATECC108/ATSHA204 USER GUIDE. Atmel Firmware Library. Features. Introduction

AT03262: SAM D/R/L/C System Pin Multiplexer (SYSTEM PINMUX) Driver. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

USER GUIDE. ATWINC1500 Xplained Pro. Preface

AVR134: Real Time Clock (RTC) Using the Asynchronous Timer. Features. Introduction. AVR 8-bit Microcontrollers APPLICATION NOTE

APPLICATION NOTE. Generating Random Secrets. ATSHA204A, ATECC108A, and ATECC508A. Description. Topics

ATtiny104 Xplained Nano. Preface. AVR 8-bit Microcontrollers USER GUIDE

AT21CS Series Reset and Discovery. Introduction. Serial EEPROM APPLICATION NOTE

APPLICATION NOTE. 3-lead CONTACT Package Usage. ATSHA204A, ATECC108A, and ATECC508A. Introduction. 3-lead CONTACT Package

AT10942: SAM Configurable Custom Logic (CCL) Driver. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

USER GUIDE. Atmel Segment LCD1 Xplained Pro. Preface

USER GUIDE. Atmel QT1 Xplained Pro. Preface

APPLICATION NOTE. AT04470: Differences between SAM D21 Variants A, B, and L. 32-bit Microcontroller. Introduction

UG313: Thunderboard Sense 2 Bluetooth Low Energy Demo User's Guide

APPLICATION NOTE. CryptoAuthentication Personalization Guide. ATSHA204A and ATECC508A. Introduction. Features

DGILib USER GUIDE Atmel-42771A-DGILib_User Guide-09/2016

APPLICATION NOTE. AT05567: TC Capture on External Interrupt with the Event System on SAM D20. Preface ASF PROJECT DOCUMENTATION

AT88CK101 HARDWARE USER GUIDE. Atmel CryptoAuthentication Development Kit. Atmel CryptoAuthentication AT88CK101 Daughterboard

Ultra Low Power Connected Demo Reference Design

USER GUIDE EDBG. Description

APPLICATION NOTE. AT11008: Migration from ATxmega16D4/32D4 Revision E to Revision I. Atmel AVR XMEGA. Introduction. Features

OLED display with pixels resolution Ambient light sensor CPU load Analog filter Quadrature Encoder with push button Digital I/O

SAMA5D2 Quad SPI (QSPI) Performance. Introduction. SMART ARM-based Microprocessor APPLICATION NOTE

QSG107: SLWSTK6101A/B Quick-Start Guide

USER GUIDE. Atmel maxtouch Xplained Pro. Preface

SMART ARM-based Microcontrollers ATSAMD21E16LMOTOR USER GUIDE

SAM4 Reset Controller (RSTC)

ATECC508A Public Key Validation. Introduction. Atmel CryptoAuthentication APPLICATION NOTE

AVR4018: Inertial Two (ATAVRSBIN2) Hardware User's Guide. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

I/O1 Xplained Pro. Preface. Atmel MCUs USER GUIDE

APPLICATION NOTE. How to Securely Switch Atmel s LIN Transceiver ATA6662/ATA6662C to Sleep Mode ATA6662/ATA6662C. Concerning Atmel ATA6662

ATZB-SAMR21-XPRO. Preface. SmartConnect USER GUIDE

AVR42772: Data Logger Demo Application on XMEGA A1U Xplained Pro. Introduction. Features. AVR XMEGA Microcontrollers APPLICATION NOTE

USER GUIDE. Atmel OLED1 Xplained Pro. Preface

Atmel AVR1619: XMEGA-B1 Xplained Demonstration. 8-bit Atmel Microcontrollers. Application Note. Features. 1 Introduction

USER GUIDE. ZigBit USB Stick User Guide. Introduction

QSG107: SLWSTK6101A/B Quick-Start Guide

Native route discovery algorithm

APPLICATION NOTE. Atmel AT03261: SAM D20 System Interrupt Driver (SYSTEM INTERRUPT) SAM D20 System Interrupt Driver (SYSTEM INTERRUPT)

APPLICATION NOTE. AT03197: Thermostat with Touch and Wireless Connectivity Hardware User's Guide. Atmel 32-bit Microcontroller. Description.

QSG107: SLWSTK6101A Quick-Start Guide

Atmel QT600 Quick Start Guide Touch Solutions

Atmel ATtiny1634 MCU Atmel ATA SBC LIN transceiver with integrated voltage regulator Touch. Three Atmel QTouch buttons One Atmel QTouch slider

[Type here] M904S. Bluetooth 4.0 SiP Module - BT 4.0 LE

USER GUIDE. AT08578: SAM D20 QTouch Robustness Demo. Atmel QTouch. Description. Features

APPLICATION NOTE. Scope. Reference Documents. Software Ethernet Bridge on SAMA5D3/D4. Atmel SMART SAMA5D3/D4 Series

APPLICATION NOTE. AT03324: Atmel REB212BSMA-EK Quick Start Guide. Atmel MCU Wireless. Introduction

Getting Started with the SAM4L-EK Demo

Hardware Prerequisites Atmel Xplained Pro Evaluation Kit Atmel WINC1500 extension USB Micro Cable (TypeA / MicroB)

APPLICATION NOTE. Atmel AVR3009: Driving QTouch Device with I 2 C Interface. Atmel QTouch. Introduction

AT07942: SAM4L Asynchronous Timer (AST) Driver. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

AT02667: XMEGA-E5 Xplained Hardware User's Guide. Features. Description. AVR XMEGA Microcontrollers APPLICATION NOTE

ATBTLC1000 Xplained Pro. Preface. SmartConnect Bluetooth USER GUIDE

USER GUIDE. Atmel PROTO1 Xplained Pro. Preface

APPLICATION NOTE. Atmel AT03304: SAM D20 I 2 C Slave Bootloader SAM D20. Description. Features

APPLICATION NOTE. Atmel AVR1638: XMEGA RTC Calibration. 8-bit Atmel Microcontrollers. Features. Introduction

QPP Proprietary Profile Guide

AVR1518: XMEGA-A1 Xplained Training - XMEGA Clock System. 8-bit Atmel Microcontrollers. Application Note. Prerequisites.

Atmel System Peripheral and Memory Products. Temperature Sensor, Crypto and Serial Memory Solutions

AT03664: Getting Started with FreeRTOS on SAM D20/D21/R21/L21/L22. Introduction. Features. SMART ARM-based Microcontrollers APPLICATION NOTE

SAMSUNG ELECTRONICS RESERVES THE RIGHT TO CHANGE PRODUCTS, INFORMATION AND SPECIFICATIONS WITHOUT NOTICE. Products and specifications discussed

Atmel and the use of Verilator to create uc Device Models

OLED display Sensors readout. Light sensor Temperature sensor

Atmel AVR ATxmega384C3 microcontroller OLED display with 128x32 pixels resolution Analog sensors. Ambient light sensor Temperature sensor

USER GUIDE. ATmega168 Xplained Mini User Guide. Introduction

APPLICATION NOTE. Atmel AT03160: Migrating Bootloader from ATxmega128A1 to other Atmel XMEGA Devices. Atmel AVR XMEGA. Features.

Atmel AVR32847: Migration from/to the UC3L0 64/32/16 from/to the UC3L0 256/ bit Atmel Microcontrollers. Application Note.

[Type here] M905. Bluetooth 4.2 Low Energy SiP Module with MCU and integrated antenna

APPLICATION NOTE. Atmel AT03782: Using Low Power Modes in SAM4N Microcontroller. Atmel 32-bit Microcontroller. Features.

APPLICATION NOTE. Atmel AT01080: XMEGA E Schematic Checklist. Atmel AVR XMEGA E. Features. Introduction

[Type here] M907. Bluetooth 4.2 Low Energy/Zigbee/RF4CE/Thread SiP Module with MCU and integrated antenna

APPLICATION NOTE. Atmel AT02260: Driving AT42QT1085. Atmel QTouch. Features. Description

QuickLogic TAG-N System User Manual

APPLICATION NOTE. AT07216: SAM G55 Schematic Checklist. Atmel SMART SAM G55. Introduction

Atmel AVR473: ATAVRSB202 Hardware User Guide. 8-bit Atmel Microcontrollers. Application Note. Features. 1 Introduction

Use of ISP1880 Accelero-Magnetometer, Temperature and Barometer Sensor

AT88RF04C. CryptoRF EEPROM Memory 13.56MHz, 4 Kilobits SUMMARY DATASHEET. Features

AT88SC3216CRF. CryptoRF EEPROM Memory 13.56MHz, 32 Kilobits SUMMARY DATASHEET. Features

ATWINC3400-XPRO. Preface. SmartConnect USER GUIDE

DATASHEET. MK-070C-HP High Performance 7 Inch Capacitive Touch Display. Amulet. Technologies. July 2015 Revision A

AT91 ARM Thumb Microcontrollers. Application Note. Using the ECC Controller on AT91SAM9260/9263 and AT91SAM7SE Microcontrollers. 1.

STK521. User Guide B AVR 01/12

APPLICATION NOTE. Atmel AVR2131: Lightweight Mesh Getting Started Guide. Atmel MCU Wireless. Features. Description

Transcription:

USER GUIDE SAML21 Wearable Demo (ATULPC-DEMO) ATSAML21G18B Preface The Wearable Demo (Ordering code: ATULPC-DEMO) Reference Design evaluation kit is hardware platform to address the wearable and IOT markets. The Wearable Demo Reference Design incorporates Atmel SAML21 microcontroller and BTLC1000 module along with sensors to demonstrate a complete solution needed for the IOT. Supported by the Atmel Studio integrated development platform, the kit provides easy access to the features that can be custom integrated in a design which will significantly reduce the Time-to-Market. Error! Bookmark not defined.

Contents Preface 1 1 Introduction... 3 1.1 Features and Overview... 3 1.2 Kit Overview... 4 2 Getting Started... 6 2.1 Quick-start... 6 2.2 Sensor Network... 6 2.3 Design documentation and related links... 7 3 User Guide... 7 3.1 Kit operation... 7 3.1.2 LED... 9 3.1.3 PTC Buttons... 9 3.1.4 Bluetooth LE Operation... 10 3.1.5 Debug/Programming... 16 3.2 Android App Operation... 16 3.2.1 App screens... 16 3.2.2 Alert message... 26 3.2.3 Settings... 28 3.3 Testing and Known Issues... 28 3.3.1 Errata(s)... 29 3.4 Wearable Demo on the Public Domain... 29 4 Revision History... 30 2

1 Introduction This document helps the user to understand the Wearable s underlying Technical details and the ways to operate it. 1.1 Features and Overview Figure 1-1. Functional Block Diagram Note: * Crypto is optional in the current design 3

Figure 1-2. Wearable kit 1.2 Kit Overview Figure 1-3. Top Side User LEDs 2- Channel Touch Button BTLC1000 VEML 6080 ATSAML21G18B BHI 160 10-pin Atmel-ICE header 4

Figure 1-4. Bottom Side BME 280 CR2032 Coin Cell Holder Footprint for ATECC508A Power Switch Processor o SAML21G18B Sensors o Physical Sensors Motion Sensors (6-axis motion (BHI160)) Accelerometer Gyro Environmental Sensors (BME280) Pressure Humidity Temperature UV Sensor (VEML 6080) Ambient Light o Virtual Sensors: The integrated Fuser Core of BHI160 receives raw sensor data from the connected sensors and provides virtual sensor data. Following virtual sensor data are supported in this Reference Design. Game Rotation Vector Step Detector Gravity Accelerometer Gyroscope Crypto o ATECC508A Display o LED indicator only Interface o Peripheral Touch Control(PTC) Connectivity o BTLC1000 module Programming header 5

o Atmel-ICE ARM 10-pin interface for programming Power o Coin Cell CR2032 CE/FCC certified Mechanical o PCB size - 40mm x 30mm (excluding the programming header extension) 2 Getting Started 2.1 Quick-start Figure 2-1. Functional Overview The Atmel SMART SAM L21 MCU based on Cortex M0+ and the Atmel SMART Bluetooth solution are the key components of the Wearable Demo platform. The BTLC1000 is an ultra-low power Bluetooth SMART System on a Chip with Integrated ARM Cortex-M0 MCU, Transceiver, Modem, MAC, PA, TR Switch, and Power Management Unit (PMU). It can be used as a Bluetooth Low Energy link controller or data pump with external host MCU or as a standalone applications processor with embedded BLE connectivity and external memory. The qualified Bluetooth Smart protocol stack is stored in dedicated ROM, the firmware includes L2CAP service layer protocols, Security Manager, Attribute protocol (ATT), Generic Attribute Profile (GATT) and the Generic Access Profile (GAP). Additionally, application profiles such as Proximity, Thermometer, Heart Rate, Blood Pressure, and many others are supported and included in the protocol stack. The BTLC1000 exchanges data with SAML21 MCU through UART interface. A BHI160 6-axis Smart Hub motion sensor and a BME280 environmental sensor from Bosch Sensortec, Vishay s VEML 6080 light/uv sensors form the network of Sensors proving periodic motion, environmental and light sense data to SAM L21 MCU through Two-Wire interface. The complete Wearable platform is powered by a simple coin cell. The Wearable Demo reference design is powered by CR2032. 2.2 Sensor Network The organs of the Wearable Demo are its sensors. The BHI160 integrates a 6-axis IMU with the Bosch Sensortec Fuser core. It provides a flexible, low power solution for motion sensing and sensor data processing. The BME280 is as combined digital humidity, pressure and temperature sensor based on proven sensing principles. The humidity sensor provides an extremely fast response time for fast context awareness applications and high overall accuracy over a wide temperature range. The pressure sensor is an absolute barometric pressure sensor with extremely high accuracy and resolution and drastically lower noise. 6

The integrated temperature sensor has been optimized for lowest noise and highest resolution. Its output is used for temperature compensation of the pressure and humidity sensors and can also be used for estimation of the ambient temperature. VEML6080 is an advanced ultraviolet (UV) and ambient light sensor. The whole sensor network is connected to SAML21 through SERCOM I2C interface. 2.3 Design documentation and related links SAM L21 Datasheet link: http://www.atmel.com/products/microcontrollers/arm/sam-l.aspx?tab=documents BTLC1000 BLE Module: http://www.atmel.com/devices/atbtlc1000.aspx BHI160: https://www.bosch-sensortec.com/bst/products/all_products/bhi160 BME280: https://www.bosch-sensortec.com/bst/products/all_products/bme280 Google Play Store link for Wearable Android App: https://play.google.com/store/apps/details?id=com.atmel.wearables 3 User Guide 3.1 Kit operation The Wearable Demo is powered by CR2032 coin cell. A switch controls the Power Supply to the entire system. After Power is ON, the Wearable goes through the initialization phase where the MCU s internal system, BTLC1000 and all the connected sensors are initialized. The end of the initialization phase is indicated by the ON to OFF transition of Power LED. After this phase, the user can enable BLE communication by Touch and Hold any one of the PTC button for about 1 second. Once it is enabled, the BLE LED start to blink for 1sec OFF + 1 sec ON. At this time, the user can connect the Wearable from Wearable Android App using Connect button. Once the connection is established, the BLE LED start to blink at faster rate. Now the user can navigate to different Android App screens to check-out the sensor values, 2-D graphs and 3- D plots. For the list of Android app screens supported, refer to section Android App Operation section in this document. If no user input is received after the BLE is enabled or if the active session is disconnected from the Android app, the Wearable enters to Low Power mode thus saving the system power consumption. Refer to the Functional Flow for the details. 7

Figure 3-1. Functional Flow Wearable Power-ON and Initialization Enter Low Power saving mode PTC wakeup input Enable BLE communication Wait for handshake from Android App Yes BLE disconnected? BLE connected? Yes No BLE connection is active No No Wait Timeout? Yes Enter Low Power saving mode 8

3.1.2 LED The Wearable Demo supports 3 user interface LED(s). 1) Power LED: The Power status LED blinks every 60 seconds. The reset status is ON to keep the user informed about the wearable initialization phase which approximately takes 15 to 16 seconds. 2) Touch LED: The Touch LED blinks when user swipe across the 2-channel touch surface is detected in either right or left direction. The reset status is OFF. 3) BLE connection status LED: The BLE status LED blinks at the rate of 50% duty cycle with period equal to 2sec when there is no active BLE connection. During active BLE connection, the LED is blinks at the rate of 980msec (OFF) + 20msec (ON). The reset status is OFF. Power LED Touch LED BLE LED 3.1.3 PTC Buttons The Touch plays a major role for the user interface. The 2-channel PTC on the top side of the Wearable has three different functionalities. 1) Enable BLE connection: After the Wearable Power ON initialization, device is in low power mode. The user has to touch and hold anywhere in PTC buttons for about 1 second to enable BLE connection. Both touch buttons act as single button for waking up the device. 2) Wakeup from Low power mode: Touch and hold any one of the PTC button for 1 seconds to wake-up the Wearable from low power mode. Exiting from low power mode puts the BLE in advertising mode. If no connection is established within 60 seconds, the Wearable re-enters the low power mode for power saving. 3) Swipe the Android App screen(s): Once the BLE connection is established with the Android phone and the app is active, swiping across the 2-channel PTC button from bottom to top or vice-versa equivalently swipe the app screen left to right or from right to left accordingly. 2-channel PTC 9

3.1.4 Bluetooth LE Operation This design incorporates Atmel Bluetooth SMART (BLE) technology using ATBTLC1000 BluSDK version 3.0. In this design, Wearable Device acts as GAP Peripheral which can advertise (to let other devices know that it's there) and Mobile Application acts as GAP Central which scans for other devices and sends a connection request to establish a connection. To exchange data between two connected devices, it uses GATT (Generic Attribute Profile) of BLE stack. It defines the way that two BLE devices transfer data back and forth using concepts called Services and Characteristics. GATT comes into play once a dedicated connection is established between two devices. Services are used to break data up into logic entities, and contain specific chunks of data called characteristics. A characteristic is a value used in a service along with properties and configuration information about how the value is accessed. A characteristic definition contains a characteristic declaration, characteristic properties, and a value. A service can have one or more characteristics, and each service distinguishes itself from other services by means of a unique numeric ID called a UUID, which can be either 16-bit (for standard BLE Services) or 128-bit (for custom services). The Wearable Device uses custom profile with 128 bit unique UUIDs. It uses base 128-bit UUID: F05A0000-3936-11E5-87A6-0002A5D5C51B. All services use 128-bit UUIDs, but for easy documentation reason the 16- bit part is listed in this document. It is embedded in the 128-bit UUID as shown in the below example. Example: 0xBAD0 maps as F05ABAD0-3936-11E5-87A6-0002A5D5C51B. All UUIDs that are mapped to 128- bit values are marked *. In this design, Wearable Device acts as GATT Server which stores data locally and provides data access methods to a remote GATT client. Mobile Application acts as GATT client which accesses data on the remote GATT server via read, write or notify operations. The custom profile uses below functions: Enable\disable sensor data from mobile application Configure sensor ODR(Output Data Rate) from mobile application Send data for enabled sensors at set output data rate to mobile application Send notifications for events like drop detection, low battery, step count and touch gesture to mobile application Table 3-1. Environment Service Characteristics UUID Properties Data Environment Data BAD0 * Read/Notify (9 Bytes) ODR BAD1 * Read/Write 1 Byte Byte0 = Temp LSB Byte1 = Temp MSB Byte2 = Pressure LSB Byte3 = Pressure MSB Byte4 = UV LSB0 Byte5 = UV LSB1 Byte6 = UV MSB0 Byte7 = UV MSB1 Byte8 = Humidity 10

When Environment Data Characteristics notification is enabled from application, the sensors (BME280 and VEML6080) starts to perform measurements at set ODR. The data is updated in the Environment Characteristics and notification is sent to application. This data is used to display environment data in mobile application. When Environment Data Characteristics notification is disabled from application, the sensor is put in stand-by mode. Output Data Rate can be set by application. It uses ODR Characteristics. The below ODR settings are allowed for Environment sensors 1Hz 2Hz 4Hz 8Hz 10Hz ODR settings can be done in mobile application settings screen. Table 3-2. Environment Service Protocol User Action From Wearable From Android Phone User enters to Environment Screen Enable Environment Characteristics Notification Environment Screen Update Environment Characteristics with sensor data and send notification to application at set ODR When user moves out of Environment Screen User Opens settings screen User sets new ODR value for environment sensors in Settings Screen Disable Environment Characteristics Notification Read ODR Characteristics to get the current Output Data Rate for environment sensors Write ODR Characteristics to set the new Output Data Rate for environment sensors 11

Table 3-3. Device Orientation Service Characteristics UUID Properties Data Device Rotation Vector BAD8 * Read/Notify Gyro-Positions BAD4 * Read/Notify Accelero-Positions BAD7 * Read/Notify Drop Detection BADA * Notify 1 Byte Step Increment BADB * Notify 1 Byte ODR BAD9 * Read/Write 1 Byte (8 Bytes) Byte0 = X LSB Byte1 = X MSB Byte2 = Y LSB Byte3 = Y MSB Byte4 = Z LSB Byte5 = Z MSB Byte6 = W LSB Byte7 = WMSB (6 Bytes) Byte0 = X LSB Byte1 = X MSB Byte2 = Y LSB Byte3 = Y MSB Byte4 = Z LSB Byte5 = Z MSB (6 Bytes) Byte0 = X LSB Byte1 = X MSB Byte2 = Y LSB Byte3 = Y MSB Byte4 = Z LSB Byte5 = Z MSB If any one of the Characteristics notification of this service is enabled from application, the sensor starts to perform measurements at set ODR. The rotation vector data is updated in the Device Rotation Vector Characteristics and the accelerometer position data is updated in the Accelerometer-Positions Characteristics. After updating the data, it sends notification to application. Wearable Device uses Game Rotation Vector (Quaternion+) data from BHI160 sensor for device orientation (3D image) plotting. Accelerometer data is used for 2D plotting graph in mobile application. If Step Increment Characteristics notification is enabled by application, Wearable Device sends Step Increment notification to application for each step detection. The data is used for Step Count Screen in mobile application. If Drop Detection Characteristics notification is enabled by application, Wearable Device sends Drop notification to application when it detects a device drop. The data is used for Wearable Drop Detected popup in mobile application. The BHI160 sensor is put in stand-by mode, when all Device Orientation Characteristics notifications are disabled from application. In other words, if the user navigates to environmental screen, BHI160 will be put in standby mode. 12

Output Data Rate can be set by application. It uses ODR Characteristics. The below ODR settings are allowed for Motion sensors (Accelerometer and Gyroscope sensors). 12.5Hz 25Hz 50Hz 100Hz 200Hz Table 3-4. Device Orientation Service Protocol User Action From Wearable From Android Phone User enters to 3D Plot Screen Enable Device Rotation Vector Characteristics Notification 3D Plot Screen Update Device Rotation Vector Characteristics with Quaternion+ data and send notification to application at set ODR When user moves out of 3D Plot Screen User enters to Step Count Screeen and starts step count. Disable Device Rotation Vector Characteristics Notification Enable Device Step Increment Characteristics Notification Step Count Screen or any other screen Send Step Increment Characteristics notification for each step detection Stops step count in Step Count Screen User enters to 2D Plot Screen (Accelerometer graph) and start the plot. Disable Device Step Increment Characteristics Notification Enable Accelero-Positions Characteristics Notification 2D Plot screen Update Accelero-Positions Characteristics with accelerometer data and send notification to app When user moves out of 2D Plot Screen Disable Accelero-Positions Characteristics Notification 13

User enters to 2D Plot Screen (Gyroscope graph) and start the plot. Enable Gyro-Positions Characteristics Notification 2D Plot screen Update Gyro-Positions Characteristics with Gyro data and send notification to app When user moves out of 2D Plot Screen User Opens settings screen User sets new ODR value for environment sensors in Settings Screen User enables Drop Detection in Settings Screen Disable Gyro-Positions Characteristics Notification Read ODR Characteristics to get the current Output Data Rate for motion sensors Write ODR Characteristics to set the new Output Data Rate for motion sensors Enable Drop Detection Characteristics Notification User drops device Send Drop Detection Characteristics notification Table 3-5. Battery Service Characteristics UUID Properties Data Low Battery BADC * Notify 1 Byte This service is used to send low battery notification to mobile application. It has one characteristics Low Battery. Notification for this characteristics is enabled by the application once connection is established. When wearable device detects low battery voltage, it sends notification to mobile application. Mobile application displays Wearable Low Battery popup, when it receives low battery notification from wearable device. 14

Table 3-6. Battery Service Protocol User Action From Wearable From Android Phone BLE connection established between mobile application and wearable device Enable Low Battery Characteristics Notification Any Screen Send Low Battery Characteristics notification when low battery voltage is detected. Table 3-7. Touch Service Characteristics UUID Properties Data Touch Gesture BADD * Notify 1 Byte This service is used to send left/right swipe notification to mobile application. It has one characteristics Touch Gesture. Notification for this characteristics is enabled by the application once connection is established. When wearable device detects left/right swipe, it sends notification to mobile application. Mobile application navigates screen based on touch gesture received from wearable device. Table 3-8. Touch Service Protocol User Action From Wearable From Android Phone BLE connection established between mobile application and wearable device Enable Touch Gesture Characteristics Notification Any Screen Update Touch Gesture Characteristics with gesture data and send notification to app. 15

3.1.5 Debug/Programming Hardware Tool: Atmel-ICE IDE: Atmel Studio 7 The Wearable supports SWD debugging/programming interface through 10-pin Atmel-ICE standard header. SAM-ICE can also be used with compatible 10-pin cable. Please refer to Debugger pin assignments from the schematics. Figure 3-2. Debug header orientation 3.2 Android App Operation The Wearable Android App is supported on Android phones/tabs running Android V4.3, V4.4 and V5.0 with Bluetooth BLE support. 3.2.1 App screens 3.2.1.1 Main Screen The Main or Home screen lists down the available Wearable devices in the vicinity. When this page launches, the app should automatically start scanning for available Wearables. The list should show all the available Wearables within the range, by the device name, device address below and signal strength (in db). Next to the name of each Wearable, there is a button CONNECT. The user should be able to select a Wearable to connect to by tapping on the CONNECT button. The app should automatically take the user to next corresponding screen to fetch the custom services as given by the selected wearable. If the Wearable is already connected, this home screen will list the connected Wearable device having DISCONNECT button. Once disconnect button is pressed, app should again scan the available Wearable. The scan should be stopped upon when the user taps on the STOP SCAN button. There should be the Navigation drawer button in the Home Screen. Pressing the Back button should exit from the application. There should be no action corresponding to a swipe to the right or to the left on the App screen or on the touch buttons on the Wearable. 16

Figure 3-3. Main Screen Figure 3-4. Connection in-progress 17

3.2.1.2 Proximity Screen The page display the Status of the Bluetooth link and using RSSI, the approximate range between the Android Host device and the Wearable can be located with a location icon. There is a Navigation Drawer button on the top left of the screen and a DISCONNECT button on the top right of the screen. When the user taps on this button, the Wearable gets disconnected from the app and the user should be taken to the Home Screen. Figure 3-5. RSSI Plot 3.2.1.3 Environmental Sensor The Environment App screen includes the following parameters with a graph button against each of them: Temperature Humidity Pressure Light The user is re-directed to the corresponding graph when the user presses the Graph button. There is Navigation Drawer button on the top left of the screen and a DISCONNECT button on the top right of the screen. When the user taps on this button, the Wearable gets disconnected from the app and the user should be taken to the Home Screen. The graph plot against each parameters has the ability to hold the last 5 minutes to 1 hour data. 18

Figure 3-6. PTH & Light sensor screen Figure 3-7. Temperature Plot 19

Figure 3-8. Humidity Plot Figure 3-9. Pressure Plot 20

Figure 3-10. Light(lx) Plot The user can slide the graph to the right or left as well as Zoom in or out. Once the user zooms out the graph, the graph should show the data of the last 1 hour. 3.2.1.4 Step Counter The Step Counter Plot is a 24 hour plot (12 A.M to 12 P.M) with one hour resolution points on the X-axis and step counts on the Y-axis. Y-axis is auto scalable. Y axis scale is auto-adjusted based on maximum step count for the available data. Once the slider on the right bottom is flipped to ON state, Irrespective of screen, the counter increment for every step count is detected until the slider is flipped to OFF state. At the stop condition, the latest value of the step count is retained till the end of the plot time period. The latest value of the step count is shown on the top screen. When no step is detected, count will be taken as zero. When the RESET button is pressed, the value of the step count reset back to zero. The Step Count plot once started, irrespective of screen, the available step count data is plotted in the graph if the step count is detected. After every 24 hours, the plot resets itself. 21

Figure 3-11. Step Counter Plot and Value There is Navigation Drawer button on the top left of the screen and a DISCONNECT button on the top right of the screen. When the user taps on this button, the Wearable gets disconnected from the app and the user should be taken to the Home Screen. Step count graph history can be cleared from the Setting Screen Swiping the screen to the left take the user to the Environment Screen. Swiping the screen to the right take the user to the Accelerometer Screen. 3.2.1.5 Motion sensing This screen and the next app screen shows the Accelerometer plot and the Gyroscope plot respectively The Accelerometer plot is a 2D plot of accelerometer against time from the data output from 6X sensor fusion algorithm. The 2D Plot of Accelerometer has time plot on X axis and acceleration (g) on the Y Axis. The 2D Plot of Gyroscope has time plot on X axis and rotational speed (deg/sec) on the Y Axis. The user at any instance can START or STOP the plot using the button on the Left bottom screen. 22

Figure 3-12. Accelerometer plot There is Navigation Drawer button on the top left of the screen and a DISCONNECT button on the top right of the screen. When the user taps on this button, the Wearable gets disconnected from the app and the user should be taken to the Home Screen. Swiping the screen to the left outside the plot take the user to the Step count Screen whereas, swiping the screen to the left from within the plot, allows the user to traverse along x-axis. Swiping the screen to the right outside the plot take the user to the Gyroscope Screen whereas, swiping the screen to the right from within the plot, allows the user to traverse along x-axis. 23

Figure 3-13. Gyroscope plot There is Navigation Drawer button on the top left of the screen and a DISCONNECT button on the top right of the screen. When the user taps on this button, the Wearable gets disconnected from the app and the user should be taken to the Home Screen. Swiping the screen to the left outside the plot take the user to the Accelerometer Screen whereas, swiping the screen to the left from within the plot, allows the user to traverse along x-axis. Swiping the screen to the right outside the plot take the user to the 3-D plot Screen whereas, swiping the screen to the right from within the plot, allows the user to traverse along x-axis. 3.2.1.6 3D-Plot This screen presents the 3D plot of the Wearable, thanks to the Quaternion Game Rotation Vector Data from BHI160 Sensor Fusion Core. There should be Navigation Drawer button on the top left of the screen. There is Navigation Drawer button on the top left of the screen and a DISCONNECT button on the top right of the screen. When the user taps on this button, the Wearable gets disconnected from the app and the user should be taken to the Home Screen. 24

Figure 3-14. 3-D Plots 25

Pressing the Back button will take the user to the Home Screen. Swiping the screen to the left take the user to the Gyroscope Screen. Swiping the screen to the right has no action. 3.2.2 Alert message The Wearable App displays pop up messages, irrespective of the screen in which the user is currently at. 1) In-Case of Wearable out of Range, Wearable Out of Range alert message screen appears. 2) In-Case of Wearable being dropped on the floor, Wearable Drop Detected alert message screen appears. 3) Wearable Low Battery alert message appears, if the battery voltage of the Wearable coin cell is below threshold (~2.4V). Among the three alert notifications, (3) has the highest priority in a scenario of simultaneous occurrence of all the three notifications. In case condition (3) happens, the alert message will be displayed and alarmed continuously until the Wearable is brought back to range and the Wearable re-connects. If the user wishes, he can only silence the alarm but not able to discard the notification but user can exit from the application by pressing EXIT. If (2) and (3) occur simultaneously, then the alert messages alter among the two for a time period of 3 seconds each, until the user acknowledges the message by tapping the OK button on the message, however there is no corresponding acknowledgement action from the android app side. Pressing OK will exit the alert message. Figure 3-15. Out-Of-Range 26

Figure 3-16. Drop Detection Figure 3-17. Battery Low 27

3.2.3 Settings In Settings menu, the user can manually turn on or off, the notifications for Wearable Drop Detection Wearable Low Battery Alert Wearable Out of Range Alert Temperature unit selection (degree C or F) Step Count Graph History- clear option Data rate for Environmental sensor using Drop down menu Data rate for Motion sensor using Drop down menu There is a Navigation Drawer button on the top left of the screen. Figure 3-18. Settings Menu 3.3 Testing and Known Issues The Wearable Demo and Android App has been tested on different Android OS versions running on different Android Phones/Tabs. KitKat - Samsung galaxy tab, Lenovo A6000, Lenovo K3 Note, Redmi Note 2 prime 28

Lollipop - Nexus9, Lenovo A6000 Marshmallow - Nexus6 3.3.1 Errata(s) 1) The Out-Of-Range alert goes off automatically and the sensor values on-screen are frozen to the last known values. There is no auto re-connection during this time even if BLE advertising is active. This issue is observed with android one running KitKat 4.4.4. After around 30 seconds, the OS gives the app the information as the connection has re-established again. 3.4 Wearable Demo on the Public Domain 1) http://www.atmel.com/about/news/release.aspx?reference=tcm:26-79357 2) https://www.youtube.com/watch?v=blb4xynmwkc 29

4 Revision History Doc Rev. Date Comments xxxxa 03/2016 Initial document release. 30

Atmel Corporation 1600 Technology Drive, San Jose, CA 95110 USA T: (+1)(408) 441.0311 F: (+1)(408) 436.4200 www.atmel.com 2014 Atmel Corporation. / Rev.:Error! Reference source not found.. Atmel, Atmel logo and combinations thereof, Enabling Unlimited Possibilities, and others are registered trademarks or trademarks of Atmel Corporation in U.S. and other countries. ARM, ARM Connected logo, and others are the registered trademarks or trademarks of ARM Ltd. Other terms and product names may be trademarks of others. DISCLAIMER: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise, to any intellectual property right is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN THE ATMEL TERMS AND CONDITIONS OF SALES LOCATED ON THE ATMEL WEBSITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDENTAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS AND PROFITS, BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF ATMEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Atmel makes no representations or warranties with respect to the accuracy or completeness of the contents of this document and reserves the right to make changes to specifications and products descriptions at any time without notice. Atmel does not make any commitment to update the information contained herein. Unless specifically provided otherwise, Atmel products are not suitable for, and shall not be used in, automotive applications. Atmel products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life. SAFETY-CRITICAL, MILITARY, AND AUTOMOTIVE APPLICATIONS DISCLAIMER: Atmel products are not designed for and will not be used in connection with any applications where the failure of such products would reasonably be expected to result in significant personal injury or death ( Safety-Critical Applications ) without an Atmel officer's specific written consent. Safety-Critical Applications include, without limitation, life support devices and systems, equipment or systems for the operation of nuclear facilities and weapons systems. Atmel products are not designed nor intended for use in military or aerospace applications or environments unless specifically designated by Atmel as military-grade. Atmel products are not designed nor intended for use in automotive applications unless specifically designated by Atmel as automotive-grade. 31