0% found this document useful (0 votes)
102 views24 pages

Please Note That Cypress Is An Infineon Technologies Company

Uploaded by

muhammad osman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views24 pages

Please Note That Cypress Is An Infineon Technologies Company

Uploaded by

muhammad osman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Please note that Cypress is an Infineon Technologies Company.

The document following this cover page is marked as “Cypress” document as this is the
company that originally developed the product. Please note that Infineon will continue
to offer the product to new and existing customers as part of the Infineon product
portfolio.

Continuity of document content


The fact that Infineon offers the following product as part of the Infineon product
portfolio does not lead to any changes to this document. Future revisions will occur
when appropriate, and any changes will be set out on the document history page.

Continuity of ordering part numbers


Infineon continues to support existing part numbers. Please continue to use the
ordering part numbers listed in the datasheet for ordering.

www.infineon.com
AN77759
Getting Started with PSoC 5LP

Author: Nidhin MS
Associated Part Family: All PSoC 5LP parts
Related Documents: For a complete list, click here.
To get the latest version of this application note, or the associated project file, please
visit http://www.cypress.com/go/AN77759.
More code examples? We heard you.
To access an ever-growing list of hundreds of PSoC code examples, please visit our code
examples web page. You can also explore the Cypress video training library here.

AN77759 introduces you to PSoC® 5LP, an Arm® Cortex®-M3-based programmable system-on-chip. It describes the
PSoC 5LP architecture and development environment, and shows you how to create a simple design using
PSoC Creator™, the development tool for PSoC 5LP. This application note also guides you to more resources for in-
depth learning about PSoC 5LP as well as PSoC in general.

Contents
1 Introduction ............................................................... 1 6.3 Part 1: Create the Design ................................ 9
2 PSoC Resources ...................................................... 2 6.4 Part 2: Program the Device ........................... 16
3 PSoC Creator ........................................................... 2 7 Summary ................................................................ 18
3.1 PSoC Creator Help .......................................... 3 8 Related Documents ................................................ 18
3.2 Technical Support ............................................ 3 Document History............................................................ 22
4 Code Examples ........................................................ 4 Worldwide Sales and Design Support ............................. 23
5 PSoC 5LP Feature Set ............................................. 5 Products .......................................................................... 23
5.1 PSoC is More Than an MCU ........................... 7 PSoC® Solutions ............................................................. 23
5.2 The Concept of PSoC Creator Components .... 7 Cypress Developer Community....................................... 23
6 My First PSoC 5LP Design ....................................... 8 Technical Support ........................................................... 23
6.1 Before You Begin ............................................. 8
6.2 About The Design ............................................ 9

1 Introduction
PSoC 5LP is a true programmable embedded system-on-chip, integrating custom analog and digital peripheral
functions, memory, and an Arm Cortex-M3 CPU on a single chip.
PSoC 5LP provides a cost-effective alternative to the combination of MCU and external ICs. The PSoC 5LP
architecture boosts performance through:

▪ 32-bit Arm Cortex-M3 core plus DMA controller and digital filter processor, at up to 80 MHz

▪ Ultra-low power with industry's widest voltage range

▪ Programmable digital and analog peripherals enable custom functions

▪ Flexible routing of any analog or digital peripheral function to any pin


A single PSoC device can integrate as many as 100 digital and analog peripheral functions, reducing design time,
board space, power consumption, and system cost while improving system quality.

www.cypress.com Document No. 001-77759 Rev. *G 1


Getting Started with PSoC 5LP

Using this Document


The next few pages describe the PSoC 5LP and the advantages of designing with PSoC and PSoC Creator. Or, you
can jump right in and quickly build a simple design – go to My First PSoC 5LP Design. The design created in this
section is also available in code example CE203303.

2 PSoC Resources
Cypress provides a wealth of data at www.cypress.com to help you to select the right PSoC device for your design,
and 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 3:

▪ Overview: PSoC Portfolio, PSoC Roadmap ▪ Technical Reference Manuals (TRM): Provide
detailed descriptions of the architecture and registers
▪ Product Selectors: PSoC 1, PSoC 3, in each of the PSoC 3, PSoC 4, PSoC 5LP, and
PSoC 4, PSoC 5LP, or PSoC 6 MCU. In PSoC 6 MCU device families.
addition, PSoC Creator includes a device
selection tool. ▪ PSoC Training Videos: These videos provide step-
by-step instructions on how to get started building
▪ Datasheets: Describe and provide electrical complex designs with PSoC.
specifications for the PSoC 3, PSoC 4,
PSoC 5LP, and PSoC 6 MCU device ▪ Development Kits:
families.
 CY8CKIT-030 is designed for analog performance.
▪ CapSense® Design Guides: Learn how to It enables you to develop and evaluate high-
design capacitive touch-sensing applications precision analog, low-power, and low-voltage
with the PSoC 3, PSoC 4, PSoC 5LP, and applications.
PSoC 6 MCU families of devices.  CY8CKIT-001 provides a common development
▪ Application Notes and Code Examples: platform where you can prototype and evaluate
different solutions using any one of the PSoC 1,
Cover a broad range of topics, from basic to
advanced level. Many of the application PSoC 3, PSoC 4, or PSoC 5LP architectures.
notes include code examples.

