Microchip Technology ATWINC3400 User Manual

ATWINC3400
ATWINC3400 BLE Profiles Application User Guide

Introduction

This document describes how to set the ATWINC3400 evaluation boards for various example applications supported by the Atmel Studio. This document also provides the list of supported hardware platforms and IDEs to be used in conjunction with the ATWINC3400 evaluation board (see Table 2-1).
Note:  All the example applications are included in the software package.
Figure 1. ATWINC3400 Extension Board
Proximity Reporter Application:
Advertisement
Pairing/bonding
Provisioning Services – Scan for Wi-Fi® APs, send Wi-Fi provision details/configuration,
trigger Wi-Fi connection
Proximity Services – Link Loss service (mandatory), Immediate Alert service, and Tx Power
service
Battery Service Application
Advertisement
Pairing/bonding
Provisioning Services – Scan for Wi-Fi APs, send Wi-Fi provision details/configuration, trigger
Wi-Fi connection
Battery level
Custom Serial Chat (CSC) Profile Application:
© 2018 Microchip Technology Inc.
User Guide
DS50002706A-page 1
ATWINC3400
Device discovery and disconnection
Pairing/bonding
Send and receive messages
Console display
Heart Rate Profile Application:
Advertisement
Pairing/bonding
Heart rate sensor measurements
Console display
Transparent Service Application:
Advertisement
Pairing/bonding
Send and receive messages
Console display
On-chip Provisioning Application:
Advertisement
Pairing/bonding
Provisioning Services – Scan for Wi-Fi APs, send Wi-Fi provision details/configuration, trigger Wi-
Fi connection
© 2018 Microchip Technology Inc.
User Guide
DS50002706A-page 2

Table of Contents

Introduction......................................................................................................................1
Features.......................................................................................................................... 1
1. Functional Overview.................................................................................................. 5
1.1. Proximity Reporter Application.....................................................................................................5
1.2. Battery Service Application.......................................................................................................... 5
1.3. Custom Serial Chat Profile Application........................................................................................ 6
1.4. Heart Rate Profile Application...................................................................................................... 6
1.5. Transparent Service Application...................................................................................................6
1.6. On-chip Provisioning Application..................................................................................................7
2. Supported Hardware Platforms and IDEs................................................................. 8
3. Hardware Setup.........................................................................................................9
3.1. ATWINC3400 Board.....................................................................................................................9
3.2. SAM D21 Xplained Pro Setup......................................................................................................9
4. Software Setup........................................................................................................ 11
4.1. Installation Steps........................................................................................................................ 11
4.2. Build Procedure..........................................................................................................................11
5. Running Example Applications................................................................................16
5.1. Initializing the Device..................................................................................................................17
5.2. BLE Provisioning Procedure...................................................................................................... 17
5.3. BLE Profile Scan and Connect...................................................................................................19
5.4. Proximity Reporter Application...................................................................................................21
5.5. Battery Service Application........................................................................................................ 24
5.6. Custom Serial Chat Profile Application...................................................................................... 25
5.7. Heart Rate Profile Application.................................................................................................... 26
5.8. Transparent Service Application.................................................................................................27
5.9. On-chip Provisioning Application................................................................................................30
6. Document Revision History..................................................................................... 33
The Microchip Web Site................................................................................................ 34
Customer Change Notification Service..........................................................................34
Customer Support......................................................................................................... 34
Microchip Devices Code Protection Feature................................................................. 34
Legal Notice...................................................................................................................35
Trademarks................................................................................................................... 35
© 2018 Microchip Technology Inc.
User Guide
DS50002706A-page 3
ATWINC3400
Quality Management System Certified by DNV.............................................................36
Worldwide Sales and Service........................................................................................37
© 2018 Microchip Technology Inc.
User Guide
DS50002706A-page 4

1. Functional Overview

This chapter describes the functional overview of all the applications that are pre-defined in Atmel Studio.

1.1 Proximity Reporter Application

