Microchip Avr-ble User Manual

AVR-BLE Hardware User Guide

Preface

The AVR-BLE Development Board is a small and easily expandable demonstration and development platform for Bluetooth® Low Energy (BLE) solutions based on the AVR® microcontroller architecture. It is designed to demonstrate that the design of a typical BLE application can be simplified by partitioning the task into three blocks:
• Smart – represented by the ATmega3208 microcontroller
• Secure – represented by the ATECC608A secure element
• Connected – represented by the RN4870 BLE module
In addition, the AVR-BLE Development Board features the following elements:
• The on-board debugger (PKoB nano) supplies full programming and debugging support through Atmel Studio/ Microchip MPLAB® X IDE. It also provides access to a serial port interface (serial to USB bridge) and two logic analyzer channels (debug GPIO).
• A mikroBUS™ socket enables the ability to expand the board capabilities with the selection from 450+ sensors and actuators options offered by MikroElektronika (www.mikroe.com) via a growing portfolio of Click board™.
© 2020 Microchip Technology Inc.
User Guide
DS50002956A-page 1

Table of Contents

Preface........................................................................................................................................................... 1
1. Introduction............................................................................................................................................. 3
1.1. Features....................................................................................................................................... 3
1.2. Board Overview............................................................................................................................3
2. Getting Started........................................................................................................................................ 6
2.1. Quick Start....................................................................................................................................6
2.2. Design Documentation and Relevant Links................................................................................. 7
3. Hardware User Guide............................................................................................................................. 8
3.1. On-Board Debugger Overview..................................................................................................... 8
3.2. Power Supply............................................................................................................................. 13
3.3. Low-Power Operation.................................................................................................................14
3.4. Target Current Measurement..................................................................................................... 14
3.5. Peripherals................................................................................................................................. 15
4. Hardware Revision History and Known Issues..................................................................................... 22
4.1. Identifying Product ID and Revision........................................................................................... 22
4.2. Revision 3...................................................................................................................................22
4.3. Revision 2...................................................................................................................................22
5. Document Revision History...................................................................................................................23
6. Appendix............................................................................................................................................... 24
6.1. Schematics.................................................................................................................................24
6.2. Assembly Drawing......................................................................................................................27
The Microchip Website.................................................................................................................................28
Product Change Notification Service............................................................................................................28
Customer Support........................................................................................................................................ 28
Microchip Devices Code Protection Feature................................................................................................ 28
Legal Notice................................................................................................................................................. 28
Trademarks.................................................................................................................................................. 29
Quality Management System....................................................................................................................... 29
Worldwide Sales and Service.......................................................................................................................30
© 2020 Microchip Technology Inc.
User Guide
DS50002956A-page 2

1. Introduction

Micro USB Connector
Debugger
Power/Status
LED
ATECC6080A
Crypto
Data LED
(Green)
Error LED
(Red)
SST25PF040CT
Serial Flash
USB/Battery
MUX
BLE LE D
(Blue)
MCP9844
Temp-sensor
BMA253
Accelerometer
ATmega3208
MCU
User Switch
(SW0)
RN4870
BLE module

1.1 Features

• ATmega3208 AVR Microcontroller
• Two User LEDs (Data and Error)
• Mechanical Button
• RN4870 Bluetooth Low Energy (BLE) Module
• MCP9844 Temperature Sensor
• BMA253 Acceleration Sensor
• ATECC608A CryptoAuthentication™ Device
• SST25PF040CT 4Mb Serial Flash
• mikroBUS Socket
• On-board Debugger
– Board identification in Atmel Studio/Microchip MPLAB® X IDE – Programming and debugging – Virtual serial port (USB CDC) – Two logic analyzer channels (DGI GPIO)
• USB or Battery Powered
Introduction

1.2 Board Overview