3 PSoC Creator
PSoC Creator is a free Windows-based Integrated Design Environment (IDE). It enables concurrent hardware and
firmware design of systems based on PSoC 3, PSoC 4, and PSoC 5LP. See Figure 1 – with PSoC Creator, you can:
1. Drag and drop Components for hardware 3. Configure Components using configuration tools
system design in the main design workspace 4. Explore the library of 100+ Components
2. Codesign your application firmware with the 5. Review Component datasheets
PSoC hardware

www.cypress.com Document No. 001-77759 Rev. *G 2


Getting Started with PSoC 5LP

Figure 1. PSoC Creator Features

3.1 PSoC Creator Help


Visit the PSoC Creator home page to download the latest version of PSoC Creator. Then, launch PSoC Creator and
navigate to the following items:

▪ Quick Start Guide: Choose the menu item Help > Documentation > Quick Start Guide. This guide gives you
the basics for developing PSoC Creator projects.

▪ Simple example projects: Choose the menu item File > Code Examples. These example projects demonstrate
how to configure and use PSoC Creator Components.

▪ System Reference Guide: Choose the menu item Help > System Reference > System Reference Guide. 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 5LP
Component Datasheets page for a list of all PSoC 5LP Component datasheets.

▪ Document Manager: PSoC Creator provides a document manager to help you to easily find and review
document resources. To open the document manager, choose the menu item Help > Document Manager.

3.2 Technical Support


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 3 at the prompt.
You can also use the following support resources if you need quick assistance.

▪ Self-help

▪ Local Sales Office Locations

www.cypress.com Document No. 001-77759 Rev. *G 3


Getting Started with PSoC 5LP

4 Code Examples Figure 2. Code Examples in PSoC Creator


PSoC Creator includes a large number of code example projects.
These code examples are available from the PSoC Creator Start
Page, as Figure 2 shows.
Code examples can speed up your design process by starting
you off with a complete design, instead of a blank page. The code
examples also show how PSoC Creator Components are used in
various applications. Code examples and datasheets are
included, as Figure 3 shows.
In the Find Code Example dialog shown in Figure 3, you have
several options:

▪ Filter for examples based on architecture or device family,


such as, 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.

Figure 3. Code Example Projects, with Sample Code

www.cypress.com Document No. 001-77759 Rev. *G 4


Getting Started with PSoC 5LP

5 PSoC 5LP Feature Set


PSoC 5LP has an extensive set of features, which include a CPU and memory subsystem, a digital subsystem, an
analog subsystem, and system resources, as Figure 4 shows (for the CY8C58xxLP device family).
For more information, see the PSoC 5LP family device datasheets, technical reference manuals (TRMs), and
application notes listed previously.

Figure 4. PSoC 5LP Architecture (CY8C58xxLP)

Analog Interconnect
Digital Interconnect

SIO
System Wide Digital System
GPIOs

Resources Universal Digital Block Array (24 x UDB) I2C


4- 25 MHz 8- Bit Quadrature Decoder 16- Bit PRS CAN 2.0 Master/

Sequencer
16- Bit
Timer
Slave
Usage Example for UDB
( Optional) PWM UDB UDB
UDB UDB UDB UDB
22 
Xtal
USB
Osc UDB FS USB
Clock Tree

UDB UDB UDB


UDB UDB 8- Bit 4x PHY
Timer 2.0
I 2C Slave
8- Bit SPI
12- Bit SPI
Logic Timer
UDB UDB
Counter
UDB UDB UDB UDB
GPIOs

PWM
IMO

GPIOs
Logic
32.768 KHz UDB UDB UDB UDB
UDB UDB
( Optional)
UART 12- Bit PWM

RTC
Timer
System Bus

GPIOs
Memory System CPU System Program &
WDT Debug
and Interrupt
EEPROM SRAM Cortex M3CPU Program
Wake Controller
Debug &
GPIOs

Trace
EMIF FLASH Cache PHUB Boundary
Controller DMA Scan
ILO

Clocking System

GPIOs
Digital Analog System
Power Management
SIOs

LCD Direct
System Filter +
Drive
Block 4x
ADCs 2x Opamp
POR and 3 per
LVD SAR -
Opamp
4 x SC / CT Blocks ADC
Sleep (TIA, PGA, Mixer etc)
Power
+
1.71 to

Temperature
5.5 V

GPIOs
1.8 V LDO Sensor 4x
4x DAC 1x CMP
Del Sig -
SMP CapSense ADC

0. 5 to 5.5 V
( Optional)

Following is a list of major features of the PSoC 5LP. For details, see Related Documents, or see a PSoC 5LP device
datasheet.

▪ Performance ▪ Memories
 DC to 80-MHz operation  Up to 256 KB program flash
 32-bit Arm Cortex-M3 CPU, 32 interrupts  Up to 32 KB additional flash for error correcting code
 24-channel direct memory access (DMA) (ECC)
