AN54181 Getting Started with PSoC® 3.pdf

AN54181
Getting Started with PSoC® 3
Author: Nidhin MS
Associated Part Family: All PSoC 3 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/AN54181.
®
AN54181 introduces you to PSoC 3, an 8051-based programmable system-on-chip. It describes the PSoC 3
architecture and development environment, and shows you how to create a simple design using PSoC Creator™, the
development tool for PSoC 3. This application note also guides you to more resources for in-depth learning about
PSoC 3 as well as PSoC in general.
Contents
1
2
3
Introduction ...............................................................1
PSoC Resources ......................................................2
PSoC Creator ...........................................................2
3.1
PSoC Creator Help ..........................................3
3.2
Technical Support ............................................3
4
Code Examples ........................................................4
5
PSoC 3 Feature Set .................................................5
5.1
PSoC is More Than an MCU ...........................7
5.2
The Concept of PSoC Creator Components ....7
1
6
My First PSoC 3 Design ........................................... 8
6.1
Before You Begin ............................................ 8
6.2
About The Design ............................................ 9
6.3
Part 1: Create the Design ................................ 9
6.4
Part 2: Program the Device ........................... 16
7
Summary ................................................................ 18
8
Related Documents ................................................ 18
Worldwide Sales and Design Support ............................. 23
®
PSoC Solutions ............................................................. 23
Technical Support ........................................................... 23
Introduction
PSoC 3 is a true programmable embedded system-on-chip, integrating custom analog and digital peripheral
functions, memory, and an 8051 CPU on a single chip.
PSoC 3 provides a cost-effective alternative to the combination of MCU and external ICs. The PSoC 3 architecture
boosts performance through:




8-bit 8051 core plus DMA controller and digital filter processor, at up to 67 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.
Using this Document
The next few pages describe the PSoC 3 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 3 Design. The design created in this section
is also available in code example CE203303.
www.cypress.com
Document No. 001-54181 Rev. *L
1
Getting Started with PSoC® 3
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:
3


Overview: PSoC Portfolio, PSoC Roadmap

Datasheets: Describe and provide electrical
specifications for the PSoC 3, PSoC 4, and
PSoC 5LP device families.

CapSense Design Guides: Learn how to
design capacitive touch-sensing applications
with the PSoC 3, PSoC 4, and PSoC 5LP
families 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.
Product Selectors: PSoC 1, PSoC 3,
PSoC 4, or PSoC 5LP. In addition, PSoC
Creator includes a device selection tool.
®

Technical Reference Manuals (TRM): Provide
detailed descriptions of the architecture and registers
in each of the PSoC 3, PSoC 4, and PSoC 5LP
device families.

PSoC Training Videos: These videos provide stepby-step instructions on how to get started building
complex designs with PSoC.

Development Kits:

CY8CKIT-030 is designed for analog performance.
It enables you to develop and evaluate highprecision analog, low-power, and low-voltage
applications.

CY8CKIT-001 provides a common development
platform where you can prototype and evaluate
different solutions using any one of the PSoC 1,
PSoC 3, PSoC 4, or PSoC 5LP architectures..
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:
3. Configure Components using configuration tools
1. Drag and drop Components for hardware
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
Figure 1. PSoC Creator Features
www.cypress.com
Document No. 001-54181 Rev.*L
2
Getting Started with PSoC® 3
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:
3.2

Quick Start Guide: Choose the menu item Help > Documentation > Quick Start Guide. This guide gives you
the basics for developing PSoC Creator projects.

Simple Component example projects: Choose the menu item File > Open > Example projects. These
example projects demonstrate how to configure and use PSoC Creator Components.

