Getting Started with PSoC 4 Prototyping Kits - CY8CKIT-049

Created by Scott Schmit, last modified on Oct 06, 2014

Purpose

The PSoC 4 product family is a very flexible ARM Cortex-M0 based technology. The 32-bit M0 core presents a nice balance between performance and power consumption. The programmable nature of PSoC devices from Cypress gives the designer much more freedom and flexibility than the average microcontroller. PSoC 4 Prototyping Kits are a very inexpensive means for getting familiar with PSoC 4 devices and PSoC devices in general. The main purpose of this page is to provide you with programming instructions and present some basic example projects that will get you up and running. The example projects require no board modification or additional components.

Useful Links

Downloads

Kit Description

The PSoC 4 Prototyping Kits plug directly into a USB port of your PC. The board is separated into 2 sections. The front section contains a full-speed USB to UART controller and numerous break-out pins for evaluation. The USB controller can be used for serial communication with a PC, or to program the PSoC 4 device using a UART bootloader (or both). The back section contains the PSoC 4 device itself, along with a user LED, a user button, and break-out pins with 0.1" (breadboard) spacing. The two portions of the board are connected when the board ships. However, they can easily be broken apart of desired. Power, Ground, and UART Transmit and Receive are the only four pins hardwired between the USB controller and the PSoC 4 device.

The following image shows the pin assignments for the breakout headers.

*Image taken from PSoC 4 Prototyping Kit User Guide

Additional Items you may find useful (soldering required):

  • PRPC007SFAN-RC - 7 position, through-hole, male pin header for breadboarding the USB controller
  • PRPC022SFAN-RC - 22 position, through-hole, male pin header for breadboarding the PSoC 4
  • PREC004SBAN-M71RC - 4 position, through-hole, male pin, right-angle header for reconnecting separated sections
  • PPPC041LGBN-RC - 4 position, through-hole, female receptacle, right-angle header for reconnecting separated sections
  • PREC005SBAN-M71RC - 5 position, through-hole, male pin, right-angle header for use with MiniProg3 programmer

Powering the Board

USB Power

The easiest way to power the board is by plugging it into a USB port of your PC. This will power the entire board with 5V from the USB port and 5V will be available on each breakout header’s power pin.

External Power

You can use an external 1.8~5V power supply to power the PSoC 4 device through the breakout headers. The USB controller draws power from the USB port (if connected). Therefore, if you want to power the PSoC4 with an external power supply, you should break apart the USB controller section from the PSoC 4 section (or at the very least, refrain from plugging it into your USB port while using external power) and use a MiniProg3 to program the PSoC 4.

Creating a Bootloadable Project

Using Bootloaders can be a little confusing if you are not already familiar with how they work. If you are new to PSoC bootloaders, please take a look at this page for background PSoC Bootloaders.

If you want to program your PSoC 4 Prototyping Kit over USB, you will need one of the following sets of files depending on which device you are using.

These are the files for the bootloader that comes preflashed to the Prototyping Kits. You will need them for your future projects to define the installed bootloader.

Create a Bootloadable PSoC Creator Project
Follow these steps for creating a bootloadable PSoC Creator project for use with the PSoC 4 Prototyping Kits.

  1. Open PSoC Creator
  2. Start a new project by selecting File → New → Project
  3. In the ‘New Project’ dialog box:
  • Select Empty PSoC 4 Design
  • Select a location for your project and a name
  • Click on the little plus sign towards the bottom to open up Advanced Settings
  • Select the specific device loaded on your Prototyping Kit (either CY8C4125AXI-483 or CY8C4245AXI-483)
  • In the ‘Application Type’ drop down menu, select Bootloadable
  • Click OK to start the project
  1. The TopDesign.cysch file should open by default. If not, open it from the Workspace Explorer window.
  2. Click and drag a Bootloadable component onto the schematic from the Component Catalog window.
  3. Double click on the Bootloadable component to configure it.
  4. In the ‘Configure Bootloadable’ dialog box:
  • Click on the Dependencies tab
  • Under ‘Bootloader HEX file’, click on the Browse button and navigate to the hex file you downloaded above
  • The ‘Bootloader ELF file’ should auto populate if you saved it in the same location as the hex file. If not, Browse to its location and select it.
  • Click OK to apply the changes and close the dialog box
  1. Continue creating your PSoC 4 project as you normally would.
  2. Save and build the project.
  3. When you build the project, a CYACD file will be created in your project’s Debug directory. This is the bootloadable file that will get sent to the PSoC 4 Prototyping board through the USB controller.

