Atmel ATBTLC1000 BluSDK User manual

ATBTLC1000 BluSDK
HID Mouse Device –Getting Started Guide
USER GUIDE
Introduction
This getting started guide describes the setup of ATBTLC1000 with a supported platform bringing up an
example profile supplied as part of BluSDK. This document explains the bring-up of HID Mouse device
example application that is embedded as part of the software release package.
Atmel-42524C-ATBTLC1000-BluSDK-HID-Mouse-Device-Getting-Started-Guide_USERGUIDE_022016

HID Mouse Device –Getting Started Guide [USER GUIDE]
Atmel-42524C-ATBTLC1000-BluSDK-HID-Mouse-Device-Getting-Started-Guide_USERGUIDE_022016
2
2
Table of Contents
1Description...................................................................................................................3
2Demo Setup .................................................................................................................4
3Supported Hardware Platforms and IDEs..................................................................4
4Hardware Setup...........................................................................................................5
4.1 SAM L21 Xplained Pro HID Device Setup.............................................................................................5
4.2 SAM D21 Xplained Pro HID Device Setup............................................................................................5
4.3 SAM G55 Xplained Pro HID Device Setup............................................................................................6
4.4 SAM 4S Xplained Pro HID Device Setup..............................................................................................6
5Configuration for HID Mouse Application..................................................................7
6Software Setup ............................................................................................................9
6.1 Installation Steps...................................................................................................................................9
6.2 Build Procedure...................................................................................................................................10
7Console Logging....................................................................................................... 14
8Running the Demo.....................................................................................................14
9BluSDK Software Architecture ................................................................................. 19
10 ATMEL EVALUATION BOARD/KIT IMPORTANT NOTICE AND DISCLAIMER........ 20
11 Revision History........................................................................................................21

HID Mouse Device –Getting Started Guide [USER GUIDE]
Atmel-42524C-ATBTLC1000-BluSDK-HID-Mouse-Device-Getting-Started-Guide_USERGUIDE_022016
3
3
1 Description
The HID over GATT (HOGP) profile defined by the Bluetooth SIG enables support of HID services over
a Bluetooth Low Energy (BLE) protocol stack using Generic Attribute profile (GATT). This allows
devices like keyboard or mouse implementing HOGP to connect to a compatible HOGP/BLE host
device (e.g.: Mobile Phone, Tablet, TV, etc.).
This document explains the details about
1. Getting started with the setup of supported platform (see Chapter 3).
2. Demonstration of a HID mouse device functionality using an Android phone.
The HOGP Mouse device application example (referred as HID Mouse device in this document)
supports the following features
Advertisement
Pairing
Services: HID Service and Device Information Service
Report Mode (Mouse)
The HID Mouse device application example supports the following characteristics for HID service.
Protocol Mode
Report
Boot Mouse Input Report
Report Map
HID Information
HID Control Point
For the purpose of demonstration, the example application simulates the function of a mouse. Once the
handshake and connection procedure between a mobile phone and the ATBTLC1000 emulating a
mouse device example is completed, a mouse cursor will appear on the mobile device’s screen.
Pressing the button on the SAM L21 platform simulates movement of mouse in a pre-defined pattern as
described in later in this document.