The AVR-BLE development board is a hardware platform that is being used to evaluate the ATmega3208 AVR microcontroller and RN4870 BLE module.
Figure 1-1. AVR-BLE Development Board Front Side
© 2020 Microchip Technology Inc.
User Guide
DS50002956A-page 3
Figure 1-2. AVR-BLE Development Board Back Side
CR2032 Battery Holder
Additional RN4870 GPIO
Introduction
© 2020 Microchip Technology Inc.
User Guide
DS50002956A-page 4
AVR-BLE Development Board (DT100111)
CDC RX
CDC TX
DEBUG GPIO0
PF0 | USART2 TX
PF1 | USART2 RX
PF3
I
2
C SCL
I
2
C SDA
PA3
PA2
BLE MODE
BLE RST
BLE RX
PF3
PD3
PA0 | USART0 TX
BLE TX PA1 | USART0 RX
HOLD#
SPI CS
SPI SCK
PD4
PD0
PA6
SPI MISOPA5
I
2
C SCL
I
2
C SDA
BMA 253 INT1
PA3
PA2
PC2
I
2
C SCL
I
2
C SDA
PA3
PA2
DEBUG GPIO1 PF4
EVENT PF2
SPI MOSIPA4
BMA 253 INT2PC3
MIC33050 DC/DC Converter
BMA253 Acceleration Sensor
ATECC608A Secure Element
PD1
PD6
PC1
PC0
PA3
PA2
5.0V
GND
SST25PF040C 4MB FLASH
PF4
PF5
Micro USB Connector
PKoB Nano Debugger/ Programmer
MCP9844 Temperature Sensor
AN
RST
SPI CS
SPI SCK
SPI MISO
SPI MOSI
3.3V
GND
ATmega3208 MCU
User Switch 0
RN4870 Bluetooth Low Energy Module
PD7
PD5
PA7
PA6
PA5
PA4
PF3
PWM
INT
USART1 RX
USART1 TX
I
2
C SCL
I
2
C SDA
DATA LED
ERROR LED
RN4870 P1_1 BLE STATUS
GREEN
RED
BLUE
Figure 1-3. AVR-BLE Quick Reference Overview
Introduction
© 2020 Microchip Technology Inc.
User Guide
DS50002956A-page 5

2. Getting Started

2.1 Quick Start

Demo Application
Out of the box, the AVR-BLE board comes programmed with the avr-lightblue-explorer-demo. This application can be used to demonstrate a number of the board features using the LightBlue® app by Punch Through.
1. Download the LightBlue® app for iOS or Android.
2. Power the board through a Micro-USB cable or CR2032 battery.
3. Open the LightBlue® app and select the AVR-BLE peripheral.
4. Use the custom interface to explore the board.
Info:  The AVR-BLE will show up in the LightBlue® app as AVR-BLE_xxxx, where xxxx are the last two bytes of the RN4870 BLE module’s Bluetooth MAC address. This makes it possible to distinguish between multiple AVR-BLE boards.
Communication between the demo application and the LightBlue® app is done by using a protocol based on ASCII packets. Refer to the protocol chapter on the avr-lightblue-explorer-demo page for a list of commands with examples, as well as the full source code for the project.
Development Requirements
MPLAB® X IDE:
MPLAB X IDE v5.30 or later
XC8 Compiler v2.10 or later
For help with installation, view the MPLAB X installation guide.
Build an Application
View the default source code that is pre-loaded onto the development board. Explore, modify, and build off this source code to create a custom application.
1. View the source code at the avr-lightblue-explorer-demo GitHub page.
2. Read through the README.md to get more information on how to expand the solution.
3. Download the project from GitHub and open it in the latest version of MPLAB® X IDE.
4. Connect a USB cable (Standard-A to Micro-B or Micro-AB) between the Windows, Mac or Linux device, and
the debug USB port on the AVR-BLE. The board will be identified in the kit window in MPLAB® X IDE.
5. Explore, modify, and build off the source code.
6. Make and program the device. Select the PKoB nano serial number as the debug tool when prompted.
Driver Installation
When the board is connected to the computer for the first time, the operating system will perform a driver software installation. The driver file supports both 32- and 64-bit versions of Microsoft® Windows® XP, Windows Vista®, Windows 7, Windows 8, and Windows 10. The drivers for the board are included with Atmel Studio/Microchip MPLAB® X IDE.
Kit Window
Once the board is powered, the green status LED will be lit and Atmel Studio/Microchip MPLAB® X IDE will auto­detect which boards are connected. Atmel Studio/Microchip MPLAB® X IDE will present relevant information like data sheets and board documentation. The ATmega3208 device on the AVR-BLE board is programmed and debugged by the on-board debugger, and therefore, no external programmer or debugger tool is required.
Getting Started
© 2020 Microchip Technology Inc.
User Guide
DS50002956A-page 6
Tip:  The Kit Window can be opened in MPLAB® X IDE through the menu bar Window > Kit Window

