PSoC Designer™, Programmable System-on-Chip™, and PSoC Express™ are trademarks and PSoC® is a registered
trademark of Cypress Semiconductor Corp. I²C is a registered trademark of Philips Electronics. All other trademarks or registered trademarks referenced herein are property of the respective corporations.
Any Source Code (software and/or firmware) is owned by Cypress Semiconductor Corporation (Cypress) and is protected by
and subject to worldwide patent protection (United States and foreign), United States copyright laws and international treaty
provisions. Cypress hereby grants to licensee a personal, non-exclusive, non-transferable license to copy, use, modify, create
derivative works of, and compile the Cypress Source Code and derivative works for the sole purpose of creating custom software and or firmware in support of licensee product to be used only in conjunction with a Cypress integrated circuit as specified in the applicable agreement. Any reproduction, modification, transla tion, 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 furthe r 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.
The PSoC® FirstTouch™ Kit includes a USB interface dongle, re ferred to as the FTPC bridge, a nd a
multifunction expansion card, referred to as the FTMF Expansion Card. The FTMF Expansion Card
demonstrates a variety of applications using ‘PSoC Powered Peripherals’. The FTMF Expansion
Card connects to the bridge through the bridge’s built-in 8x2 pin expansion port. As the name
implies, the FTPC bridge forms the connection between the FTMF Expansion Card and the various
PC applications that control and communicate with the FTMF Expan sion Card.
The FTPC bridge portion of the kit contains a programmed Cypress CY8C24894 PSoC that performs all of the USB and expansion card interface functions. The firmware that is run by this PSoC
performs the primary functions listed.
■ Functions as a USB physical and logical interface
■ Provides PSoC MiniProg emulation for In System Serial Programming (ISSP) of the expansion
cards
■ Provides communications with the PSoC programming utility
■ Performs HID data channel communications
■ Performs expansion card I2C™ communications
■ Performs expansion card SPI communications
There are no other active components inside of the FTPC bridg e. All of these interfaces run on a single PSoC device. Future pr ojects for the FirstTouch Kit allow you to modify the FTPC firmware and
try some USB Interface designs of your own.
The FirstTouch expansion card connects to the FTPC bridge through the bridge’s 8x2 pin expansion
port. This expansion port provides all of the necessary signals to program the host PSoC on the
expansion card. The expansion port also provides power, ground, and I2C or SPI communications to
and from the expansion card host PSoC and PC.
Since the FirstTouch expansion card has a dedicated host PSoC, once programmed with your
design, the expansion cards can operate either detached from the FTPC bridge in standalone mode
or connected to your system hardware. Obviously, it is necessary to provide power and ground for
the expansion card to operate in either of these two arr an ge m en ts.
There are four unused analog or digital GPIO pins on the FTPC port and four unused analog or digital GPIO pins on the expansion card. This allows you to create custom designs and connect signals
you want to the FTPC bridge or the FirstTouch expansion cards.
This section serves as a chronicle of the CY3270 PSoC® FirstTouch™ Guide.
CY3270 PSoC® FirstTouch™ Guide History
Release
Date
09/05/07
a
PSoC Express 3.0 generates the firmware.
Firmware
Revision
See Note
Guide
Version
a
**ARIThis guide is a new document.
OriginatorDescription of Change
1.2Document Conventions
This guide uses the Courier New font to distinguish file location and source code examples from
regular text. File names are presented in italics text. Keyboard commands are bolded.
2.1Install Hardware and Run the CapSense Touch Sensing Design
To install the kit hardware and run the CapSense touch sensing design, do as follows:
1. Remove both end caps from the FTPC Bridge and then connect the FTMF Expansion Card into
the header of the FTPC Bridge such that ‘Cypress Perform’ is visible on both boards. Insert the
assembled kit into your computer USB port. Select Cancel in the ‘Found New Hardware Wizard’
window that appears.
2. Slide finger along the CapSense Touch Sensing slider found on the furthe st point away from your
computer. Notice the LED variation based on the position of your finger on the slider. This is the
CapSense Touch Sensing Design working right out of the box.
2.2Install Software
To install the software, proceed as follows:
1. Remove the PSoC FirstTouch Starter Kit from your computer USB port.
2. Insert the FirstTouch Kit CD-ROM into your computer. The CD is designed to ‘Auto Run’ and the
PSoC Express installation menu should appear. Alternatively, you can double click on the Auto-run.exe file in the root directory of the CD-ROM to get the installation menu.
3. From the PSoC Express installation menu, select Install PSoC Programmer. When that is com-
plete, select Install .NET Framework. When that is complete, select Install PSoC Express and
then select Express Pack 1 for PSoC Express in that order (You can also find the latest software versions at www.cypress.com/FirstTouch). For each installation, follow the instructions
issued by the installation wizard. To copy the kit documents to your computer, select Install First-Touch kit documentation. This copies the documents to the C:\Cypress\CY3270 directory.
4. Once the software installations are complete, click Exit in the PSoC Express Installation Menu.
5. Insert the PSoC FirstTouch Starter Kit (FTPC Bridge and FTMF Expansion Card connected) into
your computer USB port. In the ‘Found New Hardware Wizard’ window, select No, not this time.
In the second ‘Found New Hardware Wizard’ window , select Install the software automatically .
Alternatively, direct the New Hardware wizard to \..\Program Files\Cypress MicroSys-tems\PSoC Programmer\drivers\ on your computer. If prompted with a 'Driver V erification'
message, click Continue Anyway.
2.3Run the Temperature, Light, and CapSense Proximity Sensing
Designs
To run the temperature, light, and CapSense proximity sensing designs do as follows:
1. Launch PSoC Express.
2. From the Express Design Catalog, expand the ‘CY3270-PSoC FirstTouch Kit’ folder, and double
3. From the top menu bar, click Build and then select Generate/Build {your project name}
Project. Click Next in the following two screens.
4. From the top menu bar, click Program and then select Programmer. Within the Programmer
window, select Port > FirstTouch and set the Programming Mode button to Reset. Select the File Load button. Within the ‘Open’ window, double-click {your project name}.hex located in
{your project folder}\{your project name}\output under the default \..\My
Documents folder or the alternate folder you designated. Then , click th e Program button.
5. Once programming completes successfully, verify the project operation by doing as follows:
a. Temperature Sensing–the LED color varies based on changes in the ambient temperature
(the buzzer sounds at extreme temperatures).
b. Light Sensing–the LED intensity varies based on changes in the ambient light.
c. CapSense Proximity Sensing–the LED color varies based on your hand’s proximity to the
board.
2.4FTMF Expansion Card Demonstrations
The FTMF Expansion Card provided in your kit is capable of supporting a variety of demonstrations.
Each demonstration has an associated PSoC Express project and data sheet that describes the
operation and usage of each of the demonstrations in det ail. Since the FTMF expansion card has its
own PSoC, you can remove it from the FTPC bridge and insert it into your target hardware or other
development platform. In order to observe each of the var iou s FT MF de monstr ations, it is nece ssa ry
to reprogram the FTMF card with the appropriate demonstration firmware. For more details refer to
the Technical Reference chapter on page 17.
The pre-programmed CapSense Touch Sensing demonstration shows how to use the CapSense
Touch Sensing slider to control LED color. Run your finger across the CapSense Touch Sensing
slider (see Figure 2-1) and notice how the color of the LED color changes. The CY8C21434 PSoC
that resides on the FTMF Expansion Card detects your finger’s position on the CapSense Touch
Sensing slider and controls the LEDs output.
The temperature sensing demonstration shows how to use a temperature sensor to control LED
color. Follow the CapSense Touch Sensing based guidelines in section 2.5 Exploring the FTMF
Expansion Card Demonstration Projects to simulate, build, and program the FTMF Expansion Boar d
with the temperature sensing de monstration. Touch the temperature sensor (see Figure 2-1) and
notice how the LED color changes. Removing your finger leads to the LED color slowly reverting
back to its initial state. The CY8C21434 PSoC that resi des on the F TMF Exp ansion Car d detect s the
temperature and controls the LEDs output.
The light sensing demonstration shows how to use an ambient light sensor to co ntrol LED in tensity.
Follow the CapSense Touch Sensing based guidelines in section 2.5 Exploring the FTMF Exp ansion
Card Demonstration Projects to simulate, build, and program the FTMF Expansion Board with the
ambient light sensing demonstration. Cover the light sensor (see Figure 2-1 on page 8) with the
palm of your hand and notice how the intensity of the LED changes. Removing your palm leads to
the LED intensity reverting back to its initial state. The CY8C21434 PSoC that resides on the FTMF
Expansion Card detects the ambient light and controls the LEDs output.
The CapSense proximity sensing demonstration shows how to use a proximity sensor to control
LED color.
The proximity detector requires the use of a Proximity Antenna and can sense an object with approximately 2–3 inches of range. In the FirstTouch Kit, this sense antenna is formed by attaching the provided wire into the pin socket labeled PRX1 as shown in Figure 2-1 on page 8. Note Upon power up,
the FTMF will establish a baseline reading of the Proximity Antenna. It is therefore necessary to connect the Proximity Antenna prior to plugging in the FirstTouch kit.
The project is setup to recalculate this baseline approximately every 30 seconds. Also notice how
the shape and position of the wire affects the demon stration operation an d the prox imity sensing distance.
Follow the CapSense Touch Sensing based guidelines in section 2.5 Exploring th e FTMF Exp ansion
Card Demonstration Projects to simulate, build, and program the FTMF Expansion Board with the
CapSense proximity sensing demonstration. Slowly approach the CapSense proximity sensor
(depicted in Figure 2-1 on page 8) with your fingers and notice how the color of the LED color
changes. Removing your fingers leads to the LED color slowly reverting back to its initial state. The
CY8C21434 PSoC that resides on the FTMF Expansion Card detects the relative proximity of your
fingers to the FTMF Expansion Card and controls the LEDs output.
2.5Exploring the FTMF Expansion Card Demonstration Projects
To explore the various FTMF Expansion Card projects, do as follows:
1. Remove the FTPC Bridge from the USB port on the PC.
2. Connect the FTMF Expansion Card into the header of the FTPC Bridge such that ‘Cypress Perform’ is visible on both the FTPC Bridge and the FTMF Expansion Card.
3. Once the two are properly connected, inser t the com p let e Fir stTouch Kit back into the USB port.
2.5.1Opening a Demonstration Project
To run demonstration project, do as follows:
1. Launch the PSoC Express Development Suite. Once PSoC Express loads, the Express Design
Catalog panel is displayed in the Start Page pane.
2. From the Express Design Catalog, expand the ‘CY3270-PSoC FirstTouch Kit’ folder.
3. Click the CapSense Touch Sensing Slider entry. A design data sheet appears in the Express
Helper panel. This data sheet describes all of the details relating to this particular project.
Since this is a Design Catalog project, you cannot change this project directly. Instead, rename the
project and save it to a new location. This makes a copy of the project that you are free to change.
4. Double-click the MultiFunction Board CapSense Touch Sensing Slider entry. A dialog box
appears prompting you for a project name and location. Browse to the location where you wan t to
save this project, give it a name, and click OK.
PSoC Express ‘clones’ the contents of the MultiFunction Board CapSense Slider demonstration
project and the Project Design window appears.
Note Other documentation included with the PSoC Express Development Suite gives detailed
descriptions about the operation of PSoC Express.
2.5.2Modifying the New Project
One example of modifying the demonstration project is as follows:
1. Place the cursor over the LED icon that appears on the Design window.
2. Right click and select Transfer Function.
3. From the Transfer Function window, select the Edit Transfer Logic radio button.
4. Click OK from the dialog box that appears.
Once the Priority Encoder Transfer Function window appears, notice the details of how the
CapSense Slider affects the LEDs.
For this simple demonstration, you can change the order of the LEDs.
1. Left click in the LED_State_Blue area and delete the text in the ‘then’ field.
2. Right click to get menu options, then double-click on LED_State_Red from the list.
3. Left click in the original LED_State_Red area and delete the test in the 'then' field.
4. Right click to get the options, then double-click on LED_State_Blue from the list.
Simulation is a very useful tool. You can run the simulation on the project you defined; if the results
are not what you expected, you can go and change the design until you get the results you want.
This saves time and effort by allowing evaluation of your design's operation prior to programming the
hardware.
Once you have made changes to your project, click the Simulation tab to proceed to the PSoC
Express Design Simulator to verify that your design do es what you intended. F or inst ance, type 23 in
the CSD Properties ‘Current Value’ box and see the ‘Red’ come up in the LED ‘Current Value’ box.
This matches the transfer function logic designed into this project.
If the behavior meets your expectations, you are ready for the next step. If not, you can go back to
the Design tab, edit the Transfer Function logic, and return to Simulation to ve rify your changes.
Other PSoC evaluation and development kits implement monitoring and tuning to change project
variables in real-time and then dynamically change the driver configuration.
2.5.4Building the New Project
Once you are confident that your design is correct, from the to p menu bar click Build and then selectGenerate/Build {your project name} Project.
2.5.4.1Selecting the Target Device
PSoC Express displays a Device Selection window that allows you to select a ‘target’ device for your
project. All FTMF Expansion Card projects must use the 32-pin CY8C21434 as the device target.
Select this device from the list and click Next. Express then continues to compile your project.
2.5.4.2Specifying the Target Device Pinout
The Express Pin Editor window appears. This window allows you to drag and drop the various
project signals to the PSoC device IO pins. For th is project, no changes are made to the pin assignments. Click Next to continue.
Note If you are creating your own project for the FTMF card, refer to the Figure 3-4 on page 21 for a
schematic and Table 3-1 on page 22 for the pin connections before proceeding beyond this point.
Once PSoC Express completes building your design, the BOM/Schematic window appears. Use this
as an error-checking step to confirm that all of the IO pins did not move and are exactly where you
intended.
2.5.5Programming the Project
To program the project to the FTMF Expansion Card, do as follows:
1. From the top menu bar, click Program and then select PSoC Programmer. The PSoC Programmer utility launches.
2. On the Programmer GUI, select Port > FirstTouch.
3. Ensure that the Device Family is set to 21X34 and the Device T y pe is CY8C21434-24LFXI (this is
the PSoC on the FTMF Expansion Card).
4. Set the Programming Mode button to Reset and then click the Program button.
The Programmer utility begins programming the project’s HEX file to the FTPC bridge; the bridge in
turn re-programs the PSoC on the FTMF Expansion Card.
Once the programming completes successfully, the FTPC Bridge resets the FTMF Expansion Card
and begins running your project on the FTMF Expansion Card. Verify the project as follows:
Did the changes that were made take effect?
If not, return to the PSoC Express Design Editor, make any necessar y changes, and rep rogram your
FTMF Expansion Card again.
2.5.7Understanding the Results
The steps described throughout the section Exploring the FTMF Expansion Card Demonstration
Projects on page 13 demonstrate the entire flow of PSoC Express, PSoC Programmer, and the First-
Touch Kit. You now know the process and PSoC Express Design Flow to make your own projects or
to load another FTMF Expansion Card demonstration project from the Express Design Catalog.
2.5.8Important Things to Remember
There are a few important points to remember when working with the FirstTouch kit and projects.
1. Use the FTMF Expansion Card schematic, pin assignment tables, or both when creating a
project. Failure to do so almost certainly guarantees that your project will not behave as planned.
2. Select the proper device to use as the ‘host’ on the particular expansion card with which you are
working.
3. Always use the ‘Reset’ programming mode when programming through the FTPC bridge.
The FTPC Bridge is the interface bridge between the expansion cards, your PC, and the various
applications such as PSoC Express™, PSoC Designer™, and the PSoC Programmer utility.
Since the FTPC Bridge enumerates as a special type of ‘combo device’ that contains a PSoC MiniProg interface, the standard PSoC Programmer utility can identify and communicate with the FTPC
bridge. This ensures that your FirstTouch Kit is automatically compatible with both PSoC Express
and PSoC Designer.
The schematic for the FTPC Bridge shown in Figure 3-1 is found on the CD included in the kit.
Noticed that the CY8C24894 PSoC device is the only active component in the entire circuit. This single PSoC handles all communications between the applications, USB, and expansion card interfaces.
The FirstTouch expansion card connects to the FTPC bridge through the 8x2 Expansion Port (this is
a built-in port on the bridge). If you are using only the FirstTouch expansion card, it is generally not
necessary to understand everything about this expansion port or the signals that it contains. By
attaching an expansion card, all of the necessar y connections are made.
Figure 3-2 is the pinout diagram for the FTPC Expansion Port. Refer to this figure as you create
projects. As you get more accustomed to the FirstTouch Kit and design flow, you may find yourself
wanting to make your own expansion cards. At that time, you may want to review the interface signals.
The FirstTouch expansion card is designed to plug and play with the FTPC bridge. All power for the
included expansion cards is provided by the FTPC bridge directly from the USB bus. No other power
supply is necessary when an expansion card is connected to the FTPC bridge. Connection to the
FTPC Expansion Port is through the 8x2 or 5x2 pin header on the expansion card.
The FirstTouch expansion cards have a dedicated host PSoC device installed. The particular PSoC
installed was chosen to act as an example as to which PSoC is most suitable for the types of applications that the particular expansion card supports. This also makes it easier to transfer your design
from the FirstTouch kit to your hardware.
By having a dedicated host PSoC, you can program then remove the expansion card fr om the FTPC
bridge. Once removed, it operates in a standalone mode or connects to your system level hardware.
This creates a design that provides ‘PSoC Powered Peripherals’ and quickly integ rate them into your
system. Before doing so, it is important to review the schematic for the particular expansion card, to
determine the proper power and grou nd con ne ct i on s an d vo ltage levels.
The expansion card contain a variety of peripheral components that allow you to experiment with
many different sensors and signal types. Each of the sensors use dedicated host PSoC IO pins.
Therefore, it is important to note which pins connect the various sensors to the host PSoC. These
details are provided in the expansion card specific portion of this guide.
Technical Reference
3.3Expansion Card Details
This section provides details for the expansion cards included with the FirstTouch Kit. Future expansion cards will include additional documentation and demonstration projects that are specific to their
operation and configuration.
The FTMF Expansion Card contains a CY8C21434 PSoC that acts as the ‘host’ for various demonstrations. The FTMF Expansion Card has hardware to support the following PSoC powered peripheral applications:
■ CapSense ‘Touch Button’
■ CapSense ’7-Element Touch Slider’
■ CapSense ’Non-Touch / Proximity Detection’
■ Ambient light-level detection
■ Thermistor-based temperature measurement
In addition to the above input sensors, the FTMF card also provides the following output devices:
NOTE: This Expansion Board Does Not Have An Onboard
Voltage Regulator - DO NOT Power With > 5Vdc
0.100" 8x2 Male
Pin Header
ISSP_XRES
ISSP_CLK
ISSP_DAT
I2C_SDA
I2C_SCL
PO5
PO4
PO3
PO2
VEXPVEXP
J1
8X2 PIN HDR RA
1
3
5
7
9
11
4
13
15
6
8
2
16
14
12
10
VEXP_IN
GND
ISSP_XRES
ISSP_CLK
ISSP_DAT
EXP_TYPE
VEXP_OUT
MISO
SPI_nss
SDA-MOSI
SCL-SCLK
NC
GPIO2
GPIO3
GPIO4
GPIO5
The dedicated sensors and output devices on the FTMF Expansion Card are there to help you
quickly evaluate and experiment with a variety of PSoC applications, without having to build any
hardware. Your PSoC Express or PSoC Designer project completely determines the remaining
FTMF Expansion Card functions. Included in the kit installation are demonstration projects that use
the following input sensors:
■ CapSense slider
■ Temperature sensor
■ Ambient Light sensor
■ CapSense proximity sensor
The FTMF Expansion Card uses a standard FirstTouch expansion header for connection to the
FTPC bridge or other target hardware.
Notice that the 8x2 pin expansion header also includes fou r General Purpos e IO connections lab eled
P02-P05. These are hard wired to four unused Po rt 0 IO pins on the CY8C21434 host and allow you
to easily connect the FTMF Expansion Card to your specific hardware or sensors. These IO pins
were specifically chosen because they have the ability to operate as analog outputs, analog inputs,
digital inputs, digital outputs, or any combination of the four types; this pin selection makes them true
analog or digital GPIO.
Your PSoC Express project designates the specific function for these A/D GPIO pins.
Since the FTMF Expansion Card connects the various sensors and output devices to predefined IO
of the host CY8C21434, it is important that you follow the pin assignment shown in Figure 3-4 on
page 21 and Table 3-1.
The schematic for the FTMF Expansion Card sh own in Figure 3-4 is found on the CD included in the
kit.
Table 3-1. FTMF PSoC Pin Assignments
Pin NumberPort NumberDesi gn Function
1P0[1]CapSense modulator capacitor
2P2[7]CapSense slider element 7
3P2[5]CapSense slider element 5
4P2[3]CapSense slider element 3
5P2[1]CapSense slider element 1
6P3[3]Unused / no-connect
7P3[1]CapSense feedback resistor
8P1[7]I2C clock line (SCL)
9P1[5]I2C data line (SDA)
10P1[3]Red LED drive
11P1[1]In system programming clock (ISSP_SCLK)
12GND
13P1[0]In system programming data (ISSP_DAT)
14P1[2]Blue LED drive
15P1[4]Green LED drive
16P1[6]Alarm/buzzer FET drive
17XRESIn system programming reset pin (ISSP_XRES)
18P3[0]Unused / no-connect
19P3[2]Unused / no-connect
20P2[0]CapSense proximity antenna pad (PRX1)
21P2[2]CapSense slider element 2
22P2[4]CapSense slider element 4
23P2[6]CapSense slider element 6
24P0[0]Thermistor temperature sensor analog input
25P0[2]User A/D-GPIO
26P0[4]User A/D-GPIO
27P0[6]A mbient light detector analog input
28+Vdd
29P0[7]Thermistor drive-voltage reference analog input
30P0[5]User A/D-GPIO
31P0[3]User A/D-GPIO
32GND
You can use the sensors and output devices in any way you want within your project, but you must
make sure to always assign the correct pins within your project. Failure to do so may cause unpredictable or unplanned project results.
Referring to Figure 3-4 on page 21, for instance, notice that a capacitor and a resistor connect to
Port P0[1] and P3[1]. These two components form the feedback network required for all CapSense.
When you assign the pinout in your PSoC Express CapSense projects, make certa in to assign these
pins to the correct functions.