The Proximity profile is defined by the Bluetooth® SIG to enable proximity monitoring between two Bluetooth Low Energy (BLE) devices. The Proximity Monitor (a Generic Attribute (GATT) client) configures the behavior of the peer Proximity Reporter device (a GATT server) based on the link conditions. The configuration includes setting the alert level, which triggers on the Link Loss or based on a different threshold of the Path Loss. The Path Loss determines the quality of the connection and it is derived out of the Received Signal Strength Indicator (RSSI). The Proximity Monitor continuously evaluates the Path Loss and creates an immediate alert in the Proximity Reporter device when the Path Loss crosses threshold values.
On-Board LED Status
The on-board LED is configured to notify the user about the alerts received. The different alerts for the Link Loss and Immediate Alert services are explained in the following subsections.
ATWINC3400
Functional Overview
Link Loss
On the Link Loss, the LED blinks according to the alert level set by the Proximity Monitor. The alert levels are:
NO_ALERT for No alert level
MILD_ALERT for Mild alert level
HIGH_ALERT for High alert level
Based on the alert level configuration set by the Proximity Monitor, the LED blinks at different rates:
If the alert level is “HIGH_ALERT” then the LED blinks faster (1 second interval)
If the alert level is “MILD_ALERT” then the LED blinks moderately (2 second interval)
If the alert level is “NO_ALERT” the LED must be off
Alert on Path Loss (Immediate Alert)
This alert is applicable when the “Immediate Alert” service is implemented. The example application relies on the Path Loss configuration done by the Proximity Monitor and notifies accordingly. The alert levels are:
NO_ALERT for No alert level
MILD_ALERT for Mild alert level
HIGH_ALERT for High alert level
Based on the alert level configuration set by the Proximity Monitor, the LED blinks at different rates:
If the alert level is “HIGH_ALERT” then the LED blinks faster (3 second interval)
If the alert level is “MILD_ALERT” then the LED blinks moderately (5 second interval)
If the alert level is “NO_ALERT” the LED must be off

1.2 Battery Service Application

The Battery Service application is used for reporting the battery level of the device using the battery characteristics. Any application discovering the database can access the battery service instance during
© 2018 Microchip Technology Inc.
User Guide
DS50002706A-page 5
discovery services. This example application simulates the device battery level from 0% to 100%, with the step of 1% every second.

1.3 Custom Serial Chat Profile Application

The Custom Serial Chat application is used for sending and receiving data between the boards (SAM D21) and the Microchip SmartConnect mobile application. This is a custom profile example application implemented over GATT. The user can send the information to the mobile phone using the console terminal that is configured with the board and vice versa.

1.4 Heart Rate Profile Application

The Heart Rate Profile application is used for enabling the collector device (GATT client) to connect and interact with a heart rate sensor (GATT server) to be used in the fitness applications. The heart rate sensor sends the heart rate measurement in bpm (beats per minute), energy expended in kJ (kilojoules), and R-R intervals in seconds. In addition to the heart rate service, this profile also implements the Device Information Service, which provides information about the heart rate sensor device.
The heart rate profile provided by Bluetooth SIG defines three characteristics for the exchange of heart rate parameters between the sensor and monitor. The characteristics of the profile are used to transfer heart rate parameters like bpm, R-R interval measurements, and other parameters like body sensor location and energy expended values. The optional “Heart Rate Control Point characteristic” is used by the heart rate monitor to reset the energy expended in the heart rate sensor.
ATWINC3400
Functional Overview
The heart rate sensor, which is the GATT server, holds the characteristics and sends the measurement values to the heart rate monitor.
The heart rate, R-R interval, and energy expended are sent using the heart rate measurement characteristics.
The heart rate measurements are sent to the monitor on a value change if the monitor has enabled the notifications.
The body sensor location is read by the monitor by its body sensor location characteristic. The energy expended sent in the heart rate measurement can be reset by the monitor by writing to the heart rate control point characteristic.
Note:  The example application simulates the sensor measurements and sends them to the heart rate collector.

1.5 Transparent Service Application

The Transparent Service is used as a data exchange method between the client and the server.
Transparent Tx characteristic is used for data transmission by the server or client. Once the Client Characteristic Configuration Descriptor of Transparent Tx is enabled, the server sends data to the client by this channel. The client also can send the data through this channel.
Transparent Rx characteristic is used for data transmission by the client. The client can send data to the server by this channel.
Transparent Control Point characteristic: To ensure successful operation, this Client Characteristic Configuration Descriptor of Transparent Control Point (TCP) must be enabled to notify. The client must perform a write to the TCP to execute a desired procedure at the server. The Transparent Control Point is used by a client to control certain behaviors of the server. The procedures are
© 2018 Microchip Technology Inc.
User Guide
DS50002706A-page 6
triggered by writing a value that includes an Op code specifying the operation and the server notifies of the result of the operations.
When enable credit-based flow control Op code is written to the TCP, the server responds with the maximum MTU size and available credit to the client. The number of credits are checked by the client to know how many data lists can be transmitted to the server. The number of credits are decreased by the list of data sent by client. The client can only send data while the number of credits is non-zero. The server returns the credit to the client after the server finishes dealing with the received data.

