MICROCHIP EV15R70A User guide

AVR-IoT WA User Guide
AVR-IoT WA Development Board User Guide

Preface

Introduction
The AVR-IoT WA Development Board is a small and easily expandable demonstration and development platform for IoT solutions. Based on the AVR® microcontroller architecture and using Wi-Fi® technology, it is designed to demonstrate that the design of a typical IoT application can be simplified by partitioning the problem into three blocks:
• Smart – represented by the ATmega4808 microcontroller
• Secure – represented by the ATECC608A secure element
• Connected – represented by the WINC1510 Wi-Fi controller module
The AVR-IoT WA Development Board features the following elements:
• The PICkit™ On-Board (PKOB nano) supplies full programming and debugging support through Atmel Studio/ MPLAB® X IDE Communication Library. It also provides access to a serial port interface (serial to USB bridge) and two logic analyzer channels (debug GPIO)
• On the PC, the on-board debugger acts as a mass storage interface device for easy drag-and-drop programming, Wi-Fi configuration, and full access to the microcontroller application Command Line Interface (CLI)
• A mikroBUS™ socket allows for expansion of the board capabilities with the selection from 450+ sensors and actuators options offered by MikroElektronika (www.mikroe.com) via a growing portfolio of Click boards
• A light sensor used to demonstrate published data
• Microchip MCP9808 high-accuracy temperature sensor used to demonstrate published data
• Microchip MCP73871 Li-Ion/LiPo battery charger with power path management
© 2020 Microchip Technology Inc.
User Guide
DS50002998B-page 1
AVR-IoT WA User Guide

Table of Contents

Preface........................................................................................................................................................... 1
1. Overview................................................................................................................................................. 3
1.1. The AVR-IoT WA Board............................................................................................................... 3
1.2. LED Indicators..............................................................................................................................3
1.3. Switch Button Use Cases.............................................................................................................4
2. Getting Started........................................................................................................................................ 5
2.1. Connecting the Board to the Host PC.......................................................................................... 5
2.2. The AVR-IoT Webpage................................................................................................................ 5
2.3. Connecting the Board to Wi-Fi® Networks................................................................................... 6
2.4. Visualizing Cloud Data in Real Time............................................................................................ 9
2.5. Configuring Other Settings ........................................................................................................ 14
2.6. Migrating to a Private AWS Cloud Account................................................................................16
3. Code Source Platforms......................................................................................................................... 17
3.1. Code Generation from MCC ......................................................................................................17
3.2. Getting the Source Code from GitHub....................................................................................... 25
4. Hardware Guide.................................................................................................................................... 26
5. FAQs, Tips, and Troubleshooting..........................................................................................................27
5.1. FAQs and Tips............................................................................................................................27
5.2. LED Status Troubleshooting.......................................................................................................28
6. Relevant Links.......................................................................................................................................30
7. Revision History.................................................................................................................................... 32
The Microchip Website.................................................................................................................................33
Product Change Notification Service............................................................................................................33
Customer Support........................................................................................................................................ 33
Microchip Devices Code Protection Feature................................................................................................ 33
Legal Notice................................................................................................................................................. 34
Trademarks.................................................................................................................................................. 34
Quality Management System....................................................................................................................... 35
Worldwide Sales and Service.......................................................................................................................36
© 2020 Microchip Technology Inc.
User Guide
DS50002998B-page 2

1. Overview

Time r/PWM
UART RX
PD7
PA0
PC3
PA6
PA5
PA4
3.3V
GND
SPI S CK
SPI MIS O
SPI MOS I
PD4
PD6
PC1
PC0
PA3
PA2
5.0V
GND
UART TX
I2C SCL
I
2
C SDA
Wi-Fi Status LED
PD3
Connec tion S tatus LED
PD2
Data Trans fer LED
PD1
Error Status LED
PD0
PF5
USER SWITCH 1
PF6
USER SWITCH 0
ATWINC1 510 Wi-Fi®Mo dule
Mic ro US B Co nnec tor
Po wer/S tatu s LED
Pro gram me r/Debug ge r
ADC AIN7
ATMEGA4808 Microco ntroller
Charge S tatus LEDs
LiPo Conne cto r
MCP7 3871 LiPo Charg er
ATECC608A S ecu re Ele ment
Light Sen s o r
MCP9 808 Temp erature Se ns or
MIC3305 0 Voltage Reg ulato r
SPI CS
Res et
Interrupt
AVR-IoT WG De ve lo pment Bo ard Pino ut

