Any Source Code (software and/or firmware) is owned by Cypress Semiconductor Corporation (Cypress) and is protected by
and subject to worldwide patent protection (United States and foreign), United States copyright laws and international treaty
provisions. Cypress hereby grants to licensee a personal, non-exclusive, non-transferable license to copy, use, modify, create
derivative works of, and compile the Cypress Source Code and derivative works for the sole purpose of creating custom
software and or firmware in support of licensee product to be used only in conjunction with a C ypress integrated circuit as
specified in the applicable agreement. Any reproduction, modification, translation, compilation, or representation of this
Source Code except as specified above is prohibited without the express written permission of Cypress.
Disclaimer: CYPRESS MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE. Cypress reserves the right to make changes without further notice to the materials
described herein. Cypress does not assume any liability arising out of the application or use of any product or circuit
described herein. Cypress does not authorize its products for use as critical components in life-support systems where a
malfunction or failure may reasonably be expected to result in significant injury to the user. The inclusion of Cypress’ product
in a life-support systems application implies that the manufacturer assumes all risk of such use and in doing so indemnifies
Cypress against all charges.
Use may be limited by and subject to the applicable Cypress software license agreement.
CySmart, F-RAM, PRoC, Programmable System-on-Chip, and PSoC Creator are trademarks, and PSoC and CapSense are
registered trademarks of Cypress Semiconductor Corporation. All other products and company names mentioned in this
document may be the trademarks of their respective holders.
2
Purchase of I
Philips I
C components from Cypress or one of its sublicensed Associated Companies conveys a license under the
2
C Patent Rights to use these components in an I2C system, provided that the system conforms to the I2C Standard
Specification as defined by Philips. As from October 1st, 2006 Philips Semiconductors has a new trade name - NXP
Semiconductors.
Flash Code Protection
Cypress products meet the specifications contained in their particular Cypress Datasheets. Cypress believes that its family of
products is one of the most secure families of its kind on the market today, regardless of how they are used. There may be
methods, unknown to Cypress, that can breach the code protection features. Any of these methods, to our knowledge, would
be dishonest and possibly illegal. Neither Cypress nor any o ther semiconductor manufacturer can guarantee the security of
their code. Code protection does not mean that we are guaranteeing the product as “unbreakable.”
Cypress is willing to work with the customer who is concerned about the inte grity of their code. Co de prot ection i s constantly
evolving. We at Cypress are committed to continuously improving the code protection features of our products.
The CY8CKIT-042-BLE boards contain electrostatic discharge (ESD)
sensitive devices. Electrostatic charges readily accumulate on the
human body and any equipment, which can cause a discharge without
detection. Permanent damage may occur on devices subjected to
high-energy discharges. Proper ESD precautions are recommended
to avoid performance degradation or loss of functionality. Store unused
CY8CKIT-042-BLE boards in the protective shipping package.
The CY8CKIT-042-BLE Bluetooth Low Energy (BLE) Pioneer Kit is intended for use as a
development platform for hardware or software in a laboratory environment. The board is an open
system design, which does not include a shielded enclosure. Due to this reason, the board may
cause interference with other electrical or electronic devices in close proximity. In a domestic
environment, this product ma y cause radio interfe rence. In such cases, the user may be required to
take adequate preventive measures. Also, this board should not be used near any medical
equipment or critical RF devices.
The CY8CKIT-042-BLE Bluetooth Low Energy (BLE) Pioneer Kit is intended for use as a
development, demonstration and evaluation platform for hardware or software in a laboratory
environment. The kit is not intended for general consumer use. Cypress recommends that the kit
only be used in a shielded room.
Attaching additional wiring to this product or modifying the product ope ration from the factory default
may affect its performance and cause interference with other apparatus in the immediate vicinity. If
such interference is detected, suitable mitigating measures should be taken.
The CY8CKIT-042-BLE as shipped from the factory has been verified to meet with requirements of
CE as a Class A product.
End-of-Life/Product Recycling
The end-of-life cycle for this kit is five years from the date of
manufacture mentioned on the back of the box. Contact your nearest
recycler to discard the kit.
ESD Protection
ESD can damage boards and associated components. Cypress recommends that the user perform
procedures only at an ESD workstation. If an ESD workstation is not available, use appropriate ESD
protection by wearing an antistatic wrist stra p attached to the chassis ground (any unpainted metal
surface) on the board when handling parts.
Handling Boards
CY8CKIT-042-BLE boards are sensitive to ESD. Hold the board only by its edges. After removing
the board from its box, place it on a grounded, static-free surface. Use a conductive foam pad if
available. Do not slide the board over any surface.
Battery Care and Use
■ Use the correct size and type of battery specified in this guide.
■ Keep battery contact surfaces and battery compartment contacts clean by rubbing them with a
clean pencil eraser or a rough cloth each time you replace batteries.
■ Remove the battery from a device when it is not expected to be in use for several months.
■ Make sure that you insert the battery into your device properly, with the + (plus) and – (minus)
terminals aligned correctly.
■ Do not place the battery next to metallic objects such as keys and coins.
■ Never throw the battery into fire.
■ Do not open up the battery.
■ Do not short the battery.
■ Do not subject the battery to high temperatures or high humidity.
■ Store the battery in a dry place.
■ Do not recharge a battery unless it is marked “rechargeable.”
Battery Disposal
Batteries can be safely disposed of with normal household waste. Never dispose of batteries in fire
because they can explode. It is important not to dispose of large amounts of batteries in a group.
Used batteries are often not completely “dead.” Grouping used batteries together can bring these
“live” batteries into contact with one another, creating safety risks.
CAUTION: Any changes or modifications not expressly approved by
the party responsible for compliance coul d void the user ’s authority to
operate the equipment.
Only the PCB antenna(s) that were certified with the module may be
used. Other antennas may be used only if they are of the same type
and have the same or lower gain.
The module must be recertified as a Class II permissive change if the
module is built into a different device than the EVB (evaluation board)
it was certified with.
THE MANUFACTURER IS NOT RESPONSIBLE FOR ANY RADIO
OR TV INTERFERENCE CAUSED BY UNAUTHORIZED
MODIFICATIONS TO THIS EQUIPMENT. SUCH MODIFICATIONS
COULD VOID THE USER'S AUTHORITY TO OPERATE THE
EQUIPMENT.
The kit contains devices that transmit and receive radio signals in accordance with the spectrum
regulations for the 2.4-GHz unlicensed frequency range.
Cypress Semiconductor Corporation has obtained regulatory approvals for this kit to be used in
specific countries. These countries include United States (FCC Part 15), Canada (IC RSS210) and
Japan (JRF/TELEC). Additional regional regulatory agency approval may be required to operate
these throughout the world.
This kit as shipped from the factory has been tested and found to comply with the limits/
requirements for following compliances:
■ FCC as a class B digital device, pursuant to part 15 of the FCC Rules.
■ This Class B digital apparatus complies with Canadian ICES-003
Regulatory statements and Product Labeling
United States (FCC)
This equipment complies with Part 15 of the FCC Rules. Operation is subject to the following two
conditions: (1) this device may not cause harmful inter ference, and (2) this d evice must accept any
interference received, including interference that may cause undesired operation.
The CY8CKIT-142 PSoC 4 BLE and CY5671 PRoC BLE modular transmitter must be labeled with
its own FCC ID number, and, if the FCC ID is not visible when the module is ins talled in to another
device, then the outside of the device into which the module is installed must also display a label
referring to the enclosed module. This exterior label can use wording such as the following:
Contains FCC ID: WAP-CY8CKIT-142 and WAP-CY5671, The enclosed device complies with Part
15 of the FCC Rules. Operation is subject to the following two conditions: (1) This device may not
cause harmful interference and (2) this device must accept any interference received, including
interference that may cause undesired operation. Any similar wording that expresses the same
meaning may be used.
CAUTION: The changes or modifications not expressly approved by the party responsible for
Compliance could void the user’s authority to operate the equipment and the antennas for this
transmitter must be installed to provide a sep aration dist ance of 20 cm from all persons an d must not
be co-located or operating in conjunction with any other antenna or transmitter.
Canada (IC)
This device complies with Industry Canada license-exempt RSS standard(s). Operation is subject to
the following two conditions: (1) this device may not cause interference, and (2) this device must
accept any interference, including interference that may cause undesired operation of the device.
This equipment complies with radio frequency exposure limits set forth by Industry Canada for an
uncontrolled environment. This equipment should be installed and operated with minimum distance
20cm between the device and the user or bystanders.
CAUTION: Any changes or modifications not expressly approved by the party responsible for compliance could void the user’s authority to operate the equipment.
This Module is labelled with its own IC ID. If the IC ID Certification Number is not visible while
installed inside another device, then the device should display the label on it referring the enclosed
module. In that case, the final end product must be labelled in a visible area with the following:
“Contains Transmitter Module IC 7922A-CY8CKIT142 and 7922A-CY5671”
OR
“Contains IC: 7922A-CY8CKIT142 and 7922A-CY5671”
Le présent appareil est conforme aux CNR d'Industrie Canada applicables aux appareils radio
exempts de licence. L'exploitation est autorisée aux deux conditions suivantes: (1) l'appareil ne doit
pas produire de brouillage, et (2) l'utilisateur de l'appareil doit accepter tout brouillage radioélectrique
subi, même si le brouillage est susceptible d'en compromettre le fonctionnement.
Cet équipement est conforme aux limites d'exposition aux radiofréquences définies par Industrie
Canada pour un environnement non contrôlé. Cet équipement doit être installé et utilisé avec un
minimum de 20cm de distance entre le dispositif et l'utilisateur ou des tiers.
Ce module est étiqueté avec son propre ID IC. Si le numéro de certification IC ID n'est pas visible
lorsqu'il est installé à l'intérieur d'un autre appareil, l'appareil doit afficher l'étiquette sur le module de
référence ci-joint. Dans ce cas, le produit fi nal doit être étiqueté dans un endroit visible par le texte
suivant:
“Contains Transmitter Module IC 7922A-CY8CKIT142 and 7922A-CY5671”
OR
“Contains IC: 7922A-CY8CKIT142 and 7922A-CY5671”
Thank you for your interest in the CY8CKIT-042-BLE Bluetooth Low Energy ( BLE) Pioneer Kit. The
BLE Pioneer Kit enables customers to evaluate and develop BLE projects using the PSoC
and PRoC
Bluetooth SMART™ or Bluetooth
®
BLE devices.
®
Low Energy (BLE) is a fully featured, layered , communication
®
4 BLE
protocol that includes a 2.4 GHz Radio, a link layer and an application layer. However, in order to
implement your projects using PSoC 4 BLE or PRoC BLE, you do not need to understand the
complex protocol. The Cypress BLE solution which includes the device, BLE Component and the
BLE Firmware Stack will take care of it for you. The Cypress BLE Firmware Stack is royalty free.
You will use two software tools, PSoC Creator and CySmart Central Emulation Tool to develop and
debug your BLE project. PSoC Creator is Cypress’ standard Integrated Development Environment
(IDE). The BLE protocol has been abstracted into an easy drag-and-drop BLE Component in PSoC
Creator. CySmart Central Emulation Tool is a Central emulation tool for Windows PCs. CySmart
Central Emulation Tool provides an easy-to-use Graphical User Interface (GUI) to enable customers
to test and debug their BLE projects.
The BLE Pioneer Kit offers footprint-compatibility with Arduino™ shields as well as 6-pin Digilent
Pmod daughter cards. In addition, the kit features a CapSense
®
slider, an RGB LED, a push button
switch, an onboard programmer/debugger and USB-UAR T/I2 C bridge functionality b lock (KitProg), a
coin cell battery holder and a Cypress F-RAM. The BLE Pioneer Kit supports 1.9 V, 3.3 V or 5 V as
operating voltages.
The BLE Pioneer Kit supports two devices: PSoC 4 BLE and PRoC BLE.
PSoC 4 BLE is a 32-bit, 48-MHz ARM
®
Cortex™-M0 BLE solution with CapSense, 12-bit Analog
Front End (1x SAR ADC, 4x Low-Power Opamps, 2x Low-Power Comparators, 2x Current DACs),
4x TCPWM
1
, 2x SCBs2, 4x UDBs3, LCD4, I2S5 and 36 GPIOs.
PSoC 4 BLE provides a complete solution for sports and fitness monitors, wearable electronics,
medical devices, home automation systems and sensor-based low-power systems for the Internet of
Things (IoT).
PRoC BLE is a 32-bit, 48-MHz ARM
4x TCPWM
1
, 2x SCBs2, LCD4, I2S5 and 36 GPIOs.
®
Cortex™-M0 BLE solution with CapSense, 12-bit ADC,
PRoC BLE provides a complete solution for BLE connectivity, HID, remote controls and toys.
Both devices are supported by a royalty-free Stack compatible with Bluetooth 4.1.
The BLE Dongle board consists of the blocks shown in Figure 1-4.
Figure 1-4. BLE Dongle Markup
1.3PSoC Creator™
PSoC Creator is a state-of-the-art, easy-to-use integrated design environment (IDE). It is a
revolutionary hardware and software co-design environment, powered by a library of preverified and
precharacterized PSoC Components™.
Introduction
With PSoC Creator, you can:
■ Drag and drop PSoC Components to build a schematic of your custom design
■ Automatically place and route components and configure GPIOs
■ Develop and debug firmware using the included component APIs
PSoC Creator also enables you to tap into an entire tool e cosystem wit h integrate d compiler ch ains
and production programmers for PSoC devices.
For more information, visit www.cypress.com/psoccreator.
1.4Getting Started
This guide will help you get acquainted with the BLE Pioneer Kit:
■ The Software Installation chapter on page 23 describes the installation of the kit software. This
includes the PSoC Creator IDE for development and debu gging applications, PSoC Programmer
for programming hex files, and the CySmart Central Emulation Tool for BLE Central emulation.
■ The Kit Operation chapter on page 27 describes the major features of the BLE Pioneer Kit such
as USB-UART and USB-I
■ The Example Projects chapter on page 41 describes multiple PSoC 4 BLE and PRoC BLE code
examples that will help you understand how to create your own BLE application using the BLE
Component and device.
■ The Hardware chapter on page 85 details the hardware content of the BLE Pioneer Kit and BLE
Dongle, and the hardware operation.
■ The Advanced Topics chapter on page 111 explains the functionality of the kit features, such as
the USB-UART bridge, USB-I
Tool.
■ The Appendix on page 117 provides schematics, board layouts, KitProg LED status, and the bill
of materials (BOM).
2
C bridges and functionalities such as programming and debugging.
2
C bridge, F-RAM, iOS app, and the CySmart Central Emulation
Visit www.cypress.com/go/psoc4ble and www.cypress.com/procble for additional learning resources
including datasheets, technical r eference manuals, and application notes.
Visit www.cypress.com/go/cysmart for information on the CySmart Central Emulation Tool.
Visit www.cypress.com/appnotes to view a growing list of application notes for PSoC 3, PSoC 4,
PSoC 4 BLE, PRoC BLE, and PSoC 5LP.
Visit this site for PSoC 4BLE and PRoC BLE application notes.
1.5.3PSoC Creator Example Projects
These simple example projects demonstrate how to configure and us e PSoC Creator components.
To open an example proje ct in PSoC Creator, go to File > Example Project (see Figure 1-5) and
choose the required example project.
To open the datasheet for any component, right-click on the component and select Open Datasheet
(see Figure 1-6).
Figure 1-6. Opening Component Datasheet
1.5.5Bluetooth Learning Resources
The Bluetooth Developer Portal provides material by the Special Interest Group (SIG) for learning
various aspects of the Bluetooth Low Energy protocol and systems. Some of them are:
■ Training videos
■ GATT profiles
■ Bluetooth community forum
Introduction
1.5.6Learning From Peers
Cypress Developer Community Forums: Visit www.cypress.com/forums
For assistance, go to our support web page, www.cypress.com/support, or contact our customer
support at +1 (800) 541-4736 Ext. 2 (in the USA) or +1 (408) 943-2600 Ext. 2 (International).
ADCAnalog-to-Digital Converter
APIApplication Programming Interface
BD addressBluetooth Device address
BLEBluetooth Low Energy
CDCCommunications Device Class
COMCommunication Port
DVDDigital Video Disc
ESDElectrostatic Discharge
F-RAMFerroelectric Random Access Memory
GUIGraphical User Interface
GPIOGeneral Purpose Input/Output
I2CInter-Integrated Circuit
IASImmediate Alert Service
IDACInterconnecting Digital-Analog Converter
IDEIntegrated Development Environment
LDOLow Drop Out (voltage regulator)
LEDLight-Emitting Diode
LPLow Power
LPTLine Print Terminal
PHYPhysical Layer
PrISMPrecise Illumination Signal Modulation
PRoCProgrammable Radio-on-Chip
PRMProtocol Service Multiplexer
PSoCProgrammable Systems-on-Chip
PWMPulse-Width Modulation
QFNQuad Flat No-lead (package)
RGBRed Green Blue
SARSuccessi ve Approximation Register
SMASubMiniatur e version A
SPISerial Peripheral Interface
SWDSerial Wire Debug
UARTUniversal Asynchronous Receiver Transmitter
USBUniversal Serial Bus
This chapter describes the steps to install the software tools and packages on a PC for using the
BLE Pioneer Kit. This includes the IDE in which the projects will be built and used for programming.
2.1Before You Begin
All Cypress software installations require administrator privileges. Ensure you have the required
privileges on the system for successful installation. Before you install the kit software, close any
other Cypress software that is currently running.
2.2Insta ll Software
Follow these steps to install the BLE Pioneer Kit software:
1. Download the BLE Pioneer Kit software from www.cypress.com/CY8CKIT-042-BLE. The
software is available in the following formats:
a. CY8CKIT-042-BLE Kit Complete Setup: This installation package contains the files related to
the BLE Pioneer Kit. However, it does not include the Windows Installer or Microsoft .NET
framework packages. If these packages are not on your computer, the installer directs you to
download and install them from the Internet.
b. CY8CKIT-042-BLE Kit Only Package: This executable file installs only the BLE Pioneer Kit
contents, which include code examples, hardware files, and user documents. This package
can be used if all the software prerequisites (listed in step 5) are installed on your PC.
c. CY8CKIT-042-BLE DVD ISO: This file is a complete package, stored in a DVD-ROM image
format, that you can use to create a DVD or extract using an ISO extraction program such as
WinZip or WinRAR. The file can also be mounted similar to a virtual CD/DVD using virtual
drive programs such as ‘Virtual CloneDrive’ and ‘MagicISO’. This file includes all the required
software, utilities, drivers, hardware files, and user documents.
2. If you have downloaded the ISO file, mount it on a virtual drive; if you do not have a virtual drive
to mount, extract the ISO contents using the appropriate ISO extractor (such as MagicISO or
PowerISO). Double-click cyautorun.exe in the root directory of the extracted content or mounted
ISO if “Autorun from CD/DVD” is not enabled on the PC. The installation window will appear
automatically.
Note: If you are using the “Kit Complete Setup” or “Kit Only Package” file, then go to step 4 for
installation.
3. Click Install CY8CKIT-042-BLE Kit to start the installation, as shown in Figure 2-1.
Figure 2-1. Installer Screen
4. Select the folder in which you want to install the CY8CKIT-042-BLE kit-related files. Choose the
directory and click Next.
5. When you click Next, the CY8CKIT-042-BLE Kit installer automatically installs the required
software, if it is not present on your computer. The following software packages are required:
Note: For the Kit Only Package, download and install the following prerequisites.
a. PSoC Creator 3.1 or later: Download the latest version from www.cypress.com/psoccreator.
b. PSoC Programmer 3.22 or later: This is installed as part of PSoC Creator installation
(www.cypress.com/programmer).
c. CySmart 1.0 or later: Download the latest version from www.cypress.com/cysmart.
6. Choose the Typical/Custom/Complete installation type in the Product Installation Overview
window, as shown in Figure 2-2. Click Next after you select the installation type.
Figure 2-2. Product Installation Overview
7. Read the license agreement and select I accept the terms in the license agreement to
continue with installation. Click Next.
8. When the installation begins, a list of packages appears on the installation page. A green check
mark appears next to each package after successful installation.
9. Click Finish to complete the CY8CKIT-042-BLE kit installation.
10.Enter your contact information or select the Continue Without Contact Information check box.
Click Finish to complete the CY8CKIT-042-BLE kit installation.
11.After the installation is complete, the kit contents are available at the following location:
<Install_Directory>\CY8CKIT-042-BLE Kit
Default location:
Windows 7 (64-bit): C:\Program Files (x86)\Cypress\CY8CKIT-042-BLE Kit
Windows 7 (32-bit): C:\Program Files\Cypress\CY8CKIT-042-BLE KitNote: For Windows 7/8/8.1 users, the installed files and the folder are read only. To use the installer
example project, follow the steps outlined in the Example Projects chapter on page 41.
The BLE Pioneer Kit installer also installs the CySmart Central Emulation Tool on your PC. This
software, along with the BLE Dongle, allows the PC to emulate as a BLE Central device. Refer to
CySmart Mobile Application on page 112 for more details on how to use the CySmart Central
Emulation Tool.
2.3Windows 8.1 USB selective suspend setting
Windows 8.1 operating system issues a suspend command to connected USB device if there is no
activity on its USB bus. This may happen to BLE Pioneer Kit/BLE Dongle if the driver installation is
not complete or driver not found. In this situation, as a response to the suspend command from the
operating system, the KitProg will shut down the on-board LDO to remain within the USB suspend
current requirement. Due to this, the BLE Pioneer Kit will not be powered and will not be functional.
To prevent this, take either of the two actions below:
1. Allow complete driver installation to take place on Windows 8.1 operating system before using
the BLE Pioneer Kit.
2. Disable the USB selective suspend setting for BLE Pioneer Kit from Power Options on Windows
8.1:
a. From Control Panel, go to Power Options.
b. Under Advanced settings, expand USB settings > USB selective suspend setting.
c. Select option to Disabled for Plugged in and On battery operation.
d. Select OK.
This chapter introduces you to the BLE Pioneer Kit and the features that will be used as part of its
operation. We will discuss features such as USB connection, programming/debugging, and
programmer firmware update. The chapter also describes the USB-UART and USB-I
along with the PC tools that can be used to communicate with the BLE device on the BLE Pioneer
Kit.
3.1Theory of Operation
Figure 3-1, Figure 3-2, and Figure 3-3 show the block diagrams for the BLE Pioneer Baseboard,
PSoC 4 BLE/PRoC BLE Module, and BLE Dongle.
Figure 3-1. BLE Pioneer Baseboard Block Diagram
The BLE Pioneer Baseboard acts as the baseboard for the PSoC 4 BLE (red module) and PRoC
BLE (black module). The BLE Pioneer Baseboard contains a PSoC 5LP device, that has KitProg
firmware, used as an onboard programmer or debugger, and for the USB-Serial interface.
The baseboard is Arduino form-factor compatible, enabling Arduino shields to be connected on top
of the board to extend the functionality of BLE modules. The board also features a 1-Mb F-RAM, an
RGB LED, a five-segment CapSense slider, a proximity header, a user switch, and a reset switch for
the PSoC 4 BLE and PRoC BLE devices on the module. The Pioneer board supports three voltage
levels: 1.9 V, 3.3 V, and 5 V.
Kit Operation
PRoC BLE/
PSoC 4
BLE
BLE I/Os
20 pin header (Digital pins)
GPIO
GPIO
KHz
Crystal
Decaps
CMOD
SAR
Bypass Cap
CTANK
VREF
RF Matching
Circuit
MHz
Crystal
Test
points
4 pin
header
RX/ TX
BLE I/Os
24 pin header (Analog pins)
Ferrite Bead
VDDD/A/R
Decaps
PowerSignal
RF Matching
Circuit
KitProg
Programmer/Serial
Communication
I2C / UART
SWD
USB
2.0
Type-A
Plug
10 pin Programming
header
SWD
Test Points
D+ / D-
Crystals
PRoC BLE
VBUS
ESD
Protection
PowerSignal
XRES
Status LED
Green
Power LED
Red
Reset SW
(Push Button)
User SW
(Push Button)
User LED
Blue
The BLE Pioneer Baseboard can also be used as a standalone programmer to program and debug
other BLE devices using serial wire debug (SWD), and as a USB-Serial interface. The KitProg
firmware on PSoC 5LP device enables bootloading PSoC 5LP over USB to upgrade the firmware.
Figure 3-2. PSoC 4 BLE/PRoC BLE Module Block Diagram
This BLE Pioneer Kit includes two modules. These modules act as a basic breakout board for the
CY8C4247LQI-BL483 (PSoC 4 BLE) and CYBL10563-56LQXI (PRoC BLE) device. The
PSoC 4 BLE and PRoC BLE Modules are identical except for the BLE device.
The BLE Dongle is the wireless interface for the CySmart Central Emulation Tool. The BLE Dongle
has a PRoC BLE device for BLE communication and KitProg for onboard programming, debugging
and for the USB-Serial interface, as shown in Figure 3-3.
The BLE Dongle has a USB Type-A plug to connect the KitProg to the USB port of the host PC. The
KitProg then communicates with the PRoC BLE device over UART or multiplexed I
2
C or an SPI bus.
The BLE Dongle also features a user LED, a user switch, and a reset switch for the PRoC BLE
device. The BLE Dongle is powered directly through the USB port (VBUS) at 5.0 V.
KitProg is the hardware/firmware block for on-board programming, debugging and bridge
functionality. It is a common reusable hardware/firmware block used across many Cypress Kit
platforms. It consists of a PSoC 5LP which connects to the PC over an USB interface and connects
to the PSoC 4 BLE or PRoC BLE device over SWD, I2C and UART pins.
The KitProg communicates with PSoC Programmer and PSoC Creator software to program/debug
the target PSoC 4 BLE or PRoC BLE over the SWD interface. The main advantage of an onboard
programmer/debugger is that users don’t have to buy an extra programmer/debugger hardware.
3.3BLE Pioneer Kit USB Connection
The BLE Pioneer Kit powers from a PC over the USB interface (J13). It enumerates as a composite
device, as shown in Table 3-1. USB drivers required for this enumeration are part of the kit installer.
The kit should be installed properly for its correct operation. Visit
www.cypress.com/CY8CKIT-042-BLE for latest kit installer.
Table 3-1. BLE Pioneer Kit Enumerated Interfaces
PortDescription
USB Composite DeviceComposite device
USB Input Device
KitProg
KitProg USB-UARTUSB-UART bridge, which appears as a COM# port
USB-I2C bridge, Kitprog Command Interface
2
USB-I
C bridge, Programmer and Debugger
Kit Operation
Figure 3-4. KitProg Driver Installation (appearance may differ depending on Windows version)
3.4Placing Modules on Baseboard
Plug the module into the BLE Pioneer Baseboard on headers J10 and J11, while keeping the
antenna directed outside. Note that the two parallel headers J10 and J11 are not equal (24-pin and
20-pin, respectively) and will not allow the module to be inserted in the opposite direction.
Figure 3-5. Baseboard with J10 and J11 Headers to connect modules
To remove the modules from the BLE Pioneer Kit, hold the BLE Pioneer Kit in one hand and the
module in the other, as shown in Figure 3-6, and pull it out using a rocking motion.
Figure 3-6. Remove module connected on BLE Pioneer Kit
3.5Programming and Debugging BLE Device
The BLE Pioneer Kit and BLE Dongle can be programmed and debugged using the KitProg. Before
programming the device, ensure that PSoC Creator and PSoC Programmer are installed on the PC.
See the section Install Software on page 23 for more information.
3.5.1Programming using PSoC Creator
1. Connect the BLE Pioneer Kit/BLE Dongle to the PC USB port, as shown in Figure 3-7.
2. Load the desired example project in PSoC Creator from File > Open > Project/Workspace.
3. Build the project by choosing Build > Build <Project Name> or [Shift] [F6], as shown in
Figure 3-8.
Figure 3-8. Build an Example Project
4. If there are no errors during build, pr og ram the firmwa re by clicking Program button on toolbar or
pressing [Ctrl] [F5], as shown in Figure 3-9. This will program the device on the BLE Pioneer Kit/
BLE Dongle and it will be ready for use.
For debugging the project using PSoC Creator, follow steps 1-5 from Programming using PSoC Cre-
ator on page 30 followed by:
1. Click on Debug icon or press [F5], as shown in Figure 3-10.
Figure 3-10. Start debug on PSoC Creator
2. Once Creator opens in debug mode, use the buttons on toolbar for debugging.
For more details on using the debug features, see the Cypress application note Getting Started with
PSoC 4 BLE.
3.5.3Programming using PSoC Programmer
PSoC Programmer (3.22 or later) can be used to program existing hex files into both the BLE Pioneer Kit or BLE Dongle. To do this, follow these steps.
1. Connect the BLE Pioneer Kit or BLE Dongle to PC and open PSoC Progr ammer fr om Start > All Programs > Cypress > PSoC Programmer <version> > PSoC Programmer <version>.
2. Click the File Load button at the top left corner of the window . Browse for the desired hex file and
click Open.
Figure 3-11. Select Hex File
3. Go to File > Program to start programing the kit with the selected file.
Note: If the hex file does not match the device selected, then PSoC Programmer will throw an
error of device mismatch and terminate programming.
4. When the programming is finished successfully , indicated by a PASS message on the status bar,
the BLE Pioneer Kit/BLE Dongle is ready for use. Close PSoC Programmer.
3.6Updating BLE Dongle for CySmart Central Emulation Tool
The BLE Dongle, provides a BLE Central mode capability using the CySmart Central Emulation Tool
(see CySmart Mobile Application on page 112) on the PC. The CySmart Central Emulation Tool on
the PC is the interface with which to configure the BLE Dongle and analyze the data transferred after
connecting with a BLE peripheral.
The BLE Dongle works along with the CySmart Central Emulation Tool, as shown in Figure 3-13.
The CySmart Central Emulation Tool is installed as part of the BLE Pioneer Kit installation and can
be opened from Start > All Programs > Cypress > CySmart <version> > CySmart <version>.
The tool operation is explained in user guide of the tool, which can be accessed from Help > HelpTopics.
Figure 3-13. BLE Dongle Interface on CySmart Central Emulation Tool
Kit Operation
If the BLE Dongle contains custom firmware on PRoC BLE, the original CySmart firmware can be
programmed back to restore the CySm art functionality. It must be connected through the USB and
enumerated as KitProg. To do this, follow these steps:
1. Connect the BLE Dongle to the USB port on the PC.
2. Open PSoC Programmer by going to Start > All Programs > Cypress > PSoC Programmer<version> > PSoC Programmer <version>.
3. Click the File Load button and browse to the location of the BLE_Dongle_CySmart.hex file. The
hex file is located at:
<Install_Directory>\CY8CKIT-042-BLE Kit\<version>\Firmware\ BLE
Dongle\Hex Files\
Note: If Cypress releases new versions of the CySmart Central Emulation Tool and the BL E Dongle firmware, then the CySmart Central Emulation Tool will display a message requesting to
update the firmware, as shown in the followin g figu r es.
4. Ensure the other settings match as shown in Figure 3-16. Click the Program button to start
programming. The status bar at the bottom of the PSoC Programmer window will show the
programming status and the result (Pass/Fail).
Figure 3-17. Programming Hex File to Dongle
5. After programming is completed successfully, the BLE Dongle firmware is updated and can be
used to connect to the CySmart Central Emulation Tool.
3.7USB-UART Bridge
The KitProg on both the BLE Pioneer Baseboard and BLE Dongle acts as a USB-UART bridge.
When connected to PC, a device named KitProg USB-UART is available under Ports (COM &LPT) in the Device Manager. The UART lines between modules and KitProg are hard-wired on
board, with UART_RX assigned to P1_4 and UART_TX assigned to P1_5 on PSoC 4 BLE/PRoC
BLE device.
COM terminal software, such as Hyperterminal or TeraTerm, can be used to send and receive data.
UART data sent from PSoC 4 BLE/PRoC BLE device on UART_TX line will be received by the
software. Data entered in the software will be received by PSoC 4 BLE/PRoC BLE on UART_RX
line. Refer to Advanced section in CY8CKIT-042 PSoC
Table 3-2 lists the specifications supported by the USB-UART bridge.
Table 3-2. Specifications Supported by USB-UART Bridge
ParameterSupported Values
Baud Rate1200, 2400, 4800, 9600, 19200, 38400, 57600, and 115200
Data Bits8
ParityNone
Stop Bits1
Flow ControlNone
File Transfer Protocols sup-
ported
3.8USB-I2C Bridge
Xmodem, 1K Xmodem, Ymodem, Kermit, and Zmodem (only
speeds greater than 2400 baud)
The KitProg can function as USB-I2C bridge and communicate with software utility Bridge Control
Panel (BCP). When connected to BCP, the KitProg USB-I
number> in the BCP. The I
used to transfer data with BCP. The I
and P3_5 (SCL), which are hardwired on board to I
2
C connection between PSoC 4 BLE/PRoC BLE device and KitProg is
2
C lines on PSoC 4 BLE/PRoC BLE device are P3_4 (SDA)
2
C lines of KitProg. The USB-I2C supports I2C
2
C is available under KitProg\<serial
speed of 50 kHz, 100 kHz, 400 kHz and 1 MHz.
BCP is installed as part of PSoC Programm er inst allation and can be acce ssed fro m St art > All Pro-
grams > Cypress > Bridge Control Panel. Refer to Advanced section in CY8CKIT-042 PSoC
®
4
Pioneer Kit User Guide for more details.
To use the USB-I
2
C functionality, select the KitProg\<serial number> in the BCP. On successful
connection, the Connected and Powered status box turn green, as shown in Figure 3-18.
Figure 3-18. KitProg USB-I
The KitProg firmware normally does not require any update. If an up date is required, then PSoC Programmer will display a warning message when the kit is connected to it, as shown in Figure 3-19.
Figure 3-19. Update KitProg
To update the KitProg, go to the Utilities tab on PSoC Programmer and click Upgrade Firmware, as
shown in Figure 3-20.
This chapter demonstrates the functionality of the PSoC 4 BLE and PRoC BLE devices using the
BLE Pioneer Kit-based example projects. Download and install the kit setup file from the kit web
page. The example projects can be accessed under the Examples and Kits on Start Page of PSoC
Creator.
4.1Using Example Projects
Follow these steps to open and use the example projects:
1. Launch PSoC Creator from Start > All Programs > Cypress > PSoC Creator 3.1 > PSoCCreator 3.1.
2. On the St art Page, under Examples and Kits section, choose Kits > CY8CKIT-042-BLE. A list of
example projects appears, as shown in Figure 4-1. Projects named with the prefix
'PSoC_4_BLE_' work on the BLE Pioneer Kit with the PSoC 4 BLE Module; projects named with
the prefix 'PRoC_BLE_' work on the BLE Pioneer Kit with the PRoC BLE Module.
3. Click on the desired example project.
Figure 4-1. Open Example Project from PSoC Creator
4. Select the folder where you want to save the project and click OK.
5. Every BLE project use a public address set in the BLE component GUI to advertise and scan,
Figure 4-2. Change BLE Public Address and Name
depending on the role: peripheral or central mode. If multiple kits in close proximity have the
same public address, then wrong devices may be connected or connections may fail. To prevent
this, change the Public address (and preferably Device name ) in the BLE compone nt GAP Set-tings tab as shown in Figure 4-2. Click OK.
Alternatively, you can select the 'Silicon generated' device address by selecting the check box.
This way, the Bluetooth Device (BD) address is generated using the silicon ID, unique to each
device. Click OK.
6. Build the example project by choosing Build > Build <Project Name>, as shown in Figure 4-3. A
.hex file will be generated.
7. Connect the BLE Pioneer Baseboard to the PC through USB Mini-B connector J13. Ensure that
the correct module (PSoC 4 BLE or PRoC BLE) is placed on the baseboard, depending on the
project opened.
8. Choose Debug > Program in PSoC Creator, as shown in Figure 4-4.
Figure 4-4. Program Device in PSoC Creator
9. If the device is not yet acquired, PSoC Creator will open the programming window. Select
KitProg and click the Port Acquire button, as shown in Figure 4-5.
Note: The serial ID starting with 'BLE' belongs to the BLE Dongle (see Updating BLE Dongle for
CySmart Central Emulation Tool on page 35).
Figure 4-5. Port Acquire
10.After the device is acquired, it is shown in a structure below the KitProg. Click the Connect button and then OK to exit the window and start programming, as shown in Figure 4-6.
Figure 4-6. Connect Device From PSoC Creator and Program
Note: As stated previously, the BLE Pioneer Kit supports both Cypress BLE devices: PSoC 4 BLE
and PRoC BLE. The description, hardware configurations, and verification method of the Example
projects explained in the following sections are valid for both PSoC 4 BLE and PRoC BLE devices.
Unless explicitly mentioned, the theory and usability for these Example projects should be
considered the same for both the modules.
This document refers to the BLE Pioneer Kits, BLE Dongle, and PC/mobile as Central or Peripheral
devices. A Central device is normally the master and requests/commands data from the Peripheral
device. BLE-enabled phones and PCs are one such example. Peripheral device, on the other hand,
store the actual data and send it to Central device when requested. Examples include BLE-enabled
sensors, proximity beacons, and so on.
This project demonstrates connectivity between the BLE Pioneer Kit (acting as a Peripheral and
GATT server device) and CySmart Central Emulation tool or mobile device running the CySmart
mobile application (acting as a Central and GATT client device). This project demonstrates following:
■ Advertisement with timeout
■ Connection with any Central device
■ Two custom services in single profile
■ Data transfer over BLE custom service using notifications, read, and write
■ Low-power mode implementation for coin-cell operation
The BLE profile in this project consists of two BLE custom services: CapSense and RGB LED. The
CapSense service consists of one custom characteristic, termed as CapSense Slider. The
CapSense slider characteristic is us ed to send one b yte data, ranging from 0 to 100, as no tification
to the GATT client device. This data is the finger location read by the CapSense component on the
five-segment slider (CSS1) present on the kit. This characteristics supports notification, which allows
the GATT server to send data to the connected client device whenever new data is available.
The RGB LED service also consists of one custom characteristic, termed as RGB LED Control.
This characteristic supports two operations, read and write, through which the connected GATT client device can read data as well as write a new value to the characteristic. This data has four byte
values indicating red, green, blue, and intensity values to control the onboard RGB LED.
Example Projects
These properties for the custom service/characteristics are configured in the BLE component under
the Profiles tab, as shown in Figure 4-7.
Figure 4-7. Attributes Configuration in BLE Component for custom services
These files contain the main function, which is the entry point and execution of the firmware application. It also contains function definition for initialization of the sys tem an d re ad in g the
CapSense slider data from the CapSense component.
These files contain all the macros and function definitions related to BLE communication and
operation. It contains the event callback function definition that is registered with the BLE component startup and used by the component to send BLE-related events from the BLE stack to the
application layer for processing. It contains a method to send CapSense not ifications to the GA TT
client device and process the Read and Write commands on the RGB LED characteristic by the
GATT client device. It updates the BLE Connection parameter, which is important for low-power
mode usage.
These files contain the function to handle low-power mode. This function is continuously called in
the main loop and is responsible for pushing the BLE hardware block (BLESS) as well as the
CPU to Deep Sleep mode as much as possible. The wakeup source is either the BLE hardware
block Link Layer internal timer or the interrupt from the user button press (SW2). This allows for
very low power mode implementation and operation using a coin cell.
Additionally, the PRoC BLE version of this project consists of the RGB_PRSm.c/.h file, which contains the function to drive the software-based PrISM method and drive the color and intensity on the
RGB LED.
This is the default firmware that comes in the modules shipped with the kit.
Two projects demonstrate this functionality on two different devices:
■ PSoC_4_BLE_CapSense_Slider_LED works with the PSoC 4 BLE Module.
■ PRoC_BLE_CapSense_Slider_LED works with the PRoC BLE Module.
The PSoC 4 BLE project implements RGB color and intensity control using the PRiSM component
whereas the PRoC BLE uses the software implementation of the PRiSM mode.
No specific hardware connections are required for this project because all connections are
hardwired on the BLE Pioneer Baseboard. Ensure that the correct module is placed on the
baseboard corresponding to the project being used. PSoC_4_BLE_CapSense_Slider_LED works
with the PSoC 4 BLE Module. PRoC_BLE_CapSense_Slider_LED works with the PRoC BLE
Module.
The pin assignment for this project is in PSoC_4_BLE_CapSense_Slider_LED.cydwr/PRoC_BLE_CapSense_Slider_LED.cydwr in the Workspace Explor er, as shown in Figure 4-10.
Figure 4-10. Pin Selection for CapSense Slider and LED Project
The project can be verified by two methods: using the CySmart Central Emulation Tool and BLE
Dongle or using the CySmart mobile application.
4.2.4.1CySmart Central Emulation Tool
To verify the CapSense and LED project using the CySmart Central Emulation Tool, follow these
steps:
Note: Refer CySmart BLE Host Emulation tool to learn how to use the tool.
1. Connect the BLE Dongle to one of the USB ports on the PC.
2. St art the CySmart Central Emulation Tool on the PC by going to Start > All Programs > Cypress> CySmart <version> > CySmart <version>. You will see a list of BLE Dongles connected to it.
If no BLE Dongle is found, click Refresh. Select the BLE Dongle and click Connect.
Figure 4-12. Connect to BLE Dongle
3. Place module on the BLE Pioneer Kit, depending on the project chosen.
4. Power the BLE Pioneer Kit through the USB connector J13.
5. Program the BLE Pioneer Kit with the CapSense and LED example project. Follo w steps in Using
Example Projects on page 41 to program the device.
6. After programming successfully, press the user button (SW2) on the BLE Pioneer kit to start the
advertisement. Advertisement is indicated by a blinking red LED on the baseboard.
Note: The project has an advertisement timeout of 30 seconds after which it returns to Deep
Sleep. Press SW2 again to restart the advertisement.
7. On the CySmart Central Emulation Tool, click Start Scan to see the list of available BLE
peripheral devices.
11.Locate the attribute Client Characteristic Configuration descriptor (UUID 0x2902) under
Figure 4-16. Read CCCD for CapSense Slider Characteristic
CapSense Slider characteristic (UUID 0xCAA2). C lick Read Value to read the existing Client
Characteristic Configuration Descriptor (CCCD) value as shown in Figure 4-16.
12.Modify the Value field of CCCD to '01:00' and click Write Value. This enables the notifications on
the CapSense Slider characteristic.
13.Swipe your finger on the CapSense slider on the BLE Pioneer kit, as shown in Figure 4-18 and
see the notification values in the CapSense Slider value fi eld , as shown in Figure 4-19.
Figure 4-18. CapSense Slider
Figure 4-19. CapSense Slider Notification Received
14.To disable notifications, modify the Value field of the Client Characteristic Configuration
Figure 4-20. Disable Notifications
descriptor to '00:00' and click Write Value.
15.Locate the RGB LED Control characteristic (UUID 0xCBB1). Click Read Value to read the existing 4-byte onboard RGB LED color information, as shown in Figure 4-21.
Figure 4-21. Read RGB LED Control Characteristic Value
16.Modify the four bytes of data in the Value field and click Write Value. You will see the
corresponding change in the color and intensity of the RGB LED on the BLE Pioneer kit, as
shown in Figure 4-22. The RGB LED will be on for 3 seconds before switching off to conserve
power.
Note: If the BLE Pioneer kit is powered from a c oin cell and not the USB Vbus, then the color
mixing and intensity will vary. This is because the coin cell provides a lower driving voltage for
RGB LEDs.
Figure 4-22. Write RGB LED Control Characteristic Value
Figure 4-23. RGB LED Control with PSoC 4 BLE Module and PRoC BLE Module
17.To disconnect from the device, click Disconnect, as shown in Figure 4-24.
Figure 4-24. Disconnect from the Device
18.To connect to this Peripheral again, restart advertising by pressing the user button (SW2) on the
BLE Pioneer Kit. Advertising is indicated by the blinking red LED.
4.2.4.2CySmart Mobile Application
To verify the CapSense and LED project using the CySmart mobile application (see CySmart Mobile
Application on page 112), follow these steps:
1. Plug the desired module on the BLE Pioneer Baseboard.
2. Connect the BLE Pioneer Kit into the PC using the J13 USB connector.
3. Program the kit with the CapSense and LED example projects. See Using Example Projects on
page 41 for programming instructions.
4. Press the user button (SW2) on the BLE Pioneer Kit to start the advertisement. This is indicated
by the blinking red LED on the BLE Pioneer Kit.
5. Open the application on the mobile device. If Bluetooth is not enabled on the device, the
application will ask to enable it.
6. After Bluetooth is enabled, the CySmart mobile application will automatically search for available
Peripherals and list them. Select the BLE Slider and LED Peripheral as shown in Figure 4-25.
7. When connected, the CySmart mobile application will list the supported profiles by the Peripherals. Scroll and select the CapSense icon, as shown in Figure 4-26.
Figure 4-26. CapSense Service Page
8. Swipe your finger on the CapSense slider on the BLE Pioneer Kit and see a similar response on
the CapSense page in the CySmart application (Figure4-27).
9. Press the back button to return to the service selection page. Scroll and tap on the RGB LED service.
10.On the RGB LED service page, swipe over the color gamut to see a similar color response on the
BLE Pioneer Kit RGB LED. The slider below the color gamut controls the intensity of the RGB
LED color. The RGB LED will be on for 3 seconds before switching off. This is done to conserve
power.
Figure 4-28. RGB LED Control with CySmart mobile application
11.To disconnect from the BLE Pioneer Kit, return to the CySmart mobile application home screen
by pressing the back button.
12.To reconnect to the peripheral, press the user button (SW2) on the BLE Pioneer Kit again and
then scan for devices using CySmart mobile application.
4.3CapSense Proximity
4.3.1Project Description
This project demonstrates connectivity between the BLE Pioneer Kit (acting as a Peripheral and
GA TT server device) and the CySmart Centr al Emulation Tool or mobile device running the CySmart
mobile application (acting as a Central and GATT client device). This project demonstrates the
following:
■ Advertisement with timeout
■ Connection with any Central device
■ One custom service
■ Data transfer over BLE custom service using notifications
■ Low-power mode implementation for coin cell operation
The BLE profile in this project consists of a single BLE custom service, called CapSense. The
CapSense service consists of a custom characteristic, termed as CapSense Proximity. The
CapSense proximity characteristic is used to send one byte data, ranging from 0 to 255, as
notification to the GATT client device. This data is the difference count read by the CapSense
component on the one-wire proximity sensor (J14) connected on the kit. This characteristics
supports notification, which allows the GATT server to send data to the connected GATT client
device whenever new data is available.
Example Projects
The properties for the custom attributes are con fig ured in the BLE componen t under the Profiles t ab,
as shown in Figure 4-29.
Figure 4-29. Attributes Configuration in BLE Component for CapSense Proximity
The project consists the following files:
■ main.c/.h
These files contain the main function, which is the entry point and execution of the firmware application. It contains function definition for initialization of the system and reading the CapSense
proximity data from the CapSense component.
■ BLEApplications.c/.h
These files contain all the macros and function definitions related to BLE communication and
operation. It contains the event callback function definition that is registered with the BLE component startup and used by the component to send BLE-related event from the BLE stack to the
application layer for processing. It contains a method to send CapSense not ifications to the GA TT
client device. It updates the BLE Connection parameter, which is important for low-power mode
usage.
■ HandleLowPower.c/.h
These files contain the function to handle low-power mode. This function is continuously called in
the main loop and is responsible for pushing the BLE hardware block (BLESS) as well as the
CPU to Deep Sleep mode as much as possible. The wakeup source is either the BLE hardware
block Link Layer internal timer or the interrupt from the user button press (SW2). This allows for
very low-power mode implementation and operation using a coin cell.
The red LED is used as the status LED and provides visual confirmation on advertising or
connection states. A blinking red LED indicates advertising state .
Two projects demonstrate this functionality on two different devices:
■ PSoC_4_BLE_CapSense_Proximity works with the PSoC 4 BLE Module.
■ PRoC_BLE_CapSense_Proximity works with the PRoC BLE Module.
■ Ensure that the correct module is placed on the baseboard corresponding to the project being
used. PSoC_4_BLE_CapSense_Proximity works with the PSoC 4 BLE Module.
PRoC_BLE_CapSense_Proximity works with the PRoC BLE Module.
■ Connect a five-inch wire (provided as part of this kit) to the proximity connector J14 on the
baseboard. Loop the wire as shown in Figure 4-32.Note: Ensure that the proximity sensor loop wire is kept away as much as possible from the BLE
antenna on the modules.
Figure 4-32. Proximity Sensor Connection on BLE Pioneer Kit with PSoC 4 BLE Module
Figure 4-33. Proximity Sensor Connection on BLE Pioneer Kit with PRoC BLE Module
The pin assignment for this project is in PSoC_4_BLE_CapSense_Proximity.cydwr/PRoC_BLE_CapSense_Proximity.cydwr in the Workspace Explorer, as shown in Figure 4-34.
Figure 4-34. Pin Selection for CapSense Proximity Project
The project can be verified by two methods: using the CySmart Central Emulation Tool and BLE
Dongle or using the CySmart iOS/Android app.
4.3.4.1CySmart Central Emulation Tool
To verify the CapSense proximity project using the CySmart Central Emulation Tool, follow these
steps:
Note: Refer CySmart BLE Host Emulation tool to learn how to use the tool.
1. Connect the BLE Dongle to one of the USB ports on the PC.
2. St art the CySmart Central Emulation Tool on the PC by going to Start > All Programs > Cypress> CySmart <version> > CySmart <version>. You will see a list of dongles connected to it. If no
BLE Dongle is found, click Refresh. Select the BLE Dongle and click Connect.
Figure 4-36. Connect to BLE Dongle
3. Connect a five-inch wire (included in the kit) to the proximity sensor connector J14 and make a
loop of it.
4. Power the BLE Pioneer Kit through the USB connector J13.
5. Program the BLE Pioneer Kit with the CapSense proximity example project. Follow the steps in
Using Example Projects on page 41 to program the device.
6. After programming successfully, press the user button (SW2) on the BLE Pioneer kit to start the
advertisement. This is indicated by a blinking red LED on the baseboard.
Note: The project has an advertisement timeout of 30 seconds after which it returns to Deep
Sleep. Press SW2 again to restart the advertisement.
7. On the CySmart Central Emulation Tool, click Start Scan to see the list of available Peripheral
devices.
8. Double-click CapSense Proximity to connect or click Connect to connect to the BLE Pioneer
Kit.
Figure 4-38. Connect to CapSense Proximity Peripheral
9. When connected, the CySmart Central Emulation Tool will display a message for the Update connection parameters. Select Yes, as shown in Figure 4-39.
Figure 4-39. Update Connection Parameter Option
Note: If you select No, the project will still work. However, th e current consumption will be higher
due to faster connection interval.
13.Bring your hand closer to the prox imity sensor on the BLE Pione er Kit, as shown in Figure 4-43
and observe the value changing in the characteristic value field, as shown in Figure 4-44.
Figure 4-43. CapSense Proximity Sensing with PSoC 4 BLE Module
Figure 4-44. CapSense Proximity Notification Received
Figure 4-46. Connect to CapSense Proximity Peripheral
Example Projects
8. When connected, the app will list the services supported by the Peripherals. Scroll and select the
CapSense service.
9. When the CapSense service page opens, bring your hand near the sensor wire on the BLE
Pioneer Kit and see a similar response in the app as a bar graph, as shown in Figure 4-47.
Figure 4-47. CapSense Proximity Sensing with PSoC 4 BLE Module
10.To disconnect from the BLE Pioneer Kit, return to the device selection screen on the CySmart
mobile application.
11.To reconnect to the Peripheral, press the user button (SW2) on the BLE Pioneer Kit to restart the
advertisement and scan for the device in the CySmart mobile application.
The BLE projects described above ha ve been fu nctioning as Periphe ral devices. This mea ns that the
firmware role was set to be a Peripheral and GATT server; another device such as the CySmart
Central Emulation Tool or CySmart mobile application will connect to it and collect the data.
This example project demonstrates the Central and GA TT client mode where it will scan for a Peripheral device, connect to it, and send commands. In this project, the BLE Pioneer Kit scans and autoconnects to a particu lar Pe ripher al de vice sup por ting Immediat e Alert Service ( IAS). Whenever the
Peripheral with a predetermined public address is found, a connection request is sent followed by
discovering the attributes. When the discovery is over, you can send one of the three alert levels to
the Peripheral device over the IAS. This is done by pressing the SW2 button on the BLE Pioneer Kit
and cycling through the alert levels.
The BLE Central project supports low-power mode operation, where the firmware supports BLE
Hardware Block and CPU Deep Sleep mode wheneve r possible. The system remains in De ep Sleep
when disconnected. Press SW2 to wake up the system and start scanning (blinking blue LED). The
scanning timeout interval is set to 30 seconds. If the p art icul ar Perip her al d evice is fou nd a dvertisin g
before timeout, a connection is made (blue LED always ON). If no such device is found, then the
system stops scanning and returns to Deep Sleep mode (LED OFF). Press SW2 again to wake the
system and restart scanning.
To aid in evaluation, the Peripheral project with the particular public address is provided in the same
workspace. This Peripheral project supports IAS and has fixed public address that the Central
device will recognize and auto-connect to. This Peripheral project should be programmed on the
BLE Dongle and powered through the USB port of PC. The received alert levels (No, Mid, and High
alert) on the BLE Dongle are represented by different LED status. No Alert is represented by LED
OFF, Mid Alert by blinking LED, and High Alert with LED always ON. Upon each successive button
press on the BLE Pioneer Kit, the LED state on the BLE Dongle changes in a circular fashion.
Two projects demonstrate the BLE Central functionality on the two devices:
■ PSoC_4_BLE_Central_IAS works with the PSoC 4 BLE Module.
■ PRoC_BLE_Central_IAS works with the PRoC BLE Module.
Additionally, the BLE_Dongle_Peripheral_IAS project is to be programmed on the BLE Dongle.
This project is present in both the PSoC_4_BLE_Central_IAS and the PRoC_BLE_Central_IAS
workspace and can be used to program the BLE Dongle separately.
Note: If the BLE Dongle is programmed with the BLE_Dongle_Peripheral_IAS example, it will not
work with the CySmart PC utility. Reprogram the BLE Dongle with the CySmart firmware according
to Updating BLE Dongle for CySmart Central Emulation Tool on page 35 to use the CySmart Central
Emulation Tool.
No specific hardware connections are required for this project because all connections are
hardwired on the BLE Pioneer Baseboard.
Ensure that the correct module is plac ed on the BLE Pioneer Baseboard corresponding to the project being used. PSoC_4_BLE_Central_IAS works with the PSoC 4 BLE Module.
PRoC_BLE_Central_IAS works with the PRoC BLE Module. BLE_Dongle_Peripheral_IAS is the
common project for both workspaces and programs the BLE Dongle with Peripheral mode firmware.
The pin assignment for this project is in PSoC_4_BLE_Central_IAS.cydwr/PRoC_BLE_Central_IAS.cydwr in the Workspace Explorer, as shown in Figure 4-51.
Figure 4-51. Pin Selection for BLE IAS Central Example Project
Similarly, the pin assignment for the BLE Dongle Peripheral project is in
BLE_Dongle_Peripheral_IAS.cydwr in the Workspace Explorer as shown in Figure 4-52.
Figure 4-52. Pin Selection for BLE IAS Peripheral Example Project
2. In the PSoC Creator Workspace Explorer, right-click on the BLE_Dongle_Peripheral_IAS
project and select Set As Active Project, as shown in Figure 4-56.
Figure 4-56. Set Dongle Peripheral Project as Active
3. Program the BLE Dongle with the BLE_Dongle_Peripheral_IAS project described in Using
Example Projects on page 41.
Note: Do not update the public device address (inside the BLE component) for the
BLE_Dongle_Peripheral_IAS example project. Changing the BLE_Dongle_Peripheral_IAS
example project public address will lead to no connection with the BLE Central device on the BLE
Pioneer kit.
4. Power the BLE Pioneer Kit through USB connector J13.
5. In the Workspace Explorer, right-click on the PSoC_4_BLE_Central_IAS project and select SetAs Active Project, as shown in Figure 4-57.
6. Program the BLE Pioneer Kit with either the PSoC_4_BLE_Central_IAS or thePRoC_BLE_Central_IAS project, depending on the module placed on the BLE Pioneer Kit.
7. Press button SW2 on the BLE Pioneer Kit to wake the system and start scanning. Scanning is
indicated by a blinking LED.
8. Wait for the BLE connection between the BLE Dongle and the BLE Pioneer Kit. The connection
success status is indicated on the baseboard in the following three stages:
a. Fast blinking blue LED represents scanning mode. Du ring this mode, the BLE Pioneer Kit is
scanning for peripheral devices.
b. Slow blinking blue LED represents discovery mode. During this mode, the BLE Pioneer Kit
has found the BLE Dongle Peripheral device and has started the connection procedure.
c. The blue LED remains on, representing the connected mode. This mode indicates that the
Peripheral device has been connected and the application can now send alert levels.
9. Press button SW2 on the BLE Pioneer Kit to send the next alert level to the BLE Dongle. The
alert level will rotate from No Alert to Mid Alert to High Alert.
Figure 4-58. User Button on BLE Pioneer Kit with PSoC 4 BLE Module
Example Projects
10.Check if the LED behavior changes for each alert notification on the BLE Dongle according to the
following table:
Alert LevelLED State
No AlertLED Off
Mild AlertLED Blinking
High AlertLED On
Note: To revert the CySmart functionality to the dongle, program the dongle hex file, as described in
Updating BLE Dongle for CySmart Central Emulation Tool on page 35.
4.5BLE Dongle and LED Control
4.5.1Project Description
This firmware supports the CySmart debug tool (see CySmart Mobile Application on page 112) by
acting as the BLE host emulator. This is the default firmware that comes in the BLE Dongle shipped
with the kit.
This project additionally demonstrates LED brightness control via a custom BLE profile, which works
with the CapSense slider example explained in CapSense Slider and LED on page 45.
The device will scan for the Peripheral acting as a CapSense Slider and LED device, and connect to
it automatically. This is achieved by filtering the advertisement packets for the CapSense Slider
service data. Then, it will enable slider notifications and process the received notifications.
Whenever CapSense detects activity, it will notify the finger location to the BLE Dongle; it will update
the LED brightness using PWM.
The custom GATT client LED control will be stopped if the CySmart Central Emulation Tool acquires
the dongle. The dongle will enter the CySmart emulator mode, in which it will process all BLE
commands as triggered by the user via the tool. The project uses custom command/event protocol
to exchange data between the CySmart Ce n tra l Emulation Tool and the BLE device via a USB-CDC
This project will be used whenever the CySmart Central Emulation Tool (see CySmart Mobile Appli-
cation on page 112) is invoked for testing other example proje ct s. In addi tion, the LED control oper a-
tion can be verified as follows.
1. Power the BLE Pioneer kit through the USB connector J13.
2. Program the BLE Pioneer kit with the CapSense and LED example project described in
CapSense Slider and LED on page 45.
3. Connect the BLE Dongle to one of the USB ports on the PC.
4. Program the BLE Dongle with the BLE_Dongle_CySmart project. See Using E xample Projects
on page 41 for programming instructions.
5. Press the user button SW2 on both the BLE Dongle and the BLE Pioneer Kit. The BLE Dongle
will start scanning and the BLE Pioneer Kit will start advertising.
6. Wait for the BLE connection betwee n the BLE Don gle an d the BLE Pio nee r Ba sebo ard . The connection success status will be indicated by a 3-second ON state of the red LED followed by the
OFF state on the BLE Pioneer Baseboard.
7. Swipe your finger on the CapSense slider and check the LED brightness variation on the BLE
Dongle.
4.6Direct Test Mode (DTM)
4.6.1Project Description
Bluetooth Core specification (v4.0 and later), Volume 6, Part F defines Direct Test Mode (DTM) as a
method to test the BLE PHY layer and provide a report back to the tester. It uses one of the two
methods, over Host Controller Interface(HCI) or through a two-wire UART interface.
Device under test (DUT) is the BLE system that is to be tested (for example, BLE Pioneer Kit). With
DTM, the RF performance of the BLE system can be verified during development or in production
line. The environment consists of the DUT and a tester. The tester ha s two parts; the upper tester
sends commands through one of the two methods (HCI or two-wire UAR T) and the lower tester performs the corresponding action over the RF link. The tester compares the command sent over HCI
and the response received over RF, and provides a result of the performance.
Figure 4-62. Direct Test Mode (DTM) Setup
The BLE Component allows configuring the device in DTM by enabling the HCI. The appropriate
response to commands from the tester are performed by the BLE protocol stack and does not
involve separate application handling. The only task is to start the BLE Component and call the API
to process the events.
The HCI is enabled in the BLE Component under the General Settings. Note that when the HCI
mode is selected, all other tabs are hidden and cannot be configured. This is because in HCI mode,
there are no upper layer processes. On enabling HCI mode in the components, the components
automatically reserves a UART block to allow communication between the tester and BLE stack.
The UART exposes the pins that can be assigned in <project.cydwr> file under Pins tab. The only
option to be configured for HCI mode is the baud rate and the pins for communication with the te ster.
Figure 4-63. HCI Mode in BLE Component
Many companies develop BLE testers for Direct Test Mode. It is also possible to create PC-based
software tools that will send HCI commands over serial communication links.
For PC-based software, the serial communication link is the COM port, which is enumerated by KitProg on PSoC 5LP of the BLE Pioneer kit. In such a case, the UART pins in PSoC 4 BLE/PRoC BLE
should be assigned to P1_4 and P1_5. These pins are hardwired to pins on PSoC 5LP and allows
USB-UART data communication between the PC-based software and the BLE device.
For external BLE testers, the serial communication is mostly over the RS232. To test with this
system, an external RS232 voltage translator is required, such as Digilent's Pmod RS232. This
translator will modify the signal level of the serial communication between the BLE device and the
RS232 port on the tester. The UART pins of the BLE device can be assigned to P0_0 and P0_1 and
the header J5 can be used to connect to the RS232 translator.
Figure 4-64. J5 Header to Interface RS232 Translator
4.6.2Hardware Connection
For DTM test mode, it is recommended to use SMA connectors and connect the tester and DUT
using a SMA to SMA connector cable. This ensures that there is minimum interference to RF
communication between the DUT and tester, and the performance measured is the true RF
performance of the device. The BLE Pioneer Kit module with SMA connector (CY8CKIT-141 PSo C 4
BLE) is available separately and can be ordered from the Cypress we b page.
Four UART pins are exposed wh en HCI mode is selecte d in the BLE Component. These pins shoul d
be assigned to allow communication with the external tester. The connection depends on the tester
being used.
If the tester is a PC-based software and communicated with HCI over serial link, then the onboard
PSoC 5LP on the BLE Pioneer Kit can act as the USB-UART bridge. The KitProg on the PSoC 5LP
enumerates as a USB-UART interface and opens a COM port in the PC. This COM port is then use d
by the software tool to communicate commands to the BLE device. In this case, the UART pins
should be assigned as follows.
Table 4-1. UART Pin Assignment for PC Software Tester
UART PinsPin Assigned
RXP1_4
TXP1_5
RTSP1_6
CTSP1_7
The UART for HCI communication exposes hardware flow control lines CTS and RTS. They can
either be connected to the hardware control lines of the tester or CTS connected to ground for operation without hardware flow control.
If the tester is an external hardware tester (CBT), then connect any of the RS232 voltage translators
to header J5 on the BLE Pioneer Kit. The UART pins should be assigned as follows.
Table 4-2. UART Pin Assignment for RS232 Voltage Translator
UART PinsPin Assigned
RXP0_0
TXP0_1
RTSP0_2
CTSP0_3
4.6.3V erify Output
1. Connect the BLE Pioneer Kit through the USB connector J13.
2. Program the BLE Pioneer Kit with the PSoC_4_BLE_DTM or PRoC_BLE_DTM project, depending on the module used (PSoC 4 BLE or PRoC BLE), as described in Using Examp le Project s on
page 41. Programming should complete successfully.
3. Connect the Serial link, UART or RS232 to the tester.
4. On the software tool for tester, configure the UART communication with the correct COM port and
baud rate, as set in the BLE Component.
5. Start the test. The tool will generate the report after the end of the test. This depends on the tester/tool being used.
This chapter describes the contents of the BLE Pionee r Kit hardware and it s dif ferent bl ocks, such as
the power block, USB connection, Arduino-compatible headers, module connectors, and CapSense
slider.
5.1BLE Pioneer Baseboard
5.1.1PSoC 5LP
An onboard PSoC 5LP contains KitProg which is used to program and debug the BLE device. The
PSoC 5LP connects to the USB port of the PC through a USB Mini-B connector and to the SWD
interface of the BLE device. PSoC 5LP is a true system-level solution providing MCU, memory,
analog, and digital peripheral functions in a single chip. The CY8C58LPxx family offers a modern
method of signal acquisition, signal processing, and control with high accuracy, high bandwidth, and
high flexibility. The analog capability spans the range from thermocouples (near DC voltages) to
ultrasonic signals.
For more information, visit the PSoC 5LP web page.
See Serial Interconnection between KitProg and Module on page 101 for more details.
5.1.2Power System
The power supply system on BLE Pioneer Baseboard is versatile, allowing the input supply to come
from the following sources:
■ 5-V power from onboard USB connector
■ 5-V to 12-V VIN power from Arduino power header (J1)
An adjustable LDO is used to output three diffe rent volt age levels (1.9 V, 3.3 V, and 5 V) to power the
module. These voltages are selected with the J16 jumper, as shown in Figure 5-1.
Figure 5-1. Schematics and Board Highlight of LDO and Power Selection Jumper
The input to the LDO can come from either the USB, th e VIN pin in the Arduino header J1 or header
J9.
Note: The typical dropout voltage of the selected LDO is 0.3 V at 500-mA output current. This gives
a minimum output of 4.6 V from the input voltage of 5 V from the VBUS. This drop also takes into
account the voltage drop across the Schottky diod e connected at the output of the LDO to protect
To demonstrate the low power consumption of PSoC 4 BLE/PRoC BLE Module, a two-pin header
(J15) is populated in series with the power supply to the module. This can be used to measure current using an ammeter without the need to desolder any components from the BLE Pioneer Baseboard, as shown in Figure 5-5.
Figure 5-5. Schematics and Board Highlight of Current Measurement Jumper
■ When the BLE Pioneer Baseboard is powered from an external voltage supply, remove the USB
cable from J13. Connect the positive terminal of the external voltage supply to the positive terminal of the ammeter and the negative terminal of the ammeter to the upper pin of J15. Connect the
negative terminal of the external voltage supply to and GND pin on board. Figure 5-7 shows the
required connections.
Figure 5-7. Current Measurement when Powered Separately
To measure the power consumption of only module with coin cell, connect the coin cell directly to the
modules, as shown in Figure 5-8. The BLE Pioneer Baseboard is designed with additional circuits to
protect the BLE device and the F-RAM in Arduino environment. Note that power consumption
measurements on the BLE Pioneer Baseboard will also include the power consumed by these
additional circuits.
Connect the positive terminal of the coin cell to pin J2.2 and negative terminal to pin J2.4 using
wires.
The BLE Pioneer Kit allows you to program and debug the PSoC 4 BLE/PRoC BLE in two ways:
■ Using the onboard KitProg
■ Using a CY8CKIT-002 MiniProg3 Programmer and Debugger
5.1.4Expansion Connectors
5.1.4.1Arduino Compatible Headers (J1, J2, J3, J4, and J12-unpopulated)
The BLE Pioneer Kit has five Arduino compatible headers: J1, J2, J3, J4, and J12, as shown in
Figure 5-9. You can develop applications based on the Arduino shield's hardware.
Figure 5-9. Arduino Headers
The J1 header contains I/O pins for reset, I/O reference voltage (IOREF), and power supply line. The
J2 header is an analog port that contains I/O pins for SAR ADC, comparator, and Op-amp. The J3
header is primarily a digital port that contains I/O pins for PWM, I
J4 header is also a digital port that contains I/O pins for UART and PWM. The J12 header is an
Arduino ICSP compatible header for the SPI interface and is not populated. Refer to the “No Load
Components” section of Bill of Materials (BOM) on page 133 for the header part number.
Note: Take care when powering the Arduino shields via Arduino-compatible power header (J1). The
V3.3 pin will output 5 V when the board is powered from USB/VIN and the system power supply
jumper (J16) is set to 5 V operation.
The J2 header is a 6×2 header that supports Arduino shields. The Port 2 and Port 3 pins of PSoC 4
BLE and PRoC BLE are brought to this header. The Port 2 pins also connect to the onboard
CapSense slider through 560-ohm resistors. When the CapSense feature is not used, remove these
resistors to help ensure better performance with these pins.
This port supports Digilent Pmod modules (see Figure 5-10). Pmods are small I/O interfaces that
connect with the embedded control boards through either 6- or 12-pin connectors. The BLE Pioneer
Kit supports the 6-pin Pmod type 2 (SPI) interface. For Digilent Pmod cards, go to
www.digilentinc.com.
This header is not populated on the BLE Pioneer Baseboard. You must populate this header before
connecting the Pmod daughter cards. Refer to the “No Load Components” section of Bill of Materials
(BOM) on page 133 for the header part number.
Figure 5-10. Schematics and Board Highlight of PMod Connector
An 8×2 header is provided on the BLE Pioneer Baseboard to pull out several pins of PSoC 5LP to
support advanced features such as a low-speed oscilloscope and a low-speed digital logic analyzer
(see Figure 5-11). This header also contains the USB-Serial interface pins that can be used when
these pins are not accessible on the Arduino headers because a shield is connected.
Note: You can use PSoC 5LP for your own custom firmware.
Figure 5-11. Schematics and Board Highlight of PSoC 5LP GPIO Expansion Header
The PSoC 5LP connects to the USB port of a PC through a Mini-B connector (see Figure 5-12),
which can also be used to power the BLE Pineer Baseboard. A resettable polyfuse is used to protect
the computer's USB ports from shorts and overcurrent. If more than 500 mA is drawn from the USB
port, the fuse will automatically break the connection until the short or overload is removed.
Figure 5-12. Schematics and Board Highlight of USB Mini-B Connector
The BLE Pioneer Kit has a five-segment linear capacitive touch slider, which is connected to the
PSoC 4 BLE/PRoC BLE Module pins (see Figure 5-13). The CMOD and CTANK capacitors are
required for CapSense functionality and are provided on the modules (see Module Board on
page 103). A 2.2-nF capacitor is present on the CMOD pin, P4[0], for CapSense operation. BLE
Pioneer Kit also supports CapSense designs that enable wa terproofing. T he connection of the shield
to the pin or to ground is made by resistors R12 and R13, respectively. By default, R13 is mounted
on the BLE Pioneer Baseboard, which connects the sh ield to ground. Popu late R12 and remove R1 3
when evaluating waterproofing designs, which will connect the shield to the designated pin, P1[6].
Figure 5-13. Schematics and Board Highlight of CapSense Slider and Shield Setting
5.1.6.2Proximity Header
The BLE Pioneer Baseboard contains a header (J14) for CapSense proximity wire connection (see
Figure 5-14. Schematics and Board Highlight of Proximity Header
Proximity Header
P0_2
P0_0
P0_1
P0_3
P2_0
VDD
J14
1x1 RECP
SS
1
MOSI
2
MISO
3
SCK
4
GND
5
VCC
6
0603
R19 ZERO
Status LED
P5LP3_1
0805
R11
820 ohm
0805
LED2
Status LED Green
21
VADJ
NO LOAD
R2
560 ohm
TP1 RED
0805
LED1
Power LED
21
Hardware
5.1.7BLE Pioneer Baseboard LEDs
The BLE Pioneer Baseboard has three LE Ds. A green LED (LED2) indicates the status of the programmer. An amber LED (LED1) indicates the status of power supplied to the board. The BLE Pioneer Kit also has a general-purpose tricolor LED (LED3) for user applications. These are connected
to P2_6 (Red LED), P3_6 (Green LED) and P3_7 (Blue LED). Figure 5-15 and Figure 5-16 show the
schematics of these LEDs.
The BLE Pioneer Baseboard contains an F-RAM de vice (FM24V10 -G) (see Figure 5-18) that can be
accessed through I
Mbit (128 KB) with an I
2
C lines P5[0] and P5[1] of the PSoC 4 BLE/PRoC BLE Module. The F-RAM is 1-
2
C speed up to 1 Mbps. The I2C slave address of the F-RAM device is seven
bits wide, and the LSB two bits are configu rable through physical pins an d are hardwired to 00 on the
board. By default, the address of the F-RAM device used on the BLE Pioneer Baseboard is 0x50.
This address can be modified by changing the R32/R36 and R33/R37 pairs. The operating voltage
range of the F-RAM is between 2 V and 3.6 V. To prevent the application of 5 V from the adjustable
LDO regulator on the BLE Pioneer Baseboard, a MOSFET based protection cir cuit similar to the one
used for the 3.3-V rail is connected between the output of the regulator and the VDD pin of the FRAM. The protection circuit cuts off the power to the F-RAM when the output of the regulator is
greater than 3.6 V.
Figure 5-18. Schematics and Board Highlight of F-RAM