In this project, we'll build an application using the CY8CKIT-050 PSoC 5LP development kit to send a message from the PSoC to a PC via UART (Universal Asynchronous Receiver/Transmitter). The message will be sent when a button is pressed. This experiment helps you understand how to use UART communication in PSoC Creator.
PSoC schematic diagram
The send message via UART project needs the following parts:
CY8CKIT-050 PSoC 5LP Development Kit
USB Cable
UART-USB Adapter or RS232-USB Cable
Push Button
Three Male-Male Wire Jumpers
Project Creation:
Open PSoC Creator.
Go to File > New > Project.
Choose the target device: PSoC5LP CY8CKIT-050 (CY8C5868AXI-LP035 chip).
Select "Empty Schematic" and name the project UART_Message.
Hardware Configuration:
Go to the Component Catalog on the right side of the screen, search for the following components and drag them to the TopDesign schematic:
UART
Digital Input Pin
Component Configuration:
Double-click on the Digital Input Pin, rename it to "BUTTON", and set the drive mode to Resistive Pull Up.
Double-click on the UART component and set the baud rate to 9600.
In the workspace explorer, double-click on Pins under UART_Message.cydwr and set Port to:
P0[0] for Tx (Transmit)
P0[1] for Rx (Receive)
P6[1] for BUTTON
Programming and Results:
Double-click on main.c in the workspace explorer under source files.
Add the code to send a message via UART when the button is pressed.
Build the design by clicking on "Build" or pressing Shift+F6.
Verify and resolve any warnings or errors.
Connect the PSoC 5LP to your computer using the USB cable.
Click on "Program" or press Ctrl+F5 to upload the code to the PSoC.
Connect P0_0 (Tx of PSoC) pin to Rx pin of the UART-USB adapter.
Connect VSSD pin of PSoC to GND pin of the UART-USB adapter.
Open a serial terminal program on your PC (e.g., RealTerm) and set the baud rate to 9600.
Press the button to see the message "Hello, World!" displayed on the serial terminal.
Code for main.c
PSoC real-life implementation