HID Mouse Device –Getting Started Guide [USER GUIDE]
Atmel-42524C-ATBTLC1000-BluSDK-HID-Mouse-Device-Getting-Started-Guide_USERGUIDE_022016
4
4
2 Demo Setup
Figure 2-1. Demo setup of HID Mouse Device Application on ATBTLC1000
BLE LINK
3 Supported Hardware Platforms and IDEs
Table 3-1. BluSDK –Supported Hardware and IDEs
Platform
MCU
Supported
BLE device
Supported evaluation kits
Supported IDEs
SAM L21 (MCU)
ATSAML21J18B
ATBTLC1000
ATBTLC1000-XSTK
(ATSAML21-XPRO-B + ATBTLC1000
XPRO)
Atmel Studio v7.0
SAM L21 (MCU)
ATSAML21J18A
ATBTLC1000
ATSAML21 XPRO + ATBTLC1000
XPRO
Atmel Studio v7.0
SAM D21 (MCU)
ATSAMD21J18A
ATBTLC1000
ATSAMD21-XPRO + ATBTLC1000
XPRO
Atmel Studio v7.0
SAM G55 (MCU)
ATSAMG55J19
ATBTLC1000
ATSAMG55-XPRO + ATBTLC1000
XPRO
Atmel Studio v7.0
SAM 4S (MCU)
ATSAM4SD32C
ATBTLC1000
ATSAM4S-XPRO + ATBTLC1000
XPRO
Atmel Studio v7.0
Android Mobile phone
(HOGP Host role)
ATBTLC1000+
Supported Atmel MCU
(HID Mouse Device
Application)

HID Mouse Device –Getting Started Guide [USER GUIDE]
Atmel-42524C-ATBTLC1000-BluSDK-HID-Mouse-Device-Getting-Started-Guide_USERGUIDE_022016
5
5
4 Hardware Setup
4.1 SAM L21 Xplained Pro HID Device Setup
Figure 4-1. ATBTLC1000 Xplained Pro Extension Connected to a SAM L21 Xplained Pro
4.2 SAM D21 Xplained Pro HID Device Setup
Figure 4-2. BTLC1000 Xplained Pro Extension Connected to a SAM D21 Xplained Pro

HID Mouse Device –Getting Started Guide [USER GUIDE]
Atmel-42524C-ATBTLC1000-BluSDK-HID-Mouse-Device-Getting-Started-Guide_USERGUIDE_022016
6
6
4.3 SAM G55 Xplained Pro HID Device Setup
Figure 4-3. ATBTLC1000 Xplained Pro Extension Connected to a SAM G55 Xplained Pro
4.4 SAM 4S Xplained Pro HID Device Setup
Figure 4-4. ATBTLC1000 Xplained Pro Extension Connected to a SAM 4S Xplained Pro

HID Mouse Device –Getting Started Guide [USER GUIDE]
Atmel-42524C-ATBTLC1000-BluSDK-HID-Mouse-Device-Getting-Started-Guide_USERGUIDE_022016
7
7
5 Configuration for HID Mouse Application
The user may need to modify few macros in hid_device.h (HID Profile) for configuring the profile for
HID Mouse application as per the desired application use-case.
Figure 5-1. HID Code Hierarchy

HID Mouse Device –Getting Started Guide [USER GUIDE]
Atmel-42524C-ATBTLC1000-BluSDK-HID-Mouse-Device-Getting-Started-Guide_USERGUIDE_022016
8
8
List of macro need to be modified by user mentioned below:
1. By default the application supports Report mode. In the case the application requires support for
only boot mode, the user can add the macro “BOOT_MODE” in the compiler/symbols tabs shown
below
Figure 5-2. Enabling Boot Mode Support
2. User should configure the desired number of reports to be supported support in the application.
Currently the maximum number of report supported is 10.
#define HID_NUM_OF_REPORT (1)
3. User should configure the desired number of service instances. Currently the maximum number
of service supported is 2.
#define HID_SERV_INST (1)