Make an Existing PSoC Creator Project Bootloadable
Follow these steps if you have an existing PSoC Creator project that you want to program on to your Prototyping Kit using the pre-installed bootloader.

  1. Open the desired workspace/project in PSoC Creator.
  2. Make sure the desired project is active by right-clicking on it in the Workspace Explorer window and selecting Set as Active Project.
  3. From the Project menu, select Build Settings.
  4. In the ‘Build Settings’ dialog box, under “Code Generation”, select Bootloadable as the Application Type.
  5. Click OK to apply and close the dialog box.
  6. Open the TopDesign.cysch file from the Workspace Explorer window if it’s not already open.
  7. Click and drag a Bootloadable component into the design from the Component Catalog window.
  8. Double click on the Bootloadable component to configure it.
  9. In the ‘Configure Bootloadable’ dialog box:
  • Click on the Dependencies tab
  • Under ‘Bootloader HEX file’, click on the Browse button and navigate to the hex file you downloaded above
  • The ‘Bootloader ELF file’ should auto populate if you saved it in the same location as the hex file. If not, Browse to its location and select it.
  • Click OK to apply the changes and close the dialog box
  1. Save and build the project.
  2. When you build the project, a CYACD file will be created in your project’s Debug directory. This is the bootloadable file that will get sent to the PSoC 4 Prototyping board through the USB controller.

Now that you have created the bootloadable file, you can move on to Programming with the UART Bootloader .

Programming with the UART Bootloader

Once you have a bootloadable project built and you’ve created your CYACD file, you can use Bootloader Host to program your PSoC 4 Prototyping Kit over USB. Bootloader Host is a Windows application that is included in the default PSoC Creator installation. You should find it in the Windows Start menu under Programs → Cypress → PSoC Creator → Bootloader Host . You can also open it from within PSoC Creator from the Tools menu.

Follow these steps for programming your PSoC 4 Prototyping Kit using Bootloader Host .

  1. Open the Bootloader Host Windows application
  2. Press and hold the user button down on the Prototyping Kit and insert it into an open USB port on your PC. The button must be pressed on power up to invoke the bootloader. The amber LED should light up indicating board power and the blue LED should blink continuously indicating the bootloader has been invoked and it is waiting for a file to upload.
  3. The Prototyping Kit should automatically enumerate and show up in the Ports window within the Bootloader Host application. You may need to wait for the driver to finish installing. If the port doesn’t show up after the driver installs, click on the Filters button in Bootloader Host and make sure “Show UART Devices” is selected.
  4. Once the Kit enumerates, select it in the Ports window.
  5. Apply the following serial settings:
  • Baud: 115200
  • Data Bits: 8
  • Stop Bits: One
  • Parity: None
  1. Select File → Open
  2. In the ‘Open’ dialog box, navigate to the CYACD file you created from your bootloadable project and open it. It will be in your project directory under < project name >.cydsn → CortexM0 → ARM_GCC_xxx → Debug.
  3. Program the Prototyping Kit by selecting Actions → Program .

Each time you want to program the kit, you will need to unplug the board, press the button and re-insert it into a USB port to invoke the bootloader. You will also need to re-select the proper COM port within the Ports window in Bootloader Host as it will disappear when you unplug the kit.

Programming with MiniProg3

Programming the PSoC 4 device can be accomplished using the MiniProg3 programmer from Cypress. The MiniProg3 does NOT ship with this kit and will run you about an extra $90. If you already have a MiniProg3 programmer from an existing Cypress development kit, feel free to use it to program your PSoC 4 Prototyping Kit. Using the MiniProg3 is easier than having to mess with bootloaders. Obviously, if you don’t already own a MiniProg3, it wouldn’t make much sense to go out and buy one just to use with this $4 kit. You should use the UART bootloader as described in the section above.

