Lesson 01: To Understand Your PSoC 5LP Board
Before you learn about the Cypress PSoC 5LP microcontroller, you have to understand the PSoC 5LP development board you are using. This session shows the location of the various components on the PSoC 5LP board and also describes the hardware interface to the external devices.
PSoC 5LP Boards
Cypress CY8CKIT-059 Kit
The Cypress CY8CKIT-059 Prototyping Kit includes the following features:
- Micro-USB connector to enable USB application development
- Onboard CMOD capacitor to enable CapSense development
- Bypass capacitors to ensure the high-quality ADC conversions
- An LED to provide feedback
- A push button to provide a simple user input
- Load capacitors to connect 32 KHz external crystal oscillator
- 3.3V to 5.5V operation
- Integrates the Cypress KitProg that is programmer/debugger with USB-UART and USB-I2C bridge functionality.
The PSoC 5LP Prototyping Kit consists of the following jumpers:
Figure 1: CY8CKIT-059 PSoC 5LP Prototyping Kit
|J1, J2||PSoC 5LP header Ports|
|J3, J7||SWD Connection|
|J5||PSoC 5LP program/debug JTAG header|
|J8, J9||KitProg GPIO Ports|
The PSoC 5LP Prototyping Kit supports a number of unpopulated headers on both the KitProg and the target PSoC 5LP boards.
The target board contains two dual-inline headers (J1 and J2). These headers are both 1×26-pin headers and include all of the I/O available on the PSoC 5LP device. These headers support all of the available ports, GND, VDD, and connections to passive elements and user-input devices.
The J1 and J2 headers support 2.54 mm (0.1 inches) spacing, so you can solder connectors to connect the target board to any development breadboard.
The pin definitions are as following:
User and Passive Inputs
The SW1 connects the PSoC 5LP pin P2 to ground when pressed. Therefore, you need to configure the PSoC 5LP pin as a resistive pull-up to detect the switch press.
When the KitProg and Target board are separated, you can mount the SW2 button on the target board to reset the PSoC 5LP device using a switch.
Figure 6: PSoC 5LP Prototyping Kit Broken into Two Parts
The PSoC 5LP Prototyping Kit contains three LEDs:
KitProg Status LED Indication
The KitProg Status LED (LED3) on the development kit indicates the status of the KitProg operation using different blink rates. Table 1 shows the KitProg LED indication and the corresponding status of the KitProg.
Table 1: The Meaning of KitProg Status LED Indications
|User Indication||Scenario||Action Required by User|
|LED3 is ON||USB enumeration is successful. The kit is in the idle state waiting for commands.||PSoC Creator, PSoC Programmer, Bridge Control Panel, and any serial port terminal program can use the kit functions.|
|LED3 is OFF||Power LED2 is ON||This means that the USB enumeration was unsuccessful. This may happen if the kit is not powered by the USB host. Verify the USB cable and check if PSoC Programmer is installed on the PC.|
|LED3 blinks very fast:
Frequency = 15.0 Hz
|SWD or I2C operation is in progress.
The Kit's COM port connect/ disconnect event (only one blink).
|In PSoC Programmer, watch the log window for status messages for SWD operations. In the Bridge Control Panel, the LED blinks on I2C command requests.
In Bridge Control Panel or any other serial port terminal program, distinguish the kit's COM port number by the blinking LED when the port is connected or disconnected.
|LED3 blinks fast:
Frequency = 4.00 Hz
|The LED3 starts blinking at power-up, if boot loadable file is corrupt.||Bootload the KitProg.cyacd file: In PSoC Programmer, connect to the kit, go to the Utilities tab, and press the Upgrade Firmware button.|
|LED3 blinks slow:
Frequency = 0.67 Hz
|Entered Bootloader mode by holding the Reset button during kit power-up.||Release the Reset button and re-plug the kit if you entered this mode by mistake. If the mode entry was intentional, bootload the new .cyacd file using the Bootloader Host tool available in PSoC Creator.|
The programming/debugging function and USB-I2C bridge function of the KitProg are mutually exclusive functions and cannot be used together. As a result, in order to use one function, the other function should be disconnected. For instance, in order to program the device while using USB-I2C bridge in Bridge Control Panel, either close Bridge Control Panel or disconnect the USB-I2C bridge in Bridge Control Panel. The USB-UART bridge function of the KitProg, however, can run in parallel to both programming/debugging and USB-I2C bridge functions.
Onboard System Capacitors
The PSoC 5LP Prototyping Kit has seven capacitors, which are used when ADC operation at high frequencies, CapSense, or external 32-kHz crystal oscillator is required in the application.
- Four ADC bypass capacitors: Required for proper ADC sampling at high frequencies:
- C9 and C12 – For two SAR ADCs (on P0 and P0)
- C7 and C13 – For Delta-Sigma ADC (on P3 and P0)
- A CapSense capacitor (CMOD) on P15: Required for proper CapSense functionality.
- Two biasing capacitors on P15 and P15: Required for interfacing an external 32-kHz crystal oscillator.
Figure 10:System Capacitors Circuit Diagram
Do not assign any digital function on these pins, which are connected with a capacitor: P0, P0, P0, P3, P15, P15, and P15.
The KitProg is an onboard programmer/debugger with USB-I2C and USB-UART bridge functionality.
Figure 11: KitProg Ecosystem
The KitProg supports different speeds for communication interfaces.
|USB-I2C Bridge||50, 100, 400, 1000||KHz|
|USB-UART Bridge||1200, 2400, 4800, 9600, 19200, 38400, 57600, and 115200||Baud (bps)|
The KitProg can act as a USB-UART bridge. This feature of the KitProg is useful to send and receive data between the Cypress device on the kit and the PC. For example, in the PSoC 5LP Prototyping Kit, the KitProg USB-UART can be used to print debug messages on COM terminal software running on the PC.
To enable the USB-UART bridge on the CY8CKIT-059 Prototyping Kit, drag and drop a UART Component from the Component Catalog to the TopDesign. The Component Catalog is located along the right side of the PSoC Creator window by default. Assigns P12 for UART RX and P12 for UART TX in the Pins tab of the Design Wide Resources file (.cydwr) from the Workspace Explorer. Note that these are the pins for the USB-UART interface on the PSoC 5LP CY8CKIT-059 Prototyping Kit. If you are using a different kit, refer to the respective Kit Guide for the appropriate pins.
To communicate with the PSoC 5LP kit from the terminal software, follow this procedure:
- Connect the KitProg J10 to the PC. The kit enumerates as a KitProg USB-UART and is available in the Device Manager under Ports (COM & LPT). A communication port is assigned to the KitProg USB-UART, as shown in Figure 12.
Figure 12: KitProg USB-UART in Device Manager
- Open the Terminal application, such as PuTTY. Double-click the PuTTY application.
Click Session (1) and select Serial under Connection type (2) and enter the COMx (the specific communication port that is assigned to the KitProg UAB-UART) in the Serial line, this example used COM7, and enter the baud rate under Speed (3). Click Open (4) to start communication, as shown in Figure 13.
Figure 13: Make a new Connection
- By default, the data bits are 8-bit, no parity check, one stop bit, and XON/XOFF flow control. If the UART configuration is not the same as the default, select Serial under Category (1). Enter the COMx in the Serial line to connect to and enter Speed (baud), Data bits, Stop bits, Parity, and Flow control under Configure the serial line (2).
Figure 14: Second Way to Make a New Connection
- Enable local echo, select Force on under Terminal ➤ Line discipline options to display the typed characters on PuTTY, as shown in Figure 15.
Figure 15: Enable Echo of Typed Characters in PuTTY
- The COM terminal software displays both the typed data and the echoed data from the PSoC 5LP UART, as shown in Figure 16.
Figure 16: Data Displayed on PuTTY
The KitProg serves as a USB-I2C bridge that can be used to communicate with the USB-I2C software running on the PC. The following steps describe how to use the USB-I2C Bridge, which can
communicate between the Bridge Control Panel software and the PSoC 5LP device.
Create a new PSoC 5LP project in PSoC Creator. Drag and drop an I2C Slave Component from the Component Catalog to the TopDesign. Select pin P12 for the I2C SCL and pin P12 for the I2C SDA in the Pins tab of the Design Wide Resources file (.cydwr) from the Workspace Explorer. Note that these are the pins for the USB-I2C interface on the PSoC 5LP CY8CKIT-059 Prototyping Kit. If you are using a different kit, refer to the respective Kit Guide for the appropriate pins.