TO THE EXTENT PERMITTED BY APPLICABLE LAW, CYPRESS MAKES NO WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS DOCUMENT OR ANY SOFTWARE
OR ACCOMPANYING HARDWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. To the extent
permitted by applicable law, Cypress reserves the right to make changes to this document without
further notice. Cypress does not assume any liability arising out of the application or use of any product or circuit described in this document. Any information provided in this document, including any
sample design information or programming code, is provided only for reference purposes. It is the
responsibility of the user of this document to properly design, program, and test the functionality and
safety of any application made of this information and any resulting product. Cypress products are
not designed, intended, or authorized for use as critical components in systems designed or
intended for the operation of weapons, weapons systems, nuclear installations, life-support devices
or systems, other medical devices or systems (including resuscitation equipment and surgical
implants), pollution control or hazardous substances management, or other uses where the failure of
the device or system could cause personal injury, death, or property damage ("Unintended Uses"). A
critical component is any component of a device or system whose failure to perform can be reasonably expected to cause the failure of the device or system, or to affect its safety or effectiveness.
Cypress is not liable, in whole or in part, and you shall and hereby do release Cypress from any
claim, damage, or other liability arising from or related to all Unintended Uses of Cypress products.
You shall indemnify and hold Cypress harmless from and against all claims, costs, damages, and
other liabilities, including claims for personal injury or death, arising from or related to any Unintended Uses of Cypress products.
Cypress, the Cypress logo, Spansion, the Spansion logo, and combinations thereof, PSoC,
CapSense, EZ-USB, F-RAM, and Traveo are trademarks or registered trademarks of Cypress in the
United States and other countries. For a more complete list of Cypress trademarks, visit
cypress.com. Other names and brands may be claimed as property
The CY8CKIT-049-4xxx contains electrostatic discharge
(ESD) sensitive devices. Electrostatic charges readily
accumulate on the human body and any equipment, and
can 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-049-4xxx boards in the protective
shipping package.
End-of-Life/Product Recycling
This kit has an end-of life five years from the date of
manufacture mentioned on the back of the box. Contact your
nearest recycler for discarding the kit.
Regulatory Compliance
The CY8CKIT-049-4xxx Prototyping 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. This may cause interference to other electrical or electronic devices in
close proximity. In a domestic environment, this product may cause radio interference. In such
cases, you may be required to take adequate preventive measures. In addition, this board should
not be used near any medical equipment or RF devices.
Attaching additional wiring to this product or modifying the product operation 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-049-4xxx Prototyping Kit, as shipped from the factory, has been verified to meet with
requirements of CE as a Class A product.
ESD can damage boards and associated components. Cypress recommends that you perform
procedures only at an ESD workstation. If such a workstation is not available, use appropriate ESD
protection by wearing an antistatic wrist strap attached to the chassis ground (any unpainted metal
surface) on your board when handling parts.
Handling Boards
CY8CKIT-049-4xxx 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 board over any surface.
Thank you for your interest in the PSoC® 4 CY8CKIT-049-4xxx family of prototyping kits. The
prototyping kit is designed as an easy-to-use and inexpensive prototyping platform for users wishing
to rapidly develop products using the PSoC 4 families and use the unique flexibility of the PSoC 4
architecture. Designed for flexibility, these kits offer an open footprint breakout board to maximize
the end utility of the PSoC 4 device. These kits provide a low-cost alternative to device samples
while providing a platform to easily develop and integrate the PSoC 4 device into your end system.
In addition, the board includes the following features:
■ Onboard CMOD capacitors to enable CapSense
■ A bypass capacitor to ensure the high quality ADC conversions
■ An LED to provide feedback
■ A push button to provide a simple user input and trigger the bootloader programming mode
■ The CY8CKIT-049-41xx PSoC 4 Prototyping kit has CY8C4125AXI-483 device on-board and
CY8CKIT-049-42xx PSoC 4 Prototyping kit has CY8C4245AXI-483 device on-board
The CY8CKIT-049-4xxx development kit also supports the Cypress USB-Serial CY7C65211
Full-Speed USB controller that enables PC connectivity and serial interfaces, such as USB-UART,
USB-I2C, USB-SPI, and USB-GPIO. The development kit includes a Cypress USB-Serial controller
used to bootload the target PSoC 4 device. The PSoC 4 prototyping board is breakable, allowing
you to separate the USB-Serial board from the PSoC 4 board.
®
development
This kit supports either 5 V or 3.3 V power supply voltages. The device can be programmed using
the bootloader or the Cypress MiniProg3 programmer. The PSoC 4 Prototyping Kit supports boards
based on the 4100 and 4200 device families, delivering a programmable platform for a wide range of
embedded applications at a very low cost. The PSoC 4 is a scalable and reconfigurable platform
architecture for a family of mixed-signal programmable embedded system controllers with an ARM
Cortex™-M0 CPU. It combines programmable and reconfigurable analog and digital blocks with
flexible automatic routing.
1.1Kit Contents
This kit contains only the PSoC 4 Prototyping Kit, either the 4100 or 4200 series device.
This user guide helps you to get acquainted with the PSoC 4 Prototyping Kit. The Software
Installation chapter on page 13 describes the installation of the PSoC Creator software. The Kit
Operation chapter on page 16 explains how to program the kit using a bootloader or a MiniProg3.
The Hardware chapter on page 26 details the hardware operation of the kit. The Code
Examples chapter on page 35 and USB-Serial Configuration chapter on page 53 walk you through
making projects and configuring the USB-Serial device on the kit. The Appendix on page 62
provides the schematics, pin assignment, and bill of materials (BOM).
1.3Additional Learning Resources
Cypress provides a wealth of data at www.cypress.com to help you to select the right PSoC device
for your design, and to help you to quickly and effectively integrate the device into your design. For a
comprehensive list of resources, see KBA86521, How to Design with PSoC 3, PSoC 4, and
PSoC 5LP. The following is an abbreviated list for PSoC 4:
■ Overview: PSoC Portfolio, PSoC Roadmap
■ Product Selectors: PSoC 1, PSoC 3, PSoC 4, or PSoC 5LP. In addition, PSoC Creator includes
a device selection tool.
■ Datasheets: Describe and provide electrical specifications for the PSoC 4000, PSoC 4100, and
PSoC 4200 device families.
■ CapSense Design Guide: Learn how to design capacitive touch-sensing applications with the
PSoC 4 family of devices.
■ Application Notes and Code Examples: Cover a broad range of topics, from basic to advanced
level. Many of the application notes include code examples. Visit the PSoC 3/4/5 Code Examples
webpage for a list of all available PSoC Creator code examples. For accessing code examples
from within PSoC Creator – see PSoC Creator Code Examples on page 10. These code
examples available across PSoC Creator, Application notes and kits for the most part will NOT be
bootloadable. However, with a very small modification you can port them to a bootloadable
project and use them with the CY8CKIT-049. Refer to Converting a Non-bootloadable Project to
a Bootloadable Project on page 40 for details.
■ Technical Reference Manuals (TRM): Provide detailed descriptions of the architecture and
registers in each PSoC 4 device family.
■ Development Kits:
❐ CY8CKIT-042 and CY8CKIT-040, PSoC 4 Pioneer Kits, are easy-to-use and inexpensive
development platforms. These kits include connectors for Arduino™ compatible shields and
®
Digilent
❐ CY8CKIT-049 is a very low-cost prototyping platform for sampling PSoC 4 devices.
❐ CY8CKIT-001 is a common development platform for all PSoC family devices.
■ The MiniProg3 device provides an interface for flash programming and debug.
■ Knowledge Base Articles (KBA): Provide design and application tips from experts on the
devices/kits. For instance, KBA93541, explains how to use CY8CKIT-049 to program another
PSoC 4.
PSoC Creator includes a large number of code example projects. These projects are available from
the PSoC Creator Start Page, as Figure 1-3 shows.
Example projects can speed up your design process by starting you off with a complete design,
instead of a blank page. The example projects also show how PSoC Creator Components can be
used for various applications. Code examples and datasheets are included, as Figure 1-4 on
page 11 shows.
In the Find Example Project dialog shown in Figure 1-4 on page 11, you have several options:
■ Filter for examples based on architecture or device family, i.e., PSoC 3, PSoC 4 or PSoC 5LP;
category; or keyword
■ Select from the menu of examples offered based on the Filter Options
■ Review the datasheet for the selection (on the Documentation tab)
■ Review the code example for the selection. You can copy and paste code from this window to
your project, which can help speed up code development, or
■ Create a new project (and a new workspace if needed) based on the selection. This can speed
up your design process by starting you off with a complete, basic design. You can then adapt that
design to your application.
If you have any questions, our technical support team is happy to assist you. You can create a support request on the Cypress Technical Support page.
If you are in the United States, you can talk to our technical support team by calling our toll-free number: +1-800-541-4736. Select option 2 at the prompt.
You can also use the following support resources if you need quick assistance.
■ Self-help.
■ Local Sales Office Locations.
1.4Document Conventions
Table 1-1. Document Conventions for Guides
ConventionUsage
Courier NewDisplays file locations, user entered text, and source code:
C:\...cd\icc\
ItalicsDisplays file names and reference documentation:
Read about the sourcefile.hex file in the PSoC Creator User Guide.
[Bracketed, Bold]Displays keyboard commands in procedures:
[Enter] or [Ctrl] [C]
File > OpenRepresents menu paths:
File > Open > New Project
BoldDisplays commands, menu paths, and icon names in procedures:
Click the File icon and then click Open.
Times New RomanDisplays an equation:
2 + 2 = 4
Text in gray boxesDescribes Cautions or unique functionality of the product.
All Cypress software installations require administrator privileges, but these are not required to run
the software after it is installed. Close any other Cypress software that is currently running before
installing the kit software.
Note: The kit contents are installed in the C:\Program Files\Cypress folder by default. If the
Code examples are being run from the default install location, administrator privileges are required. If
you do not have administrator privileges, copy the Firmware folder from the default install location to
any other location on your PC and access the files
2.2CY8CKIT-049-41xx/CY8CKIT-049-42xx Software
The kit requires Cypress' proprietary software, such as PSoC Creator, PSoC Programmer and the
USB-Serial Configuration Utility, and generic software such as .NET Framework, Windows Installer,
and Internet Explorer. The kit software is available on the kit web page in three formats:
Table 2-1. Kit Software Formats
Install PackageFile FormatUsage
This package can be used if the PC does not have any
CY8CKIT-049-41xx_Kit ISO/
CY8CKIT-049-42xx_Kit ISO
CY8CKIT-049-41xx_Kit Only/
CY8CKIT-049-42xx_Kit Only
ISO
EXE
EXE
Cypress or non-Cypress prerequisite software installed. It first
installs the prerequisites and then the kit content (firmware,
hardware, and documentation files) in the specified location.
This package can be used if the PC does not have any
Cypress prerequisite software installed. If any non-Cypress
prerequisites are found to be missing during installation, the
installer provides links to download and install them and then
installs the kit content (firmware, hardware, and
documentation files) in the specified location.
This package can be used if the PC has all the Cypress and
non-Cypress prerequisites installed. It installs only the kit
content (firmware, hardware, and documentation files) in the
specified location. If any of the prerequisites are found
missing during the installation process, the installer prompts
you to install all the required software before attempting to
install the kit. The installer redirects to the kit web page to
download and install any missing Cypress software. Similarly,
it provides links to download and install the missing non-
Cypress prerequisites.
Note: The USB-Serial Configuration Utility requires Visual C++. If Visual C++ is not installed in the
PC, the installer provides link to install the Visual C++ Redistributable package in the PC.
Note: Adobe Reader is required to view kit documents. If Adobe Reader is not installed on your PC,
the installer provides the link to download and install it.
Note: PSoC Creator is provided with a free Keil C licence that has to be registered within 30 days of
installing PSoC Creator. To register your Keil license, you will require an internet connection. Please
read http://www.cypress.com/?id=4&rID=38519 for more details. Please read
http://www.cypress.com/?id=4&rID=44355 if PSoC Creator needs to be used on a PC that does not
have internet connection. The product ID for the Keil compiler is IKA1P-M6Q0E-8W7ST.
2.3Install Software
1. Run cyautorun.exe in the kit ISO to start the installation process.
3. Select the folder to install the kit files. Choose the directory and click Next. The installation
directory is referred to as <Install_Directory> in this document.
4. When you click Next, the kit installer automatically installs the required software, if it is not
present on your computer.
5. Select the installation type in the Product Installation Overview window. The drop-down menu
contains three options: Typi cal (installs all the required features), Custom (lets you choose the
features to be installed), and Complete (installs all the contents). Click Next after you select the
installation type.
Note: It is recommended that you choose the Complete installation type.
6. Read and Accept the End-User License Agreement and click Next to proceed with the
installation.
7. When the installation begins, a list of packages appears on the installation page. A green check
mark appears adjacent to every package after successful installation.
8. After installing all the packages, the CyInstaller finish page opens up. Please provide the
requested contact information or uncheck the “Continue Without Contact Information” checkbox
and click on Finish button to complete the kit installation.
Software Installation
After the installation is complete, the kit contents are available at the following location:
1. For CY8CKIT-049-41xx: <Install_Directory>\ CY8CKIT-049-41xx \<version>
2. For CY8CKIT-049-42xx: <Install_Directory>\ CY8CKIT-049-42xx \<version>
2.4Install Hardware
There is no additional hardware installation required for this kit.
2.5Uninstall Software
To uninstall the software, do one of the following:
■ Go to Start > All Programs > Cypress > Cypress Update Manager > Cypress Update
Manager, and then select the Uninstall button corresponding to the kit software.
■ Go to Start > Control Panel > Programs and Features, and then select the Uninstall/Change
2.6Open the “PSoC 4 Code” Code Example in PSoC Creator
Note: The code examples require administrator privileges if they are run directly from the default
install location (C:\Program Files\Cypress). If you do not have administrator privileges, copy the
Firmware folder from the default install location to any other location on your PC and use the files.
1. Launch the PSoC Creator software from the Start menu.
Figure 2-1. PSoC Creator Start Page
2. Open the SCB_Bootloader.cywrk workspace by choosing File > Open > Project/Workspace
and navigating to the directory in which your project is present.
Figure 2-2. Open Project/Workspace
The workspace includes two sample projects linked in the Workspace Explorer. Subsequent
chapters of this user guide show how to build, program, and understand the code examples supplied
with this kit.
The PSoC 4 Prototyping Kit is simplistic in design and focuses on providing you with complete
access to develop applications using the PSoC 4 device family. The development kit supports a
number of onboard functions such as an LED, push button, through-hole connections, USB-Serial
connectivity to the PC, and a breakable board design to separate the two target boards.
Figure 3-1. PSoC 4 Prototyping Kit
3.1Connecting the PSoC 4 Prototyping Kit to a Computer
To use the PSoC 4 Prototyping Kit, you need to connect the kit to a target PC. The kit is designed to
be connected to the computer through USB. The USB connector will provide power to the target
boards and enable serial communication. CY8CKIT-049-4xxx implements a PCB-based USB
connector that makes connections to the USB port when plugged in. The amber LED turns on when
the board is plugged into the port to indicate power.
Figure 3-2. Connecting the PSoC 4 Prototyping Kit to a Computer
Figure 3-3. PSoC 4 Prototyping Kit Connected to the Computer
3.2CY8CKIT-049-4xxx USB COM Port
Kit Operation
When you connect the CY8CKIT-049-4xxx to the PC over a USB interface, it enumerates as a COM
port device under the Device Manager window on the Windows OS. Often, the COM port number will
be higher than any existing COM port value. For example, in the following image the
CY8CKIT-049-4xxx enumerates as COM37.
Figure 3-4. CY8CKIT-049-4xxx USB COM Port in Device Manager
When connecting your CY8CKIT-049-4xxx to a computer for the first time or to any new USB port, it
may take a moment to enumerate because the computer will complete an online check for the latest
drivers.
Figure 3-5. Automatic Driver Software Installation for CY8CKIT-049-4xxx
Note: The baud rate settings do not apply to the virtual COM port as the data transmission is taking
place using the Full-Speed USB bus at 12 Mbps. However, because of the virtual COM port driver
that sits between the PC and the USB-Serial device, the operating system will see the device as a
normal serial port and you will be able to set the baud rate. However, these settings may be ignored.
3.3Programming a CY8CKIT-049-4xxx Project Using the Bootloader
The following example shows how to bootload (program) a project into the PSoC 4 with the
USB-Serial device, using the Bootloader Host. To use this method, the PSoC 4 device must contain
the bootloader and the project must be configured as bootloadable. This is the default programming
method for new users.
The following steps use the code example included in the kit installer.
2. Open the SCB_Bootloader.cywrk workspace from Examples and Kits > Kits. Select
CY8CKIT-049-41xx folder for CY8CKIT-049-41xx PSoC 4 Prototyping Kit and
CY8CKIT-049-42xx folder for CY8CKIT-049-42xx PSoC 4 Prototyping Kit.
3. Select the folder where you want to save the project and click OK.
Note: The UART_Bootloader project is a dependency for the Bootloadable Blinking LED project.
Hence, both example projects must be built by selecting Build > Build All Projects.
5. In the Workspace Explorer, right-click the Bootloadable Blinking LED project and select Set As Active Project.
Figure 3-8. Set the Code Example as Active Project
The bootloadable project must be associated with the bootloader project's HEX and ELF files.
This will ensure that the firmware code mapping aligns with the code on the target device.
6. Under the 'Bootloadable Blinking LED' code example, double-click the 'TopDesign.cysch' file to
open the schematic view. Select the tab for the Bootloadable Project schematic page if it is not
already selected.
8. In the configuration window, select the Dependencies tab and click the Browse button to point to
the HEX and ELF files present in the ‘Dependencies’ folder under project directory; click OK. The
file paths (assuming the CY8CKIT-040-42xx) will appear as follows:
10.Connect the CY8CKIT-049-4xxx prototyping board to the PC. When connecting the kit to the port,
depress the SW1 button as it is plugged in.
You will notice that the blue LED begins to blink rapidly; this indicates that the PSoC 4 is in 'Bootloader Mode' and is ready to be loaded with the latest firmware. This must be done each time you
bootload the PSoC 4.
11. Sele ct Tools > Bootloader Host to open the Bootloader Host tool.
12.Click Filters and select the Show UART Devices option from the Port Filters window and click
OK. This lists all COM devices connected to the computer.
Note: The PID of the Bootloader is F13B. You may enter this PID in the Port filters window to list
only the Kit Bootloader.
Figure 3-15. Port Filters
The Bootloader Host tool will now display all of the available UART based COM ports.
13.Click the COM port from the list of available ports and enter the UART configuration such as
Baud Rate, Data Bits, Stop Bits, and Parity for the USB-UART configuration on the USB-Serial
device.
The values for the UART are: 115200 baud rate, 8 data bits, 1 stop bit, and no parity.
14.Click File > Open and navigate to the Bootloadable_Blinking_LED.cyacd file generated in the
CortexM0 folder in your project directory, and click Open.
Figure 3-16. Opening the Generated File
15.Click the Program button to flash the part with your new application code.
The status window provides output message and a status bar indicates the programming progress. When bootloading is complete, your application executes with the latest version of the
application code.
Figure 3-17. Program the Device With Application Code
See application note AN73854 for additional details on bootloading.
The default configuration of the USB-Serial device on the CY8CKIT-049-4xxx prototyping kit is the
USB-UART mode. The CY8CKIT-049-4xxx also enables a default UART connection between the
USB-Serial device and the PSoC 4. This connection is indicated by two parallel 4-pin headers in the
middle of the board. The default pin connections are shown in Ta bl e 3 -2 .
Table 3-1. Pin Mapping for USB-Serial Port and PSoC 4 UART
USB-Serial UARTPSoC 4 UART
TXP4.0 (RX)
RXP4.1 (TX)
GNDGND
VDDVDD
Figure 3-18. UART Pin Connections on CY8CKIT-049-4xxx
Kit Operation
The USB-Serial device provides the PSoC 4 device with an interface to a PC. The USB-Serial
device enumerates as a COM port to allow any terminal software to be used to communicate with
the PSoC 4. To use the USB-UART functionality in the COM terminal software, select the
corresponding COM port. Note that if the USB-Serial device board is separated from the PSoC 4
board, you will still be able to use the USB-Serial device to communicate with any UART device
using the 4-pin header.
The USB-Serial device is by default configured as a USB-UART device with the following
specifications. The USB-UART settings can also be configured from the Cypress USB-Serial
Configuration Utility. The default setting are as shown in bold in the table below.
Table 3-2. USB-UART settings as seen in Cypress USB-Serial Configuration Utility
PSoC 4 is a new generation of programmable system-on-chip device from Cypress for embedded
applications. It combines programmable analog, programmable digital logic, programmable I/O, and
a high-performance ARM Cortex-M0 core. With PSoC 4, you can create the combination of peripherals required to meet your application's specifications.
The PSoC 4 Prototyping Kit features an onboard USB-Serial device, which communicates to a PC
through USB to provide serial communication support and serial port debugging.
The PSoC 4 Prototyping Kit has a user LED and a power status LED. This kit includes a button that
connects to the PSoC 4 device, which can be used to develop applications. This button is also used
to enable the onboard bootloader. The PSoC 4 pins are brought out onto headers J1 to J2 on the kit
and support 100-mil breadboard spacing.
The PSoC 4 Prototyping Kit can be powered from USB or an external power supply. The input voltage is either 5 V from USB or a variable supply from an external source.
The power supply system on this board is dependent on the source of the power. For most applications, you can use the 5 V supply from the USB connection to power the system. You can also connect an external power supply to the board for low-voltage applications. The kit supports the
following connections:
■ 5 V from the PCB USB
■ 1.8-5 V from a regulated supply connected to VDD
It is important to understand that this prototyping kit does not have any onboard ESD protection circuitry. Therefore, the power source for the CY8CKIT-049-4xxx must be of a high quality to ensure
that the board is protected from any over-current conditions and swapped-power connections.
You can measure the current consumption of the PSoC 4 device by using one of these methods:
Method 1:
1. Separate the USB-Serial board by 'snapping' the perforated edge between the two boards.
2. Power the remaining prototyping board via any of the VDD terminals.
3. Place an ammeter in series with the VDD connection to measure the current consumption.
Method 2:
1. Remove the resistor R6 and install a 2-pin jumper in the supplied holes of J4.
2. Connect an ammeter across the 2-pin jumper to measure the current to the PSoC 4 device.
This method can be used either with USB power or with power supplied to one of the VDD pins.
4.3.2Board Separation (Snapping)
CY8CKIT-049-4xxx supports both the PSoC 4 and USB-Serial boards. To separate the two boards
for testing or development, break the two boards apart at the built-in perforated edge.
The easiest method of separating the two boards is to place the kit on the edge of a table, where the
edge of the table is directly below the perforated edge and the smaller USB-Serial device is off the
table edge. Press gently on the USB-Serial board and snap the two boards apart. If any material is
removed from the edge of the boards, use sheers to clean up the edge of the kit.
Hardware
Figure 4-3. CY8CKIT-049-4xxx Broken as Two Parts
4.3.3Header Connections
The CY8CKIT-049-4xxx Prototyping Kit supports a number of unpopulated headers on both the
USB-Serial and the PSoC 4 boards.
4.3.3.1Functionality of the J1 and J2 Headers (PSoC 4)
The main PSoC 4 board contains two dual-inline headers (J1 and J2). These headers are both
1×22-pin headers and include all of the I/O available on the PSoC 4 devices. These headers support
all of the available ports, GND, VDD, and connections to passive elements and user-input devices.
The J1 and J2 headers support 100-mil spacing, so you can solder the male connectors to connect
the CY8CKIT-049-4xxx to any development breadboard.
4.3.3.2Functionality of J3 and J5 Headers (PSoC 4 to USB-Serial)
Both the USB-Serial and the PSoC 4 prototyping boards each contain a 1×4-pin header. This header
provides a physical connection between the two devices. Specifically, the connection includes the
UART (RX and TX), VDD, and GND connections between the two devices. When the boards are
separated, this physical connection is broken.
4.3.3.3Functionality of J6 and J7 Headers (USB-Serial)
The USB-Serial board contains two dual-inline headers (J6 and J7). These headers are both 1x7-pin
headers and include all of the GPIO and SCB connections. These headers support all of the available ports, GND, VDD, and connections to passive elements and user-input devices.
The J6 and J7 headers support 100-mil spacing, so you can solder the male connectors to connect
the USB-Serial board to any development breadboard.
The main PSoC 4 board contains a single push button connected to the P0.7 pin on the PSoC 4
device. This button can be used for general user inputs and for triggering the bootloader for programming.
CY8CKIT-049-4xxx contains two LEDs: the amber LED, which indicates the board is power applied
and the blue LED that is directly connected to the PSoC 4 device through the pin P1.6. The blue LED
is also used to indicate the bootloader mode by rapidly blinking. The power LED is on the USB-Serial
board; if the boards are separated, the PSoC 4 section does not consume current through the power
LED.
The three capacitors on the CY8CKIT-049-4xxx prototyping kit enable proper development of ADC
and CapSense code examples. These capacitors are the following:
■ A SAR ADC bypass capacitor: Required for proper sampling at high frequencies,
■ Two CapSense capacitors (CMOD and CTANK): Required for proper CapSense functionality.
This section describes how to use the code example included with the kit and how to develop
custom bootloadable code examples for new applications.
For a list of all code examples available with PSoC Creator, visit the PSoC 3/4/5 Code Examples
page. This page lists all the PSoC Creator based code examples available across PSoC Creator,
Application notes and kits. Most of these examples CANNOT be directly used with the kit. Refer to
Converting a Non-bootloadable Project to a Bootloadable Project on page 40 for details on how to
port these projects to use with CY8CKIT-049.
For PSoC Creator related training and video tutorials, visit PSoC Creator training page.
5.1Bootloader Base Code Example
The CY8CKIT-049-4xxx prototyping board is pre-programmed with a simple blinking LED code
example. This code example uses a PWM to slowly blink an LED. Included in the application project
is the Bootloader Base project. The Bootloader code is detailed in the UART_Bootloader project
available on the kit web page.
In the bootloader example, the device rapidly blinks an LED when the bootloader is active, provides
UART communication support for bootloading, and reads the state of the switch (SW1). You can
observe the state of the board by noticing the rate at which the LED blinks. The bootloader is activated when you plug in the CY8CKIT-049-4xxx while pressing the SW1 button. The bootloader
reads the state of this button during power-up. If the button is not pressed, the bootloader jumps to
the user's application code. If the button is pressed, then the bootloader waits for a new application
to be transferred. While the bootloader waits for the new application, it rapidly blinks the onboard
blue LED.
Note that the bootloader project is fully customizable, so you can use different methods for entering
the bootloader mode, and different feedback mechanisms. For example, you can change the project
so that it waits at power-up for a specified amount of time for a new application to be loaded rather
than through the use of a button press. All resources of the PSoC are available for use by the
bootloader project.
For details on UART bootloader in PSoC 4, please refer AN68272 - PSoC
5LP UART Bootloader. The landing page of the application note also includes a video providing an
The Bootloader Base Project includes the source code in the main.c and the UART_Btld.c files,
which support bootloading the PSoC 4 device. The source code is available for reference, but is not
necessary to create bootloadable applications.
5.2Bootloadable Code Example
The example in Programming a CY8CKIT-049-4xxx Project Using the Bootloader on page 18
showed how to bootload the application code for a blinking LED project into the device using the
USB-Serial controller.
In the bootloadable code example, the following components are used:
■ Bootloadable
■ PWM
■ Clock
■ Digital Output Pin
■ Digital Constants (logic HIGH/LOW)
■ Off-Chip Components (external resistor, LED, and Vss)
In this code example, the PWM component is used to drive an output on a pin connected to the user
LED. The bootloadable component is placed to ensure that your application code is correctly
mapped to the target PSoC 4 bootloader flash-space mapping.
7. Navigate to the schematic view to place your components (double-click on the .cysch file from the
project in Workspace Explorer).
Select the Page 1 tab in the schematic if it is not already selected. The key component that must
be added is the Bootloadable component, which is used to generate the bootloadable application
code.
Figure 5-4. Bootloadable Project Schematic
8. Double-click the Bootloadable component to configure the selections.
The selections must be the same as those in the code example. Refer to Programming a
CY8CKIT-049-4xxx Project Using the Bootloader on page 18.
9. Click the Dependencies tab to select the HEX and ELF files from the UART Bootloader project
included with the kit.
You must always point your bootloadable project to a base bootloader project. The bootloader
project can be in the same workspace as your bootloadable project, but this is not necessary.
This code example uses the default application shipped with CY8CKIT-049-4xxx.
10.Click Apply and then click OK.
Figure 5-6. Specifying the References
11. After the project builds without errors, follow the steps shown in Programming a CY8CKIT-049-
4xxx Project Using the Bootloader on page 18 to bootload the new code into the target using the
Bootloader Host application.
This example does not have any source code, but is a base code example. Follow the steps in the
next examples to add functionality to this base project.
5.4Converting a Non-bootloadable Project to a Bootloadable Project
As part of PSoC Creator application notes and kits available at www.cypress.com, Cypress provides
many code examples that you can work with. Most of these code examples do not include a bootloader in the project and are not directly usable with the CY8CKIT-049 kit. However, with a very
small modification to the project, they can be easily made to work with the CY8CKIT-049 kit. The following section describes how to port a code example that is not bootloadable into a bootloadable
example. We will take a simple PSoC Creator code example, PWMExample, for this purpose. You
can follow the same steps to port any non-bootloadable project to a bootloadable project.
This example explains how to get the PWMExample project from the PSoC Creator code examples
list into your workspace and target the CY8CKIT-049-4xxx development kits.
1. In PSoC Creator, click Find Example Project… under Start Page > Examples and Kits.
Figure 5-7. Opening “Find Example Project” Window
Code Examples
2. Set the Device Family option to the kit family; select PSoC 4200 for the CY8CKIT-049-42xx kit
and PSoC 4100 for the CY8CKIT-049-41xx kit. The PSoC 4200 device family and
CY8CKIT-049-42xx are used in this example.
3. You should now see all the examples supported by PSoC Creator for the selected family. In the
Project Name field, enter ‘PWMExample’. Select the PWMExample project from the list displayed and click Create New Workspace.
Figure 5-9. PWMExample Project Lookup
4. In the dialog box that appears, navigate to the folder location where you want to create the project.
5. After the workspace is created, PSoC Creator opens the help document detailing the project features and content. You can close this document and open it from the Workspace Explorer when
required.
6. When the project opens in PSoC Creator, navigate to the Workspace Explorer window, right-click
on the project, and select Build Settings.
Figure 5-10. Accessing Build Settings
7. Because this project was originally set as a NormalApplication Type, we need to change it to Bootloadable. In the Application Type drop-down menu, select Bootloadable. Click Apply and
then OK.
10.Double-click on the placed bootloadable component to configure the selections.
Figure 5-14. General Tab Parameters
11. Click the Dependencies tab to select the .hex and .elf files from the UART Bootloader project
included with the kit (<Install_Directory>\CY8CKIT-049-42xx\<version>\Firmware\SCB_Bootloader\ UART_Bootloader.cydsn\CortexM0\ARM_GCC_484\Debug\). This is
done to point the bootloadable project to the bootloader running in the kit. Click Apply and then
OK.
12.Because the project is not designed for the CY8CKIT-049 kit, you need to change the PWM output pin to the LED pin in CY8CKIT-049 (P1[6]). To do this, open PWMExample.cydwr from the
Workspace Explorer.
Figure 5-16. Opening “.cydwr” File
13.Select the LED_GREEN pin to P1[6] in the CY8CKIT-049 kit.
Figure 5-17. 'cydwr' Pin Settings
14.Select Build > Build PWMExample.
Figure 5-18. Building the Project
15.Connect the CY8CKIT-049-4xxx kit to the PC while pressing the SW1 button; this will put the
device into Bootloader mode. Entry into Bootloader mode is shown by the blinking LED.
16.Open the Bootloader Host utility by selecting Tools > Bootloader Host from the PSoC Creator
menu. Connect to the COM port and make your port configurations.
Figure 5-19. Bootloader Host Tool
17.Click Filters…; configure it as shown in Figure 14 and then click OK.
20.Click the Program button. When the firmware is programmed, observe that the LED moves from
low intensity to higher intensity in steps of 100. You can change the BRIGHTNESS_DECREASE
macro to modify the step size.
Figure 5-23. Program Button in Bootloader Host
5.4.2Entering Bootloader Mode from the Bootloadable Application
To program the PSoC 4 device on the CY8CKIT-049 kit, you need to enter the bootloader mode
through which you can load the desired application via the Bootloader Host utility and the USB-Serial
bridge. The default bootloader in the onboard PSoC 4 enters the bootloader mode when the SW1
button is pressed during board/device power up. This method of entering the bootloader can be time
consuming and you may not prefer removing the board from the PC each time you want to program
it. You can also enter the bootloader mode using the Bootloadable component present in the application project. When you want to enter bootloader mode, say when a button is pressed for a predefined duration or a command is sent via UART, all you need to do is detect the condition to enter
bootloader mode from the bootloadable application and call the “Bootloadable_Load()” API when the
condition is met. Let us use the example in PWMExample on page 41 and modify the project to enter
bootloader mode from the bootloadable application when SW1 is pressed for more than 2 seconds.
Code Examples
Follow these steps to modify the project in PWMExample on page 41 to enter bootloader mode from
the application.
1. Open TopDesign.cysch of the project; drag and drop a Digital Input Pin component into the
schematic view.
Figure 5-24. Digital Input Pin Component in Component Catalog
5. Add the following code inside the infinite “for” loop. Note that you need to define a variable ‘uint8
swCounter’ in the beginning of the main loop.
for(;;)
{
/* Reset the software counter if SW1 is not pressed (Pulled high)
*/
if(SW1_Read())
{
swCounter = 0;
}
else
{
/* Increment the counter if SW1 is pressed (Shorted to GND) */
swCounter++;
}
/* Provide a 10 ms delay to make the counter approximately periodic every
10 ms */
CyDelay(10);
/* Check if the software counter has passed 2 s (200 * 10 ms)
==> Since the software counter is incremented only when SW1 is
==> pressed, SW1 is pressed for more than 2 seconds
==> Enter bootloader mode */
if(swCounter > 200)
{
Bootloadable_Load();
}
}
6. Build the project using Build > Build PWMExample01.
7. Program the PSoC 4 device as described from Step 15 in PWMExample on page 41.
8. When the new application is loaded, the output of the project will remain the same as in PWMEx-
ample on page 41. If you press and hold SW1 for 2 seconds without unplugging the device from
the PC, the device will enter bootloader mode (the LED will blink). To exit the bootloader mode,
unplug and re-plug the board from the USB port.
The CY8CKIT-049-4xxx Prototyping Kits support the CY7C6521x family of USB controller products.
The CY7C6521x devices are a family of full-speed USB-Serial bridge controllers. These bridge controllers offer configurable serial channels for UART, I2C, SPI, or GPIO interfaces, with the industry's
lowest power consumption in the stand-by mode (5 µA).
USB-Serial bridge controllers integrate the CapSense capacitive-touch sensing technology and
USB-IF Battery Charging specification version 1.2. These controllers are ideal for applications such
as portable medical devices (such as blood-glucose meters), point-of-sales terminals, serial cables
(including USB-to-UART and RS-232 cables) and other applications requiring USB connectivity.
CY8CKIT-049-4xxx development kits use the USB-Serial device to provide connectivity to a PC and
to perform USB-UART bootload programming. The following sections provide instructions on how to
use and configure the USB-Serial device on the CY8CKIT-049-4xxx kits.
6.1USB-Serial Resources
Use the following links to access a wide variety of content that includes custom software, utilities,
datasheets, and knowledge base articles.
Cypress USB-Serial Configuration Utility is an application included in the USB-Serial software development kit (SDK) installation. This utility is used to configure the USB-Serial device configuration,
and helps use additional capabilities of USB-Serial device such as USB-UART configurations, USBGPIO controls, and custom development using the USB-I2C and USB-SPI protocols.
After you install the USB-Serial SDK, click Start > All Programs > Cypress > CypressUSBSerial > Cypress USB-Serial Configuration Utility to launch the USB-Serial Configuration
Utility.
Note: For Windows 8 or higher OS, launch Cypress USB-Serial Configuration Utility by doubleclicking on <Install_Directory>\USB-Serial SDK\<version>\bin\USB Serial Configuration Utility.exe.
1. Connect the CY8CKIT-049-4xxx prototyping kit to the PC.
2. Open the USB-Serial Configuration Utility.
3. Select the Select Target tab.
Figure 6-2. Selecting the Target in USB-Serial Configuration Utility
USB-Serial Configuration
The USB-Serial Configuration Utility will automatically detect that the USB-Serial Device has
been connected to the PC and will display the device in the Select Device drop-down menu.
After connecting to the device, a new tab opens that displays the device marketing part number.
Figure 6-3. Selecting the Connected Device
5. Select the new tab and begin configuring the device.
6.2.2Configuring a Serial Port
The USB-Serial device acts as a USB-UART bridge for the CY8CKIT-049-4xxx development kit. You
can use the Configuration Utility to read the default settings and configure new UART settings.
1. After connecting to the USB-Serial device, click the CY7C65211-24LTXI tab.
2. Select the SCB tab under the CY7C65211-24LTXI tab to see the default UART settings on the
USB-Serial device.
7. Connect to the device and navigate to the UART configuration window to see that the new configuration has been set. In this example, the Baud Rate is changed from 115200 to 9600.
Figure 6-10. Device UART Parameters Changed
6.2.3Configuring GPIOs
USB-Serial Configuration
The USB-Serial device included in the CY8CKIT-049-4xxx Prototyping Kit also supports GPIO controls through the J6 header. Each of the serial protocols requires a different number of GPIO pins.
Based on your serial configuration, the number of available GPIOs will change. The Configuration
Utility will only display the available GPIOs based on your serial configuration. For more information
on the serial configuration and the respective GPIO consumption, refer to the USB-Serial device
datasheet.
1. Plug CY8CKIT-049-4xxx into a USB port on the PC, and connect to the USB-Serial device using
the Configuration Utility.
3. Click Configure on the Unused GPIOs drive mode. This launches the GPIO configuration window.
This example shows how to change the output mode of the GPIO 08 pin to drive an output. You
can connect the pin to the PSoC 4, an LED, or any external circuitry.
4. Click the Select Drive Mode drop-down menu for the GPIO 08 pin.
Figure 6-12. Configuring GPIO Drive Mode
5. Select Drive 1 from the available options and click OK. This example makes the pin HIGH.
6. Program the new configuration into the device and cycle the port to see the new configuration
applied. For example, if the GPIO 08 pin is connected to an LED, you will see that the LED is on.
Apart from the UART and the GPIO features described in earlier sections, the USB-Serial device
included in the CY8CKIT-049-4xxx provides several other features, such as the following:
■ USB-I2C (Master/Slave)
■ USB-SPI (Master/Slave)
■ Cypress CapSense (up to eight buttons)
■ Battery Charging Detect (BCD)
For more information on these features, refer to the device datasheet and the USB-Serial Configuration Utility user guide. (Select Help > Help Topics).
Note: USB-UART works in the USB Communication Device Class (CDC), while all other configuration controls such as GPIO, SPI, and I2C use the Cypress vendor driver on the PC. Therefore, COM
port tools such as PuTTY or HyperTerminal will only work for the UART bridge. You can use the C++
APIs to create scripts and tools included with the USB-Serial SDK to evaluate and control the other
bridge options.
A.2Programming a CY8CKIT-049-4xxx Project Using MiniProg3
To use MiniProg3 for programming, connect wires or a 5-pin 100-mil spaced header to the
programming header on the CY8CKIT-049-4xxx board. The programming header is a 5-pin header
indicated on the silkscreen and is labeled ‘PROG’. The suggested part numbers are
Molex 22-05-3051 (right angled male header) and Molex 22-23-2051 (straight header). The
suggested part numbers for 5 pin headers are 5-pin Molex-KK right-angle male header
(Part number# 22-05-3051) or 5-pin Molex-KK vertical male header (Part number# 22-23-3051).
Please see images below for orientation of the header. The CY8CKIT-049 supports both power cycle
and reset programming modes.
Figure A-3. Connecting CY8CKIT-049-4xxx to MiniProg3 using right angled header
Figure A-6. CY8CKIT-049-4xxx Connections for MiniProg3
The code examples described in this section show how to bootload new projects into PSoC 4 and
create bootloader and bootloadable projects. To access the kit examples, download the examples
from the kit web page.
The initial example shows how to program the kit with just a bootloader using MiniProg3. Note that
the kit is pre-programmed with a project containing a bootloader, so this step is not necessary to
change the application firmware.
2. Open the SCB_Bootloader.cywrk workspace by choosing File > Open > Project/Workspace
and navigating to the directory in which your project is present.
Figure A-8. Opening the Project in PSoC Creator
The workspace includes two sample projects linked in the Workspace Explorer - a bootloader
project and a bootloadable project.
3. Right-click the UART_Bootloader project and select Set As Active Project.
Figure A-9. Setting Code Example as Active Project in Workspace Explorer
4. Select Build > Build UART_Bootloader.
Figure A-10. Building the Project
5. Connect MiniProg3 to the CY8CKIT-049-4xxx prototyping board.