Follow these steps for programming your PSoC 4 Prototyping Kit with the MiniProg3 programmer.

  1. Solder a 5 position, 0.1" pitch, through-hole male pin header (like this one: PREC005SBAN-M71RC) to the programming pins on the Prototyping Kit header.
  2. Plug the MiniProg3 programmer into the connector you just soldered and connect the MiniProg3 to your PC using a USB mini-B cable.
  3. Power the Prototyping Kit by plugging it into a USB port of your PC, or by supplying power through the 0.1" headers (one or the other, see Powering the Board section above)
  4. Program the PSoC 4 device within PSoC Creator from the Debug menu, or program the PSoC 4 device using the PSoC Programmer Windows utility.

Example Projects for PSoC 4 Prototyping Kit

The following demos were created for use with either the 4100 or 4200 Prototyping Kit (projects are included for each platform). They require no board modification or external components. Simply plug the board into an open USB port of your PC and follow the provided instructions for programming and testing each demo. Each example project requires PSoC Creator to be installed along with Bootloader Host for programming. Bootloader Host is included in the PSoC Creator install. The required bootloader files are included in each example’s zip file in a folder called Bootloader_Dependencies.

1 - GPIO Example
This example demonstrates basic usage of the on-board user button and blue LED. When you press the button, the LED turns on. When you release the button, the LED turns off.

  1. Download the following project (corresponding to your platform) and unzip the contents to a known location.
  1. Double click the GPIO_Example.cywrk workspace file to open the project in PSoC Creator. This will allow you to view the project’s schematic and browse through the example code.
  2. Build the project to ensure there are no errors and the CYACD file is created in the project’s Debug folder.
  3. Program the board as described in the “Programming with the UART Bootloader” section above.

When the board finishes programming, the blue LED should stop blinking. When you press the user button, the blue LED should light up.

1 - PWM Example
This example demonstrates PWM functionality for the PSoC 4 family. A PWM block is used to control the intensity of the blue LED. The compare value of the PWM block is incremented and decremented continuously. The blue LED will pulsate as the compare value is increased and decreased.

  1. Download the following project (corresponding to your platform) and unzip the contents to a known location.
  1. Double click the PWM_Example.cywrk workspace file to open the project in PSoC Creator. This will allow you to view the project’s schematic and browse through the example code.
  2. Build the project to ensure there are no errors and the CYACD file is created in the project’s Debug folder.
  3. Program the board as described in the “Programming with the UART Bootloader” section above.

When the board finishes programming, you should see the blue LED pulsate brighter and dimmer as the PWM compare value is continuously adjusted.

3 - UART Example
This example demonstrates how to implement serial communication with the PC through the on-board USB controller. You will need to have a terminal program installed on your PC (Tera Term is a good free one). The program will display “Hello World!” on the terminal window and then echo any characters that are typed on the keyboard. The program will wait for you to press the user button before proceeding which gives you time to disconnect from Bootloader Host and setup your terminal window.

  1. Download the following project (corresponding to your platform) and unzip the contents to a known location.
  1. Double click the UART_Example.cywrk workspace file to open the project in PSoC Creator. This will allow you to view the project’s schematic and browse through the example code.
  2. Build the project to ensure there are no errors and the CYACD file is created in the project’s Debug folder.
  3. Program the board as described in the “Programming with the UART Bootloader” section above.
  4. In Bootloader Host, disconnect from the Prototyping Kit by deselecting it in the Ports window, or you can exit out of Bootloader Host completely.
  5. Open a terminal window (like Tera Term), select the Prototyping Kit port, and setup the following serial settings:
  • Baud: 115200
  • Data Bits: 8
  • Stop Bits: One
  • Parity: None

Press the user button and “Hello World!” should display in the terminal window. Any characters you type on the keyboard should echo in the terminal window.

Comments from the Author

PSoC 4 is a very flexible and inexpensive ARM Cortex-M0 based microcontroller. The programmable nature of PSoC devices gives you much more freedom than typical microcontrollers. The PSoC 4 Prototyping Kits are a very inexpensive platform for getting familiar with PSoC 4 devices. They can be a little bit difficult to get up and running if you have no prior experience with bootloaders, but hopefully this page helped you get over the initial learning curve. I hope you have fun experimenting with PSoC 4 devices from Cypress!

  • Scott

Comments/Questions

For questions or feedback about information on this or any other page, please go to the TechForum: TechForum