1.1 The AVR-IoT WA Board

The AVR-IoT WA Development Board is shown in AVR-IoT Development Board.
Figure 1-1. AVR-IoT Development Board
AVR-IoT WA User Guide
Overview

1.2 LED Indicators

The development board features four LEDs that can be used to provide diagnostic information for the demo code that comes with the board. At power-up, the LED array should flash twice in the following order: Blue, Green, Yellow, and Red. This will indicate that the board is pre-programmed. Each LED is assigned to indicate the status of a certain aspect of the IoT system, which can be found in the table below.
© 2020 Microchip Technology Inc.
User Guide
DS50002998B-page 3
AVR-IoT WA User Guide
Table 1-1. LED Indicators
LED Color Type Indication Details
Label Pattern
WIFI Solid Blue Wi-Fi Network Connection Indicates a successful connection to
Blue
Blinking Blue
(slow blink)
Soft AP Mode Indicates that the board can be
the local Wi-Fi network.
detected and used as a Wi-Fi
access point. For details, refer to
Section 2.3.3 Via Soft AP.
Overview
Green
Yellow
Red
Blinking Blue
(fast blink)
CONN Solid Green AWS Cloud Connection Indicates a successful MQTT
Blinking
Green
DATA Blinking
Yellow
Solid Yellow
for ON state,
LED Off for
OFF state for
extended time
ERROR Solid Red Error Status Indicates an error in the application.
Wi-Fi Network Connection Indicates that the board is trying to
establish a successful connection to a Wi-Fi network. In combination with
a blinking green LED, it means that the board is trying to connect to the
network using default Wi-Fi
credentials.
connection to AWS Cloud.
AWS Cloud Connection Indicates that the board is trying to
establish a MQTT connection to
AWS Cloud
Data Publication to the
Cloud
State of Toggle sent within
MQTT publish packet
Indicates that sensor data in the
form of MQTT packet has been
successfully published to AWS
Cloud.
Indicates the state of the Toggle
switch (ON = 1 / OFF = 0), received
as part of the packet published by
AWS Cloud on the subscribed topic.

1.3 Switch Button Use Cases

The AVR-IoT WA board also has two switches that can be used to enter modes at power-up:
• Hold SW0 for two LED cycles to enter Soft AP mode (refer to Section 2.3.3 Via Soft AP)
• Hold both SW0 and SW1 to use default Wi-Fi credentials. The default credentials are configurable through MCC, and the application uses the following default values:
Table 1-2. Wi-Fi Credentials
SSID Password
MCHP.IOT microchip
© 2020 Microchip Technology Inc.
User Guide
DS50002998B-page 4

2. Getting Started

2.1 Connecting the Board to the Host PC

The AVR-IoT WA development board can be connected to a computer using a standard Micro-USB cable. Once plugged in, the LED array at the top right-hand corner of the board should flash twice in the following order: Blue, Green, Yellow, and Red. When the board is not connected to Wi-Fi , the blue LED will blink continuously. The board will appear as a Removable Storage Device on the host PC, as shown in Curiosity Board as Removable Storage. Double click the CURIOSITY drive to open it and get started.
Note:  All procedures are identical for Windows®, Mac OS®, and Linux® environments.
Figure 2-1. Curiosity Board as Removable Storage
AVR-IoT WA User Guide
Getting Started
The CURIOSITY drive should contain the following five files:
• CLICK-ME.HTM – redirects the user to the AVR-IoT web demo application
• KIT-INFO.HTM – redirects the user to a site containing information and resources about the board
• KIT-INFO.TXT – a text file with details about the PKOB nano firmware and the board’s serial number
• PUBKEY.TXT – a text file with the public key used for data encryption
• STATUS.TXT – a text file with the status of the board
Double click on the CLICK-ME.HTM file to enter the dedicated web page to access the web application.

2.2 The AVR-IoT Webpage

