Cypress PSoC® 6 BLE Pioneer Kit (CY8CKIT-062-BLE) - Review

Table of contents

RoadTest: Cypress PSoC® 6 BLE Pioneer Kit (CY8CKIT-062-BLE)

Author: jomoenginer

Creation date:

Evaluation Type: Development Boards & Tools

Did you receive all parts the manufacturer stated would be included in the package?: True

What other parts do you consider comparable to this product?: TI CC3220 Xilinx MiniZed Renesas AE-CLOUD1 Odyssey MAX® 10 FPGA & BLE Sensor Kit

What were the biggest problems encountered?: There were no major issues encountered during this RoadTest, but I did run into some issues with the examples where settings were not correct for the PSoC 6 BLE Pioneer Kit but those were resolved fairly quickly both by my own discovery and from the Cypress Forum.

Detailed Review:

Introduction

 

There were extra Cypress PSoC 6 BLE Pioneer Kits available so I was lucky enough to received one of these awesome boards from Randall. This is my first experience in the PSoC realm but I was pleasantly surprised with working with this kit. The PSoC 6 MCU is a very interesting device that provides great flexibility in creating devices that run via software defined hardware or via the ARM Cortex M0 plus and M4 cores. With this architecture, tasks can be split between each of the ARM cores where the more I/O intensive process can be assigned to the M4 core where the lower power process can be assigned to the M0 plus core where each have access to the GPIO ports.

The BLE Pioneer Kit offers a good set of options to test the capabilities of the PSoC 6 and BLE capability. The added Arduino headers allow the board to be easily expanded using many of the available Arduino shields (This is restricted to only the 3.3v shields though). The included E-INK display was very interesting in that it did not require being constantly updated to keep an image which would be helpful in low power scenarios. The CapSense Touch Pad with slider, buttons and proximity sensor were a real nice addition where user interaction could be monitored remotely via the BLE device.  And, the built in Bluetooth Low Energy circuit adds an important IoT option where the board could be used to prototype something such as a remote node with local HMI.  I did find a Add-On board by Sparkfun and DigiKey that address XBee Wi-Fi capabilities that could expand the board to more of a gateway device.  There are just so many options the dev kit offers that one could spend many moons testing out, but for this RoadTest I focused on just a few of the features.  I had intended to attempt configuring MQTT-SN as well as motor control but time is running out.  However, I do plan to keep working with this board and expand my familiarity with the PSoC capabilities.

 

Areas I will cover are:

1. PSoC 6 Hardware Blinky

2. PSoC 6 FreeRTOS Blinky

3. PSoC 6 ARM Cortex M0+ and M4 RGB Blinky

4. PSoC 6 BLE UI with CySmart 1.2 (PC version)

5. PSoC 6 BLE CapSense Proximity Sensor

6. PSoC 6 BLE to Raspberry Pi

7. PSoC 6 PDM to PCM E_INK Mic Test

 

Tools Used:

CY8CKIT-062-BLE Pioneer Kit

PSoC® 6 BLE Pioneer Kit

PSoC 6 BLE Pioneer Board

CY5677 CySmart BLE 4.2 USB Dongle

CY8CKIT-028-EPD E-INK Display Shield

 

PSoC Creator 4.2 beta 2

https://community.cypress.com/docs/DOC-14408

 

PSoC 6 BLE Kit

https://community.cypress.com/docs/DOC-13747

 

CySmart – Bluetooth® LE Test and Debug Tool

http://www.cypress.com/documentation/software-and-drivers/cysmart-bluetooth-le-test-and-debug-tool

 

BlueZ

http://www.bluez.org/

 

BluePy

https://pypi.python.org/pypi/bluepy/1.1.0

 

Robot ARM - ALAN HAWSE

https://iotexpert.com/

 

PSoC 6 101 Examples

http://www.cypress.com/video-library/PSoC/psoc-6-101-lesson-1-2-psoc-creator-ide/579241

 

 

image

 

PSoC 6 BLE Pioneer Kit Getting Started

 

Before proceeding with the examples, it is best to ensure the PSoC MCU is updated to the latest firmware.

To update the firmware, the PSoC Programmer is used.  Once the Pioneer Kit is plugged into an available USB port using the provided USB cable to the USB Type-C port on the Pioneer Board.

This should be located in the following location (This is with Windows 8)

C:\Program Files\Cypress\Programmer

 

Launch the application and select the KitProg2 from the Pioneer Kit and click Upgrade Firmware

 

image

 

PSoC Creator 4.2 - Create a new project

 