controller  Up to 64 KB of SRAM
 24-bit 64-tap digital filter processor (DFB)  2 KB EEPROM

www.cypress.com Document No. 001-77759 Rev. *G 5


Getting Started with PSoC 5LP

▪ Digital peripherals ▪ Versatile I/O system


 Four 16-bit timer, counter, and PWM  46 to 72 I/O pins; up to 62 general-purpose I/Os
(TCPWM) (GPIOs)
 I2C, 1-Mbps bus speed  Up to eight performance I/O (SIO) pins
 USB 2.0-certified Full-Speed (FS) 12 Mbps ▪ 25 mA current sink
 Full CAN 2.0b, 16 Rx, 8 Tx buffers ▪ Programmable input threshold and output high
voltages
 20 to 24 universal digital blocks (UDB),
▪ Can act as a general-purpose comparator
programmable to create any number of
functions: ▪ Hot swap capability and overvoltage tolerance
▪ 8-, 16-, 24-, and 32-bit timers, counters,  Two USBIO pins that can be used as GPIOs
and PWMs  Route any digital or analog peripheral to any GPIO
▪ I2C, UART, SPI, I2S, and LIN 2.0
interfaces
 LCD direct drive from any GPIO, up to 46 × 16
segments
▪ Cyclic redundancy check (CRC)
▪ Pseudo random sequence (PRS)
 CapSense support from any GPIO
generators  1.2-V to 5.5-V interface voltages, up to four power
domains
▪ Quadrature decoders
▪ Gate-level logic functions ▪ Programmable clocking
 3- to 74-MHz internal oscillator, 1% accuracy at
▪ Analog Subsystem 3 MHz
 Configurable 8- to 20-bit delta-sigma ADC  4- to 25-MHz external crystal oscillator
 Up to two 12-bit SAR ADCs  Internal PLL clock generation up to 80 MHz
 Four 8-bit DACs  Low-power internal oscillator at 1, 33, and 100 kHz
 Four comparators  32.768-kHz external watch crystal oscillator
 Four operational amplifiers (opamps)  12 clock dividers routable to any peripheral or I/O
 Four programmable analog blocks, to
create: Refer to the datasheet for a full review of PSoC 5LP
▪ Programmable gain amplifier (PGA) features.
▪ Transimpedance amplifier (TIA)
▪ Mixer
▪ Sample and hold (S/H) circuit
 CapSense® support, up to 62 sensors
 1.024 V ±0.1% internal voltage reference

www.cypress.com Document No. 001-77759 Rev. *G 6


Getting Started with PSoC 5LP

5.1 PSoC is More than an MCU


Figure 5 shows that a typical MCU contains a CPU and a set of peripheral functions such as ADC, DAC, UART, SPI,
and general I/O, all linked to the CPU’s register interface. Within the MCU, the CPU is the “heart” of the device – the
CPU manages everything from setup to data movement to timing. Without the CPU the MCU cannot function.
Figure 6 shows that PSoC is quite different. The CPU, analog, digital, and I/O are equally important resources in a
programmable system. It is the system’s interconnect and programmability that is the heart of PSoC – not the CPU.
The analog and digital peripherals are interconnected with a highly configurable routing matrix, which allows you to
create custom designs to precisely meet your application requirements. You can program PSoC to emulate an MCU,
but you cannot program an MCU to emulate PSoC.

Figure 5. Block Diagram of a Typical MCU Figure 6. PSoC 5LP Block Diagram

Port A Port B Gen I/O Gen I/O

Gen I/O

Gen I/O
UART Digital System
ADC
(w/ Programmable Logic)

SPI
DAC ARM
CPU

Gen I/O

Gen I/O
I2C
Arm8051
Cortex-M3

Timer PWM
System Interconnect

Gen I/O

Gen I/O
Port C Port D Analog System

Gen I/O Gen I/O

A typical MCU requires CPU firmware to process state machines, use a timer for timing, and drive an output pin.
Thus the functional path is almost always through the CPU. However with PSoC asynchronous parallel processing is
possible. You can configure a PSoC to have elements that operate independently from the CPU.
For example, Figure 6 shows that PSoC 5LP has no UART. However, you can make as many UARTs as you need
within the configurable digital logic, using the predesigned and pretested UART Component in PSoC Creator. You
can configure each UART to have as few or as many features as you need.

5.2 The Concept of PSoC Creator Components


The key to successful PSoC designs is the PSoC Creator IDE. PSoC Creator encapsulates PSoC peripherals and
other resources as graphical elements called Components. Components are dragged and dropped onto a schematic,
and wired together, making the design process fast and easy. Design changes can be quickly made with just a few
mouse clicks.
For example, in a traditional MCU, to blink an LED using a PWM peripheral you must:
1. Locate the registers corresponding to the PWM.
2. Calculate the values to be written to the PWM registers, based on the required PWM period and duty cycle.
3. Write many lines of code to configure the PWM registers, set the pin drive mode and to connect the PWM output
to the pin.
To implement the same functionality in PSoC is a trivial exercise, as you will find in the next section.