AVR-IoT Webpage shows an image of the AVR-IoT WA webpage. This page displays the sensor data and allows the
user to regenerate the Wi-Fi credentials as a file labeled WIFI.CFG. This can be loaded onto the board, acting as a storage device to reconfigure access point parameters.
The status markers in the middle of the page, as shown in Webpage Status Indicators, indicate the progress of the system setup. These markers will light up once each stage has completed successfully.
© 2020 Microchip Technology Inc.
User Guide
DS50002998B-page 5
Figure 2-2. AVR-IoT Webpage
AVR-IoT WA User Guide
Getting Started
Figure 2-3. Webpage Status Indicators
The leftmost marker indicates if the board is connected to the host PC. Next to this, the Wi-Fi marker lights up once the board is connected to a Wi-Fi network and the blue LED will stop blinking and stay on to indicate the board connection state. To the right of the Wi-Fi marker, the AWS Cloud Message Queuing Telemetry Transport (MQTT) marker is found, indicating the status of the TCP socket connection and MQTT connection to AWS Cloud. The corresponding green LED will stop blinking and stay on to indicate the board connection state. Finally, the rightmost marker lights up, signifying that data is streaming from the board to the cloud. For each successful MQTT publication of data, yellow LED on the board blinks.

2.3 Connecting the Board to Wi-Fi® Networks

2.3.1 Via AVR-IoT Webpage

There are several ways to connect the AVR-IoT WA Development Board to the Internet. The easiest way is through the AVR-IoT webpage (www.avr-iot.com/aws). The lower left-hand corner of the site will show a wireless network connection window where the user can choose to connect to an open (no password required) network or enter the credentials for a password protected (WPA/WPA2/WEP) Wi-Fi network. Entering Wi-Fi Credentials in AVR-IoT
Webpage shows how to enter the Wi-Fi credentials on the website.
© 2020 Microchip Technology Inc.
User Guide
DS50002998B-page 6
Important: 
• The Wi-Fi network SSID and password are limited to 31 characters. Avoid using quotation marks, names, or phrases that begin or end with spaces.
• The AVR-IoT WA Development Board supports only 2.4 GHz networks inline, thus it is recommended to use mobile hotspots to connect the board to the Internet.
Figure 2-4. Entering Wi-Fi Credentials in AVR-IoT Webpage
AVR-IoT WA User Guide
Getting Started
Once the required details are entered, click the Download Configuration button. This will download the WIFI.CFG (text) file to the host PC. From the WIFI.CFG’s download location, drag and drop the file to the CURIOSITY drive to update the Wi-Fi credentials of the board. The blue LED will stop blinking and will stay continuously ON to show a successful connection to the Wi-Fi Access Point.
Important:  Any information entered in the SSID and password fields is not transmitted over the web or to the Microchip or any of the Cloud servers. Instead, the information is used locally (within the browser) to generate the WIFI.CFG file.

2.3.2 Via Command Line Interface (CLI)

Another way of connecting to the Wi-Fi is through the Serial Command Line Interface (CLI). This interface can be accessed through any serial terminal application. Using the UART settings defined in Section 2.5.2 Serial USB
Interface , the user can reconfigure the board to a Wi-Fi network by entering the Wi-Fi command. Wi-Fi Configuration via Serial Command Line (Open Network) and Wi-Fi Configuration via Serial Command Line (Secured Network)
show examples of trying to connect to open, or secured networks, respectively. For more details on the Wi-Fi command and its parameters, refer to Section 2.5.2 Serial USB Interface .
© 2020 Microchip Technology Inc.
User Guide
DS50002998B-page 7
AVR-IoT WA User Guide
Figure 2-5. Wi-Fi Configuration via Serial Command Line (Open Network)
Figure 2-6. Wi-Fi Configuration via Serial Command Line (Secured Network)
Getting Started

2.3.3 Via Soft AP