Once PSoC creator is installed, you can either select to open an existing example or create a new one from scratch. Here I show how simple it is to get to Blinky with PSoC Creator 4.2 and the PSoC 6 BLE Pioneer Kit.

NOTE: I found installing PSoC Creator 4.1 Complete first then installing PSoC Creator 4.2 Complete created a clean environment to work with.

 

1. Open PSoC Creator 4.2

 

image

 

2. Select New -> Project from the File menu

image

 

3. Select Target device PSoC 6 -> PSoC 63 and click Next

image

 

4. From the Select project template window, select "Empty schematic"

image

 

5. Leave the defaults in the Select target IDE(s) window.

image

 

6. Set a Workspace name and Project name and Location for the new project

image

 

7. Once Finish is clicked, the main PSoC Creator window will appear.

image

 

8. From the Component Catalog in the right side of the screen, select Digital Output Pin from Ports and Pins and drag it to the workspace area.

image

9. Double click the Digital Output Pin component and set the component Name. Leave the other settings to the defaults.

image

 

10. From Digital -> Functions in the Component catalog, select PWM(TCPWM) and drag it to the workspace.

image

 

11. Double click the PWM component and set the name and the Period 0 to '1000' and  Compare 0 to '500'.

image

 

12. From the Component Catalog, select System -> Clock and drag it to the workspace

image

 

13. Double click the Clock component and set the Frequency to 'kHz'

image

 

14. On the Left of the workspace, select the Wire tool and connect the 'pwm' output to the RED LED component input.

image

 

15. In the Workspace Explorer, double click the 'Pins' option under Design Wide Resources and set the Port/Pin value for the RED LED.

P0[3] is for the RED LED from the RGB LED.

image

 

16. Once the circuit is in place, select Build -> Generate Application from the menu options

image

 

17. If all is well, the Build should succeed.

 

18. Select Build -> Build {Project Name} from the menu options.

    The Build should succeed if all is well.

 

19. Once the build is complete, click the Program button to program the board.

image

  Select  a Debug Target to use to program the board and click OK/Connect.

image

 

20.  If there are no errors, the result should be that the RED RGB LED Blinks.

image

 

Here is a video basically showing the same process of getting to Blinky Via Hardware on the Cypress PSoC 6 BLE Pioneer Kit.

 

 

Cypress PSoC 6 BLE Pioneer Kit FreeRTOS Blinky

 

Another Example I tried was to blink the LEDs using the ARM Cortex M0+ and M4 core simultaneously. This is based on another example I had see where what was shown was to blink an LED from each core separately in different projects. I wanted to do this at the same time.

 

First I took one of the single core projects and then added the other LEDs from the on board  RGB LE to the TopDesign

 

image

 

Since this is not using the Hardware feature of the PSoC, you need to disable the Hardware Connection (HW connection) from the Digital Output of each LED component.

image

 

Then set the Pins for each LED Component to the associated RGB pin:

NOTE:  RED       - P0[3]

             GREEN  -  P1[1]

             BLUE     -  P11[1]

 

image

 

Then in the 'main_cm0p.c' file, I added the following code. I used M0 to blink the BLUE LED.

#include "project.h"


int main(void)
{
    __enable_irq(); /* Enable global interrupts. */
    /* Enable CM4.  CY_CORTEX_M4_APPL_ADDR must be updated if CM4 memory layout is changed. */
    Cy_SysEnableCM4(CY_CORTEX_M4_APPL_ADDR); 


    /* Place your initialization/startup code here (e.g. MyInst_Start()) */


    for(;;)
    {
        /* Place your application code here. */
        Cy_GPIO_Write(BLUE_PORT , BLUE_NUM, 1);
        CyDelay(1000);
        Cy_GPIO_Write(BLUE_PORT , BLUE_NUM, 0);
        CyDelay(1000);


    }
}

 

 

Then in main_cm4.c  I added code to blink the RED and GREEN LED.

#include "project.h"


int main(void)
{
    __enable_irq(); /* Enable global interrupts. */


    /* Place your initialization/startup code here (e.g. MyInst_Start()) */


    for(;;)
    {
        /* Place your application code here. */
        Cy_GPIO_Write(Red_PORT, Red_NUM, 1);
        CyDelay(500);
        Cy_GPIO_Write(Red_PORT, Red_NUM, 0);
        CyDelay(500);
        Cy_GPIO_Write(GREEN_PORT , GREEN_NUM, 1);
        CyDelay(500);
        Cy_GPIO_Write(GREEN_PORT , GREEN_NUM, 0);
        CyDelay(500);


    }
}

 

