CY3215-DK PSoC 1 In-Circuit Emulator Development Kit Guide, Doc. # 001-66514 Rev. *B
28
4.
Code Examples
4.1
My First Code Example
4.1.1
Project Objective
This project is used to demonstrate blinking an LED at a varying duty cycle using a hardware pulse
width modulator (PWM). Another LED is caused to blink using a software delay. The clock dividers
VC1, VC2, and VC3 are used to divide the 24-MHz system clock by 16, 16, and 256, respectively.
The resulting 366-Hz clock is used as the input to an 8-bit PWM. This in turn produces an LED blink
period of 1.4 Hz. The project also demonstrates how an LED can toggle on/off with a delay of
approximately 1 second.
The following user modules are used in this project:
■
PWM - An 8-bit PWM is used to generate a 366-Hz signal. An LED is connected to the PWM out-
put. This LED blinks at 1.4 Hz.
■
LED - This module is used to toggle an LED on/off.
4.1.2
Creating My First PSoC 1 Project
1. Open PSoC Designer 5.1.
2. To create a new project, click File > New Project. The New Project window opens.
3. In this window, select the Chip-level icon. Name the project Example_My_First_PSoC_Project,
as shown in
.
4. Click Browse and navigate to the directory in which the project should be created.
Figure 4-1. New Project Window
5. Click OK. The Select Project Type window opens.