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 th is 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 harml ess 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 thereo f, WICED, PSo C, CapSense, EZ-USB, FRAM, 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 of their
respective owners.
The PSoC 4000S Prototyping Kit 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
PSoC 4000S Prototyping kits in the protective shipping package.
End-of-Life/Product Recycling
This kit has an end-of life five years from the date of manufacture which is
encoded in bar code placed on the pack. Contact your nearest recycler for
discarding the kit.
Regulatory Compliance
The CY8CKIT-145-40XX PSoC® 4000S 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 measur es. 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 PSoC 4000S Prototyping Kit, as shipped from the factory, has been ve rified to meet with the
requirements of CE as a Class A product.
General Safety Instructions
ESD Protection
ESD can damage boards and associated components. Cypress recommends that you perform
procedures only at an ESD workstation. If an ESD workstation is not available, use appropriate ESD
protection by wearing an antistatic wrist strap attached to a grounded metal object.
Handling Boards
PSoC 4000S Prototyping Kit is 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 surf ac e.
Thank you for your interest in the CY8CKIT-145-40XX PSoC® 4000S Prototyping Kit. The
PSoC 4000S Prototyping Kit enables customers to evaluate and develop projects using the
PSoC 4000S device family.
PSoC 4000S device family is an expansion to the PSoC 4000 device family that offers more flash,
GPIOs, and programmable analog and digital blocks. PSoC 4000S device is a programmable
embedded system-on chip, integrating custom analog and digital peripheral functions, memory, and
an ARM
peripheral functions allow higher flexibility, in-field tuning of the design, and faster time-to-market.
The PSoC 4000S Prototyping Kit offers an open footprint breakout board to maximize the end utility
of the PSoC 4000S device. This kit provides a low-cost alternative to device samples while providing
a platform to easily develop and integrate the PSoC 4000S device into your end-system.
The board includes the following features:
■ 3 CapSense buttons
■ 5-Segment CapSense slider
■ LEDs to provide feedback
■ Onboard C
■ Bypass capacitor to ensure high-quality analog-to-digital conversions (No Load by default)
■ A push button to provide a simple user input
■ Load capacitors to connect the 32-kHz external crystal oscillator
■ Cypress EZ-BLE
■ 5-V operation
®
Cortex®-M0+ microcontroller on a single chip. The programmable analog and digital
, C
MOD
TANK
®
PRoC™ Module
, C
intA
and C
capacitors to enable CapSense development
intB
The PSoC 4000S Prototyping Kit also integrates Cypress KitProg2, which enables onboard
programming, debugging, and bridging functionality such as USB-UART and USB-I2C. KitProg2 is
used to program and debug the target PSoC 4000S/EZ-BLE PRoC device. The PSoC 4000S
Prototyping kit is designed to snap away the KitProg2 board from the PSoC 4000S target board.
You will use PSoC Creator™ to develop and debug your PSoC 4000S device projects. PSoC
Creator is Cypress’s standard integrated design environment (IDE). If you are new to PSoC Creator,
see the documentation on the PSoC Creator home page. You can also refer the application note
AN79953 - Getting Started with PSoC 4, which gives an introduction to the PSoC 4 device.
The PSoC 4000S Prototyping Kit contains PSoC 4000S Prototyping board and Quick Start Guide.
The PSoC 4000S Prototyping board is as shown in Figure 1-1.
PSoC Creator is a state-of-the-art, easy-to-use IDE. It introduces revolutionary hardware and
software co-design, powered by a library of fully verified a nd character ized PSoC Compon ents™, as
shown in Figure 1-4. With PSoC Creator, you can:
1. Drag and drop Components to build your hardware system design in the main design workspace
2. Co-design your application firmware with the PSoC hardware
3. Configure Components using configuration tools
4. Explore the library of 100+ Components
5. Access Component datasheets
Figure 1-4. PSoC Creator Features
Introduction
PSoC Creator also enables you to tap into an entire tool ecosystem with integrated compiler chains
and production programmers for PSoC devices.
For more information, visit www.cypress.com/psoccreator.
PSoC Creator includes a large number of code examples. These examples are accessible from the
PSoC Creator Start Page, as shown in Figure 1-5.
Code examples 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 to use PSoC Creator Components for
various applications. Code examples and documentation are included as shown in Figure 1-6.
In the Find Example Project dialog shown in Figure 1-6, you have several options:
■ Filter for examples based on a device family or keyword.
■ Select from the list of examples offered based on the Filter Options.
■ View the project documentation for the selection (on the Documentation tab).
■ View the code for the selection on the Sample Code tab . You can also copy and paste cod e from
this window to your project, which can help speed up code development.
■ Create new workspace for the code example or add to your existing workspace. Th is can speed
up your design process by starting you off with a complete , basic design. You can then adapt that
design to your application.
Figure 1-6. Code Example Projects with Sample Code
Introduction
1.3.2Kit Code Examples
You can access the installed kit code examples from the PSoC Creator Start Page. To access these
examples, expand the Kits under the section Examples and Kits; then, expand the specific kit to
see the code examples. Refer to the Code Examples chapter on page 25 for a list of code examples
that you can use on this kit.
1.3.3PSoC Creator Help
Launch PSoC Creator and navigate to the following items:
■ Quick Start Guide: Choose Help > Documentation > Quick Start G uide . This guide gives you
demonstrate how to configure and use PSoC Crea to r Co mp one nt s. To access examples related
to a specific Component, right-click on the Component in the schematic or in the Component
Catalog. Select the Find Code Example option in the context menu that appears.
■ System Reference Guide: Choose Help > System Reference Guides. This guide lists and
describes the system functions provided by PSoC Creator.
■ Component Datasheets: Right-click a Component and select Open Datasheet. Visit the
PSoC 4 Component Datasheets page for a list of all PSoC 4 Component datasheets.
■ Document Manager: PSoC Creator provides a document manager to help you easily find and
access the document resources. To open the document manager, choose the menu item Help > Document Manager.
This guide will help you be acquainted with the CY8CKIT-145-40XX PSoC 4000S Prototyping Kit:
■ The Software Installation chapter on page 15 chapter describes the installation of the kit
software. This includes the PSoC Creator IDE to develop and debug the applications, and PSoC
Programmer to program the .hex files on to the device.
■ The Kit Operation chapter on page 19 chapter describes the major features of the PSoC 4000S
Prototyping Kit and functionalities such as programming, debugging, and the USB-UART and
USB-I2C bridges.
■ The Code Examples chapter on page 25 chapter describes PSoC 4000S code examples that will
help you understand how to create your own PSoC 4000S projects.
■ The Appendix chapter on page 28 provides the detailed hardware description, kit schematics,
and the bill of materials (BOM).
1.5Additional 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 de sign. 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 and PSoC Roadmap.
■ Product Selectors: PSoC 4 Product Selector. In addition, PSoC Creator includes a device
selection tool.
■ Datasheets: Describe and provide electrical specifications for the PSoC 4000, PSoC 4100, PSoC
■ 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.
Many of the application notes include code examples. Visit the PSoC 3/4/5 Code Examples web
page for a list of all available PSoC Creator code examples. To access code examples from
within PSoC Creator - see PSoC Creator Code Examples on page 10.
■ Technical Reference Manuals (TRM): Provide detailed descriptions of the architecture and
registers in each PSoC 4 device family.
■ Development Kits:
❐ CY8CKIT-041, CY8CKIT-046, CY8CKIT-044, CY8CKIT-042 and CY8CKIT-040 are easy-to-
use and inexpensive development pla tf or ms . These kits includ e co nn e c to rs for Arduino
compatible Shields and Digilent Pmod Peripheral Modules.
❐ CY8CKIT-043, CY8CKIT-049, and CY8CKIT-145 are very low-cost protot yp ing plat fo rm 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 using the
device.
■ PSoC Creator Training: Visit www.cypress.com/go/creatorstart/creatortraining for a
comprehensive list of video trainings on PSoC Creator.
■ Learning from Peers: Visit www.cypress.com/forums to meet enthusiastic PSoC developers
discussing the next generation embedded systems on Cypress Developer Community Forums.
This chapter describes the steps to install the software tools and packages on a PC for using the
PSoC 4000S Prototyping Kit. This includes the IDE on which the projects will be built and used for
programming.
2.1Before You Begin
To install Cypress software, you will require administrator privileges. However, they are not required
to run software that is already installed. Before you install the kit software, close any other Cypress
software that is currently running.
2.2Install Software
Follow these steps to install the PSoC 4000S Prototyping Kit software:
1. Download the PSoC 4000S Prototyping Kit software from www.cypress.com/CY8CKIT-145. The
kit software is available in three different formats for download.
a. CY8CKIT-145-40XX Kit Only: This executable file installs only the kit contents, which include
kit 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.
b. CY8CKIT-145-40XX Kit Complete Setup: This installation package contains the file s rela ted
to the kit along with Cypress prerequisite software such as PSoC Creator and PSoC
Programmer . 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.
c. CY8CKIT-145-40XX DVD ISO: This file is a complete package, stored in a DVD-ROM image
format, which 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 like 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. Extract the ISO contents if you do
not have a virtual drive to mount. Double-click cyautorun.exe in the root directory of th e extracted
content or the mounted ISO if “Autorun from CD/DVD” is not enabled on the computer. The
installation window will appear automatically.
Note: If you are using the “Kit Complete Setup” or “Kit Only” file, then go to step 4 for installation.
Note: For Windows 7/8/8.1/10 users, the installed files and the folder are read only. To use the
installed code examples, follow the steps outlined in the Code Examples on page 25. These steps
will create an editable copy of the example in a path that you choose so the original installed
example is not modified.
The software can be uninstalled using one of the following methods:
Go to Start > All Programs > Cypress > Cypress Update Manager > Cypress Update Manager
and select the Uninstall button that corresponds to the kit software.
Go to Start > Control Panel > Programs and Features for Windows 7 or Add/Remove Programs
for Windows XP; choose the product and select the Uninstall/Change button.
This chapter introduces you to the various features of the PSoC 4000S Prototyping Kit. It primarily
includes the theory of Operation, programming and debugging functionality, KitProg2 USB-UART
and USB-I2C bridges.
3.1Theory of Operation
The PSoC 4000S Prototyping Kit is built ar ound the PSoC 4 000S device. Figure 3-1 shows the block
diagram of the PSoC 4000S device. Refer to the PSoC 4000S datasheet for details on device fea-
tures.
Figure 3-2 shows the block diagram for the PSoC 4000S Prototyping Kit.
!"#$
%&
'()*+!
,
-
*%
$
+
#
&
.
'///
*%
!"
0
.12
34
#$
%&
'***
!"
34
%&
'()*
&
'///
/<
'***
/<
Figure 3-2. Block Diagram of PSoC 4000S Prototyping Kit
Kit Operation
The PSoC 4000S Prototyping Kit is simple in design and pr ovides co mplete access to develo p applications using the PSoC 4000S device family.
This kit supports the following features:
1. CapSense Buttons and LEDs: Three CapSense buttons (BTN0, BTN1, and BTN2) and
corresponding LEDs (LED9, LED10, and LED11) are provided on a breakout board to
demonstrate the CapSense buttons functionality of the PSoC 4000S device. All the I/Os used for
implementing the CapSense Buttons and corres ponding LEDs are expose d through the h eaders
J1 and J10.
2. CapSense Slider and LEDs: A 5-segment linear slider (SLD0, SLD1, SLD2, SLD3, and SLD4)
with corresponding LEDs (LED4, LED5, LED6, LED7, and LED8) are provided on a breakout
board to demonstrate the CapSense Slider functionality of the PSoC 4000S device. All the I/Os
used for implementing the CapSense Slider and corresponding LEDs are exposed through the
headers J2 and J9.
3. KitProg2 Status LED: The amber status LED (LED3) indicates the status of KitProg2 (see
KitProg2 on page 22). For more details on the KitProg2 status, refer to the KitProg2 User Guide.
4. KitProg2 (PSoC 5LP) I/O Headers (J6, J7): These headers bring out a few GPIO lines of the
onboard PSoC 5LP device. These include the KitProg2 USB-I2C bridge lines and USB-UART
bridge lines. The additional PSoC 5LP pins are direct connections to the inter na l pro gra mm a ble
analog logic of PSoC 5LP. You can use these pins as General-purpose input/output (GPIO) also.
5. Power LED (LED2): The amber power LED is turne d on whe n the kit is conne cted a nd power ed
through the onboard USB connector (J8).
6. PSoC 4000S I/O Headers (J1, J2): The PSoC 4000S Prototyping board brings all GPIOs of the
target PSoC 4000S device to the two expansion headers, enabling the user to have maximum
access to the capabilities of the PSoC 4000S device.
7. 10-pin Programming Header (J11): This header allows you to program/debug the
PSoC 4000S/EZ-BLE devices using an external programmer such as MiniProg3. This header is
not populated by default.
8. EZ-BLE PRoC Module and LED: The kit includes Cypress EZ-BLE PRoC Module for BLE
connectivity and Blue LED (LED12) connected to P1_6 of its GPIO.
9. SWD Selection Switch (SW4): A DPDT switch is provided on the prototyping board to select the
SWD lines of either PSoC 4000S or EZ-BLE PRoC Module for programming.
10. Reset Button (SW1): This button is used to reset PSoC 4000S and EZ-BLE devices.
11. PSoC 4000S (U2): This kit is designed to highlight the features of PSoC 4000S
(CY8C4045AZI-S413).
12. 5-pin Programming Headers (J4, J5): These headers can be used to program/d ebug the target
SWD devices. After the bo ard is snapped, J5 can be used to program/debug the
PSoC 4000S/EZ-BLE PRoC Module using an external programmer such as MiniProg3. J4 can
be used to program any other external target device using onboard PSoC 5LP (KitProg2).
13. KitProg2 (PSoC 5LP) Programmer and Debugger (U1): The CY8C5868LTI-LP039 PSoC 5LP
device (U1) serving as KitProg2 is a multi-functional system, which includes a programmer,
debugger , USB- I2C bridge , and a USB-UAR T bridge. Refer to the KitProg2 User Guide for more
details. KitProg2 User Guide can also be found in the installation folder:
14. User Button (SW2): This push button can be used to provide an input to the PSoC 4000S/
EZ-BLE devices. Note that the switch connects th e PSoC 4000S/EZ-BL E d evice’s pin to ground
when pressed, so you need to configure the PSoC 4000S/EZ-BLE device’s pin as resistive
pull-up for detecting the switch press.
15. KitProg2 Mode Selection Button (SW3): This push button provides input to the PSoC 5LP
device. It can be used to switch between various modes of KitProg2 (SWD Programmer/
Debugger, Mass Storage Programmer, Bootloader and Custom Application Modes). Note that
the switch connects the PSoC 5LP pin to ground when pressed.
16. On-board USB connector (J8): A PCB USB connector is provided to connect the kit to a
computer.
17. Current measurement jumper (J3): Provision to mount a 2-pin jumper (J3) for measuring the
current to the PSoC 4000S device. To measure the current consumption of the PSoC 4000S
device, remove the resistor R22, mount a 2-pin jumper (J3) and connect an ammeter across
jumper J3. Refer to the Measure PSoC 4000S Current Consumption on page 32 for more
details.
KitProg2 is a multi-functional system, which includes a programmer, debugger, USB-I2C bridge, and
a USB-UART bridge. The PSoC 4000S Prototyping Kit also supports Mass Storage Programming
using KitProg2. A Cypress PSoC 5LP device is used to implement the KitProg2 functionality. The
KitProg2 is integrated in most PSoC development kits. For more details on the KitProg2 functionality,
refer to the KitProg2 User Guide in the kit installation directory:
The target PSoC 4000S/EZ-BLE device can be programmed and debugged using KitProg2. Before
programming the device, ensure that PSoC Creator and PSoC Programmer software are installed
on the computer. See the Software Installation chapter on page 15 for more information.
3.2.1Programming and Debugging Using PSoC Creator
1. Connect the prototyping board to the computer through the PCB USB connector (J8), as shown
in Figure 3-3. The kit enumerates as a composite device if you are plugging in the PSoC 4000S
Prototyping Kit to your PC for the first time. The kit drivers will get installed automatically.
Successful enumeration is indicated by Amber Status LED (LED3) ON. If the Amber Status LED
(LED3) is not ON, refer to the KitProg2 User Guide for details on the KitProg2 status and
troubleshooting instructions.
Kit Operation
Figure 3-3. Connecting the PSoC 4000S Prototyping Kit to Computer
2. Open the desired project in PSoC Creator. For this, go to File > Open > Project/Workspace.
This provides the option to browse and open a saved project. To open the code example provided with the kit, follow the instructions specified in the Code Examples chapter on page 25.
3. Select the option Build > Build <Project_Name>, or press Shift + F6 to build the project as
shown in Figure 3-4.
Figure 3-4. Build the Code Example
4. If there are no errors during build, program th e firm wa re into the kit by cho os ing Debug >
Program or by pressing Ctrl + F5 as shown in Figure 3-5. This programs the device on the
PSoC 4000S Prototyping board.
PSoC Creator has an integrated debugger. You can start the debugger by selecting Debug > Debug
or by pressing [F5]. Refer to the Debugging Using PSoC Creator section in the KitProg2 User
Guide for a detailed explanation on how to debug using PSoC Creator.
PSoC Programmer (3.24.2 or later) can be used to prog ram exist ing .hex files into the PSoC 4000S
Prototyping board. Refer to the Programming Using PSoC Programmer section in the KitProg2
User Guide for a detailed explanation on how to program using PSoC Programmer.
The KitProg2 firmware normally does not require any update. You can use the PSoC Programmer
software to update the KitProg2 firmware. Refer to KitProg2 Driver Installation section in the Kit-
Prog2 User Guide for a detailed explanation on how to update the KitProg2 firmware.
3.2.3Mass Storage Programming
The KitProg2 in PSoC 4000S Prototyping board supports programming through a USB Mass Storage interface. This interface allows you to program the PSoC 4000S/EZ-BLE devices by copying
.hex files into an emulated USB Mass Storage device. For more details on KitProg2 Mass Storage
Programmer, refer to the KitProg2 User Guide.
3.2.4USB-UART Bridge
The KitProg2 on the PSoC 4000S Prototyping board can act as a USB-UART bridge. The UART
lines between the PSoC 4000S and the KitProg2 are hard-wired on the board, through the snappable area, with UART_RX assigned to P3 [1] and UART_TX assigned to P3 [0] on PSoC 4000S. For
more details on the KitProg2 USB-UART functionality, refer to the KitProg2 User Guide.
Kit Operation
Figure 3-6. UART connection between KitProg2 and PSoC 4000S
3.2.5USB-I2C Bridge
The KitProg2 can function as a USB-I2C bridge and communicate with the Bridge Control Panel
(BCP) software utility. The I2C lines between the PSoC 4000S device and KitProg2 are hardwired on
the board, through the snappable area, with SCL assigned to P1 [0] and SDA assigned to P1[1] on
PSoC 4000S. The USB-I2C supports I2C speeds of 50 kHz, 100 kHz, 400 kHz, and 1 MHz. For
more details on the KitProg2 USB-I2C functionality, refer to the KitProg2 User Guide.
Figure 3-7. I2C connection between KitProg2 and PSoC 4000S
The PSoC 4000S Prototyping Kit includes one code example. To access the code example, download and install the CY8CKIT-145-40XX Kit setup file from www.cypress.com/CY8CKIT-145. After
installation, the code example can be accessed from the PSoC Creator Start page as shown in
Figure 4-1. For more code examples, visit PSoC 3/4/5 Code Exa m ple s, whic h lis ts all PSoC Creator
code examples available across application notes, kits, and PSoC Creator.
4.1Using the Kit Example Projects
Follow these steps to open and use the example pro je cts :
1. Launch PSoC Creator from Start > All Programs > Cypress > PSoC Creator <version> >
PSoC Creator <version>.
2. On the Start page, click CY8CKIT-145-40XX under Examples and Kits > Kits. A list of examp le
projects appears, as shown in Figure 4-1.
3. Click on the desired example project, select a location to save the project and click OK.
4. Build the code example by choosing Build > Build <Project Name>. A .hex file is generated
after the build process.
5. Connect the PSoC 4000S Prototyping board to the PC using the onboard PCB USB connector
J8 as shown in Figure 3-3.
6. Choose Debug > Program in PSoC Creator to program the code example.
7. If the device is already acquired, programming will complete automatically and the result will
appear in the PSoC Creator status bar at the bottom left side of the screen. If the device is yet to
be acquired, the Select Debug Target window will appear. Select KitProg2/<serial number>
and click the Port Acquire button, as shown in Figure 4-2.
8. After the device is acquired, it is shown in a tree structure below the KitProg2/<serial number>.
Click the Connect button and then click OK to exit the window and start programming, as shown
in Figure 4-3.
Figure 4-3. Connect Device from PSoC Creator and Program
4.1.1CE210709 CapSense Linear Slider and Buttons
This code example demonstrates the operation of a CapSense linear slider with five segments and
three CapSense buttons. CapSense linear slider and buttons data is sent to the CapSense Tuner or
EZ-BLE PRoC Module using I2C communication. The CapSense linear slider touch position and
buttons status is used to turn ON/OFF corresponding LEDs on the kit. It also demonstrates connectivity between the EZ-BLE PRoC Module (acting as a Peripheral and GATT server device) and
mobile device running the CySmart mobile application (acting as a Central and GATT client device).
This code example also demonstrates a simple breathing effect of LED with breath-in and breath-out
rate of 1 Hz using the SmartIO and PWM Components.
The target board uses the PSoC 4000S device. PSoC 4000S is a scalable and reconfigurable
platform architecture for a family of programmable embedded system controllers with an ARM
Cortex-M0+ CPU. It combines programmable and reconfigurable analog and digital blocks with
flexible automatic routing. The PSoC 4000S device family, based on this platform architecture, is a
combination of a microcontroller with digital programmable logic, programmable analog,
programmable interconnect, high-performance analog-to-digital conversion, opamps with
comparator mode, and standard communication and timing peripherals. The PSoC 4000S products
are fully compatible with members of the PSoC 4 platform for new applications and design needs.
The programmable analog and digital subsystems allow flexibility and in-field tuning of the design.
For more information, refer to the PSoC 4 web pageand the PSoC 4000S Family Datasheet.
PSoC 5LP on the KitProg2 board is used to program and debug the target PSoC 4000S device/
EZ-BLE PRoC Module. KitProg2 PSoC 5LP connects to the USB port of the computer through the
PCB USB connector and to the SWD interface of the target PSoC 4000S device/EZ-BLE PRoC
Module. See the KitProg2 User Guide for additional details and functions provided by the KitProg2.
The power supply system on this board is dependent on the power source. For most applications,
you can use the 5 V supply from the USB connection to power the system. You can also c on ne ct an
external power supply to the board for low-voltage applications. The kit supports the following
connections:
■ 5 V from the KitProg2 USB (J8)
■ 3.3 V to 5.5 V from a regulated supply connected to VTARG (this will not power the KitProg2
section of the board)
Note: To use an external power supply, while KitProg2 is connected to the PCB USB, remove the
D1 diode from the board. This ensures that VTARG supply from KitProg2 is not supplied to the target
device. KitProg2 measures the target voltage and adjusts the logic levels on the programming pins
accordingly.
Note that this prototyping kit does not have any onboard ESD protection circuitry. Therefore,
the power source for the PSoC 4000S Prototyping board must be of a high quality to ensure
that the board is protected from any over-current conditions and swapped-power connections.
A.1.2.4Measure PSoC 4000S Current Consumption
You can measure current consumption of the PSoC 4000S device by following the steps below.
1. Remove the resistors R22, R23 and install a 2-pin jumper in the supplied holes of J3.
2. Connect an ammeter across the 2-pin jumper to measure the current to the PSoC 4000S device.
This method can be used either with USB power or with the power supplied to one of the VTARG
pins but NOT when supplying power to one of the VDD pins.
After measuring the current consumption, populate the resistors R22 and R23 for normal operation
of the kit.
A.1.2.5Board Separation (Snapping)
The PSoC 4000S Prototyping board consists of a PSoC 4000S board, a KitProg2 board and two
sensor boards.
CAUTION! Do not apply excess pressure on the board while snapping as it may damage the onboard components.
To separate the PSoC 4000S and KitProg2 boards for evaluation or development, break the two
boards apart at the built-in perforated edge between J4 and J5. 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 KitProg2 board is off the table edge. Press gently on the KitProg2 board and snap the two boards apart. If any material is removed from the edge of the boa rds,
use shears to clean up the edge of the kit. Note that once the boards are separated, direct UART
and I2C connections between the PSoC 4000S device and KitProg2 are lost. This is because the
traces connecting the UART and I2C lines are cut off during the separation. However, you can
access KitProg2’s UART and I2C lines through header J6.
Follow a similar approach to snap the sensor boards from PSoC 4000S board.
Figure A-4. PSoC 4000S Prototyping Board separated into Four Parts
A.1.2.6Header Connections
The PSoC 4000S Prototyping board supports a number of unpopulated headers on both the
KitProg2 and the target PSoC 4 boards.
Functionality of J1 and J2 Headers (Target Board)
The target board contains two, single in-line headers (J1 and J2). Both are 1×22 pin headers and
include all of the I/Os available on the PSoC 4000S device. 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 connectors to connect the target board to any
development breadboard. The CapSense Slider signals and the Slider LED signals from header J1
are routed to header J10 on the sensor board. The CapSense Buttons signals and the Button LED
signals from header J2 are routed to header J9 on the sensors board.
J2_01VDDAPower
J2_02GNDGround
J2_03P0_0/SLD0GPIO/Slider 0 Rx
J2_04P0_1/SLD1GPIO/Slider 1 Rx
J2_05P0_2/SLD2GPIO/Slider 2 Rx
J2_06P0_3/SLD3GPIO/Slider 3 Rx
J2_07P0_4/UART_RXGPIO/UART Receive
J2_08P0_5/UART_TXGPIO/UART Transmit
J2_09P0_6/SLD4GPIO/Slider 4 Rx
J2_10P0_7/USER BUTTONGPIO/User Button
J2_11P2_0/LED4GPIO/Slider 0 LED
J2_12P2_1/LED5GPIO/Slider 1 LED
J2_13P2_2/LED6GPIO/Slider 2 LED
J2_14P2_3/LED7GPIO/Slider 3 LED
J2_15P2_4/LED8GPIO/Slider 4 LED
J2_16P2_5/LED1GPIO/User LED
J2_17P2_6/SLD TXGPIO/Slider Tx
J2_18P2_7GPIO
J2_19P4_0/CTANKGPIO/CTANK
J2_20P4_1/CMODGPIO/CMOD
J2_21GNDGround
J2_22VDDDPower
Functionality of J4 and J5 Headers (PSoC 4000S to KitProg2)
KitProg2 and target boards each contains a 1 × 5-pin header. These headers provide a physical connection between the two devices. Specifically, the connection includes the SWD interface, required
to program/debug the target PSoC 4000S device/EZ-BLE PRoC Module, power, ground, and reset.
The KitProg2 board contains two single in-line headers (J6 and J7). Both are 1×7-pin-headers, used
to provide access to several pins of the PSoC 5LP device to support advanced features such as a
low-speed oscilloscope and a low-speed digital logic analyzer. These headers also contain the KitProg2 bridge pins (UART and I2C pins of KitProg2 (PSoC 5LP)) that ca n be used when the two
boards are separated. The J6 and J7 headers support 100-mil spacing, so you can solder connectors to connect the KitProg2 board to any development breadboard.
This 10-pin header allows you to program and debug PSoC 4000S and EZ-BLE PRoC mo dule using
an external programmer such as MiniProg3. This header is not populated by default.
User Button
The target PSoC 4000S Prototyping board contains a single push button (SW2) connected to the
P0[7] pin on the PSoC 4000S device. It is also connected to P4[1] pin on the EZ-BLE PRoC modu le.
This button can be used for general user inputs or to control different states in an application
including waking up the device from sleep or deep sleep.
Figure A-9. User Button on the Board
Reset Button
The Kit contains a push button (SW1) connected to the XRES pins on the target PSoC 4000S and
EZ-BLE devices. When this button is pressed, the XRES lines of the PSoC 4000S and EZ-BLE are
connected to ground, which, in turn, resets the devices.
The kit contains a push button (SW3) connected to P1[2] of the PSoC 5LP device. This can be used
to switch between different modes of KitProg2 such as Programmer/Debugger, Mass storage programmer, Bootloader and Custom application. Refer to the KitProg2 User Guide for more details.
This button can also be used as general purpose button in custom application for PSoC 5LP device.
Three CapSense buttons (BTN0, BTN1 and BTN2) are provided on a breakout board to
demonstrate the CapSense button functionality of PSoC 4000S device. All the I/Os used for
implementing the CapSense Buttons are exposed though the headers J1 and J10.
A 5-segment linear slider (SLD0, SLD1, SLD2, SLD3, and SLD4) is provided on a breakout board to
demonstrate the CapSense slider functionality of PSoC 4000S device. All the I/Os used for implementing the CapSense Slider are exposed though the headers J2 and J9.
Figure A-13. CapSense Slider
A.1.2.9LEDs
The PSoC 4000S Prototyping board contains 12 LEDs:
■ The amber Power LED (LED2): Indicates that the board is powered from the PCB USB
connector. This LED will not glow when the board is powered from VDD or VTARG directly.
■ The amber Status LED (LED3): Indicates the KitProg2 status, connected to P1[4] of the KitProg2
PSoC 5LP device. For more details on the KitProg2 status LED, refer to the KitProg2 User Guide.
■ The blue LED (LED1): This is the user LED, connected to P2[5] of the target PSoC 4000S device.
■ Slider LEDs (LED4, LED5, LED6, LED7, LED8): The LEDs corresponding to five segments of the
slider are connected to P2[0], P2[1], P2[2], P2[3], and P2[4] of PSoC 4000S device.
■ Button LEDs (LED9, LED10, LED1 1): There are 3 button LEDs corresponding to 3 buttons. They
are connected to P3[4], P3[5], and P3[6] of the target PSoC 4000S device.
■ EZ-BLE Blue LED (LED12): This is the user LED connected to P1[6] of EZ-BLE PRoC Module.
The PSoC 4000S Prototyping board has eight capacitors in addition to power supply decoupling
capacitors:
■ Four CapSense capacitors (CMOD, CTANK, CintA, CintB): Required for CapSe nse functionality
of PSoC 4000S device.
■ SAR bypass capacitor for PSoC 4000S (C3 - No Load by defa ult ) an d PSoC 5LP (C7).
■ Two biasing capacitors (C9 and C12): Required to interface an external 32-kHz crystal oscillator
(WCO).
Note: The crystal oscillator is not placed on the board; it can be soldered on pins P0[5] and P0[4] of
PSoC 4000S.
Figure A-20. System Capacitors Circuit Diagram
A.1.2.11EZ-BLE PRoC Module
The board includes an EZ-BLE PRoC Module, which is loaded by default. The EZ-BLE PRoC Module is a fully integrated, 10 × 10 × 1.8 mm, fully certified, programmable module designed for easeof-use and reduced time-to-market. It contains Cypress's PRoC BLE chip, two crystals, chip
antenna, shield, and passive components. Refer to AN96841 - Getting Started With EZ-BLE PRoC
Module for more details. Visit www.cypress.com/ez-bleprocmodule to buy the EZ-BLE PRoC Mod-
A.4Programming the PSoC 4000S Prototyping Kit Using Miniprog3/
KitProg2
The target board allows you to program the PSoC 4000S/EZ-BLE PRoC Module using a MiniProg3
or an external KitProg2 device via the 10-pin JTAG header or the 5-pin SWD header. To do this,
connect wires or a 5-pin 100-mil spaced header to J5 or a 10-pin JTAG header to J11 on the target
board. The PSoC 4000S Prototyping Kit supports both power cycle and reset programming modes.
Figure A-23. Connecting CY8CKIT-145-40XX to MiniProg3
Note:CY8CKIT-002 MiniProg3 is not part of the PSoC 4000S Prototyping Kit contents and can be
purchased from the Cypress Online Store.