www.cypress.com Document No. 001-77759 Rev. *G 7


Getting Started with PSoC 5LP

Pin Component: Connect Any Function to Any Pin


PSoC 5LP includes an extensive routing fabric that allows you to route almost any function – digital or analog – to
any pin. PSoC Creator makes this easy to do by providing a Pin Component, which with just a few mouse clicks you
can configure, connect to a PSoC resource, and associate with a physical pin. You can also easily change Pin
Component connections, which lets you rapidly handle board-level design changes.

Components Based on Programmable Digital Resources


PSoC 5LP has programmable digital blocks called Universal Digital Blocks (UDBs). PSoC Creator provides a number
of Components made from the UDBs. These include UART, SPI, I2C, I2S, Timer, PWM, Counter, CRC, quadrature
decoder, digital gates (AND, OR, NOT, XOR, etc.), and many more. You can even create your own custom state
machines and digital logic.

Components Based on Programmable Analog Resources


PSoC 5LP also has programmable analog blocks called switched capacitor continuous time (SC/CT) blocks. PSoC
Creator provides analog Components, such as programmable gain amplifier (PGA) and transimpedance amplifier
(TIA), that are made from the SC/CT blocks.

6 My First PSoC 5LP Design


This section does the following:

▪ Demonstrates how PSoC can be programmed to do more than a traditional MCU

▪ Shows how to build a simple PSoC design and install it in a development kit

▪ Provides detailed steps that make it easy to learn PSoC design techniques using the PSoC Creator IDE

6.1 Before You Begin

Have You Installed PSoC Creator?


Download and install PSoC Creator from the PSoC Creator home page. Note that the installation may take a long
time – see the PSoC Creator Release Notes for more information.

Do You Have a Development Kit?


Table 1 lists all Cypress development kits for the PSoC 5LP. Kits are also available from other manufacturers.

Table 1. Cypress PSoC 5LP Kits

PSoC 5LP Kit PSoC 5LP Device Part Number Programming

CY8CKIT-059 CY8C5888LTI-LP097 Integrated programmer


CY8CKIT-050 CY8C5868AXI-LP035 Integrated programmer
CY8CKIT-001 CY8C5868AXI-LP035 MiniProg3 program and debug kit

Want To See the Project In Action?


If you don’t want to go through the development process shown in the next section, you can get the completed code
example project at CE203303. You can then jump to the Build and Program steps. The code example is designed for
the CY8CKIT-059; you can easily modify it for other kits.

www.cypress.com Document No. 001-77759 Rev. *G 8


Getting Started with PSoC 5LP

6.2 About The Design


This design is described in detail in code example CE203303, PSoC 3 and PSoC 5LP Breathing LED. It implements
a “breathing LED” effect exclusively in hardware, with no CPU usage beyond initialization. Figure 7 shows the
PSoC Creator schematic.

Figure 7. Breathing LED Schematic (Pin and LED are selected for CY8CKIT-059)

6.3 Part 1: Create the Design


This section takes you through the design process, step by step. It guides you through both hardware and firmware
design entry.
Note: These instructions assume that you are using PSoC Creator 3.3. The overall development process is the same
for other versions of PSoC Creator, however some of the dialog boxes may be different.
1. Create a new PSoC Creator project.
A project contains all of the source code and other files required to create a single output module that can be
downloaded to a target PSoC 5LP device.
A. Start PSoC Creator. Figure 8. Create a New PSoC Creator Project
B. Select menu item
File > New > Project…
as Figure 8 shows.
A Create Project window is displayed.

www.cypress.com Document No. 001-77759 Rev. *G 9


Getting Started with PSoC 5LP

2. Select the project type for the CY8CKIT-059 kit. See Figure 9.
PSoC Creator can speed up the development process by automatically setting various project options for
specified development kits or target devices.
A. Click Target hardware.
B. In the pull-down menu, select Kit: CY8CKIT-059 (PSoC 5LP).
C. Click Next.

Figure 9. Create a New Project for the CY8CKIT-059

www.cypress.com Document No. 001-77759 Rev. *G 10


Getting Started with PSoC 5LP

3. Select an empty schematic as a project template. See Figure 10.


PSoC Creator can speed up the development process by basing a new design on an existing code example. For
this exercise, we will start from an empty schematic.
A. Click Empty Schematic.
B. Click Next.
C. In the next dialog, enter text for a Workspace name. A workspace is a container for one or more projects. A
project is usually contained in a workspace.
D. Enter text for a Project name. The project and workspace names can be the same or different.
E. Specify the Location of your workspace and project.
F. Click Finish.

Figure 10. Create a New Empty Project

D
E

A project is created. Several new panes are displayed: Workspace Explorer, Schematic (TopDesign.cysch),
and Component Catalog.

www.cypress.com Document No. 001-77759 Rev. *G 11


Getting Started with PSoC 5LP

4. Build the hardware portion of the design.


