Getting started with PSoC 6 Wi-Fi-BT Pioneer Kit

Published  May 10, 2021   0
User Avatar Vinay YN
Author
Getting started with PSoC 6 Cypress Development Board

We are all aware of AVR, PIC, ARM, and ESPS that are widely used in the field of embedded systems. Besides, there is one new and feature-rich IoT-enabled embedded platform, PSoC 6 Wi-Fi-BT Pioneer Kit that has been designed for developing next-generation Internet of Things (IoT) applications. It provides developers with an ultra-low-power, flexible, and secure MCU architecture. This kit comes with a Murata Wi-Fi And Bluetooth module, which provides robust and secured Wi-Fi and Bluetooth connectivity in one chip. The Arduino UNO headers on the kit enable different types of shield interfaces to PSoC. The PSoC 6 comes with an onboard debugger/programmer (KitProg) to easily debug and program the target device.

So in this tutorial, we will learn about PSoC 6 Wi-Fi-BT Pioneer Kit, its hardware, and the different features that it provides, and finally, we will run some basic example codes.

Contents of Cypress PSoC6 Wi-Fi-BT Pioneer Kit

Before we go any further, let's look at the block diagram of the PSoC 6 Wi-Fi-BT Pioneer Kit to get a better understanding. The hardware diagram of the board is given below.

CY8C-KIT Architecture: 

CY8C-KIT Architecture

Power-Supply Sub-Section: 

The total power supply section of the CY8CKIT board is shown below.

CY8CKIT Board Supply Section

Pinouts of CY8CKIT Board

The complete pinout structure of the CY8CKIT board is shown below:

CY8CKIT Board Pinout

Main Microcontroller MCU Features

The PSoC 6 CY8C6247 is 32-bit dual-core MCU, with an Arm Cortex-M4 and Arm Cortex-M0 from Cypress semiconductor. It has 1MB of Flash memory, 288KB of SRAM, 102 GPIO pins 7 programmable analog blocks, 56 programmable digital blocks, Full-Speed USB, PDM-PCM digital microphone interface, Capacitive-sensing with Cap Sense, Wi-Fi and Bluetooth radio modules, Bluetooth Low Energy with 5.0 specification. Cortex M4 is the Main CPU. It runs at Up to 150 MHz, Low Power 1.7-V to 3.6-V Operation gives a perfect solution for portable applications and IoT Applications.

PSoC6 and Modus Toolbox Software

ModusToolbox was built to make it easier and more efficient by removing development barriers and allowing the user to create real-time applications quickly. ModusToolbox has all the features to get started with IoT easily. It has covering applications from embedded sense and control to wireless and cloud-connected systems with the easiest interfaces in less time. ModusToolbox provides the choice of compiler, editor, debugger, and revision control system in a single standalone IDE. To get started with Modus Toolbox, you can download the Modus Toolbox software from the official website and you can install it on your PC. Once done, we can proceed further.

Creating Example Program using PSoC6 Development Kit and ModusToolbox Software

At this point, I will assume that you have installed the ModusToolbox software. You also need to install eclipse IDE, once we do that we can move onto the next step. But before moving onto the actual code, we need to upgrade the firmware of the PSoC 6 Development Kit. By default, the kit comes with the KitProg2 but ModusToolbox requires firmware Kitprog3.

To update the firmware, you need to use the Command prompt and then follow these steps.

1. On the PSoC 6 Development kit, press and hold the SW3 and then power up the PSoC through a USB cable. This action switches the programmer to Bootloader Mode. When it enters bootloader mode, LED2 on the board starts blinking.

PSoC6 Development kit Connection

2. Now, we need to go to the modus toolbox folder and open the fw-loader folder using the command prompt. Now, in the command prompt, we need to enter fw-loader - update-kp3 and hit enter.

3. Firmware upgrading status will appear on the screen. 

Firmware Upgrading Status

Once it is successfully upgraded, new kitprog3 info will pop up on the computer screen.

Let’s get started with our first program for LED Blinking Using PSoC6.

To create the project, open the ModusToolbox Software and give a name to the project workspace. Here, I gave the project workspace name LED_BLINK.

After entering the name, click Launch.

Eclipse IDE Directory

Now, the main window will appear on the screen. Next, select the New application from the start menu.