NOTE: I set the time between the Red and Green blink to 500 where as the blue in M0 was set to 1000 to offset the blinks.

 

This is video showing the working example.

Cypress PSoC 6 BLE Pioneer Kit  RGB control

 

 

Another example I tried was to run FreeRTOS on the Pioneer Kit and blink an LED. The Digital Pin placement was similar to the previous examples so I will skip that here.

 

This is the code that was used to get to Blinky with FreeRTOS

In the 'main_cm0p.c' file, the code to start the M4 core was left in place and no other code was added.

#include "project.h"


int main(void)
{
    __enable_irq(); /* Enable global interrupts. */
    /* Enable CM4.  CY_CORTEX_M4_APPL_ADDR must be updated if CM4 memory layout is changed. */
    Cy_SysEnableCM4(CY_CORTEX_M4_APPL_ADDR); 


    /* Place your initialization/startup code here (e.g. MyInst_Start()) */


    for(;;)
    {
        /* Place your application code here. */
    }
}

 

In the 'main_cm4.c' file, a Task was created to blink the LED and the code to run xTaskCreate and vTaskStartScheduler was added in the main. That is it to blink and LED with FreeRTOS with PSoC Creator and the BLE Pioneer Kit.

#include "project.h"


void LED_TASK(void)
{
    for(;;)
    {
        Cy_GPIO_Write(RED_PORT, RED_NUM, 1);
        vTaskDelay(500);
        Cy_GPIO_Write(RED_PORT, RED_NUM, 0);
        vTaskDelay(500);
    }
    
}
int main(void)
{
    __enable_irq(); /* Enable global interrupts. */


    /* Place your initialization/startup code here (e.g. MyInst_Start()) */
    xTaskCreate(LED_TASK, "LED_TASK", 400, NULL, 1, 0);
    vTaskStartScheduler();


    for(;;)
    {
        /* Place your application code here. */
    }
}

 

 

This is a video I make showing this process and the resulting RGB Blink.

 

 

 

 

Cypress PSoC 6 BLE Pioneer Kit  BLE Test and Debug

 

The CySmart 1.2 Test and Debug Tool from can be used to read the values from the Pioneer Kit via BLE. This requires the CySmart BLE Dongle that was provided with the kit as well as CySmart 1.2 PC application.

NOTE: There are mobile device version as well.

The CE220167 PSoC 6 MCU BLE UI Example was used to test teh BLE connection.

 

1. Ensure the CySmart BLE Dongle is plugged in, Open the CySmart Application and select the CySmart BLE 4.2 dongle from the Supported Targets list.

image

image

 

2. Once the CySmart 1.2 application opens, click on the Start Scan button:

image

 

3. Select the BLE UI device listed (This is the PSoC 6 Dev Kit), select Connect and then click on  "Discover All Attributes"

image

 

4. Click "Enable All Notifications"   to received events from the CapSense devices on the Pioneer Kit.

NOTE: Then Blue Box with Check Mark indicates Notifications are Enabled.

image

 

Characteristics for CapSense:

  0x000E – Shows the values from the CapSense Slider

  0x0018 – Shows the values from the CapSense Buttons

  0x0013 – Used to write values to the RGB LE

       Value: 00:00:00:00 = RED:GREEN:BLUE:Intensity

 

The following video shows this in action.

 

 

 

Cypress PSoC 6 BLE Pioneer Kit CapSense Proximity Sensor

 

The Cypress PSoC 6 BLE Pioneer Kit also has a header at J13 that is used to test the Proximity Sensor option of the CapSense. In the kit is a set of jumper wires and one can be used to create a circle and inserted into J13 as a sensor input.   The CySmart 1.2 application can be used to view the values over BLE.

 

This is how the connection looks.

image

 

In this video I show how to read the values from CySmart 1.2

 

 

BLE to Raspberry Pi Using the PSoC 6 Pioneer Kit

 

This example came by the way of Sparkfun and DigiKey related to the Pioneer IoT Add-on Shield for the PSoC 6 BLE Pioneer Kit.

https://learn.sparkfun.com/tutorials/using-the-psoc-6-pioneer-board-with-the-pioneer-iot-add-on-shield#example--ble-to-r…

 

https://www.digikey.ca/product-detail/en/sparkfun-electronics/DEV-14531/1568-1813-ND/8111235

 

image

 

The example is label:

      Example : BLE to Raspberry Pi Using the PSoC 6 Pioneer Kit

 

This add on board includes headers for an XBee module, Micro-SD slot for data collection and Qwiic connection which can be used to connect with other Sensor modules.