Starter designs: Choose the menu item File > New > Project > PSoC 3 Starter Designs. These starter
designs demonstrate the unique features of PSoC 3.

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 3 Component
Datasheets page for a list of all PSoC 3 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.
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-5414736. Select option 8 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-54181 Rev.*L
3
Getting Started with PSoC® 3
4
Code Examples
Figure 2. Code Examples in PSoC Creator
PSoC Creator includes a large number of code example projects.
These projects are available from the PSoC Creator Start Page,
as Figure 2 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 are
used in various applications. Code examples and datasheets are
included, as Figure 3 shows.
In the Find Example Project dialog shown in Figure 3, 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
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.
for
the
selection
(on
the
Figure 3. Code Example Projects, with Sample Code
www.cypress.com
Document No. 001-54181 Rev.*L
4
Getting Started with PSoC® 3
5
PSoC 3 Feature Set
PSoC 3 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 CY8C38xx device family).
For more information, see the PSoC 3 family device datasheets, technical reference manuals (TRMs), and
application notes listed previously.
Figure 4. PSoC 3 Architecture (CY8C38xx)
Analog Interconnect
Quadrature Decoder
UDB
UDB
UDB
UDB
Sequencer
Usage Example for UDB
IMO
Universal Digital Block Array ( 24 x UDB)
8-bit
Timer
16-bit
PWM
UDB
UDB
UDB
UDB
UDB
UDB
UDB
UDB
22 
UDB
UDB
UDB
FS USB
2.0
4x
Timer
Counter
PWM
12-bit SPI
UDB
Master/
Slave
UDB
UDB
8-bit
Timer
Logic
UDB
8-bit SPI
I 2C Slave
UDB
I2C
CAN
2.0
16-bit PRS
Logic
UDB
UDB
UART
UDB
UDB
USB
PHY
GPIOs
GPIOs
Clock Tree
32.768 KHz
( Optional)
Digital System
System Wide
Resources
Xtal
Osc
SIO
4 to 25 MHz
(Optional)
GPIOs
Digital Interconnect
12- bit PWM
RTC
Timer
System Bus
WDT
and
Wake
EEPROM
CPU System
8051 CPU
SRAM
Interrupt
Controller
Program &
Debug
GPIOs
Memory System
Program
GPIOs
Debug &
Trace
EMIF
PHUB
DMA
FLASH
ILO
Boundary
Scan
Power Management
System
LCD Direct
Drive
Analog System
Digital
Filter
Block
ADC
POR and
LVD
1.8V LDO
SMP
+
4x
Opamp
-
3 per
Opamp
4 x SC/CT Blocks
(TIA, PGA, Mixer etc)
Temperature
Sensor
1x
Del Sig
ADC
4 x DAC
+
4x
CMP
-
GPIOs
1 .71 V to
5.5 V
Sleep
Power
GPIOs
SIOs
Clocking System
CapSense
0 .5 V to 5.5 V
( Optional)
Following is a list of major features of the PSoC 3. For details, see Related Documents, or see a PSoC 3 device
datasheet.


Performance




DC to 67-MHz operation
8-bit 8051 CPU, 32 interrupts
24-channel direct memory access (DMA)
controller
24-bit 64-tap digital filter processor (DFB)
www.cypress.com
Memories


Up to 64 KB program flash


Up to 8 KB of SRAM
Up to 8 KB additional flash for error correcting code
(ECC)
2 KB EEPROM
Document No. 001-54181 Rev.*L
5
Getting Started with PSoC® 3


Digital peripherals

Up to four 16-bit timer, counter, and PWM
(TCPWM)




I C, 1-Mbps bus speed

Full CAN 2.0b, 16 Rx, 8 Tx buffers




20 to 24 universal digital blocks (UDB),
programmable to create any number of
functions:
8-, 16-, 24-, and 32-bit timers, counters,
and PWMs
2
I C, UART, SPI, I2S, and LIN 2.0
interfaces
Cyclic redundancy check (CRC)
Pseudo random sequence (PRS)
generators
Quadrature decoders
Gate-level logic functions
Analog Subsystem





Configurable 8- to 20-bit delta-sigma ADC
Four 8-bit DACs
Four comparators
Four operational amplifiers (opamps)




Four programmable analog blocks,
create:
Programmable gain amplifier (PGA)
Transimpedance amplifier (TIA)
Mixer
Sample and hold (S/H) circuit
to
46 to 72 I/O pins; up to 62 general-purpose I/Os
(GPIOs)
Up to eight performance I/O (SIO) pins
25 mA current sink
Programmable input threshold and output high
voltages
 Can act as a general-purpose comparator
 Hot swap capability and overvoltage tolerance


