The PIC-BLE Development Board is a small and easily expandable demonstration and development platform for
Bluetooth® Low Energy (BLE) solutions based on the PIC® 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 PIC16LF18456 microcontroller
• Secure – represented by the ATECC608A secure element
• Connected – represented by the RN4870 BLE module
In addition, the PIC-BLE Development Board features the following elements:
• The on-board debugger (PKoB nano) supplies full programming and debugging support through Microchip
MPLAB® X IDE. It also provides access to a serial port interface (serial to USB bridge) and one logic analyzer
channel (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™.
The Microchip Website.................................................................................................................................28
Out of the box, the PIC-BLE board comes programmed with the pic-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 PIC-BLE peripheral.
4.Use the custom interface to explore the board.
Info: The PIC-BLE will show up in the LightBlue® app as PIC-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 PIC-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 pic-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 pic-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 PIC-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 Microchip MPLAB® X IDE.
Kit Window
Once the board is powered, the green status LED will be lit and Microchip MPLAB® X IDE will auto-detect which
boards are connected. Microchip MPLAB® X IDE will present relevant information like data sheets and board
documentation. The PIC16LF18456 device on the PIC-BLE board is programmed and debugged by the on-board
debugger, and therefore, no external programmer or debugger tool is required.
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 PIC-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.
• 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.
• 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.
• 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.
• PIC-BLE website - Kit information, latest user guide and design documentation.
• PIC-BLE on Microchip Direct - Purchase this kit on Microchip Direct.
PIC-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 PIC16LF18456 in Microchip MPLAB® X IDE
• A mass storage device that allows drag-and-drop programming of the PIC16LF18456
• A virtual serial port (CDC) that is connected to a Universal Asynchronous Receiver/Transmitter (UART) on the
PIC16LF18456, 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 PIC-BLE Board. The table below
shows how the LED is controlled in different operation modes.
Table 3-1. On-Board Debugger LED Control
Operation ModePower and Status LED
Hardware User Guide
Boot Loader modeThe LED blinks slowly during power-up.
Power-upThe LED is ON.
Normal operationThe LED is ON.
ProgrammingActivity indicator: The LED blinks slowly during programming/debugging.
Drag-and-drop
programming
FaultThe LED blinks rapidly if a power Fault is detected.
Sleep/OffThe 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 PIC-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 PIC16LF18456 using
Microchip MPLAB® X IDE.
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 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.
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 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.