However, at the site and in the downloaded code there is an BLE to Raspberry Pi example that shows one way to communicates with the Pioneer Board from a Raspberry Pi. This example uses BluePy and Bluez for the connection and reading the CapSense button data from the Pioneer kit.

To test this, the code needs to downloaded on the PC and the Raspberry Pi. This includes both the Python code for the RasPi and the PSoC 6 code.

https://github.com/sparkfun/Pioneer_Kit_Shield/archive/master.zip

 

BlueZ

http://www.bluez.org/

 

BluePy

https://pypi.python.org/pypi/bluepy/1.1.0

 

 

On the Raspberry Pi, this code can be downloaded using the 'git' command

 

git clone https://github.com/sparkfun/Pioneer_Kit_Shield

 

If not installed already, install BluePy on the RasPi

$ sudo pip install bluepy
Collecting bluepy
  Downloading bluepy-1.1.4.tar.gz (218kB)
   100% |████████████████████████████████| 225kB 152kB/s
Building wheels for collected packages: bluepy
  Running setup.py bdist_wheel for bluepy ... done
  Stored in directory: /root/.cache/pip/wheels/b0/2e/3b/e04ce57e3c9a72edaa6de88002df305b4071415f627d16f4dd
Successfully built bluepy
Installing collected packages: bluepy
Successfully installed bluepy-1.1.4

 

Once the example code is loaded to the PSoC 6 dev kit, check that the BLE connection is active from the RasPi using 'hcitool'

 

sudo hcitool lescan
LE Scan ...
00:A0:50:21:81:34 PSoC6 CapSense LED
00:A0:50:21:81:34 (unknown)

 

Once the PSoC 6 BLE address is obtained, bluepy install can be check by the following.

$ cd /usr/local/lib/python2.7/dist-packages/bluepy

 
 $ python btle.py 00:A0:50:21:81:34
Connecting to: 00:A0:50:21:81:34, address type: public
Service <uuid=generic attribute="" handlestart="12" handleend="15"> :
 Characteristic , hnd=0xd, supports INDICATE
Service <uuid=generic access="" handlestart="1" handleend="11"> :
 Characteristic , hnd=0x2, supports READ
   -> 'PSoC6 CapSense LED'
 Characteristic , hnd=0x4, supports READ
   -> '\x00\x02'
 Characteristic , hnd=0x6, supports READ
   -> '<\x00P\x00\x00\x00\xc8\x00'
 Characteristic , hnd=0x8, supports READ
   -> '\x00'
 Characteristic <2ac9>, hnd=0xa, supports READ
   -> '\x00'
Service <uuid=53c66884-a327-49d4-b577-aeebf5830d3e handlestart="16" handleend="20"> :
 Characteristic , hnd=0x11, supports NOTIFY
Service <uuid=df7735e8-de2a-4d77-9672-13041499e08b handlestart="26" handleend="30"> :
 Characteristic <0003caa3-0000-1000-8000-00805f9b0131>, hnd=0x1b, supports NOTIFY
Service <uuid=7728c479-ecb9-4938-b349-c286faa650b8 handlestart="21" handleend="25"> :
 Characteristic , hnd=0x16, supports NOTIFY READ WRITE
   -> '\x00\x00\x00\x00'

 

The 'gatttool' can be used to gather the characteristic data from the Pioneer Kit BLE device.

$ sudo bluez-5.43/attrib/gatttool -I
[ ][LE]> connect 00:A0:50:21:81:34
Attempting to connect to 00:A0:50:21:81:34
Connection successful
[00:A0:50:21:81:34][LE]> primary
attr handle: 0x0001, end grp handle: 0x000b uuid: 00001800-0000-1000-8000-00805f9b34fb
attr handle: 0x000c, end grp handle: 0x000f uuid: 00001801-0000-1000-8000-00805f9b34fb
attr handle: 0x0010, end grp handle: 0x0014 uuid: 53c66884-a327-49d4-b577-aeebf5830d3e
attr handle: 0x0015, end grp handle: 0x0019 uuid: 7728c479-ecb9-4938-b349-c286faa650b8
attr handle: 0x001a, end grp handle: 0x001e uuid: df7735e8-de2a-4d77-9672-13041499e08b

 