Eclipse IDE for ModusToolbox

A project creator window will appear on the screen. Here, we have to choose the Board Support Package (BSP). Under PSoC 6 BSP, select CY8CKIT-062-WIFI-BT and click Next.

Board Supporting Package Selecting Window

Then choose the Appropriate Application Template (For this project, I am using the Empty PSoC App) and click create. To complete the process, it will take up to a minute.

EclipseIDE Application Selection

After successful initialization, the main window will appear with README.md

PSoC 6 Cypress Development Board Setup

Now, open main.c From project window.

LED Blink using PSoC6

main.c will appear with Basic syntax code.

PSoC6 Syntex

Now, write the code to main.c. On the Kit, there are three user LEDs Available, here I am utilizing user LED5 to blink.

Code to Blink LED on Cypress PSoC 6 Board

The complete code to Blink LED on Cypres PSoC 6 board is given below. The code is very simple and uses simple built-in functions to execute commands.

We start our code by including all the required libraries, and we include “cy_pdl.h”, “that. h”, and “cybsp.h”

#include "cy_pdl.h"
#include "that.h"
#include "cybsp.h"

Next, we have our main function. In the main function, we initialize a cy_rslt_t type variable result. Next, we initialize the device and store the return code to the result variable, this can be used for debugging. Next, we check if we got a success message, if so we enable the interrupt by the enable_irq() method.

Next, we initialize the GPIO and set it as an output. For our example, we are using GPIO5 you can check pinout if you are confused.

int main(void)
{
    cy_rslt_t result;
    result = cybsp_init() ; /* Initialize the device and board peripherals */
    CY_ASSERT(result == CY_RSLT_SUCCESS);
    enable_irq();
    cyhal_gpio_init(CYBSP_USER_LED5,CYHAL_GPIO_DIR_OUTPUT,CYHAL_GPIO_DRIVE_STRONG, CYBSP_LED_STATE_OFF); /* Enable LED5 As User LED Output */

Finally, we declare an infinite for loop which loops around infinitely inside the for loop. The process of blinking the LED is pretty usual. First we make the GPIO5 high, then add a delay of 500ms then we put the GPIO5 to LOW and we also add another delay of 500 ms. Now, this process goes on and on until the power is off.

    for (;;)
    {
           cyhal_gpio_write(CYBSP_USER_LED5, false); /* LED5 OFF */
           cyhal_system_delay_ms(500); /* Create Delay */
           cyhal_gpio_write(CYBSP_USER_LED5, true); /*LED5 ON */
           cyhal_system_delay_ms(500); /* Create Delay */
    }}

Now you can compile the code and upload. To compile and upload the Code, select Debug (KitProg3_MiniProg4) from Launches Menu. 

KitProg3_MiniProg4

Compile and upload the selection.

Note: Before launching, make sure that the device is connected to your computer.

After successful uploading, the following windows will appear and your Kit is Ready for Action.

Cypress PSoC6 Board Programming

 Code uploading status

Cypress PSoC6 Board Code

Code successfully uploaded

PSoC 6 Cypress Development Board

I hope you liked the article and learned something new. If you have questions regarding this tutorial, please write them in the comment section below or you can use Forum for technical discussion.

Also, check out the video linked below to get started with PSoC 6 Cypress Development Board.

Code
#include "cy_pdl.h"
#include "cyhal.h"
#include "cybsp.h"
int main(void)
{
    cy_rslt_t result;
    result = cybsp_init() ; /* Initialize the device and board peripherals */
    CY_ASSERT(result == CY_RSLT_SUCCESS);
    enable_irq();
    cyhal_gpio_init(CYBSP_USER_LED5,CYHAL_GPIO_DIR_OUTPUT,CYHAL_GPIO_DRIVE_STRONG, CYBSP_LED_STATE_OFF); /* Enable LED5 As User LED Output */
    for (;;)
    {
    	 cyhal_gpio_write(CYBSP_USER_LED5, false); /* LED5 OFF */
    	 cyhal_system_delay_ms(500); /* Create Delay */
    	 cyhal_gpio_write(CYBSP_USER_LED5, true); /*LED5 ON */
    	 cyhal_system_delay_ms(500); /* Create Delay */
    }}
Video

Have any question realated to this Article?

Ask Our Community Members