The last method to connect to the Wi-Fi is through the advanced Software Access Point (Soft AP) mode, a feature of the WINC module on-board. This method is ideal if the user is only using a mobile device, such as a mobile phone or tablet, instead of a laptop or PC. The Soft AP mode can be entered by pressing and holding the SW0 push button for most of the start-up time between initial power-up LED cycling. When the Soft AP mode has been successfully entered, the board can be detected as a Wi-Fi access point named MCHP.IOT.ACCESSPOINT. The blue LED will start blinking when Soft AP is available. Using a mobile device such as a mobile phone or tablet, connect to the MCHP.IOT.ACCESSPOINT hotspot. It will redirect to a sign-in page where the user can enter the SSID and password of the network to which the board will connect. The Device Name will not be considered, and the authorization type will always be WPA/WPA2 (2). Once these details are entered, click the Connect button to connect the board to the network. Refer to Figure 2-7 to see how the sign-in page will look like.
© 2020 Microchip Technology Inc.
User Guide
DS50002998B-page 8
Figure 2-7. Connecting via Soft AP
AVR-IoT WA User Guide
Getting Started

2.4 Visualizing Cloud Data in Real Time

Out of the box, all AVR-IoT WA Development Boards are pre-registered to Microchip’s AWS Cloud sandbox account. This account is set up for demonstration purposes only. All data gathered by the sensors of the AVR-IoT WA Development Boards are published on the Microchip sandbox account and can be identified by the following details:
Table 2-1. Project Details
Region: iot.us-east-2
Port: 8883
There is no permanent storage or collection of data published by the boards connected to the Microchip sandbox account. The full storage catalog of the AWS Cloud features, such as data storage/retention, can be available to the user with the use of the board once removed from the sandbox and the associated Thing Name/Public Key has been migrated to a private account.

2.4.1 Publishing data to AWS Cloud

A MQTT publish packet is always sent to the MQTT broker using a specific topic. The AVR-IoT WA Development Board publishes messages using the topic ‘thingName/sensors’ in communication to the AWS cloud. The messages published on this topic contains the real-time data obtained from the on-board light and temperature
© 2020 Microchip Technology Inc.
User Guide
DS50002998B-page 9
sensors. The frequency of sending a PUBLISH packet can be decided by the user application. The application is written such that the sensor data is published to the Cloud every second.
2.4.1.1 Updating the Device Shadow
In order to control the device from the Cloud, the AWS Shadow Service feature is used. The AWS Shadow service maintains a shadow of the device in the form of a JSON document. The device’s state can be stored and retrieved, leveraging upon the AWS Shadow Topics. To set and get the state of the device, either HTTP or MQTT can be used. For the demo application, MQTT protocol is chosen. Each device is represented by its unique thing name.
To update the device’s shadow, publish on the topic ‘$aws/things/thingName/shadow/update’.
1. Device updating its reported state: – The device would publish on this topic to update the state of its reported attributes. Below is an example
of a payload where ‘toggle’ is the attribute:
{ "state" : { "reported" : { "toggle" : 1 } } }
AVR-IoT WA User Guide
Getting Started
– The payload consists of key-value pairs. In the above example, attribute ‘toggle’ is set to ‘1’. The user can
expand the application to add more attributes, which requires updates in the firmware.
2. Client requesting to update a device shadow: – To request a change in attribute value, the client will publish on the same topic and the payload will be:
{ "state" : { "desired" : { "toggle" : 1 } } }
– The payload consists of key-value pairs. In the above example, attribute ‘toggle’ is set to ‘1’. The user can
expand the application to add more attributes, which requires updates in the firmware.
{ "state" : { "reported" : { "toggle" : 1 } } }
Further information can be found here: /update
Note:  Remember to replace thingName with the device's actual thing name.

2.4.2 Subscribing to AWS Shadow Topic

To get information about the device’s shadow from the shadow service, the device has to subscribe to specific shadow topics. More information on shadow topics can be found here at Shadow MQTT topics.
© 2020 Microchip Technology Inc.
User Guide
DS50002998B-page 10
AVR-IoT WA User Guide
Getting Started
The device subscribes to ‘$aws/things/thingName/shadow/update/delta’.The shadow service will send updates on this topic when there is a difference in attribute values. For example, the reported toggle state is 1 but a client sent a desired state for toggle as 0. The device would receive update like below:
{ "version": 1349, "timestamp": 1583450271, "state": { "toggle": 0 }, "metadata": { "toggle": { "timestamp": 1583450271 } } }
Further information can be found here: /update/delta
Note:  Remember to replace thingName with the device's actual thing name.
© 2020 Microchip Technology Inc.
User Guide
DS50002998B-page 11
Loading...
+ 25 hidden pages