In this step, you drag Components from the Figure 11. Select PWM Component
Component Catalog onto the schematic. You
then configure each Component, and wire
them together.
a. In the Component Catalog window,
Cypress tab, find the PWM Component,
as Figure 11 shows.
b. Drag two instances of the PWM
Component onto the schematic (see
Figure 7).

www.cypress.com Document No. 001-77759 Rev. *G 12


Getting Started with PSoC 5LP

5. Configure the PWM Components, as Figure 12 shows.


This creates square wave outputs from both PWMs; the square waves have slightly different frequencies. The
difference in frequencies results in a beat frequency that is modulated on the LED.
On the schematic, double-click each PWM Component to configure it.
A. For PWM_1, change the PWM Mode to One Output.
B. No other changes need be made to PWM_1. Click OK to close the dialog.
C. For PWM_2, change the PWM Mode to One Output.
D. Set the Period value of PWM_2 to be slightly different from the default.
E. Set the CMP Value 1 of PWM_2 to approximately half the period.
F. Changes for PWM_2 are complete. Click OK to close the dialog.

Figure 12. Configure the PWM Components

A C

E
B
F

6. Drag from the Component Catalog to the schematic, and configure, the additional Components listed in Table 2.
The Off-Chip Components are not required, but help to show the overall purpose of the design.
Note that in each configuration dialog the Name field is automatically populated; you can change the name to
any valid text. Each Component name must be unique in the schematic.

Table 2. Design Components

Component Catalog

Component Tab Group Change from Default Configuration

Logic Low Cypress Digital > Logic none


Xor Cypress Digital > Logic none
Clock Cypress System Set Frequency to 5 kHz
Digital Output Pin Cypress Ports and Pins Check the External terminal box
Resistor Off-Chip Passive none
LED Off-Chip Diodes none
Ground Off-Chip Power none

www.cypress.com Document No. 001-77759 Rev. *G 13


Getting Started with PSoC 5LP

7. Select the wire tool (Figure 13) to connect Figure 13. Select the Wire Tool
the logic (or press ‘w’ as a shortcut).
Wire the Components as Figure 7 shows.

8. At this point, the hardware design is complete, however the Pin Component must still be associated with a
physical pin.
Choose the physical pin for the LED on the development kit that you are using. (For the CY8CKIT-059, the pin
used is port 2, pin 1, pr P2[1].)
A. In the Workspace Explorer window, double-click the .cydwr file in your project, as Figure 14 shows. This
opens the design-wide resources (DWR) window.
B. Select the Pins tab. The Pin Components defined in the project are displayed, as well as a pin diagram of
the target device.
C. Associate the schematic Pin Component with the desired physical pin.

Figure 14. Associate the Pins

9. You must now write a couple of lines of firmware. Before doing so, it is best to have PSoC Creator generate all of
the code that is associated with the Components.
Select the PSoC Creator menu item Build > Figure 15. Generate Application
Generate Application, as Figure 15 shows.
If there are no errors, PSoC Creator
generates several code files, under the folder
Generated_Source.

www.cypress.com Document No. 001-77759 Rev. *G 14


Getting Started with PSoC 5LP

10. Add code to the auto-generated file main.c. It has a framework for adding code; the code that you must add, to
start the two PWM Components, is highlighted, as Code 1 shows. In the Workspace Explorer window, double-
click the main.c file in your project to open it.
Note: This code assumes that the PWM Components have the default names. If you renamed your PWM
Components to something other than the default values, use those names in the _Start() function calls.

Code 1. Main Code for Breathing LED


#include <project.h>

int main()
{
//CyGlobalIntEnable; /* Enable global interrupts. */

/* Place your initialization/startup code here (e.g. MyInst_Start()) */


PWM_1_Start();
PWM_2_Start();

for(;;)
{
/* Place your application code here. */
}
}

11. If you skipped to this step without going through the design process, do the following:
A. Download the code example file CE203303.zip from CE203303, and extract it to a convenient location in
your computer.
B. Download and install PSoC Creator as described in step 1 on page 9.
C. Open the file CE203303.cywrk in PSoC Creator.
D. Confirm that the project pin assignments match your development kit (DVK), as described in step 8 on
page 14.
E. Select the PSoC Creator menu item Figure 16. Build Project
Build > Build <project name>, as
Figure 16 shows. If there are no errors,
the project is built and ready to program
to the target DVK.

www.cypress.com Document No. 001-77759 Rev. *G 15


Getting Started with PSoC 5LP

6.4 Part 2: Program the Device


The programming process is the same for all the development kit boards. To set up your DVK, follow the instructions
in the Kit Guide document.
1. Confirm the connection between PSoC Creator and your DVK.
Select the PSoC Creator menu item Figure 17. Select Debug Target
Debug > Select Debug Target., as
Figure 17 shows.
A. A “Select Debug Target” dialog is
displayed, as Figure 18 shows. Click on
your target DVK (PSoC Creator
supports multiple DVK connections).
B. Click Port Acquire.

Figure 18. Select and Acquire the Target for Programming

