PSoC Lab 09: UART
- Learn about UART protocol
- Connect PSoC with PC using UART
- Learn how to design a string parser
Required Reading Material(s)
The UART provides asynchronous communications commonly referred to as RS232 or RS485. In the PSoC Creator, the UART component can be configured for Full Duplex, Half Duplex, RX only, or TX only versions. All versions provide the same basic functionality. They differ only in the amount of resources used.
For most use cases, you can easily configure the UART by choosing the baud rate, parity, number of data bits,and number of start bits.
- The most common configuration for RS232 is often listed as "8N1", which is shorthand for eight data bits, no parity,and one stop bit.This is the default configuration for the UART Component. Therefore,in most applications you only need to set the baud rate.
- A second common use for UARTs is in multidrop RS485 networks. The UART Component supports 9-bit addressing mode with hardware address detect,as well as a TX output enable signal to enable the TX transceiver during transmissions.
UART/USB Bridge Module
Theincludes an on-board programmer which also is PSoC 5LP and it can serve as a UART/USB bridge for this project. This will allow us to communicate with the PSoC 5LP device's UART port using an USB port of the PC. The hardware connections for UART are connected to P12.6(RX) and P12.7(TX)
If you are using other types of PSoC 5LP development board, you will need to prepare a UART/USB module for this lab. Here, I recommend using FTDI FT232RL UART/USB module. This modules have two versions: 3.3V and 5V. Some of FTDI module has a switch to change the different voltage level. You can find them from Amazon or using Google.com to find other store:
In this lab, you need to setup a UART
Required Components List
|FTDI UART/USB Bridge Module (Optional)||x 1|
Circuit / Schematic Diagram
Related Reference Material(s)
Creating a New Project
Launch the PSoC Creator and create a New Project. In the New Project wizard, select Empty Schematic, edit the name of the Project and Workspace.
PSoC Components and TopDesign.cysch
After you create a project, the PSoC Creator will bring up the TopDesign.cysch tab, with an empty schematic. You need to add the following components to the TopDesign.cysch.
Sample Firmware Code
Building the code and Programming
You can build the project using the Build menu or Build icon . The Output panel shows the build results. Any errors will stop the build process and messages identifying these problems will be displayed in the Output panel.
To program the PSoC with the newly build firmware, connect the PSoC board to the PC using the USB cable. Load the program using either the Debug➤Program selection or the following Program icon . The programming status is also shown in the Output panel.
When programmed, you can test your system and observe the results.
Around five questions should be based on Required Reading Material. Two more challenging questions will require students to perform additional research for extra credit points