[00:A0:50:21:81:34][LE]> characteristics
handle: 0x0002, char properties: 0x02, char value handle: 0x0003, uuid: 00002a00-0000-1000-8000-00805f9b34fb
handle: 0x0004, char properties: 0x02, char value handle: 0x0005, uuid: 00002a01-0000-1000-8000-00805f9b34fb
handle: 0x0006, char properties: 0x02, char value handle: 0x0007, uuid: 00002a04-0000-1000-8000-00805f9b34fb
handle: 0x0008, char properties: 0x02, char value handle: 0x0009, uuid: 00002aa6-0000-1000-8000-00805f9b34fb
handle: 0x000a, char properties: 0x02, char value handle: 0x000b, uuid: 00002ac9-0000-1000-8000-00805f9b34fb
handle: 0x000d, char properties: 0x20, char value handle: 0x000e, uuid: 00002a05-0000-1000-8000-00805f9b34fb
handle: 0x0011, char properties: 0x10, char value handle: 0x0012, uuid: f973ac76-6599-4d40-8aba-5d349056e490
handle: 0x0016, char properties: 0x1a, char value handle: 0x0017, uuid: e77b0b04-7e5f-4c39-9439-66d32560c825
handle: 0x001b, char properties: 0x10, char value handle: 0x001c, uuid: 0003caa3-0000-1000-8000-00805f9b0131

 

Turn on BLUE LED:

$ sudo gatttool -i hci0 -b 00:A0:50:21:81:34 --char-write-req --handle=0x0017 --value=0000ffff

 

Read characteristic 29 = 0x001d

$ sudo gatttool -i hci0 -b 00:A0:50:21:81:34 --char-read --handle=0x001d
Characteristic value/descriptor: 00 00

 

Sparkfun Bluepy example:

$ cd Pioneer_Kit_Shield/Software/BLE

 
 $ sudo python scanble.py
Waiting...
Waiting...
Waiting...
Waiting...
Notification received!
btn 1 on
Notification received!
btn 1 off
Notification received!
btn 1 on
Notification received!
btn 1 off
Notification received!
btn 1 on
Notification received!
btn 1 off
Notification received!
btn 1 on
Notification received!
btn 1 off
Notification received!
btn 0 on
Notification received!
btn 0 off
Notification received!
btn 0 on
Notification received!
btn 0 off

 

 

Video showing this in action

 

 

Cypress PSoC 6 BLE Pioneer Kit – E-Ink Mic Test

 

This example show

CE219431 - PSoC 6 MCU PDM-to-PCM Example

http://www.cypress.com/documentation/code-examples/ce219431-psoc-6-mcu-pdm-pcm-example

 

This example shows how to use the pulse-density modulation/pulse-code modulation (PDM/PCM) hardware block in PSoC 6 with E-INK Microphone.

 

Block Diagram from CE219431 Example PDF

image

 

Text from Example:

"The CY8CKIT-028-EPD shield has a microphone with a single-bit PDM output. This allows you to convert any audio captured by the microphone into a digital signal (PDM). The PSoC 6 device in CY8CKIT-062 converts this digital signal to a quantized 16-bit value (PCM). An interrupt is triggered when there is enough data to be processed (at least 128 samples). The absolute values of the samples are summed and divided by the number of samples. This represents the overall loudness of the sound, which is proportional to the volume"

 

In this video I show this working on the Cypress PSoC 6 BLE Pioneer Kit.

 

 

Since this review is getting a bit long, I'll make this the last example for now.  I may come back to add more later.

 

Cypress PSoC 6 BLE Pioneer Kit  - Battery Powered

This is a quick example of running the Cypress PSoC 6 BLE Pioneer Kit off of a 3.7v LiPo Battery.  I had an old printer board that had a couple right angle JST headers, so I snagged one off and placed it at J15 on the Pioneer board.  When the USB Type-C connection is active, the Battery LED indicates that it is charging the battery by turning red.  When the USB connection is removed, the board still functions as expected with out interruption.

 

This video show the board being powered by  3.7v LiPo Battery.

 

Conclusion

 

The Cypress PSoC 6 BLE Pioneer Kit offers a wide variety of options that cover BLE connections to Touch sensing via the CapSense Touch Pad.  The PSoC 6 MCU brings a new dimension to Embedded development that enhances the flexibility of the ARM cores that are part of the PSoC. This allows circuits to be build on chip rather than externally reducing the footprint a board layout. There are features of kit that I would like to explore such as RTOS debugging using a J-Link Debugger and Percepio Tracealyzer as well as using the board to power a Robotic platform.  The Add-On card from DigiKey to add XBee connectivity would be a cool options to explore as well.  I'll certainly enjoy continuing to work with the Cypress PSoC 6 BLE Pioneer Kit in the future.

Thanks element14 for allowing me this opportunity to review this very cool board.

 

Cheers,

 

Jon

Anonymous