www.cypress.com Document No. 001-77759 Rev. *G 16


Getting Started with PSoC 5LP

2. Connect to the PSoC on your target DVK. See Figure 19.


A. Click PSoC 5LP.
B. Click Connect. The “Target unacquired” message changes to “Target acquired”, and the button label
changes to “Disconnect”.
C. Click OK to close the dialog.
PSoC Creator is now connected to the target DVK and PSoC, and you can now program the PSoC.

Figure 19. Connect to the Target PSoC 5LP

3. To program the PSoC 5LP, select the PSoC Figure 20. Program Device
Creator menu item Debug > Program, as
Figure 20 shows.
4. Programming begins; programming status is
displayed in the PSoC Creator status bar
(the lower-left corner of the window, as
Figure 21 shows).
Note: You may see a warning message
“This programmer is currently out of date”.
Refer to the KitProg User Guide in your kit
documentation for information on how to
upgrade your programmer firmware.

Figure 21. Programming Status

On the CY8CKIT-059 DVK, the blue LED gradually transitions from full ON to full OFF over a few seconds.

www.cypress.com Document No. 001-77759 Rev. *G 17


Getting Started with PSoC 5LP

7 Summary
This application note explored the PSoC 5LP architecture and development tools. The most important concept to be
gained from this application note is that PSoC is more than an MCU. PSoC 5LP is a truly programmable embedded
system-on-chip, integrating configurable analog and digital peripheral functions, memory, and a 32-bit Cortex-M3
CPU on a single chip.
Because of the integrated features and low-leakage power modes, PSoC 5LP is an ideal choice for low-power and
cost- effective embedded systems.

8 Related Documents
Table 3 lists system-level and general application notes that are recommended for the next steps in learning about
PSoC and PSoC Creator:

Table 3. General and System-Level Application Notes

Document Document Name

AN61290, PSoC® 3 and PSoC 5LP Hardware Design Considerations,


AN88619 PSoC® 4 Hardware Design Considerations
AN81623 PSoC® 3, PSoC 4, and PSoC 5LP Digital Design Best Practices
AN77900, PSoC® 3 and PSoC 5LP Low-power Modes and Power Reduction Techniques,
AN86233, PSoC® 4 Low-power Modes and Power Reduction Techniques,
AN90114 PSoC® 4000 Low-power Modes and Power Reduction Techniques
AN68403 PSoC® 3 and PSoC 5LP Analog Signal Chain Calibration
AN57821 PSoC® 3, PSoC 4, and PSoC 5LP Mixed-Signal Circuit Board Layout Considerations
AN58827 PSoC® 3 and PSoC 5LP Internal Analog Routing Considerations
AN73854 PSoC® 3, PSoC 4, and PSoC 5LP Introduction to Bootloaders
AN60616 PSoC® 3 and PSoC 5LP Startup Procedure
AN60631 PSoC® 3 and PSoC 5LP Clocking Resources
AN77835 PSoC® 3 to PSoC 5LP Migration Guide
AN78175, PSoC® 3 and PSoC 5LP IEC60730 Class B Safety Software Library,
AN89056 PSoC® 4 IEC60730 Class B Safety Software Library

Table 4 lists application notes (AN), code examples (CE), and knowledge base articles (KBA) that are linked to the
device description in PSoC 5LP Feature Set.

Table 4. Documents Related to PSoC 5LP Features

Document Document Name

CPU and Interrupts

AN89610 PSoC® 4 and PSoC 5LP Arm Cortex Code Optimization


AN54460 PSoC® 3 and PSoC 5LP Interrupts

Memory

CE95313 PSoC® 3, PSoC 4, and PSoC 5LP Emulated EEPROM Memory

Direct Memory Access (DMA)

AN52705 PSoC® 3 and PSoC 5LP – Getting Started with DMA


AN84810 PSoC® 3 and PSoC 5LP Advanced DMA Topics
AN61102 PSoC® 3 and PSoC 5LP – ADC Data Buffering Using DMA

www.cypress.com Document No. 001-77759 Rev. *G 18


Getting Started with PSoC 5LP

Document Document Name

CE95375 SPI Master and DMA with PSoC® 3 and PSoC 5LP
CE95376 SPI Slave and DMA with PSoC® 3 and PSoC 5LP

Digital Filter Block (DFB)

CE95316 Filter From to ADC to VDAC Using DFB with PSoC® 3 and PSoC 5LP
CE95317 Filter From to ADC to VDAC Using DFB in Polling Mode with PSoC® 3 and PSoC 5LP

I2C

CE95324 I2C LCD with PSoC® 3 and PSoC 5LP


CE95314 PSoC® 3, PSoC 4, and PSoC 5LP EZI2C

USB

AN57294 USB 101: An Introduction to Universal Serial Bus 2.0


