Lesson KB 02: To Understand Your PSoC 5LP Board
Overview
Before you learn about the Cypress PSoC 5LP microcontroller, you have to understand the PSoC 5LP development board you use. 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, a programmer/debugger with USB-UART and USB-I2C bridge functionality.
Jumper
The PSoC 5LP Prototyping Kit consists of the following jumpers:
Figure 1: CY8CKIT-059 PSoC 5LP Prototyping Kit
Jumper# | Description |
---|---|
J1, J2 | PSoC 5LP Header Connectors |
J3, J7 | SWD Connector |
J4 | PSoC VDD |
J5 | PSoC 5LP program/debug SWD/JTAG header |
J6 | Micro-USB connector |
J8, J9 | KitProg GPIO Ports |
J10 | KitProg Connector (To Host PC for program/debug) |
Header Connections
Header Connections
The PSoC 5LP Prototyping Kit supports several 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 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 follows:
User and Passive Inputs
User and Passive Inputs
Push Button (SW1)
The target PSoC 5LP board contains a single push button connected to the P2[2] pin on the PSoC 5LP device. This button is a negative logic input and can be used for general user inputs or to control different states in an application.
Figure 3: Push Button on the Board
BOOT/Target RST Button (SW3)
The KitProg board contains a push-button connected to the XRES pin on the target PSoC 5LP device and P12_4 of the KitProg device. This button serves two functions:
- Reset the PSoC 5LP device: When this button is pressed, the XRES line of the PSoC 5LP is connected to the ground, which, in turn, resets the target device.
- Bootload the KitProg: When this button is pressed while plugging the KitProg into the USB port of the PC, the KitProg enters the bootloader mode. In this mode, boot loadable applications can be downloaded on the KitProg device.
Figure 4: Reset/Boot Button on KitProg board
Reset Button (SW2)
The target board also provides a footprint for a through-hole switch, which can be used to reset the device when the two boards are separated.
Figure 5: Reset (RST) Button on the Board
The SW1 connects the PSoC 5LP pin P2[2] to the 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
LEDs
LEDs
The PSoC 5LP Prototyping Kit contains three LEDs:
Power Amber LED (LED2)
LED2 indicates that the PCB USB connector powers the board. LED2 will not light when the board is powered from the micro-USB connector, VDD or VTARG directly.
Figure 7: Power LED
Status Green LED (LED3)
LED3 Indicates the KitProg status, connected to P3.1 of the KitProg PSoC 5LP device. The details on the KitProg status LED are shown in Table 1.
Figure 8: Status LED
User Red LED (LED1)
This is the user LED connected to P2[1] of the target PSoC 5LP device.
Figure 9: User LED
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 an idle state, waiting for commands. | PSoC Creator, PSoC Programmer, Bridge Control Panel, and any serial port terminal program can use the kit. |
LED3 is OFF | Power LED2 is ON | This means that the USB enumeration was unsuccessful. This may happen if the USB host does not power the kit. 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 the 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, to use one function, the other function should be disconnected. For instance, to program the device while using the 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
Onboard System Capacitors
The PSoC 5LP Prototyping Kit has seven capacitors, which are used when ADC operation at high frequencies, CapSense, or an 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[4] and P0[2])
- C7 and C13 – For Delta-Sigma ADC (on P3[2] and P0[3])
- A CapSense capacitor (CMOD) on P15[4]: Required for proper CapSense functionality.
- Two biasing capacitors on P15[2] and P15[3]: Required for interfacing an external 32-kHz crystal oscillator.
Figure 10:System Capacitors Circuit Diagram
Do not assign any digital function to these pins, which are connected with a capacitor: P0[2], P0[3], P0[4], P3[2], P15[2], P15[3], and P15[4].
KitProg
KitProg
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.
Functionality | Supported Speed | Units |
---|---|---|
Programmer | 1.6 | MHz |
USB-I2C Bridge | 50, 100, 400, 1000 | KHz |
USB-UART Bridge | 1200, 2400, 4800, 9600, 19200, 38400, 57600, and 115200 | Baud (bps) |
USB-UART Bridge
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[6] for UART RX and P12[7] for UART TX in the Pins tab of the Design Wide Resources file (.cydwr) from the Workspace Explorer. Note: these are the pins for the USB-UART interface on the PSoC 5LP CY8CKIT-059 Prototyping Kit. If 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
- The default settings are 8-bit data, with 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
USB-I2C Bridge
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[0] for the I2C SCL and pin P12[1] for the I2C SDA in the Pins tab of the Design Wide Resources file (.cydwr) from the Workspace Explorer. Note: these are the pins for the USB-I2C interface on the PSoC 5LP CY8CKIT-059 Prototyping Kit. If using a different kit, refer to the respective Kit Guide for the appropriate pins.