1.6 On-chip Provisioning Application

The On-chip Provisioning application is used for receiving Wi-Fi provisioning data via Bluetooth and then triggering a Wi-Fi connection. The majority of the provisioning functionality is performed by the BLE Cortus of ATWINC3400, with the host application performing some helper functions via dedicated libraries. This application triggers a Wi-Fi scan and lists the scanned APs on the receiver. On receiving the Wi-Fi configuration data (which is passed to the host application where it is fed into the BLE Cortus provisioning API), it validates the data and starts the connection process. On successful connection, the Bluetooth connection is terminated. If the connection is not successful with received configuration, the provisioning process restarts and lists the latest scanned APs again.
ATWINC3400
Functional Overview
© 2018 Microchip Technology Inc.
User Guide
DS50002706A-page 7
Supported Hardware Platforms and IDEs

2. Supported Hardware Platforms and IDEs

The following table provides the supported hardware platforms and IDEs for the ATWINC3400.
Table 2-1. Supported Hardware and IDEs
ATWINC3400
Platform MCU Supported BLE
Device
SAM D21 ATSAMD21J18A ATWINC3400 ATSAMD21-XPRO Atmel Studio v7.0
Supported Evaluation Kits
Supported IDEs
© 2018 Microchip Technology Inc.
User Guide
DS50002706A-page 8

3. Hardware Setup

3.1 ATWINC3400 Board

The following figure illustrates the samples of SAM D21 and ATWINC3400 kit details displayed in Atmel Studio.
Figure 3-1. SAM D21 Kit Details
Figure 3-2. ATWINC3400 Kit Details
ATWINC3400
Hardware Setup

3.2 SAM D21 Xplained Pro Setup

The following figure illustrates the ATWINC3400 Xplained Pro extension board connected to SAM D21 Xplained Pro.
© 2018 Microchip Technology Inc.
User Guide
DS50002706A-page 9
Figure 3-3. SAM D21 Xplained Pro Board
ATWINC3400
Hardware Setup
© 2018 Microchip Technology Inc.
User Guide
DS50002706A-page 10

4. Software Setup

4.1 Installation Steps

1. Download and install the Atmel Studio.
2. Install the standalone Advanced Software Framework (ASF) package.
3. Android™ Application Installation – The android applications for testing BLE profiles are available in the following locations of the BLE application examples.
3.1. BLE Provisioning application – This application supports BLE Provisioning. This app is
available in “provision_ap_with_ble_on_chip_profile_example” at
\common_components_wifi_winc3400_provision_ap_with_ble_on_chip_prof ile_example_samd21_xplained_pro\src\android_app \Atmel_WiFi_BLE_prov.apk
3.2. Transparent Service application – This application is used to test the example Transparent
Service application. This app is available in “provision_ap_with_ble_on_chip_profile_example” at \
\common_components_wifi_winc3400_transparent_service_example_samd21 _xplained_pro\ src\android_app\BLEDK3_V1.0.apk
3.3. Microchip SmartConnect Application – This application is used to test all the BLE profiles.
Download and install the Microchip SmartConnect app on the mobile phone, available in the Google Play™ Store for Android.
ATWINC3400
Software Setup
Note:  Atmel Studio offers predefined example projects for the SAM D21 extension boards.

4.2 Build Procedure

Perform the following steps to build an example project using Atmel Studio IDE. This example build procedure is developed using the SAM D21 + ATWINC3400 Xplained Pro board.
1. Open the Atmel Studio and select File > New > Example Project.
Figure 4-1. Example Project from ASF
2. In the New Example Project from ASF or Extensions window:
© 2018 Microchip Technology Inc.
User Guide
DS50002706A-page 11
ATWINC3400
Software Setup
2.1. Enter “3400” keyword in the search box, which lists all the supported examples for SAM
D21 Xplained Pro board.
2.2. Select the respective example application by expanding the “Atmel – Atmel Corp.” in the
All Projects tab. This selection automatically populates the project Name, Location, Solution, Solution Name and Device.
2.3. Click OK.
Figure 4-2. Searching for a Specific Example Application
3. Select the “Accept License Agreement” check box and then click Finish.
4. The Atmel Studio generates the project files for the selected application example that can be used in the SAM D21 Xplained Pro board.
© 2018 Microchip Technology Inc.
User Guide
DS50002706A-page 12
Loading...
+ 25 hidden pages