AN57473 USB HID Basics with PSoC® 3 and PSoC 5LP
AN58726 USB HID Intermediate with PSoC® 3 and PSoC 5LP
AN56377 PSoC® 3 and PSoC 5LP – Introduction to Implementing USB Data Transfers
AN82072 PSoC® 3 and PSoC 5LP USB General Data Transfer with Standard HID Drivers
AN73503 USB HID Bootloader for PSoC® 3 and PSoC 5LP
CE95390 USB Audio with PSoC® 3 and PSoC 5LP
CE95395 USB MIDI with PSoC® 3 and PSoC 5LP
CE95394 USB HID Mouse with PSoC® 3 and PSoC 5LP
CE95393 USB Bulk Transfer with PSoC® 3 and PSoC 5LP
CE95392 USB Bootloader with PSoC® 3 and PSoC 5LP
CE95396 USB UART with PSoC® 3 and PSoC 5LP

Controller Area Network (CAN)

AN52701 PSoC® 3 and PSoC 5LP – Getting Started with Controller Area Network (CAN)
CE95282 CAN as Control Node with PSoC® 3 and PSoC 5LP
CE95283 CAN as Remove Node with PSoC® 3 and PSoC 5LP
KBA86565 Difference Between Full CAN and Basic CAN Mailbox
KBA86566 Acceptance Filter Implementation for CAN Receive Message
KBA86567 Modifying the Full CAN Mailbox’s Identifier in the Program

Universal Digital Blocks (UDB)

AN82250 PSoC® 3, PSoC 4, and PSoC 5LP – Implementing Programmable Logic Designs with Verilog
AN82156 PSoC® 3, PSoC 4, and PSoC 5LP – Designing PSoC CreatorTM Components with UDB Datapaths
CE95295 8-Bit UDB Counter with PSoC® 3 and PSoC 5LP
CE95384 16-Bit UDB-Based Timer with PSoC® 3 and PSoC 5LP
CE95323 Hardware Fan Control with PSoC® 3 and PSoC 5LP
KBA85325 Comparison of Resource Utilization Between PSoC® 3 and PSoC 5LP UDBs and Other Vendor CPLDs
KBA86336 Just Enough Verilog for PSoC®

Analog to Digital Converter (ADC)

AN84783 Accurate Measurement Using PSoC® 3 and PSoC 5LP Delta-Sigma ADC

www.cypress.com Document No. 001-77759 Rev. *G 19


Getting Started with PSoC 5LP

Document Document Name

CE95277 Delta-Sigma ADC in Single-Ended Mode with PSoC® 3 and PSoC 5LP
CE95271 Delta-Sigma ADC in Differential Mode with PSoC® 3 and PSoC 5LP
CE95276 Sequencing SAR ADC with PSoC® 3 and PSoC 5LP
KBA81866 Best Method of Amplification to Get Better Performance from PSoC® 3 and PSoC 5LP Delta-Sigma ADC
KBA84753 Choice of Reference Voltage for Accurate ADC Measurements in PSoC® 3, PSoC 4 and PSoC 5LP

Digital to Analog Converter (DAC)

AN60305 Using PSoC® 3 and PSoC 5LP IDACs to build a better VDAC
AN64275 PSoC® 3 and PSoC 5LP: Getting More Resolution from 8-Bit DACs
AN69133 PSoC® 3 and PSoC 5LP Easy Waveform Generation with the WaveDAC8 Component
CE95397 Voltage DAC with PSoC® 3 and PSoC 5LP
CE95309 Dithered Voltage DAC with PSoC® 3 and PSoC 5LP
KBA84732 VDAC8 Output Voltage in PSoC® 3 and PSoC 5LP
KBA83238 Driving an External Load using VDAC in PSoC® 3 or PSoC 5LP

Comparator

AN60220 PSoC® 3 and PSoC 5LP Multiplexed Comparator


CE95292 Analog Voltage Comparator with PSoC® 3 and PSoC 5LP
CE95361 Scanning Comparator Using Internal VDAC with PSoC® 3 and PSoC 5LP
CE95360 Scanning Comparator Using Common Mode with PSoC® 3, PSoC 4, and PSoC 5LP

Operational Amplifier (Opamp)

CE95339 Operational Amplifier (Opamp) with PSoC® 3 and PSoC 5LP

Programmable Analog Block (SC/CT)

AN60321 Peak Detection with PSoC® 3 and PSoC 5LP


AN62582 AM Modulation and Demodulation
CE95342 Programmable Gain Amplifier (PGA) with PSoC® 3 and PSoC 5LP
CE95343 Inverting Programmable Gain Amplifier with PSoC® 3 and PSoC 5LP
CE95383 Transimpedance Amplifier (TIA) with PSoC® 3 and PSoC 5LP
CE95357 Sample and Hold with PSoC® 3 and PSoC 5LP
CE95337 Analog Signal Mixer with PSoC® 3 and PSoC 5LP

CapSense

AN75400 PSoC® 3 and PSoC 5LP CapSense® Design Guide


CE95287 CapSense® CSD Using Tuner with PSoC® 3 and PSoC 5LP
CE95284 CapSense® CSD Design with PSoC® 3 and PSoC 5LP

I/O

AN72382 Using PSoC® 3 and PSoC 5LP GPIO Pins


