1. Create a New PSoC 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.
Start PSoC Creator
Find the PSoC Creator 4.x icon to launch the tool by using one of the following methods:
- On the windows desktop, find the PSoC Creator icon and double click on it.

- Launch PSoC Creator from Windows Start Menu.

- Use the Windows Start key and type "PSoC Creator" to locate the PSoC Creator, then click on it.
Create New Project
The first step of creating a design is using New Project Wizard to create a new PSoC project. The following items will be done by the New Project Wizard:
- Select the kit, module, or device
- Select the type of project to create
- Specify the project name and location
- Choose whether to create a new Workspace or add to an existing Workspace
Follows the next steps to open the wizard dialog, and configure for a new project:
- To start a new project, you can either:
- Click the "Create New Project..." link on the PSoC Creator Start Page
- Click the Create New Project button
in the menu bar, or
- From the File menu and select "New➤Project ..." to open the NEW Project Wizard

- In the "Create Project" dialog, you need to select one of the following type of target device:
- Target kit: Use this option to select a specific kit or the last used kit.
- Target module: Use this option to select a specific module, or the last used module.
- Target device: Use this option to select a device family and series, the last used device, or to launch the Device Selector.
......
- Next, in the "Select project template" dialog, select an Empty schematic as a project template.

- In the next dialog, you have to enter text for a Workspace name. A workspace is a container for one or more projects. A project is usually contained in a workspace.
- In Workspace name field, type the name of the Workspace, for example: "PSoC5LP_Lab".
- In Location field, type the path where you want the project to be saved, or click
and navigate to the appropriate directory.
- In Project name field, type the name of your project, for example: "MyFirstPSoC".

PSoC Creator organizes applications into Workspace that can contain one or more projects.
- Click Finish button, then PSoC Creator will create a new directory in the "Location" field; and create subdirectory for Workspace. In the Workspace subdirectory, the Project directory will be created.

- After PSoC Creator creates all the folders and files, the main windows will show on the screen, and several new panes are displayed: Workspace Explorer, Schematic (TopDesign.cysch), and Component Catalog.

- By default, PSoC Creator creates a new workspace containing the new project. Files and folders are added to the Workspace Explorer shown in the Source tab.
- In the document panel, the Schematic Editor displays the top-level schematic file (TopDesign.cysch).
- The Component Catalog panel opens to display a list of Components can be used in your design.
4. Assign Pins and Connect Hardware
At this point, the hardware design is complete, however the Pin Component must till be associated with a physical pin.
If you did not assign any pins, after you click Generate Application or Build your project from Build menu, the PSoC Creator will automatically assign the pin to a physical port/pin on the device. To specify a specific pin, use the Pin Editor to assign the pin for the component..
- In the Workspace Explorer window, expand the "Design Wide Resources (.cydwr)" folder in your project and double-click on the Pins to open the Design Wide Resource (DWR) Pin Editor.

- Pull down the menu in the Port or Pin column and assign Pin_1 to the following pin, depending on the kit your used:
Cypress CY8CKIT-059 Kit
Cypress CY8CKIT-059 kit already has a switch and a LED on the board. The switch is connected to port 2, pin2 (P2[2]), and the LED is connected to port 2, pin 1 (P2[1]). Therefore, for CY8CKIT-059 Kit, you can assign Pin_1 to P2[1] (or Pin 63).

EagleSoC Development Board
For EagleSoC Development Board, use P2[1] (or pin).

EagleSoC Mini Board
For EagleSoC Mini Board, you can assign Pin_1 to any pin. Here we assign P2[1] (or pin) to LED.

- You will notice that many pins have some extra text associate with their port/pin information; for example, P1[2] is also labeled as 「XRES[0]:opt」. These are special functions that can be associated with the pin for improved performance, rather than mandates that a given pin be used for a specific function.
5. Generate Application
Before you write the code, you have to let PSoC Creator to generate all the necessary API files to support the hardware components that you plced in the schematic eariler. To do that, choose the "Generate Application" item in the Build function.
- Select the PSoC Creator menu item Build➤Generate Application, or click
icon on the toolbar.

- If there are no error, PSoC Creator generates several code files, under the folder Generated_Source. These are the support files for the components. Do not edit them. They are, in fact, just standard C files, and you could rework them to fit your needs, but the IDE can, and does, frequently regenerate those files, which would wipe out any changes you've made.

6. Write C Code
Add code to the auto-generated file main.c.
- In the Workspace Explorer panel, double-click the main.c file in your project to open it on the Document window.
- Add the following function to main():
PWM_1_Start();

This code assumes that the PWM Component has the default name. If you renamed your PWM Component to something other than the defaulr value, use those name in the _Start() function call..
/* ========================================
*
* Copyright YOUR COMPANY, THE YEAR
* All Rights Reserved
* UNPUBLISHED, LICENSED SOFTWARE.
*
* CONFIDENTIAL AND PROPRIETARY INFORMATION
* WHICH IS THE PROPERTY OF your company.
*
* ========================================
*/
#include "project.h"
int main(void)
{
CyGlobalIntEnable; /* Enable global interrupts. */
/* Place your initialization/startup code here (e.g. MyInst_Start()) */
PWM_1_Start();
for(;;)
{
/* Place your application code here. */
}
}
/* [] END OF FILE */
7. Program the Device
The programming process is the same for all the developmemnt kit boards.
- Connect the programmer to your PSoC 5LP development board and plug it into your PC with a USB cable.
- Confirm the programmer is connected with PSoC Creator through the USB port.
Select the PSoC Creator menu item Debug➤Select Debug Target... A "Select Debug Target" diglog is displayed
CY8CKIT-059 Kit
CY8CKIT-059 already has on-board programmer, so just plug the CY8CKIT-059 kit into your PC with a USB extend cable.
EagleSoC Development Board
You need a external programmer, such as MiniProg3 or EagleSoC Prog. Connect the programmer to your PSoC5LP board SWD Port and plug it to your PC withe a USB cable.
If you are using the EagleSoC Boards, use a wire to connect the P0[0] pin to one of the four LEDs.
EagleSoC Mini Board
You need a external programmer, such as MiniProg3 or EagleSoC Prog. Connect the programmer to your PSoC5LP board SWD Port and plug it to your PC withe a USB cable.
If you are using the EagleSoC Boards, use a wire to connect the P0[0] pin to one of the four LEDs.
- Click Program button
in the menu bar.
- If the Select Debug Target dialog displays, select your device, then click Connect and OK.
PSoC Creator will build your design, generate code, and program the device. When programming is complete, the selected LED on the board will blink; press the Reset button if needed.