USB 2.0-certified Full-Speed (FS) 12 Mbps




2


Versatile I/O system



Two USBIO pins that can be used as GPIOs


CapSense support from any GPIO

Route any digital or analog peripheral to any GPIO
LCD direct drive from any GPIO, up to 46 × 16
segments
1.2-V to 5.5-V interface voltages, up to four power
domains
Programmable clocking

3- to 62-MHz internal oscillator, 1% accuracy at
3 MHz





4- to 25-MHz external crystal oscillator
Internal PLL clock generation up to 67 MHz
Low-power internal oscillator at 1, 33, and 100 kHz
32.768-kHz external watch crystal oscillator
12 clock dividers routable to any peripheral or I/O
Refer to the datasheet for a full review of PSoC 3 features.
®
CapSense support, up to 62 sensors
1.024 V ±0.1% internal voltage reference
www.cypress.com
Document No. 001-54181 Rev.*L
6
Getting Started with PSoC® 3
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
Gen I/O
Port B
Gen I/O
Digital System
(w/ Programmable Logic)
Gen I/O
UART
ADC
Gen I/O
Port A
Figure 6. PSoC 3 Block Diagram
PWM
Gen I/O
Port D
System Interconnect
Analog System
Gen I/O
Port C
8051
Gen I/O
Timer
Gen I/O
I2C
Gen I/O
SPI
ARM
CPU
DAC
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 3 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-54181 Rev.*L
7
Getting Started with PSoC® 3
Pin Component: Connect Any Function to Any Pin
PSoC 3 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 3 has programmable digital blocks called Universal Digital Blocks (UDBs). PSoC Creator provides a number of
2
Components made from the UDBs. These include UART, SPI, I C, 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 3 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 3 Design
This section does the following:



6.1
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
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 3. Kits are also available from other manufacturers.
Table 1. Cypress PSoC 3 Kits
PSoC 3 Kit
PSoC 3 Device Part Number
Programming
CY8CKIT-030
CY8C3866AXI-040
Integrated programmer
CY8CKIT-001
CY8C3866AXI-040
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 PSoC 5LP-based CY8CKIT-059; you can easily modify it for PSoC 3 kits.
www.cypress.com
Document No. 001-54181 Rev.*L
8
Getting Started with PSoC® 3
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 3 device.
A.
Start PSoC Creator.
B.
Select menu item
File > New > Project…
as Figure 8 shows.
Figure 8. Create a New PSoC Creator Project
A Create Project window is displayed.
www.cypress.com
Document No. 001-54181 Rev.*L
9
Getting Started with PSoC® 3
2.
Select PSoC 3 as the target device. See Figure 9.
PSoC Creator can speed up the development process by automatically setting various project options for
specified target devices or development kits.
A.
Click Target device.
B.
In the pulldown menu, select PSoC 3.
C.
Click Next.
Figure 9. Create a New Project for the CY8CKIT-059
A
B
C
www.cypress.com
Document No. 001-54181 Rev.*L
10
Getting Started with PSoC® 3
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
A
B
C
D
E
F
A project is created. Several new panes are displayed: Workspace Explorer, Schematic (TopDesign.cysch),
and Component Catalog.
www.cypress.com
Document No. 001-54181 Rev.*L
11
Getting Started with PSoC® 3
4.
Build the hardware portion of the design.
In this step, you drag Components from the
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-54181 Rev.*L
Figure 11. Select PWM Component
12
Getting Started with PSoC® 3
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
C
A
D
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
www.cypress.com
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
Document No. 001-54181 Rev.*L
13
Getting Started with PSoC® 3
7.
Select the wire tool (Figure 13) to connect
the logic (or press ‘w’ as a shortcut).
Figure 13. Select the Wire Tool
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-030, the pin
used can be port 6, either pin 2 or pin 3, also referred to as P6[2] or P6[3].)
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
A
C
B
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 >
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-54181 Rev.*L
Figure 15. Generate Application
14
Getting Started with PSoC® 3
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, doubleclick 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.
B.
C.
D.
E.
F.
Download the code example file CE203303.zip from CE203303, and extract it to a convenient location in
your computer.
Download and install PSoC Creator as described in step 1 on page 9.
Open the file CE203303.cywrk in PSoC Creator.
Confirm that the project pin assignments match your development kit (DVK), as described in step 8 on
page 14.
In the Workspace Explorer window,
Figure 16. Build Project
right-click the project name, select
Device
Selector,
and
select
CY8C3866AXI-040 as the target device.
Select the PSoC Creator menu item
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-54181 Rev.*L
15
Getting Started with PSoC® 3
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
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 17. Select Debug Target
Figure 18. Select and Acquire the Target for Programming
A
B
www.cypress.com
Document No. 001-54181 Rev.*L
16
Getting Started with PSoC® 3
2.
Connect to the PSoC on your target DVK. See Figure 19.
A.
Click the PSoC 3.
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 3
A
B
C
3.
To program the PSoC 3, select the PSoC
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).
Figure 20. Program Device
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-030 DVK, a red LED gradually transitions from full ON to full OFF over a few seconds.
www.cypress.com
Document No. 001-54181 Rev.*L
17
Getting Started with PSoC® 3
7
Summary
This application note explored the PSoC 3 architecture and development tools. The most important concept to be
gained from this application note is that PSoC is more than an MCU. PSoC 3 is a truly programmable embedded
system-on-chip, integrating configurable analog and digital peripheral functions, memory, and an 8051 CPU on a
single chip.
Because of the integrated features and low-leakage power modes, PSoC 3 is an ideal choice for low-power and costeffective 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,
AN88619
PSoC® 3 and PSoC 5LP Hardware Design Considerations,
PSoC® 4 Hardware Design Considerations
AN81623
PSoC® 3, PSoC 4, and PSoC 5LP Digital Design Best Practices
AN77900,
AN86233,
AN90114
PSoC® 3 and PSoC 5LP Low-power Modes and Power Reduction Techniques,
PSoC® 4 Low-power Modes and Power Reduction Techniques,
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,
AN89056
PSoC® 3 and PSoC 5LP IEC60730 Class B Safety Software Library,
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 3 Feature Set.
Table 4. Documents Related to PSoC 3 Features
Document
Document Name
CPU and Interrupts
AN60630
PSoC® 3 8051 Code and Memory 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-54181 Rev.*L
18
Getting Started with PSoC® 3
Document
Document Name
CE95375
CE95376
SPI Master and DMA with PSoC® 3 and PSoC 5LP
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
www.cypress.com
Accurate Measurement Using PSoC® 3 and PSoC 5LP Delta-Sigma ADC
Document No. 001-54181 Rev.*L
19
Getting Started with PSoC® 3
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-54181 Rev.*L
20
Getting Started with PSoC® 3
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, lowpower design, and capacitive touch sensing.
www.cypress.com
Document No. 001-54181 Rev.*L
21
Getting Started with PSoC® 3
Document History
®
Document Title: AN54181 - Getting Started with PSoC 3
Document Number: 001-54181
Revision
ECN
Orig. of
Change
Submission
Date
Description of Change
**
2724905
TDU
06/26/2009
New Application Note
*A
2749147
FSU
08/06/2009
Minor change to remove the document from the web.
*B
2786097
TDU
10/13/2009
Minor change to post the document to external web.
*C
2880116
TDU
02/17/2010
Updated content from Beta 3 to Beta 4. Changed the Digital Ports to Digital Output
Pins.
*D
3048871
UDAY
10/05/2010
Changed title. Added Associated Project. Removed Figure 1. Replaced
screenshots. Added FTK programming instructions. Added Additional Resources.
Changed pins P0[7] and P1[7] to P2[0] and P2[1], respectively. Edits to Building My
First PSoC 3 Design.
*E
3287465
ROSS
06/17/2011
Complete rewrite of the application note. Added discussion about PSoC and the
variations between families. Included some specific discussion about PSoC 3.
Changed the project design to perform a different kind of blinking. Added support
for the CY8CKIT-030.
*F
3292422
ROSS
06/24/2011
Renamed the project file.
*G
3358169
ROSS
08/30/2011
Target demo boards use AXI device. Project file updated to work with AXI device
from AXA device.
*H
3451203
ROSS
12/14/2011
Template Update
Minor code update to support PSoC Creator 2.0.
Some improvements to the organization of the text.
*I
3820056
RNJT
11/23/2012
Updated for PSoC 5LP.
*J
4466134
NIDH
08/05/2014
Updated the abstract and introduction. Removed the comparison of PSoC devices,
and provided the link to PSoC platform roadmap instead. Added related application
notes.
*K
4592410
MKEA
12/10/2014
Added PSoC Resources section.
Updated for PSoC Creator 3.0 SP2.
Edits and rewrites throughout.
*L
5013167
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
www.cypress.com
Document No. 001-54181 Rev.*L
22
Getting Started with PSoC® 3
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.
PSoC® Solutions
Products
Automotive
cypress.com/go/automotive
psoc.cypress.com/solutions
Clocks & Buffers
cypress.com/go/clocks
PSoC 1 | PSoC 3 | PSoC 4 | PSoC 5LP
Interface
cypress.com/go/interface
Cypress Developer Community
Lighting & Power Control
cypress.com/go/powerpsoc
cypress.com/go/plc
Community | Forums | Blogs | Video | Training
Memory
cypress.com/go/memory
Technical Support
PSoC
cypress.com/go/psoc
cypress.com/go/support
Touch Sensing
cypress.com/go/touch
USB Controllers
cypress.com/go/usb
Wireless/RF
cypress.com/go/wireless
PSoC is a registered trademark and PSoC Creator is a trademark of Cypress Semiconductor Corp. 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
Phone
Fax
Website
: 408-943-2600
: 408-943-4730
: www.cypress.com
© Cypress Semiconductor Corporation, 2009-2015. The information contained herein is subject to change without notice. Cypress Semiconductor
Corporation assumes no responsibility for the use of any circuitry other than circuitry embodied in a Cypress product. Nor does it convey or imply any
license under patent or other rights. Cypress products are not warranted nor intended to be used for medical, life support, life saving, critical control or
safety applications, unless pursuant to an express written agreement with Cypress. Furthermore, Cypress does not authorize its products for use as
critical components in life-support systems where a malfunction or failure may reasonably be expected to result in significant injury to the user. The
inclusion of Cypress products in life-support systems application implies that the manufacturer assumes all risk of such use and in doing so indemnifies
Cypress against all charges.
This Source Code (software and/or firmware) is owned by Cypress Semiconductor Corporation (Cypress) and is protected by and subject to worldwide
patent protection (United States and foreign), United States copyright laws and international treaty provisions. Cypress hereby grants to licensee a
personal, non-exclusive, non-transferable license to copy, use, modify, create derivative works of, and compile the Cypress Source Code and derivative
works for the sole purpose of creating custom software and or firmware in support of licensee product to be used only in conjunction with a Cypress
integrated circuit as specified in the applicable agreement. Any reproduction, modification, translation, compilation, or representation of this Source
Code except as specified above is prohibited without the express written permission of Cypress.
Disclaimer: CYPRESS MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS MATERIAL, INCLUDING, BUT
NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress reserves the
right to make changes without further notice to the materials described herein. Cypress does not assume any liability arising out of the application or
use of any product or circuit described herein. Cypress does not authorize its products for use as critical components in life-support systems where a
malfunction or failure may reasonably be expected to result in significant injury to the user. The inclusion of Cypress’ product in a life-support systems
application implies that the manufacturer assumes all risk of such use and in doing so indemnifies Cypress against all charges.
Use may be limited by and subject to the applicable Cypress software license agreement.
www.cypress.com
Document No. 001-54181 Rev.*L
23