HID Mouse Device –Getting Started Guide [USER GUIDE]
Atmel-42524C-ATBTLC1000-BluSDK-HID-Mouse-Device-Getting-Started-Guide_USERGUIDE_022016
9
9
6 Software Setup
6.1 Installation Steps
1. Atmel Studio installation [Atmel Studio 7.0 (build 594) Installer –with .NET]
http://www.atmel.com/tools/atmelstudio.aspx
(Note: SAM L21 Rev B/SAM D21/SAM G55/SAM 4S part pack is built-in as part of Atmel Studio
7.0)
2. Atmel USB Driver Installer from http://www.atmel.com/tools/atmelstudio.aspx.
3. Install the standalone ASF package from
http://www.atmel.com/tools/AVRSOFTWAREFRAMEWORK.aspx.
Note: Refer to the BluSDK release notes for updates to version numbers of the components
mentioned above.
This ASF msi package will install the following examples within the Atmel Studio environment.
1. HID Profile Device Application for SAM L21.
2. HID Profile Device Application for SAM D21.
3. HID Profile Device Application for SAM G55.
4. HID Profile Device Application for SAM 4S.

HID Mouse Device –Getting Started Guide [USER GUIDE]
Atmel-42524C-ATBTLC1000-BluSDK-HID-Mouse-Device-Getting-Started-Guide_USERGUIDE_022016
1
0
10
6.2 Build Procedure
The following procedure is explained for SAML21 application example. The same procedure is valid for
the case of all the other supported platform as well.
1. Select New Example Project.
Figure 6-1. Creating a New Project

HID Mouse Device –Getting Started Guide [USER GUIDE]
Atmel-42524C-ATBTLC1000-BluSDK-HID-Mouse-Device-Getting-Started-Guide_USERGUIDE_022016
1
1
11
2. Enter “BLE-HID” in search window and expand Atmel Corp Projects. The location and the name
of the project can be selected in the respective fields. Click OK.
Figure 6-2. Selecting HID Device Application from Example Projects
3. Accept the license Agreement. The studio will generate the BLE-HID Mouse project for SAM L21.

HID Mouse Device –Getting Started Guide [USER GUIDE]
Atmel-42524C-ATBTLC1000-BluSDK-HID-Mouse-Device-Getting-Started-Guide_USERGUIDE_022016
1
2
12
4. Building the solution.
Figure 6-3. Building the HID Device Application
5. Download the application via the DEBUG USB to the SAM L21 board using Device Programming
option available in Tools as shown below
Figure 6-4. Selecting Device Programming Option

HID Mouse Device –Getting Started Guide [USER GUIDE]
Atmel-42524C-ATBTLC1000-BluSDK-HID-Mouse-Device-Getting-Started-Guide_USERGUIDE_022016
1
4
14
7 Console Logging
For the purpose of debugging, logging is made available through a serial console. The logging interface
utilizes the same COM port that connects to supported platform (see Chapter 3). A serial port monitor
application (for example TeraTerm) shall be opened and attached to the appropriate COM port
enumerated by the device on the PC.
8 Running the Demo
1. Connect the ATBTLC1000 Xplained Pro Board to SAM L21 Xplained Pro EXT1 as indicated in
Figure 4-1. (The steps mentioned below use SAM L21 as reference. If SAM G55 or SAM D21 is
used for the demo, the same steps are applicable.)
2. Power on the SAM L21 by connecting the USB Cable.
3. On the PC, open any Terminal Application (e.g. TeraTerm). Select the appropriate COM Port.
(Settings: Baudrate 115200, None Parity, one Stop bit, one Start bit, no Hardware Handshake.)
4. Press the Reset button on the SAM L21 or supported platform (see Chapter 3) board.
5. The device is now in advertising mode as shown below.
Figure 8-1. HID Mouse Device in Advertising Mode
6. The demo requires use of an Android mobile phone supporting HOGP. The HOGP profile is
natively supported in Android from version 4.4 (Android KitKat) and upwards. The phone must
include support a Bluetooth chipset supporting BT 4.0 or upwards on the mobile phone, In
Bluetooth settings scan for the devices, device with “ATMEL-HID” will be found as shown below.
Click on “ATMEL-HID” to get connected.
Figure 8-2. Atmel HID (Mouse) Device Discovery on Bluetooth Settings Page
7. Once the user clicks on “ATMEL-HID”, pairing procedure started.
Figure 8-3. Pairing Process with HID Device