2.2 Design Documentation and Relevant Links

The following list contains links to the most relevant documents and software for the AVR-BLE Board:
MPLAB® X IDE - MPLAB X IDE is a software program that runs on a PC (Windows®, Mac OS®, Linux®) to develop applications for Microchip microcontrollers and digital signal controllers. It is called an Integrated Development Environment (IDE) because it provides a single integrated “environment” to develop code for embedded microcontrollers.
Atmel Studio - Free IDE for the development of C/C++ and assembler code for microcontrollers.
IAR Embedded Workbench® for AVR® - This is a commercial C/C++ compiler that is available for AVR microcontrollers. There is a 30-day evaluation version as well as a 4 KB code-size-limited kick-start version available from their website.
MPLAB® Xpress Cloud-based IDE - MPLAB Xpress Cloud-Based IDE is an online development environment that contains the most popular features of our award-winning MPLAB X IDE. This simplified and distilled application is a faithful reproduction of our desktop-based program, which allows users to easily transition between the two environments.
MPLAB® Code Configurator - MPLAB Code Configurator (MCC) is a free software plug-in that provides a graphical interface to configure peripherals and functions specific to your application.
Atmel START - Atmel START is an online tool that helps the user to select and configure software components and tailor your embedded application in a usable and optimized manner.
Microchip Sample Store - Microchip sample store where you can order samples of devices.
MPLAB Data Visualizer - MPLAB Data Visualizer is a program used for processing and visualizing data. The Data Visualizer can receive data from various sources such as serial ports and on-board debugger’s Data Gateway Interface, as found on Curiosity Nano and Xplained Pro boards.
Studio Data Visualizer - Studio Data Visualizer is a program used for processing and visualizing data. The Data Visualizer can receive data from various sources such as serial ports, on-board debugger’s Data Gateway Interface as found on Curiosity Nano and Xplained Pro boards, and power data from the Power Debugger.
Microchip PIC and AVR Examples - Microchip PIC and AVR Device Examples is a collection of examples and labs that use Microchip development boards to showcase the use of PIC and AVR device peripherals.
Microchip PIC and AVR Solutions - Microchip PIC and AVR Device Solutions contains complete applications for use with Microchip development boards, ready to be adapted and extended.
AVR-BLE website - Board information, latest user guide and design documentation.
AVR-BLE on Microchip Direct - Purchase this board on Microchip Direct.
Getting Started
© 2020 Microchip Technology Inc.
User Guide
DS50002956A-page 7

3. Hardware User Guide

3.1 On-Board Debugger Overview

