Hello!
In today’s example we are including four (4) separate basic communication examples for PSoC 4 devices. These examples have been created to target the CY8CKit-001 and CY8CKit-038 development kits. In these examples we make use of the LCD modules included in the Kit-001.
These examples focus on providing I2C (Master, Slave, and EzI2C), SPI (Master and Slave), and UART examples. In the master and slave examples the PSoC 4 is used as both a master and slave device echoing values between the two components. In each example we use the LCD display as a visual indicator of the data transfer.
If you are migrating this project to the Pioneer kit you will likely need to add a UART component like in example and de-comment the LCD code. This is a simple task that you can mimic from that earlier example.
Forum Post Attachments:
At the bottom of this post we are including the following items:
- Example Project Zip File
Components Used:
The user can download the example project at the bottom of this post. The project uses the following list of Creator Components:
- I2C
- EZI2C
- SPI
- UART
Firmware Description:
The main.c firmware is included in the example project. Please review the commented sections for more details.
In this post we are including four examples to display numerous serial interfaces available on the PSoC 4. These example projects are meant to be a starting point for new users who wish to get started or implement a serial component (configuration and code). The four examples are:
- EzI2C (EzI2C Slave and Master)
- I2C (Slave and Master)
- SPI (Slave and Master)
- UART (TX and RX)
In each example we have implemented both the slave and master controls on the single PSoC. The code is structured in each example with a master and slave section. This allows the user to easily copy and paste the code from the examples into their design.
Users can easily update these projects to support the Pioneer kit by navigating to the CYDWR screen in PSoC Creator and modifying the pin outs to match the PSoC 4 Pioneer layout.
The PSoC 4 Pioneer Kit does not have an LCD module so the user can update the project to support the UART bridge and the PSoC 5LP. This update is similar to example . Simply de-comment the LCD code and add in the UART put string commands to send the data to the PC hyperterminal application.
Hardware Connections:
The user will need to review the CYDWR pin selections and using the red wires included in the Pioneer kit to connect the master and slave connections on the PSoC 4.
Test Your Project:
Program the example project into the PSoC 4 device and view the output on the LCD screen (kit-038) or the UART hyperterminal application (kit-042).
I hope this example can help you in your design.
Best,
Matt