HID Mouse Device –Getting Started Guide [USER GUIDE]
Atmel-42524C-ATBTLC1000-BluSDK-HID-Mouse-Device-Getting-Started-Guide_USERGUIDE_022016
1
6
16
8. Once the pairing done connected device is listed in paired device.
Figure 8-6. ATMEL-HID Device Shown as Connected
9. Console log on HID device side for pairing and connection procedure.
Figure 8-7. HID Mouse Device Console Log after Connection and Pairing Completion

HID Mouse Device –Getting Started Guide [USER GUIDE]
Atmel-42524C-ATBTLC1000-BluSDK-HID-Mouse-Device-Getting-Started-Guide_USERGUIDE_022016
1
7
17
10. Once the device connected to host (Phone). User can click on SW0 button for simulating mouse
movement.
Figure 8-8. SW0 Button for Mouse Movement Simulation
11. For every press on button, the user can see corresponding cursor movement on HID host as
described below:
First 5 Button Press: Cursor moves right
Next 5 Button Press: Cursor moved down
Next 5 Button Press: Cursor moves left
Next 5 Button Press: Cursor moved up
The same sequence is repeated based on user input. A snapshot of the console logs are shown
below.
Figure 8-9. HID Device Console Log for Movement

HID Mouse Device –Getting Started Guide [USER GUIDE]
Atmel-42524C-ATBTLC1000-BluSDK-HID-Mouse-Device-Getting-Started-Guide_USERGUIDE_022016
1
8
18
Figure 8-10. Mouse Cursor Position on Phone
Figure 8-11. Mouse Move Simulation
Cursor position after pressing SW0 button 5 times
from start (5 moves RIGHT)
Cursor position after pressing SW0 button 10
times from start (5 moves DOWN)
Cursor position after pressing SW0 button 15
times from start (5 moves LEFT)
Cursor position after pressing SW0 button 20
times from start (5 moves UP)
Initial cursor position (START)

HID Mouse Device –Getting Started Guide [USER GUIDE]
Atmel-42524C-ATBTLC1000-BluSDK-HID-Mouse-Device-Getting-Started-Guide_USERGUIDE_022016
1
9
19
9 BluSDK Software Architecture
The following diagram illustrates the various layers in the BLE subsystem for the ATBTLC1000
configuration. The External host can be supported platform.
Figure 9-1. BluSDK Software Architecture

HID Mouse Device –Getting Started Guide [USER GUIDE]
Atmel-42524C-ATBTLC1000-BluSDK-HID-Mouse-Device-Getting-Started-Guide_USERGUIDE_022016
2
0
20
10 ATMEL EVALUATION BOARD/KIT IMPORTANT NOTICE AND
DISCLAIMER
This evaluation board/kit is intended for user's internal development and evaluation purposes only. It is
not a finished product and may not comply with technical or legal requirements that are applicable to
finished products, including, without limitation, directives or regulations relating to electromagnetic
compatibility, recycling (WEE), FCC, CE or UL. Atmel is providing this evaluation board/kit “AS IS”
without any warranties or indemnities. The user assumes all responsibility and liability for handling and
use of the evaluation board/kit including, without limitation, the responsibility to take any and all
appropriate precautions with regard to electrostatic discharge and other technical issues. User
indemnifies Atmel from any claim arising from user's handling or use of this evaluation board/kit. Except
for the limited purpose of internal development and evaluation as specified above, no license, express
or implied, by estoppel or otherwise, to any Atmel intellectual property right is granted hereunder.
ATMEL SHALL NOT BE LIABLE FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR
CONSEQUENTIAL DAMGES RELATING TO USE OF THIS EVALUATION BOARD/KIT.
ATMEL CORPORATION
1600 Technology Drive
San Jose, CA 95110
USA
Other manuals for ATBTLC1000 BluSDK
6
Table of contents
Other Atmel Wireless Module manuals