AN60580 SIO Tips and Tricks in PSoC® 3 and PSoC 5LP
KBA82883 Controlling a PSoC® 3 and PSoC 5LP GPIO in Firmware
KBA91716 Differences Between SIO and GPIO Pins in PSoC® 3 and PSoC 5LP

www.cypress.com Document No. 001-77759 Rev. *G 20


Getting Started with PSoC 5LP

Document Document Name

Segment LCD

AN52927 PSoC® 3 and PSoC 5LP - Segment LCD Direct Drive


CE95368 Segment LCD with PSoC® 5LP

About the Author


Name: Nidhin MS
Title: Applications Engineer Sr.
Background: Nidhin graduated from GEC Thrissur, with a Bachelor's degree in Electronics and
Communication Engineering. His technical interests are analog signal processing, low-
power design, and capacitive touch sensing.

www.cypress.com Document No. 001-77759 Rev. *G 21


Getting Started with PSoC 5LP

Document History
Document Title: AN77759 - Getting Started with PSoC 5LP
Document Number: 001-77759

Revision ECN Orig. of Submission Description of Change


Change Date

** 3554384 ROSS 03/20/2012 New application note


*A 3819945 RNJT 11/23/2012 Updated for PSoC 5LP
*B 3866015 RNJT 01/11/2013 Fixed PSoC 5LP links
*C 4592410 MKEA 12/10/2014 Added PSoC Resources section.
Updated for PSoC Creator 3.0 SP2
Edits and rewrites throughout.
*D 4645196 NIDH 02/17/2015 Updated for PSoC Creator 3.1
Updated template
Sunset review
*E 5013158 MKEA 11/25/2015 Deleted attached project; transferred it to code example CE203303. Added
references to the code example.
Updated for PSoC Creator 3.3
Expanded Related Documents section
Miscellaneous minor edits, mainly to better align with AN79953, Getting Started
with PSoC 4
*F 5834826 AESATMP8 07/27/2017 Updated logo and Copyright.
*G 6134854 NIDH 04/12/2018 Added "More Code Examples" boilerplate on page 1.
Updated "PSoC Resources" section to include PSoC 6.
Updated the template.

www.cypress.com Document No. 001-77759 Rev. *G 22


Getting Started with PSoC 5LP

Worldwide Sales and Design Support


Cypress maintains a worldwide network of offices, solution centers, manufacturer’s representatives, and distributors. To find
the office closest to you, visit us at Cypress Locations.

Products
PSoC® Solutions
Arm® Cortex® Microcontrollers cypress.com/arm
PSoC 1 | PSoC 3 | PSoC 4 | PSoC 5LP | PSoC 6 MCU
Automotive cypress.com/automotive
Clocks & Buffers cypress.com/clocks Cypress Developer Community
Interface cypress.com/interface Forums | WICED IOT Forums | Projects | Videos | Blogs |
Training | Components
Internet of Things cypress.com/iot
Memory cypress.com/memory Technical Support
Microcontrollers cypress.com/mcu cypress.com/support
PSoC cypress.com/psoc
Power Management ICs cypress.com/pmic
Touch Sensing cypress.com/touch
USB Controllers cypress.com/usb
Wireless Connectivity cypress.com/wireless

All other trademarks or registered trademarks referenced herein are the property of their respective owners.

Cypress Semiconductor
198 Champion Court
San Jose, CA 95134-1709

© Cypress Semiconductor Corporation, 2012-2018. This document is the property of Cypress Semiconductor Corporation and its subsidiaries, including
Spansion LLC (“Cypress”). This document, including any software or firmware included or referenced in this document (“Software”), is owned by
Cypress under the intellectual property laws and treaties of the United States and other countries worldwide. Cypress reserves all rights under such
laws and treaties and does not, except as specifically stated in this paragraph, grant any license under its patents, copyrights, trademarks, or other
intellectual property rights. If the Software is not accompanied by a license agreement and you do not otherwise have a written agreement with
Cypress governing the use of the Software, then Cypress hereby grants you a personal, non-exclusive, nontransferable license (without the right to
sublicense) (1) under its copyright rights in the Software (a) for Software provided in source code form, to modify and reproduce the Software solely for
use with Cypress hardware products, only internally within your organization, and (b) to distribute the Software in binary code form externally to end
users (either directly or indirectly through resellers and distributors), solely for use on Cypress hardware product units, and (2) under those claims of
Cypress’s patents that are infringed by the Software (as provided by Cypress, unmodified) to make, use, distribute, and import the Software solely for
use with Cypress hardware products. Any other use, reproduction, modification, translation, or compilation of the Software is prohibited.
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. No computing device can be absolutely secure. Therefore, despite security
measures implemented in Cypress hardware or software products, Cypress does not assume any liability arising out of any security breach, such as
unauthorized access to or use of a Cypress product. In addition, the products described in these materials may contain design defects or errors known
as errata which may cause the product to deviate from published specifications. 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, WICED, 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 of their respective owners.

www.cypress.com Document No. 001-77759 Rev. *G 23

You might also like