AVR-BLE contains an on-board debugger for programming and debugging. The on-board debugger is a composite USB device consisting of several interfaces:
• A debugger that can program and debug the ATmega3208 in Atmel Studio/Microchip MPLAB® X IDE
• A mass storage device that allows drag-and-drop programming of the ATmega3208
• A virtual serial port (CDC) that is connected to a Universal Asynchronous Receiver/Transmitter (UART) on the ATmega3208, and provides an easy way to communicate with the target application through terminal software
• A Data Gateway Interface (DGI) for code instrumentation with logic analyzer channels (debug GPIO) to visualize program flow
The on-board debugger controls a Power and Status LED (marked PS) on the AVR-BLE Board. The table below shows how the LED is controlled in different operation modes.
Table 3-1. On-Board Debugger LED Control
Operation Mode Power and Status LED
Hardware User Guide
Boot Loader mode The LED blinks slowly during power-up.
Power-up The LED is ON.
Normal operation The LED is ON.
Programming Activity indicator: The LED blinks slowly during programming/debugging.
Drag-and-drop programming
Fault The LED blinks rapidly if a power Fault is detected.
Sleep/Off The LED is OFF. The on-board debugger is either in a sleep mode or powered down.

3.1.1 Debugger

The on-board debugger on the AVR-BLE Board appears as a Human Interface Device (HID) on the host computer’s USB subsystem. The debugger supports full-featured programming and debugging of the ATmega3208 using Atmel Studio/Microchip MPLAB® X IDE, as well as some third-party IDEs.
Success: The LED blinks slowly for 2 sec.
Failure: The LED blinks rapidly for 2 sec.
This can occur if the board is externally powered.
Info:  Slow blinking is approximately 1 Hz, and rapid blinking is approximately 5 Hz.
Remember:  Keep the debugger’s firmware up-to-date. Firmware upgrades are done automatically when
using Atmel Studio/Microchip MPLAB® X IDE.

3.1.2 Virtual Serial Port (CDC)

The virtual serial port (CDC) is a general purpose serial bridge between a host PC and a target device.
© 2020 Microchip Technology Inc.
User Guide
DS50002956A-page 8
3.1.2.1 Overview
Target MCU
UART TX
UART RX
Debugger
USB
CDC RX
CDC TX
PC
Terminal
Software
Target
Receive
Target
Send
Terminal Receive
Terminal
Send
The on-board debugger implements a composite USB device that includes a standard Communications Device Class (CDC) interface, which appears on the host as a virtual serial port. The CDC can be used to stream arbitrary data in both directions between the host computer and the target: All characters sent through the virtual serial port on the host computer will be transmitted as UART on the debugger’s CDC TX pin, and UART characters captured on the debugger’s CDC RX pin will be returned to the host computer through the virtual serial port.
Figure 3-1. CDC Connection
Hardware User Guide
Info:  As shown in Figure 3-1, the debugger’s CDC TX pin is connected to a UART RX pin on the target
for receiving characters from the host computer. Similarly, the debugger’s CDC RX pin is connected to a UART TX pin on the target for transmitting characters to the host computer.
3.1.2.2 Operating System Support
On Windows machines, the CDC will enumerate as Curiosity Virtual COM Port and appear in the Ports section of the Windows Device Manager. The COM port number can also be found there.
Info:  On older Windows systems, a USB driver is required for CDC. This driver is included in installations of Atmel Studio/Microchip MPLAB® X IDE.
On Linux machines, the CDC will enumerate and appear as /dev/ttyACM#.
Info:  tty* devices belong to the “dialout” group in Linux, so it may be necessary to become a member of that group to have permissions to access the CDC.
On MAC machines, the CDC will enumerate and appear as /dev/tty.usbmodem#. Depending on which terminal program is used, it will appear in the available list of modems as usbmodem#.
Info:  For all operating systems: Be sure to use a terminal emulator that supports DTR signaling. See Section 3.1.2.4 “Signaling”.
3.1.2.3 Limitations
Not all UART features are implemented in the on-board debugger CDC. The constraints are outlined here:
Baud rate: Must be in the range of 1200 bps to 500 kbps. Any baud rate outside this range will be set to the closest limit, without warning. Baud rate can be changed on-the-fly.
Character format: Only 8-bit characters are supported.
© 2020 Microchip Technology Inc.
User Guide
DS50002956A-page 9
Loading...
+ 21 hidden pages