<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mouser PSoC 6 &#8211; IoT Expert</title>
	<atom:link href="https://iotexpert.com/category/misc/mouser-psoc-6/feed/" rel="self" type="application/rss+xml" />
	<link>https://iotexpert.com</link>
	<description>Engineering for the Internet of Things</description>
	<lastBuildDate>Mon, 22 Oct 2018 11:33:48 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://iotexpert.com/wp-content/uploads/2017/01/cropped-Avatar-32x32.jpg</url>
	<title>Mouser PSoC 6 &#8211; IoT Expert</title>
	<link>https://iotexpert.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Lesson 5 &#8211; PSoC 6 Introduction: Bluetooth Low Energy</title>
		<link>https://iotexpert.com/lesson-5-psoc-6-introduction-bluetooth-low-energy/</link>
					<comments>https://iotexpert.com/lesson-5-psoc-6-introduction-bluetooth-low-energy/#comments</comments>
		
		<dc:creator><![CDATA[Alan Hawse]]></dc:creator>
		<pubDate>Thu, 09 Nov 2017 13:05:36 +0000</pubDate>
				<category><![CDATA[Mouser PSoC 6]]></category>
		<category><![CDATA[PSoC 6]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=4582</guid>

					<description><![CDATA[Project Description This project is a PSoC 6 BLE extension of the previous project with CapSense and UART. The BLE will: Advertise the device with the name &#8220;P6Intro&#8221; and as having the CapSense Service Will allow one connection (with no security) A BLE CapSense Service with the CapSense Slider characteristic as &#8220;notify&#8221; When the CapSense slider [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><span><h1>PSoC 6 Introduction</h1>
<p><div class="table-responsive"><table  style="width:95%; "  class="easy-table easy-table-default " border="1">
<thead>
<tr><th >#</th>
<th >Title</th>
<th >Comment</th>
</tr>
</thead>
<tbody>
<tr><td >0</td>
<td ><a href="https://iotexpert.com/2017/11/07/lesson-0-psoc-6-introduction-a-two-hour-psoc-6-class/">A Two Hour PSoC 6 Class</a></td>
<td >An introduction to the PSoC 6 class with links to all of the documents</td>
</tr>

<tr><td >1</td>
<td ><a href="https://iotexpert.com/2017/11/08/lesson-1-psoc-6-introduction-resources/" rel="noopener">Resources</a></td>
<td >Links to all of the Cypress PSoC 6 information including videos, application notes etc.</td>
</tr>

<tr><td >2</td>
<td ><a href="https://iotexpert.com/2017/11/08/lesson-2-psoc-6-introduction-first-project/">Your First Project</a></td>
<td >Learn how to build a PSoC 6 project and program your CY8CKIT-062-BLE development kit</td>
</tr>

<tr><td >3</td>
<td ><a href="https://iotexpert.com/2017/11/09/lesson-3-psoc-6-introduction-freertos-and-a-debugging-uart/" rel="noopener">FreeRTOS and a Debugging UART</a></td>
<td >Build a project using FreeRTOS including a debug console with the UART</td>
</tr>

<tr><td >4</td>
<td ><a href="https://iotexpert.com/2017/11/09/lesson-4-psoc-6-introduction-capsense/" rel="noopener">CapSense</a></td>
<td >Build a project using the Mutual Cap Buttons and Self Cap Slider</td>
</tr>

<tr><td >5</td>
<td ><a href="https://iotexpert.com/2017/11/09/lesson-5-psoc-6-introduction-bluetooth-low-energy/" rel="noopener">Bluetooth Low Energy</a></td>
<td >Build a CapSense project using BLE and CySmart</td>
</tr>
</tbody></table></div></p>
<p>Since I did the webinar several things have happened</p>
<ol>
<li>Lesson 4: I fixed an error in the stack size for FreeRTOS</li>
<li>Lesson 5: The PSoC Creator BLE PDL has been upgraded to greatly simplify the notifyCapSense function</li>
</ol>
<p>All of the projects are available at git@github.com:iotexpert/psoc-6-introduction.git or <a href="https://github.com/iotexpert/psoc-6-introduction" target="_blank" rel="noopener">www.github.com/iotexpert/psoc-6-introduction</a></p></span></p>
<h1>Project Description</h1>
<p>This project is a PSoC 6 BLE extension of the previous project with CapSense and UART.</p>
<p>The BLE will:</p>
<ul>
<li>Advertise the device with the name &#8220;P6Intro&#8221; and as having the CapSense Service</li>
<li>Will allow one connection (with no security)</li>
<li>A BLE CapSense Service with the CapSense Slider characteristic as &#8220;notify&#8221;</li>
<li>When the CapSense slider updates it will send a notification to any connected device</li>
</ul>
<p>The CapSense will (same as before)</p>
<ul>
<li>BTN0 will set the intensity to 0%</li>
<li>BTN1 will set the intensity to 100%</li>
<li>CapSense slider will set the intensity (0-100) when touched</li>
</ul>
<p>The UART will (same as before)</p>
<ul>
<li>UART Key &#8216;0&#8217; turn the LED to intensity = 0%</li>
<li>UART Key &#8216;1&#8217; turn the LED to intensity = 100%</li>
<li>UART Key &#8216;5&#8217; turn the LED to intensity = 50%</li>
<li>UART Key &#8216;?&#8217; will printout help</li>
</ul>
<h1>How does it work?</h1>
<p>This device will act as a GAP Peripheral with a GATT database server with the <a href="http://www.cypress.com/documentation/software-and-drivers/cypresss-custom-ble-profiles-and-services" target="_blank" rel="noopener">CapSense Service</a>.  The PSoC 6 BLE component will allow you to split the BLE function onto the CM0+ (Controller) and the CM4 (Host and Profiles).  On the CM4 you will build an event handler which will act each time something happens in the Bluetooth world e.g. a connection, a disconnection, a read or write.</p>
<p>(same as previous project) You can control the intensity of an LED with a pulse width modulator and a high frequency input clock.  If the duty cycle is &#8220;small&#8221; then the intensity of the LED is low (meaning dim).  If the duty cycle is &#8220;big&#8221; then the intensity is &#8220;high&#8221;.  A 0% duty cycle will be off, a 50% duty cycle will be in the middle and 100% duty cycle will be all on.  To make this work I will set the input clock to 1 MHZ and the PWM Period to 100.  The PWM Compare value will then be set between 0 and 100 to represent brightness in percent.</p>
<p>(same as previous project) The Cypress CapSense block has two sensing modes, mutual capacitance and self-capacitance.   The CY8CKIT-062-BLE has two Mutual Capacitance buttons and a 5-Segment Self or Mutual Capacitance Slider.</p>
<p>The project will have four tasks</p>
<ul>
<li>BLE &#8211; Will act as a BLE GATT Peripheral that advertises the CapSense Service with the CapSense Slider.  The value of the slider will &#8216;Notify&#8217;</li>
<li>UART &#8211; Read data from the keyboard and send messages to the PWM Task</li>
<li>CapSense &#8211; Read finger positions from the slider and buttons and send messages to the PWM Task</li>
<li>PWM &#8211; Will have an input queue, when a integer message is received it will set the PWM compare value to the integer received (0 &gt;= msg &lt;= 100)</li>
</ul>
<h1>How am I going to do it?</h1>
<ol>
<li>Copy, Paste and Rename the CapSense UART Project</li>
<li>Add and Configure the BLE Component</li>
<li>Fix the Interrupts</li>
<li>Update the main_cm0p. c to run the BLE radio</li>
<li>Add three global variables to main_cm4.c</li>
<li>Create a new task to process the BLE</li>
<li>Create an Event Handler</li>
<li>Make a Function to Send Notifications</li>
<li>Update the capSenseTask to Send Values</li>
<li>Add the bleTask to main function in main_cm4.c</li>
<li>Program and Test</li>
</ol>
<h1>Copy, Paste and Rename the CapSense UART Project</h1>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.23.37-PM.png"><img fetchpriority="high" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.23.37-PM-603x1024.png" alt="" width="603" height="1024" class="alignnone size-large wp-image-4585" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.23.37-PM-603x1024.png 603w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.23.37-PM-600x1018.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.23.37-PM-177x300.png 177w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.23.37-PM.png 608w" sizes="(max-width: 603px) 100vw, 603px" /></a></p>
<p>Right click on the PSoC-6-Introdution and Paste</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.34.05-PM.png"><img decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.34.05-PM.png" alt="" width="636" height="550" class="alignnone size-full wp-image-4586" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.34.05-PM.png 636w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.34.05-PM-600x519.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.34.05-PM-300x259.png 300w" sizes="(max-width: 636px) 100vw, 636px" /></a></p>
<p>Right click and rename the project to be CapSense_BLE</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.35.14-PM.png"><img decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.35.14-PM-626x1024.png" alt="" width="626" height="1024" class="alignnone size-large wp-image-4587" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.35.14-PM-626x1024.png 626w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.35.14-PM-600x981.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.35.14-PM-183x300.png 183w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.35.14-PM.png 650w" sizes="(max-width: 626px) 100vw, 626px" /></a></p>
<p>When is asks you to rename&#8230; do it</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.36.02-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.36.02-PM.png" alt="" width="944" height="722" class="alignnone size-full wp-image-4588" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.36.02-PM.png 944w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.36.02-PM-600x459.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.36.02-PM-300x229.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.36.02-PM-768x587.png 768w" sizes="auto, (max-width: 944px) 100vw, 944px" /></a></p>
<p>It should look like this now.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.24.21-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.24.21-PM.png" alt="" width="543" height="958" class="alignnone size-full wp-image-4584" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.24.21-PM.png 543w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.24.21-PM-170x300.png 170w" sizes="auto, (max-width: 543px) 100vw, 543px" /></a></p>
<h1>Add and Configure the BLE Component</h1>
<p>Go to the Component Catalog and find the Bluetooth Low Energy component and drag/drop it into your design schematic.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.37.17-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.37.17-PM-854x1024.png" alt="" width="854" height="1024" class="alignnone size-large wp-image-4589" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.37.17-PM-854x1024.png 854w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.37.17-PM-600x720.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.37.17-PM-250x300.png 250w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.37.17-PM-768x921.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.37.17-PM.png 1143w" sizes="auto, (max-width: 854px) 100vw, 854px" /></a></p>
<p>Configure the component to be a &#8220;Dual Core &#8230;&#8221; and set the  number of connections to 1.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.38.36-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.38.36-PM-1024x843.png" alt="" width="1024" height="843" class="alignnone size-large wp-image-4590" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.38.36-PM-1024x843.png 1024w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.38.36-PM-600x494.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.38.36-PM-300x247.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.38.36-PM-768x632.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.38.36-PM.png 1313w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Add the Capsense service to your server by clicking &#8220;Load Service&#8230;&#8221;</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.20.44-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.20.44-PM-1024x825.png" alt="" width="1024" height="825" class="alignnone size-large wp-image-4595" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.20.44-PM-1024x825.png 1024w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.20.44-PM-600x483.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.20.44-PM-300x242.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.20.44-PM-768x619.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.20.44-PM.png 1562w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>And selecting the &#8220;CapSense.service&#8221; file.  I created this file to have the right UUIDs and characteristics.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.21.10-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.21.10-PM-1024x950.png" alt="" width="1024" height="950" class="alignnone size-large wp-image-4594" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.21.10-PM-1024x950.png 1024w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.21.10-PM-600x557.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.21.10-PM-300x278.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.21.10-PM-768x712.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.21.10-PM.png 1466w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a> <a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.20.44-PM.png"></a></p>
<p>You can now look at the CapSense Slider service and the CapSlider characteristic</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.21.36-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.21.36-PM-1024x821.png" alt="" width="1024" height="821" class="alignnone size-large wp-image-4593" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.21.36-PM-1024x821.png 1024w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.21.36-PM-600x481.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.21.36-PM-300x240.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.21.36-PM-768x616.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.21.36-PM.png 1562w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Set the name of our peripheral in the &#8220;GAP Settings&#8221;.  In this case I will call it P6INTRO.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.23.45-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.23.45-PM-1024x827.png" alt="" width="1024" height="827" class="alignnone size-large wp-image-4596" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.23.45-PM-1024x827.png 1024w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.23.45-PM-600x485.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.23.45-PM-300x242.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.23.45-PM-768x620.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.23.45-PM.png 1560w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Configure the advertising settings to advertise the name of the device and the CapSense Service.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.24.09-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.24.09-PM-1024x823.png" alt="" width="1024" height="823" class="alignnone size-large wp-image-4597" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.24.09-PM-1024x823.png 1024w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.24.09-PM-600x482.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.24.09-PM-300x241.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.24.09-PM-768x618.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-2.24.09-PM.png 1562w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<h1>Fix the Interrupts</h1>
<p>Almost all of the interrupt sources in the PSoC 6 can be connected to one or both of the Cortex cores.  I think that you are probably crazy to attach it to both.  In this case the BLE interrupt needs to be connected to the &#8220;ARM CM0+&#8221;</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.51.43-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.51.43-PM-1024x378.png" alt="" width="1024" height="378" class="alignnone size-large wp-image-4591" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.51.43-PM-1024x378.png 1024w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.51.43-PM-600x221.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.51.43-PM-300x111.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.51.43-PM-768x283.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-05-at-4.51.43-PM.png 1491w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<h1>Update main_cm0p. c to Run the BLE Radio Controller</h1>
<pre class="lang:c decode:true" title="main_cm0.c">#include &lt;project.h&gt;
int main(void)
{
    __enable_irq(); /* Enable global interrupts. */
  
   
    Cy_BLE_Start(0);
    
    /* Enable CM4.  CY_CORTEX_M4_APPL_ADDR must be updated if CM4 memory layout is changed. */
    Cy_SysEnableCM4(CY_CORTEX_M4_APPL_ADDR); 
    

    for(;;)
    {
        Cy_BLE_ProcessEvents();
    }
}
</pre>
<h1>Add three global variables to main_cm4.c</h1>
<p>The BLE Task will have a queue that the CapSense will use to send out changes in the CapSense Slider.</p>
<pre class="start-line:9 EnlighterJSRAW" data-enlighter-language="c"" title="Global Variables in main_cm4.c">QueueHandle_t bleQueueHandle;
int connected=0;
int notify=0;
</pre>
<h1>Create a new task to process the BLE</h1>
<p>The. task will just start up the BLE processing on the CM4.  Then it will cause the BLE event manager to run.  If a new value of the CapSense slider is set, it will send out a notification using the &#8220;notifyCapSense&#8221; function</p>
<pre class="start-line:61 lang:c decode:true " title="bleTask in main_cm4.c">// bleTask handles the BLE connection (or not).. if the user connects and turns on
// notifications then it sends out new values of the CapSense slider
void bleTask(void *arg)
{
    (void)arg;   
    uint32_t msg;
    
    printf("Starting BLE Task\r\n");
    bleQueueHandle = xQueueCreate(1,sizeof(uint32_t));
    Cy_BLE_Start(customEventHandler);
    
    for(;;)
    {
        Cy_BLE_ProcessEvents();
        
        // CapSense task will put CapSense slider values in the bleQueueHandle
        if(xQueueReceive(bleQueueHandle,&amp;msg,0) == pdTRUE)
            notifyCapSense((uint8_t)msg);
       
        taskYIELD();
    }
}
</pre>
<h1>Create an Event Handler</h1>
<p>You will need a task to handle the BLE processing on the CM4.  Each time a Bluetooth event occurs you will need to do &#8220;something&#8221;</p>
<pre class="start-line:29 lang:c decode:true" title="customEventHandler in main_cm4.c">// This event handler is called by BLE
void customEventHandler(uint32_t event, void *eventParameter)
{
     cy_stc_ble_gatts_write_cmd_req_param_t   *writeReqParameter;   

    switch (event)
    {
        case CY_BLE_EVT_STACK_ON:
        case CY_BLE_EVT_GAP_DEVICE_DISCONNECTED: // Central disconnects
            Cy_BLE_GAPP_StartAdvertisement(CY_BLE_ADVERTISING_FAST,CY_BLE_PERIPHERAL_CONFIGURATION_0_INDEX);
            connected = 0;
            notify=0;
        break;

        case CY_BLE_EVT_GATT_CONNECT_IND: // A Central connection is made
            connected = 1;
        break;
        
        case CY_BLE_EVT_GATTS_WRITE_REQ:
            writeReqParameter = (cy_stc_ble_gatts_write_cmd_req_param_t *)eventParameter;

            if(CY_BLE_CAPSENSE_CAPSLIDER_CLIENT_CHARACTERISTIC_CONFIGURATION_DESC_HANDLE ==  writeReqParameter-&gt;handleValPair.attrHandle)
                notify = writeReqParameter-&gt;handleValPair.value.val[0];
              
            Cy_BLE_GATTS_WriteRsp(writeReqParameter-&gt;connHandle);
        break;

        default: // Ignore all other events
        break;
    }
}
</pre>
<h1>Make a Function to Send Notifications</h1>
<pre class="start-line:13 lang:c decode:true ">// This function is run inside BLE Task and sends notification if you are connected and notifications are on
void notifyCapSense(uint8_t capValue)
{    
    if(!(connected &amp;&amp; notify))
        return;
    
    cy_stc_ble_gatts_handle_value_ntf_t v1;
    v1.connHandle = cy_ble_connHandle[0];
    v1.handleValPair.attrHandle = CY_BLE_CAPSENSE_CAPSLIDER_CHAR_HANDLE;
    v1.handleValPair.value.len = 1;
    v1.handleValPair.value.val = &amp;capValue;
    
    Cy_BLE_GATTS_Notification(&amp;v1);
        
}
</pre>
<p><strong>EDIT!!!!</strong></p>
<p>If you look at the source code at GitHub you will find that I removed the variables &#8220;connected&#8221; and &#8220;notify&#8221; and I changed the notifyCapSense function.  This was done because the BLE PDL implementation was greatly improved and simplified. The new function iterates through the connections and sends the notification to all of them.  This was done to handle multiple connections.</p>
<pre class="start-line:12 lang:c decode:true ">// This function is run inside BLE Task and sends notification if you are connected and notifications are on
void notifyCapSense(uint8_t capValue)
{    
   
    unsigned int index;
    
    printf("Sending CapSense %d\r\n",capValue);
   
    cy_stc_ble_gatt_handle_value_pair_t handleValuePair;
    handleValuePair.attrHandle = CY_BLE_CAPSENSE_CAPSLIDER_CHAR_HANDLE;
    handleValuePair.value.val = &amp;capValue;
    handleValuePair.value.len = 1;
    
    Cy_BLE_GATTS_WriteAttributeValueLocal(&amp;handleValuePair);
   
    /* Iterate and send notiication to all the connected devices that are ready to receive notification */
    for(index = 0; index &lt;CY_BLE_CONN_COUNT; index++)
    {     
        Cy_BLE_GATTS_SendNotification(&amp;cy_ble_connHandle[index], &amp;handleValuePair);
    }
        
}</pre>
<h1>Update the capSenseTask to Send Values</h1>
<p>Inside of the capsenseTask you need to send new values of the slider to the BLE task via the Queue.  Meaning the BLE task needs to send out notifications, but it can only do that if the capsenseTask notifies it of changes.</p>
<pre class="start-line:188 lang:c decode:true ">sliderPos=CapSense_GetCentroidPos(CapSense_LINEARSLIDER0_WDGT_ID);
            if(sliderPos&lt;0xFFFF) // If they are touching the slider then send the %
            {
                msg = sliderPos;
                xQueueSend(pwmQueueHandle,&amp;msg,0); // Send message to PWM - change brightness
                xQueueSend(bleQueueHandle,&amp;msg,0); // Send message to BLE
            }</pre>
<h1>Add the bleTask to main function in main_cm4.c</h1>
<p>In the main function you need to start the BLE Task.</p>
<pre class="lang:c decode:true">xTaskCreate( bleTask, "BLE Task",4096,0,3,0);</pre>
<h1>Program and Test</h1>
<p>To test this project I will run the CySmart iOS App.  First, you can see all of the devices that are advertising</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/IMG_5102.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/IMG_5102-576x1024.png" alt="CySmart" width="576" height="1024" class="alignnone size-large wp-image-4665" srcset="https://iotexpert.com/wp-content/uploads/2017/11/IMG_5102-576x1024.png 576w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_5102-600x1067.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_5102-169x300.png 169w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_5102-768x1365.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_5102.png 1242w" sizes="auto, (max-width: 576px) 100vw, 576px" /></a></p>
<p>Scroll left (or right) to find the &#8220;CapSense Slider&#8221;</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/IMG_5106.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/IMG_5106-576x1024.png" alt="" width="576" height="1024" class="alignnone size-large wp-image-4663" srcset="https://iotexpert.com/wp-content/uploads/2017/11/IMG_5106-576x1024.png 576w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_5106-600x1067.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_5106-169x300.png 169w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_5106-768x1365.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_5106.png 1242w" sizes="auto, (max-width: 576px) 100vw, 576px" /></a></p>
<p>When you see it, Press on the CapSense Slider Icon</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/IMG_5105.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/IMG_5105-576x1024.png" alt="" width="576" height="1024" class="alignnone size-large wp-image-4664" srcset="https://iotexpert.com/wp-content/uploads/2017/11/IMG_5105-576x1024.png 576w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_5105-600x1067.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_5105-169x300.png 169w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_5105-768x1365.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_5105.png 1242w" sizes="auto, (max-width: 576px) 100vw, 576px" /></a></p>
<p>Then put your finger on the slider and you should see it change</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/IMG_5104.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/IMG_5104-576x1024.png" alt="" width="576" height="1024" class="alignnone size-large wp-image-4666" srcset="https://iotexpert.com/wp-content/uploads/2017/11/IMG_5104-576x1024.png 576w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_5104-600x1067.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_5104-169x300.png 169w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_5104-768x1365.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_5104.png 1242w" sizes="auto, (max-width: 576px) 100vw, 576px" /></a></p>
<p>Here is a picture of the whole system.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/IMG_1228.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/IMG_1228-1024x768.jpg" alt="PSoC 6 BLE CapSense &amp; CySmart" width="1024" height="768" class="alignnone size-large wp-image-4668" srcset="https://iotexpert.com/wp-content/uploads/2017/11/IMG_1228-1024x768.jpg 1024w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_1228-600x450.jpg 600w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_1228-300x225.jpg 300w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_1228-768x576.jpg 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/lesson-5-psoc-6-introduction-bluetooth-low-energy/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
		<item>
		<title>Lesson 4 &#8211; PSoC 6 Introduction: CapSense</title>
		<link>https://iotexpert.com/lesson-4-psoc-6-introduction-capsense/</link>
					<comments>https://iotexpert.com/lesson-4-psoc-6-introduction-capsense/#comments</comments>
		
		<dc:creator><![CDATA[Alan Hawse]]></dc:creator>
		<pubDate>Thu, 09 Nov 2017 13:05:17 +0000</pubDate>
				<category><![CDATA[Mouser PSoC 6]]></category>
		<category><![CDATA[PSoC 6]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=4547</guid>

					<description><![CDATA[Project Description This project is a demonstration of a PSoC 6 running an RTOS using CapSense and the UART to control the intensity of the Red LED with a Pulse Width Modulator (PWM) The CapSense will: BTN0 will set the intensity to 0% BTN1 will set the intensity to 100% CapSense slider will set the intensity [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><span><h1>PSoC 6 Introduction</h1>
<p><div class="table-responsive"><table  style="width:95%; "  class="easy-table easy-table-default " border="1">
<thead>
<tr><th >#</th>
<th >Title</th>
<th >Comment</th>
</tr>
</thead>
<tbody>
<tr><td >0</td>
<td ><a href="https://iotexpert.com/2017/11/07/lesson-0-psoc-6-introduction-a-two-hour-psoc-6-class/">A Two Hour PSoC 6 Class</a></td>
<td >An introduction to the PSoC 6 class with links to all of the documents</td>
</tr>

<tr><td >1</td>
<td ><a href="https://iotexpert.com/2017/11/08/lesson-1-psoc-6-introduction-resources/" rel="noopener">Resources</a></td>
<td >Links to all of the Cypress PSoC 6 information including videos, application notes etc.</td>
</tr>

<tr><td >2</td>
<td ><a href="https://iotexpert.com/2017/11/08/lesson-2-psoc-6-introduction-first-project/">Your First Project</a></td>
<td >Learn how to build a PSoC 6 project and program your CY8CKIT-062-BLE development kit</td>
</tr>

<tr><td >3</td>
<td ><a href="https://iotexpert.com/2017/11/09/lesson-3-psoc-6-introduction-freertos-and-a-debugging-uart/" rel="noopener">FreeRTOS and a Debugging UART</a></td>
<td >Build a project using FreeRTOS including a debug console with the UART</td>
</tr>

<tr><td >4</td>
<td ><a href="https://iotexpert.com/2017/11/09/lesson-4-psoc-6-introduction-capsense/" rel="noopener">CapSense</a></td>
<td >Build a project using the Mutual Cap Buttons and Self Cap Slider</td>
</tr>

<tr><td >5</td>
<td ><a href="https://iotexpert.com/2017/11/09/lesson-5-psoc-6-introduction-bluetooth-low-energy/" rel="noopener">Bluetooth Low Energy</a></td>
<td >Build a CapSense project using BLE and CySmart</td>
</tr>
</tbody></table></div></p>
<p>Since I did the webinar several things have happened</p>
<ol>
<li>Lesson 4: I fixed an error in the stack size for FreeRTOS</li>
<li>Lesson 5: The PSoC Creator BLE PDL has been upgraded to greatly simplify the notifyCapSense function</li>
</ol>
<p>All of the projects are available at git@github.com:iotexpert/psoc-6-introduction.git or <a href="https://github.com/iotexpert/psoc-6-introduction" target="_blank" rel="noopener">www.github.com/iotexpert/psoc-6-introduction</a></p></span></p>
<h1>Project Description</h1>
<p>This project is a demonstration of a PSoC 6 running an RTOS using CapSense and the UART to control the intensity of the Red LED with a Pulse Width Modulator (PWM)</p>
<p>The CapSense will:</p>
<ul>
<li>BTN0 will set the intensity to 0%</li>
<li>BTN1 will set the intensity to 100%</li>
<li>CapSense slider will set the intensity (0-100) when touched</li>
</ul>
<p>The UART will:</p>
<ul>
<li>UART Key &#8216;0&#8217; turn the LED to intensity = 0%</li>
<li>UART Key &#8216;1&#8217; turn the LED to intensity = 100%</li>
<li>UART Key &#8216;5&#8217; turn the LED to intensity = 50%</li>
<li>UART Key &#8216;?&#8217; will printout help</li>
</ul>
<h1>How does it work?</h1>
<p>You can control the intensity of an LED with a pulse width modulator and a high frequency input clock.  If the duty cycle is &#8220;small&#8221; then the intensity of the LED is low (meaning dim).  If the duty cycle is &#8220;big&#8221; then the intensity is &#8220;high&#8221;.  A 0% duty cycle will be off, a 50% duty cycle will be in the middle and 100% duty cycle will be all on.  To make this work I will set the input clock to 1 MHz and the PWM Period to 100.  The PWM Compare value will then be set between 0 and 100 to represent brightness in percent.</p>
<p>The Cypress CapSense block has two sensing modes, mutual capacitance and self capacitance.   The CY8CKIT-062-BLE has two Mutual Capacitance buttons and a 5 segment Self or Mutual Capacitance Slider.</p>
<p>The project will have three tasks</p>
<ul>
<li>UART &#8211; Read data from the keyboard and send messages to the PWM Task</li>
<li>CapSense &#8211; Read finger positions from the slider and buttons and send messages to the PWM Task</li>
<li>PWM &#8211; Will have an input queue, when a integer message is received it will set the PWM compare value to the integer received (0 &gt;= msg &lt;= 100)</li>
</ul>
<h1>How am I going to do it?</h1>
<ol>
<li>Create a new project by copy/paste the FreeRTOS-UART Project</li>
<li>Configure Schematic for Higher Frequency Clock and Change PWM Settings</li>
<li>Add a new PWM task and modify the UART</li>
<li>Program and Test</li>
<li>Edit the FreeRTOS.h and make a bigger heap</li>
<li>Add the CapSense Buttons to the Schematic and Set the Pins</li>
<li>Add the capsenseTask</li>
<li>Program and Test</li>
<li>Add the CapSense Slider to the Schematic and Set the Pins</li>
<li>Update the capsenseTask</li>
<li>Program and Test</li>
</ol>
<h1>Create a new Project by Copy/Paste of FreeRTOS-UART Project</h1>
<p>Right click on the FreeRTOS-UART Project then select &#8220;Copy&#8221;</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-9.35.25-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-9.35.25-AM.png" alt="PSoC 6 Create New Project - Copy" width="512" height="716" class="alignnone wp-image-4554 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-9.35.25-AM.png 512w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-9.35.25-AM-215x300.png 215w" sizes="auto, (max-width: 512px) 100vw, 512px" /></a></p>
<p>Then right click on the Workspace and select &#8220;Paste&#8221;</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-9.35.48-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-9.35.48-AM.png" alt="PSoC 6 Create New Project - Paste" width="393" height="473" class="alignnone wp-image-4553 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-9.35.48-AM.png 393w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-9.35.48-AM-249x300.png 249w" sizes="auto, (max-width: 393px) 100vw, 393px" /></a></p>
<p>&nbsp;</p>
<p>Right click on &#8220;FreeRTOS-UART-Copy01)&#8221; and rename it to &#8220;CapSense&#8221;</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-9.32.51-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-9.32.51-AM.png" alt="PSoC 6 Create New Project - Rename" width="491" height="735" class="alignnone wp-image-4551 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-9.32.51-AM.png 491w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-9.32.51-AM-200x300.png 200w" sizes="auto, (max-width: 491px) 100vw, 491px" /></a></p>
<p>Click &#8220;Rename&#8221; (all of these files will be regenerated so it doesn&#8217;t really matter)</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-9.33.09-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-9.33.09-AM.png" alt="PSoC 6 Create New Project - Rename" width="631" height="486" class="alignnone wp-image-4550 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-9.33.09-AM.png 631w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-9.33.09-AM-600x462.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-9.33.09-AM-300x231.png 300w" sizes="auto, (max-width: 631px) 100vw, 631px" /></a></p>
<p>Close all windows by right clicking &#8220;Close All But This&#8221; on the start tab</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-9.33.29-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-9.33.29-AM.png" alt="PSoC Creator Close All Windows" width="321" height="350" class="alignnone wp-image-4549 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-9.33.29-AM.png 321w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-9.33.29-AM-275x300.png 275w" sizes="auto, (max-width: 321px) 100vw, 321px" /></a></p>
<h1>Configure Schematic for Higher Frequency Clock and Change PWM Settings</h1>
<p>If you blink the LED fast enough, you will not be able to see the &#8220;Blink&#8221; it will just appear to be bright or dim based on the duty cycle.  Start by changing the clock to 1 MHz.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-10.54.07-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-10.54.07-AM.png" alt="PSoC 6 Update Clock" width="625" height="479" class="alignnone wp-image-4558 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-10.54.07-AM.png 625w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-10.54.07-AM-600x460.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-10.54.07-AM-300x230.png 300w" sizes="auto, (max-width: 625px) 100vw, 625px" /></a></p>
<p>Double click on the PWM_1</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-10.53.55-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-10.53.55-AM.png" alt="PSoC 6 Update TCPWM" width="489" height="311" class="alignnone wp-image-4559 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-10.53.55-AM.png 489w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-10.53.55-AM-300x191.png 300w" sizes="auto, (max-width: 489px) 100vw, 489px" /></a></p>
<p>Fix the Period to be 100 and the compare to be 50</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-10.53.06-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-10.53.06-AM.png" alt="PSoC 6 Update TCPWM" width="845" height="622" class="alignnone wp-image-4561 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-10.53.06-AM.png 845w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-10.53.06-AM-600x442.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-10.53.06-AM-300x221.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-10.53.06-AM-768x565.png 768w" sizes="auto, (max-width: 845px) 100vw, 845px" /></a></p>
<p>The LED on the CY8CKIT-062-BLE is active low which means that when it is 0 the LED is on.  I want the opposite behavior so I can configure the PWM output to be inverted on the advanced tab.  Click the button next to &#8220;Invert PWM Output&#8221;</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-10.53.21-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-10.53.21-AM.png" alt="PSoC 6 Update TCPWM Advanced" width="845" height="618" class="alignnone wp-image-4560 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-10.53.21-AM.png 845w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-10.53.21-AM-600x439.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-10.53.21-AM-300x219.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-10.53.21-AM-768x562.png 768w" sizes="auto, (max-width: 845px) 100vw, 845px" /></a></p>
<h1>Add a new PWM Task and Modify the UART Task</h1>
<p>Next, I will create the pwmTask function.  It will simply wait for someone to send a message to the pwmQueue.  The message is simply a uint32_t that represents the PWM compare value &#8230; aka the percent intensity of the LED.  When it gets the value, it will update the hardware.</p>
<p><strong>Edit:</strong> In the comments below you can see that Charles asked that I clarify where these functions should go.  When I did this, I put them basically at the top of the file&#8230; just under the #includes.   The only thing that really matters is that they need to be put before they are used so that the compiler knows the function prototypes.  If you put them after they are used then you need to make forward declarations.</p>
<pre class="start-line:20 lang:c decode:true">#include "queue.h"
QueueHandle_t pwmQueueHandle; 

// This task controls the PWM
void pwmTask(void *arg)
{
    (void)arg;
    
    uint32_t msg;
    
    printf("Starting PWM Task\r\n");
    pwmQueueHandle = xQueueCreate(1,sizeof(uint32_t));
   
    while(1)
    {
        xQueueReceive(pwmQueueHandle,&amp;msg,portMAX_DELAY);
        Cy_TCPWM_PWM_SetCompare0(PWM_1_HW,PWM_1_CNT_NUM,msg);
   }
}
</pre>
<p>In the main function you need to start the pwmTask</p>
<pre class="lang:c decode:true " title="main_cm4.c">xTaskCreate(pwmTask,"PWM Task",configMINIMAL_STACK_SIZE*8,0,3,0);</pre>
<p>Next, I will update the uartTask</p>
<ul>
<li>To not getchar&#8217;s unless there is something in the RX buffer of the UART (line 13).</li>
<li>Create a message aka a uin32_t based on the key pressed and send it with xQueueSend</li>
<li>If there was nothing there then taskYIELD to one of the other tasks (line 35)</li>
</ul>
<pre class="lang:c decode:true">// uartTask - the function which handles input from the UART
void uartTask(void *arg)
{
    (void)arg;
    
    char c;
    uint32_t msg;

    printf("Started UART Task\r\n");
    setvbuf(stdin,0,_IONBF,0);
	while(1)
	{
		if(Cy_SCB_UART_GetNumInRxFifo(UART_1_HW))
		{
		    c = getchar();
    		switch(c)
	    	{
		    	case '0': // send the stop message
			    	msg = 0;
		    		xQueueSend(pwmQueueHandle,&amp;msg,portMAX_DELAY);               
		    	break;
		    	case '1': // Send the start message
		    		msg = 100;
		    		xQueueSend(pwmQueueHandle,&amp;msg,portMAX_DELAY);
		    	break;
			    case '5':
				    msg = 50;
				    xQueueSend(pwmQueueHandle,&amp;msg,portMAX_DELAY);
			    break;
			    case '?': // Print Help 
				    printf("s - stop PWM\r\nS - start PWM\r\n");
			    break;
		    }
		}
		taskYIELD();
    }
}
</pre>
<h1>Program and Test</h1>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/IMG_5098.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/IMG_5098-768x1024.jpg" alt="PSoC 6 Test PWM" width="768" height="1024" class="alignnone wp-image-4653 size-large" srcset="https://iotexpert.com/wp-content/uploads/2017/11/IMG_5098-768x1024.jpg 768w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_5098-600x800.jpg 600w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_5098-225x300.jpg 225w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_5098-scaled.jpg 1920w" sizes="auto, (max-width: 768px) 100vw, 768px" /></a></p>
<h1>Edit the FreeRTOS.h and make a bigger heap</h1>
<p>The CapSense task is going to take more heap space that is currently allocated for FreeRTOS.  To fix this I need to edit the FreeRTOS.h and change the heap size to 48K (which I picked out of the air)</p>
<pre class="lang:c decode:true">#define configTOTAL_HEAP_SIZE                   (48*1024)</pre>
<h1>Add the CapSense Buttons to the Schematic and Set the Pins</h1>
<p>In order to add CapSense to the design, you find the CapSense component in the Component Catalog. Then you drag it into your schematic.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-11.21.02-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-11.21.02-AM.png" alt="PSoC 6 Add CapSense Component" width="692" height="640" class="alignnone wp-image-4568 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-11.21.02-AM.png 692w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-11.21.02-AM-600x555.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-11.21.02-AM-300x277.png 300w" sizes="auto, (max-width: 692px) 100vw, 692px" /></a></p>
<p>The next thing to do is configure the CapSense block.  I start by re-naming it to &#8220;CapSense&#8221;.  Then I click on the plus and add two &#8220;Button&#8221;s to the design.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-12.06.55-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-12.06.55-PM.png" alt="PSoC 6 Add CapSense Buttons" width="776" height="561" class="alignnone wp-image-4571 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-12.06.55-PM.png 776w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-12.06.55-PM-600x434.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-12.06.55-PM-300x217.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-12.06.55-PM-768x555.png 768w" sizes="auto, (max-width: 776px) 100vw, 776px" /></a></p>
<p>Then I change the configuration to &#8220;CSX (Mutual-cap).</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-12.04.55-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-12.04.55-PM.png" alt="PSoC 6 Setup Mutual CapSense" width="774" height="563" class="alignnone wp-image-4570 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-12.04.55-PM.png 774w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-12.04.55-PM-600x436.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-12.04.55-PM-300x218.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-12.04.55-PM-768x559.png 768w" sizes="auto, (max-width: 774px) 100vw, 774px" /></a></p>
<p>On the CY8CKIT-062-BLE, there is a shared transmit line. This saves 1 pin.  You need to tell the CapSense component that you are using a shared Tx.  To do this click on Advanced -&gt; Widget Details.  Then pick &#8220;Button1_tx&#8221; and set the Sensor Connection / Ganging to &#8220;Button0_Tx&#8221;</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-12.05.34-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-12.05.34-PM.png" alt="PSoC 6 Setup CapSense Tx" width="773" height="564" class="alignnone wp-image-4569 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-12.05.34-PM.png 773w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-12.05.34-PM-600x438.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-12.05.34-PM-300x219.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-12.05.34-PM-768x560.png 768w" sizes="auto, (max-width: 773px) 100vw, 773px" /></a></p>
<p>Once the CapSense is configured you need to Set the Pins.<a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-11.21.46-AM.png"></a></p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-11.24.31-AM-1.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-11.24.31-AM-1.png" alt="PSoC 6 Fix Pins" width="592" height="228" class="alignnone wp-image-4573 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-11.24.31-AM-1.png 592w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-11.24.31-AM-1-300x116.png 300w" sizes="auto, (max-width: 592px) 100vw, 592px" /></a></p>
<p>Next you run &#8220;Generate Application&#8221; which will let PSoC Creator place and route the design plus bring in all of the required drivers.</p>
<h1>Add the capsenseTask</h1>
<p>Now create a new task function called capsenseTask it will</p>
<ul>
<li>Use 4 variables to hold the previous and current state of the buttons (line 81-84)</li>
<li>Start the CapSense Block (line 88)</li>
<li>Start CapSense Scanning (line 89)</li>
<li>If the CapSense hardware is not busy then you can talk to it. (line 93)</li>
<li>Start by turning the raw data into useable information (line 96)</li>
<li>Read the state of the buttons (line 98-99)</li>
<li>If the button state has changed, then send a message to the PWM Task (line 101-110)</li>
<li>Save the state of the buttons (line 111-112)</li>
<li>Update the baseline information (line 114)</li>
<li>Start Scanning again (line 115)</li>
<li>If the CapSense block is busy then yield to the other tasks (line 118)</li>
</ul>
<pre class="start-line:75 lang:c decode:true">// capsenseTask
// Read buttons and slider using CapSense and send messages to pwmQueue
void capsenseTask(void *arg)
{
    (void)arg;
    
    uint32_t msg;
    
    int b0prev=0;
    int b1prev=0;
    int b0current=0;
    int b1current=0;
    int sliderPos;
    
    printf("Starting CapSense Task\r\n");
    
    CapSense_Start();
    CapSense_ScanAllWidgets();
        
    for(;;)
    {
        if(!CapSense_IsBusy())
        {
            CapSense_ProcessAllWidgets();
/*
            sliderPos=CapSense_GetCentroidPos(CapSense_LINEARSLIDER0_WDGT_ID);
            if(sliderPos&lt;0xFFFF) // If they are touching the slider then send the %
            {
                msg = sliderPos;
                xQueueSend(pwmQueueHandle,&amp;msg,portMAX_DELAY);
            }
*/
            b0current = CapSense_IsWidgetActive(CapSense_BUTTON0_WDGT_ID);
            b1current = CapSense_IsWidgetActive(CapSense_BUTTON1_WDGT_ID); 
            
            if(b0current &amp;&amp; b0prev == 0) // If they pressed btn0
            {
                msg = 0; 
                xQueueSend(pwmQueueHandle,&amp;msg,portMAX_DELAY);
            }
            if( b1current &amp;&amp; b1prev == 0) // If they pressed btn0
            {
               msg = 100;
               xQueueSend(pwmQueueHandle,&amp;msg,portMAX_DELAY);  
            }
            b0prev = b0current;
            b1prev = b1current;
               
            CapSense_UpdateAllBaselines();
            CapSense_ScanAllWidgets();
        }
        else
            taskYIELD();
            
    }    
}</pre>
<p>And start the capSense task in main.</p>
<pre class="lang:c decode:true">xTaskCreate( capsenseTask, "CapSense Task",2048*2,0,3,0);</pre>
<h1>Program and Test</h1>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/IMG_5100.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/IMG_5100-768x1024.jpg" alt="PSoC 6 Test CapSense Buttons" width="768" height="1024" class="alignnone wp-image-4655 size-large" srcset="https://iotexpert.com/wp-content/uploads/2017/11/IMG_5100-768x1024.jpg 768w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_5100-600x800.jpg 600w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_5100-225x300.jpg 225w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_5100-scaled.jpg 1920w" sizes="auto, (max-width: 768px) 100vw, 768px" /></a></p>
<h1>Add the CapSense Slider to the Schematic and Set the Pins</h1>
<p>To make the slider work you need to add a LinearSlider widget by pressing the &#8220;+&#8221; and selecting LinearSlider</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-12.51.33-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-12.51.33-PM.png" alt="PSoC 6 Add CapSense Slider" width="773" height="564" class="alignnone wp-image-4576 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-12.51.33-PM.png 773w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-12.51.33-PM-600x438.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-12.51.33-PM-300x219.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-12.51.33-PM-768x560.png 768w" sizes="auto, (max-width: 773px) 100vw, 773px" /></a></p>
<p>Once you have added the LinearSlider you need to set the pins for the new CapSense Slider</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-12.51.51-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-12.51.51-PM.png" alt="PSoC 6 Fix CapSense Slider Pins" width="581" height="367" class="alignnone wp-image-4575 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-12.51.51-PM.png 581w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-12.51.51-PM-300x190.png 300w" sizes="auto, (max-width: 581px) 100vw, 581px" /></a></p>
<h1>Update the capsenseTask to Include the Slider</h1>
<p>The changes are small to make the LinearSlider work.  You just need to</p>
<ol>
<li>Read the position of the slider (line 99)</li>
<li>The slider will be 0xFFFF if there is no touch&#8230; in which case ignore it (line 100)</li>
<li>If you got a touch, then make that a message and set it to the PWM (line 102-103)</li>
</ol>
<pre class="start-line:99 lang:c decode:true " title="CapSense Task - main_cm4.c">          sliderPos=CapSense_GetCentroidPos(CapSense_LINEARSLIDER0_WDGT_ID);
            if(sliderPos&lt;0xFFFF) // If they are touching the slider then send the %
            {
                msg = sliderPos;
                xQueueSend(pwmQueueHandle,&amp;msg,portMAX_DELAY);
            }
</pre>
<h1>Program and Test</h1>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/IMG_5101-2.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/IMG_5101-2-768x1024.jpg" alt="PSoC 6 CapSense Slider" width="768" height="1024" class="alignnone size-large wp-image-4657" srcset="https://iotexpert.com/wp-content/uploads/2017/11/IMG_5101-2-768x1024.jpg 768w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_5101-2-600x800.jpg 600w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_5101-2-225x300.jpg 225w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_5101-2-scaled.jpg 1920w" sizes="auto, (max-width: 768px) 100vw, 768px" /></a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/lesson-4-psoc-6-introduction-capsense/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
		<item>
		<title>Lesson 3 &#8211; PSoC 6 Introduction: FreeRTOS and a Debugging UART</title>
		<link>https://iotexpert.com/lesson-3-psoc-6-introduction-freertos-and-a-debugging-uart/</link>
					<comments>https://iotexpert.com/lesson-3-psoc-6-introduction-freertos-and-a-debugging-uart/#comments</comments>
		
		<dc:creator><![CDATA[Alan Hawse]]></dc:creator>
		<pubDate>Thu, 09 Nov 2017 13:04:52 +0000</pubDate>
				<category><![CDATA[Mouser PSoC 6]]></category>
		<category><![CDATA[PSoC 6]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=4510</guid>

					<description><![CDATA[Project Description This project will show you how to build a PSoC 6 project that is running FreeRTOS and printing information to the debugging UART How does it work? The PSoC 6 is a very capable, fast dual Coretex-M MCU.  In order to manage your design complexity that can be attacked with this chip, we [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><span><h1>PSoC 6 Introduction</h1>
<p><div class="table-responsive"><table  style="width:95%; "  class="easy-table easy-table-default " border="1">
<thead>
<tr><th >#</th>
<th >Title</th>
<th >Comment</th>
</tr>
</thead>
<tbody>
<tr><td >0</td>
<td ><a href="https://iotexpert.com/2017/11/07/lesson-0-psoc-6-introduction-a-two-hour-psoc-6-class/">A Two Hour PSoC 6 Class</a></td>
<td >An introduction to the PSoC 6 class with links to all of the documents</td>
</tr>

<tr><td >1</td>
<td ><a href="https://iotexpert.com/2017/11/08/lesson-1-psoc-6-introduction-resources/" rel="noopener">Resources</a></td>
<td >Links to all of the Cypress PSoC 6 information including videos, application notes etc.</td>
</tr>

<tr><td >2</td>
<td ><a href="https://iotexpert.com/2017/11/08/lesson-2-psoc-6-introduction-first-project/">Your First Project</a></td>
<td >Learn how to build a PSoC 6 project and program your CY8CKIT-062-BLE development kit</td>
</tr>

<tr><td >3</td>
<td ><a href="https://iotexpert.com/2017/11/09/lesson-3-psoc-6-introduction-freertos-and-a-debugging-uart/" rel="noopener">FreeRTOS and a Debugging UART</a></td>
<td >Build a project using FreeRTOS including a debug console with the UART</td>
</tr>

<tr><td >4</td>
<td ><a href="https://iotexpert.com/2017/11/09/lesson-4-psoc-6-introduction-capsense/" rel="noopener">CapSense</a></td>
<td >Build a project using the Mutual Cap Buttons and Self Cap Slider</td>
</tr>

<tr><td >5</td>
<td ><a href="https://iotexpert.com/2017/11/09/lesson-5-psoc-6-introduction-bluetooth-low-energy/" rel="noopener">Bluetooth Low Energy</a></td>
<td >Build a CapSense project using BLE and CySmart</td>
</tr>
</tbody></table></div></p>
<p>Since I did the webinar several things have happened</p>
<ol>
<li>Lesson 4: I fixed an error in the stack size for FreeRTOS</li>
<li>Lesson 5: The PSoC Creator BLE PDL has been upgraded to greatly simplify the notifyCapSense function</li>
</ol>
<p>All of the projects are available at git@github.com:iotexpert/psoc-6-introduction.git or <a href="https://github.com/iotexpert/psoc-6-introduction" target="_blank" rel="noopener">www.github.com/iotexpert/psoc-6-introduction</a></p></span></p>
<h1>Project Description</h1>
<p>This project will show you how to build a PSoC 6 project that is running FreeRTOS and printing information to the debugging UART</p>
<h1>How does it work?</h1>
<p>The PSoC 6 is a very capable, fast dual Coretex-M MCU.  In order to manage your design complexity that can be attacked with this chip, we gave you the ability to use a Real Time Operating System &#8211; FreeRTOS.  With a few simple clicks it will startup for you.</p>
<p>The CY8CKIT-062-BLE has a KitProg-2 Debugger/Programmer on board.  In addition to Program/Debug it can also serve as a USB &lt;&#8211;&gt; UART bridge which will allow you to open a terminal program on your PC to do Input/Output with a UART in the PSoC 6.</p>
<h1>How am I going to do it?</h1>
<ol>
<li>Copy &#8220;MyFirstDesign&#8221; to Start a New Project</li>
<li>Modify the Build Settings to add Debug Printing and FreeRTOS</li>
<li>Add the UART to the Schematic and Assign the Pins</li>
<li>Create the UART Test Firmware</li>
<li>Program and Test the Debug UART</li>
<li>Modify firmware for FreeRTOS</li>
<li>Program and Test</li>
<li>A Tour of PDL for the TCPWM</li>
</ol>
<h1>Copy &#8220;MyFirstDesign&#8221; to Start a New Project</h1>
<p>Right click on &#8220;MyFirstDesign&#8221; and select &#8220;Copy&#8221;</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.28.13-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.28.13-PM.png" alt="PSoC Creator Copy Project" width="458" height="722" class="alignnone wp-image-4515 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.28.13-PM.png 458w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.28.13-PM-190x300.png 190w" sizes="auto, (max-width: 458px) 100vw, 458px" /></a></p>
<p>Then right click on the workspace and select &#8220;Paste&#8221;</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.28.31-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.28.31-PM.png" alt="PSoC Creator Copy/Paste" width="396" height="480" class="alignnone wp-image-4514 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.28.31-PM.png 396w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.28.31-PM-248x300.png 248w" sizes="auto, (max-width: 396px) 100vw, 396px" /></a></p>
<p>Then right click on &#8220;MyFirstDesign_Copy_01&#8221; and select rename.  Then type in a reasonable name like &#8220;FreeRTOS-UART&#8221;</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.29.18-PM.png"></a> <a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.28.50-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.28.50-PM.png" alt="PSoC Creator Copy / Paste" width="448" height="742" class="alignnone wp-image-4513 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.28.50-PM.png 448w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.28.50-PM-181x300.png 181w" sizes="auto, (max-width: 448px) 100vw, 448px" /></a></p>
<p>PSoC Creator will ask you about some files.  Just click &#8220;Rename&#8221;</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.29.18-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.29.18-PM.png" alt="PSoC Creator Rename" width="629" height="482" class="alignnone wp-image-4512 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.29.18-PM.png 629w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.29.18-PM-600x460.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.29.18-PM-300x230.png 300w" sizes="auto, (max-width: 629px) 100vw, 629px" /></a></p>
<p>Now you will have three projects in your workspace.  I typically click &#8220;Program&#8221; which will build the copied project and program the development kit&#8230; just to make sure that stuff still works.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.33.04-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.33.04-PM-1024x820.png" alt="PSoC Creator Workspace" width="1024" height="820" class="alignnone wp-image-4516 size-large" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.33.04-PM-1024x820.png 1024w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.33.04-PM-600x481.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.33.04-PM-300x240.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.33.04-PM-768x615.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.33.04-PM.png 1273w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<h1>Modify the build settings to add debug printing and FreeRTOS</h1>
<p>You can build massively complex systems with PSoC 6.  In order to help manage that complexity I like to turn on debug printing so that &#8220;printf&#8221; works.  I also like to use a Real Time Operating System (FreeRTOS).  PSoC Creator has both of these things built in.  We called the printf functionality &#8220;Retarget I/O&#8221; because you need to &#8220;target&#8221; the Input / Output of the printf &#8230; aka STDIN and STDOUT to a peripheral in the PSoC.  The best peripheral to use for printf is the UART that is attached to your computer via kitprog2.</p>
<p>To add printf and FreeRTOS to your project you need to: Right click on the project and select &#8220;Build Settings&#8230;&#8221;</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.40.30-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.40.30-PM.png" alt="PSoC Creator Modify Build Settings" width="467" height="715" class="alignnone wp-image-4521 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.40.30-PM.png 467w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.40.30-PM-196x300.png 196w" sizes="auto, (max-width: 467px) 100vw, 467px" /></a></p>
<p>Click on the Peripheral Driver Library and then select &#8220;FreeRTOS&#8221; and &#8220;Memory Management heap_4&#8221;.  Then select &#8220;Retarget I/O&#8221;.  When you build your project this will cause PSoC Creator to add both of these to your project.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.40.59-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.40.59-PM-1024x729.png" alt="PSoC Creator Build Settings FreeRTOS" width="1024" height="729" class="alignnone wp-image-4520 size-large" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.40.59-PM-1024x729.png 1024w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.40.59-PM-600x427.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.40.59-PM-300x214.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.40.59-PM-768x547.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.40.59-PM.png 1046w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Select Build-&gt;Generate Application and notice that PSoC Creator added a number of files to your project including the FreeRTOS, stdio_user.c/.h and retarget_io</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.42.13-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.42.13-PM.png" alt="PSoC Creator retarget_io.c" width="508" height="914" class="alignnone wp-image-4519 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.42.13-PM.png 508w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.42.13-PM-167x300.png 167w" sizes="auto, (max-width: 508px) 100vw, 508px" /></a></p>
<h1>Add the UART to the Schematic and Assign the Pins</h1>
<p>In order to printf, getchar and putchar  you need to attach c standard library stdin and stdout to &#8220;something&#8221;.  The best &#8220;something&#8221; is the UART that is attached to the KitProg2 which is attached to your computer.  Then you can open a terminal program (like Putty) and read and write to the PSoC.</p>
<p>So, to do this you need to add a UART to your design schematic from the component catalog.  In the picture below I just typed &#8220;uart&#8221; in the search box.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.47.03-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.47.03-PM-1024x820.png" alt="PSoC Creator Debug UART" width="1024" height="820" class="alignnone wp-image-4524 size-large" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.47.03-PM-1024x820.png 1024w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.47.03-PM-600x480.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.47.03-PM-300x240.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.47.03-PM-768x615.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.47.03-PM.png 1275w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>What pins on the PSoC 6 BLE is the UART attached to?  Well&#8230; if you turn over your CY8CKIT-062-BLE you will find a little map that show that the PSoC 6 BLE UART is attached to the PSoC 5LP UART.  The PSoC 5LP is programmed with the KitProg2 firmware.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/IMG_5091.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/IMG_5091-e1509742204438-1024x768.jpg" alt="PSoC 6 CY8CKIT-062-BLE" width="1024" height="768" class="alignnone wp-image-4525 size-large" srcset="https://iotexpert.com/wp-content/uploads/2017/11/IMG_5091-e1509742204438-1024x768.jpg 1024w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_5091-e1509742204438-600x450.jpg 600w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_5091-e1509742204438-300x225.jpg 300w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_5091-e1509742204438-768x576.jpg 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>To attach those pins in your firmware you just double click on the &#8220;Pins&#8221; tab in the DWR.  Then you can select &#8220;Port&#8221; for the UART RX and TX.  Look at the picture below.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.47.49-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.47.49-PM-1024x821.png" alt="PSoC 6 PSoC Creator Pin Settings" width="1024" height="821" class="alignnone wp-image-4523 size-large" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.47.49-PM-1024x821.png 1024w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.47.49-PM-600x481.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.47.49-PM-300x241.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.47.49-PM-768x616.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.47.49-PM.png 1273w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Now that I have all of that done, I run &#8220;Build-&gt;Generate Application&#8221; to get all of the new settings into my project.</p>
<h1>Create the UART Test Firmware</h1>
<p>The next step in making the printf work is to &#8220;retarget&#8221; it to the UART we just put in the schematic.  Open &#8220;stdio_user.h&#8221; and add &#8220;include &lt;project.h&gt;&#8221; (line 130) and change IO_STDOUT_UART and IO_STDIN_UART to be UART_1_HW.  The name &#8220;UART_1&#8221; on lines 136-137</p>
<pre class="start-line:130 lang:c decode:true" title="stdio_user.h">#include &lt;project.h&gt;
#include "cy_device_headers.h"

/* Must remain uncommented to use this utility */
#define IO_STDOUT_ENABLE
#define IO_STDIN_ENABLE
#define IO_STDOUT_UART      UART_1_HW
#define IO_STDIN_UART       UART_1_HW</pre>
<p>Now edit your main_cm4.c to:</p>
<ul>
<li>Turn on the UART with UART_1_Start() on line</li>
<li>Then a couple of printfs lines 24-25</li>
</ul>
<p>Note that &#8220;\033[2J\033[H&#8221; is just a <a href="http://ascii-table.com/ansi-escape-sequences-vt-100.php" target="_blank" rel="noopener">VT100 escape sequence</a> for clear screen and go home.</p>
<pre class="start-line:12 lang:c decode:true" title="main_cm4.c">#include "project.h"
#include &lt;stdio.h&gt;

int main(void)
{
    __enable_irq(); /* Enable global interrupts. */

    /* Place your initialization/startup code here (e.g. MyInst_Start()) */

    PWM_1_Start();
    UART_1_Start();
    
    printf("\033[2J\033[H"); // Clear Screen
    printf("Test\r\n");
    
    
    for(;;)
    {
        /* Place your application code here. */
    }
}</pre>
<h1>Program and Test the Debug UART</h1>
<p>You need to figure out which com port that the KitProg2 is attached to.  To do this run the device manager by pressing the &#8220;windows&#8221; button then typing &#8220;device manger&#8221;</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.56.08-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.56.08-PM.png" alt="Device Manager" width="385" height="616" class="alignnone wp-image-4527 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.56.08-PM.png 385w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.56.08-PM-188x300.png 188w" sizes="auto, (max-width: 385px) 100vw, 385px" /></a></p>
<p>Click on ports.  Then you can see that the programmer is &#8220;KitProg2&#8221; and that the UART is attached to COM9 (everyone will have a different number)</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.56.27-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.56.27-PM.png" alt="Device Manager" width="776" height="575" class="alignnone wp-image-4526 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.56.27-PM.png 776w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.56.27-PM-600x445.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.56.27-PM-300x222.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.56.27-PM-768x569.png 768w" sizes="auto, (max-width: 776px) 100vw, 776px" /></a></p>
<p>Run <a href="http://www.putty.org" target="_blank" rel="noopener">Putty</a> (or  your favorite terminal program)</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.58.21-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.58.21-PM.png" alt="Putty" width="448" height="437" class="alignnone wp-image-4530 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.58.21-PM.png 448w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-4.58.21-PM-300x293.png 300w" sizes="auto, (max-width: 448px) 100vw, 448px" /></a></p>
<p>Press the program button on PSoC Creator and you should see your test print</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-5.01.09-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-5.01.09-PM.png" alt="Putty PSoC 6 UART" width="661" height="418" class="alignnone wp-image-4528 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-5.01.09-PM.png 661w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-5.01.09-PM-600x379.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-5.01.09-PM-300x190.png 300w" sizes="auto, (max-width: 661px) 100vw, 661px" /></a></p>
<h1>Modify firmware for FreeRTOS</h1>
<p>When I look out the output window from the previous step you can see that there is a warning message from FreeRTOS.  Lets fix that warning (by deleting line 83).  While we are at it, lets change the heap size to 48K (48*1024)</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-08-at-6.14.24-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-08-at-6.14.24-AM-1024x627.png" alt="" width="1024" height="627" class="alignnone size-large wp-image-4649" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-08-at-6.14.24-AM-1024x627.png 1024w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-08-at-6.14.24-AM-600x367.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-08-at-6.14.24-AM-300x184.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-08-at-6.14.24-AM-768x470.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-08-at-6.14.24-AM.png 1970w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Now lets turn on FreeRTOS. Double click on main_cm4.c to open it in the code editor.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-7.41.27-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-7.41.27-AM.png" alt="Modify FreeRTOS Firmware" width="336" height="762" class="alignnone wp-image-4533 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-7.41.27-AM.png 336w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-7.41.27-AM-132x300.png 132w" sizes="auto, (max-width: 336px) 100vw, 336px" /></a></p>
<p>Add the following firmware to your project.</p>
<p>The uartTask is function that FreeRTOS uses to create a Task.  This task will control the uart. (which is amazingly enough why I named it uartTask)</p>
<ul>
<li>The function call &#8220;setvbuff&#8221; turns of buffering on stdin&#8230; which means every character will immediately come through to your program</li>
<li>getchar just gets a character from the terminal</li>
<li>the &#8216;s&#8217; and &#8216;S&#8217; will start and stop the PWM (more to follow)</li>
</ul>
<p>In main I</p>
<ul>
<li>Create a task for the uartTask (line 56)</li>
<li>Start FreeRTOS (line 57)</li>
</ul>
<pre class="lang:c decode:true " title="main_cm4.c">/* ========================================
 *
 * Copyright YOUR COMPANY, THE YEAR
 * All Rights Reserved
 * UNPUBLISHED, LICENSED SOFTWARE.
 *
 * CONFIDENTIAL AND PROPRIETARY INFORMATION
 * WHICH IS THE PROPERTY OF your company.
 *
 * ========================================
*/
#include "project.h"
#include &lt;stdio.h&gt;
#include "FreeRTOS.h"
#include "task.h"

// uartTask - the function which handles input from the UART
void uartTask(void *arg)
{
    (void)arg;
    char c;
    setvbuf(stdin,0,_IONBF,0);
    while(1)
    {
        c = getchar();
        switch(c)
        {
            case 's': // Stop the PWM
                printf("Stopped PWM\r\n");
                Cy_TCPWM_PWM_Disable(PWM_1_HW,PWM_1_CNT_NUM);
                
            break;
            case 'S': // Start the PWM
                printf("Started PWM\r\n");
                Cy_TCPWM_PWM_Enable(PWM_1_HW,PWM_1_CNT_NUM);
                Cy_TCPWM_TriggerStart(PWM_1_HW, PWM_1_CNT_MASK);
            break;
        }
    }
}


int main(void)
{
    __enable_irq(); /* Enable global interrupts. */

    /* Place your initialization/startup code here (e.g. MyInst_Start()) */

    PWM_1_Start();
    UART_1_Start();
    
    printf("\033[2J\033[H"); // VT100 Clear Screen
    printf("Test\r\n");
 
    // Mask a FreeRTOS Task called uartTask
    xTaskCreate(uartTask,"UART Task",configMINIMAL_STACK_SIZE,0,3,0);
    vTaskStartScheduler();  // Will never return
    
    for(;;) // It will never get here
    {
    }
}</pre>
<p>How did I figure out how to start/stop the PWM?  To find the documentation for &#8220;PDL&#8221; aka the Peripheral Driver Library, you can right click on the component in the schematic and select &#8220;Open PDL Documentation&#8221;</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-7.18.26-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-7.18.26-AM.png" alt="PSoC 6 TCPWM" width="450" height="561" class="alignnone wp-image-4532 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-7.18.26-AM.png 450w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-7.18.26-AM-241x300.png 241w" sizes="auto, (max-width: 450px) 100vw, 450px" /></a></p>
<p>Or you can open &#8220;Help &#8211;&gt; Documentation &#8211;&gt; Peripheral Driver Library&#8221;</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-7.51.42-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-7.51.42-AM.png" alt="PSoC Creator Help" width="603" height="646" class="alignnone wp-image-4534 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-7.51.42-AM.png 603w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-7.51.42-AM-600x643.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-7.51.42-AM-280x300.png 280w" sizes="auto, (max-width: 603px) 100vw, 603px" /></a></p>
<p>In the documentation I can see all kind of functions, including &#8220;Cy_TCPWM_PWM_Disable&#8221;</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-7.19.35-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-7.19.35-AM-1024x690.png" alt="PSoC 6 PDL" width="1024" height="690" class="alignnone wp-image-4531 size-large" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-7.19.35-AM-1024x690.png 1024w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-7.19.35-AM-600x405.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-7.19.35-AM-300x202.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-7.19.35-AM-768x518.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-7.19.35-AM.png 1317w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<h1>Program and Test</h1>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-9.30.49-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-9.30.49-AM.png" alt="PSoC 6 FreeRTOS Test" width="651" height="414" class="alignnone wp-image-4545 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-9.30.49-AM.png 651w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-9.30.49-AM-600x382.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-9.30.49-AM-300x191.png 300w" sizes="auto, (max-width: 651px) 100vw, 651px" /></a></p>
<h1>A Tour of PDL for the TCPWM</h1>
<p>How did I figure out that the TCPWM_Type *base should be &#8220;UART_1_HW&#8221;?  &#8230;.. well &#8230;. You might ask yourself, &#8220;What does PWM_1_Start()&#8221; do?  It just calls PDL start function.  OK&#8230; so what does that do?  To find out you can right click on the &#8220;PWM_1_Start&#8221; function and select &#8220;Go To Definition&#8221; which will take you to the source code.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-8.00.20-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-8.00.20-AM.png" alt="PSoC 6 Tour of PDL" width="509" height="491" class="alignnone wp-image-4536 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-8.00.20-AM.png 509w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-8.00.20-AM-300x289.png 300w" sizes="auto, (max-width: 509px) 100vw, 509px" /></a></p>
<p>You will end up in a file called &#8220;PWM_1.c&#8221;.  This file was created for you automatically by PSoC Creator.   This function is really simple.</p>
<ul>
<li>If it has never been initialized then it calls init (lines 15-19)</li>
<li>Then it enables the TCPWM (line 22)</li>
<li>Then if there not an external pin on the PWM, then it causes a software trigger (line 25)</li>
</ul>
<pre class="EnlighterJSRAW" data-enlighter-language="c">/*******************************************************************************
* Function Name: PWM_1_Start
****************************************************************************//**
*
*  Calls the PWM_1_Init() when called the first time and enables 
*  the PWM_1. For subsequent calls the configuration is left 
*  unchanged and the component is just enabled.
*
* \globalvars
*  \ref PWM_1_initVar
*
*******************************************************************************/
void PWM_1_Start(void)
{
    if (0U == PWM_1_initVar)
    {
        (void) Cy_TCPWM_PWM_Init(PWM_1_HW, PWM_1_CNT_NUM, &amp;PWM_1_config);

        PWM_1_initVar = 1U;
    }

    Cy_TCPWM_Enable_Multiple(PWM_1_HW, PWM_1_CNT_MASK);
    
    #if (PWM_1_INPUT_DISABLED == 7UL)
        Cy_TCPWM_TriggerStart(PWM_1_HW, PWM_1_CNT_MASK);
    #endif /* (PWM_1_INPUT_DISABLED == 7UL) */    
}
</pre>
<p>So, you might ask yourself what is &#8220;PWM_1_HW&#8221;?  Well this is just the base address of the registers for the PWM_1.  Lets follow that.  Right click on it and go to definition.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-8.01.48-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-8.01.48-AM.png" alt="PSoC 6 PDL" width="623" height="463" class="alignnone wp-image-4537 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-8.01.48-AM.png 623w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-8.01.48-AM-600x446.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-8.01.48-AM-300x223.png 300w" sizes="auto, (max-width: 623px) 100vw, 623px" /></a></p>
<p>This will take you to PWM_1.h and you will see PWM_1_HW is setup as PWM_1_TCPWM_HW.  What is that?  Well do the right click thing again and find out.</p>
<pre class="lang:c decode:true" title="PWM_1.h">/***************************************
*           API Constants
***************************************/

/**
* \addtogroup group_macros
* @{
*/
/** This is a ptr to the base address of the TCPWM instance */
#define PWM_1_HW                 (PWM_1_TCPWM__HW)

/** This is a ptr to the base address of the TCPWM CNT instance */
#define PWM_1_CNT_HW             (PWM_1_TCPWM__CNT_HW)

/** This is the counter instance number in the selected TCPWM */
#define PWM_1_CNT_NUM            (PWM_1_TCPWM__CNT_IDX)

/** This is the bit field representing the counter instance in the selected TCPWM */
#define PWM_1_CNT_MASK           (1UL &lt;&lt; PWM_1_CNT_NUM)
/** @} group_macros */

#define PWM_1_INPUT_MODE_MASK    (0x3U)
#define PWM_1_INPUT_DISABLED     (7U)
</pre>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-8.04.51-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-8.04.51-AM.png" alt="PSoC 6 PDL" width="650" height="421" class="alignnone wp-image-4538 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-8.04.51-AM.png 650w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-8.04.51-AM-600x389.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-8.04.51-AM-300x194.png 300w" sizes="auto, (max-width: 650px) 100vw, 650px" /></a></p>
<p>This will take you to &#8220;cyfitter.h&#8221; which is the output of the place and route.  It tell you that PWM_1_TCP is really TCPWM0</p>
<pre class="start-line:28 lang:c decode:true" title="cyfitter.h">/* PWM_1_TCPWM */
#define PWM_1_TCPWM__CNT_HW TCPWM0_CNT0
#define PWM_1_TCPWM__CNT_IDX 0u
#define PWM_1_TCPWM__HW TCPWM0
#define PWM_1_TCPWM__IDX 0u</pre>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/lesson-3-psoc-6-introduction-freertos-and-a-debugging-uart/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
		<item>
		<title>Lesson 1 &#8211; PSoC 6 Introduction: Resources</title>
		<link>https://iotexpert.com/lesson-1-psoc-6-introduction-resources/</link>
					<comments>https://iotexpert.com/lesson-1-psoc-6-introduction-resources/#respond</comments>
		
		<dc:creator><![CDATA[Alan Hawse]]></dc:creator>
		<pubDate>Wed, 08 Nov 2017 13:16:05 +0000</pubDate>
				<category><![CDATA[Mouser PSoC 6]]></category>
		<category><![CDATA[PSoC 6]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=4452</guid>

					<description><![CDATA[Summary This is an index with links to all of the PSoC 6 learning resources.  You can click the links to go the website or see screen captures of the resources. PSoC 6 Product Page PSoC 6 Documentation PSoC 6 Community CY8CKIT-062-BLE Development Kit Web Page CY8CKIT-062-BLE Development Kit Guide PSoC 6 Datasheet PSoC 6 [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><span><h1>PSoC 6 Introduction</h1>
<p><div class="table-responsive"><table  style="width:95%; "  class="easy-table easy-table-default " border="1">
<thead>
<tr><th >#</th>
<th >Title</th>
<th >Comment</th>
</tr>
</thead>
<tbody>
<tr><td >0</td>
<td ><a href="https://iotexpert.com/2017/11/07/lesson-0-psoc-6-introduction-a-two-hour-psoc-6-class/">A Two Hour PSoC 6 Class</a></td>
<td >An introduction to the PSoC 6 class with links to all of the documents</td>
</tr>

<tr><td >1</td>
<td ><a href="https://iotexpert.com/2017/11/08/lesson-1-psoc-6-introduction-resources/" rel="noopener">Resources</a></td>
<td >Links to all of the Cypress PSoC 6 information including videos, application notes etc.</td>
</tr>

<tr><td >2</td>
<td ><a href="https://iotexpert.com/2017/11/08/lesson-2-psoc-6-introduction-first-project/">Your First Project</a></td>
<td >Learn how to build a PSoC 6 project and program your CY8CKIT-062-BLE development kit</td>
</tr>

<tr><td >3</td>
<td ><a href="https://iotexpert.com/2017/11/09/lesson-3-psoc-6-introduction-freertos-and-a-debugging-uart/" rel="noopener">FreeRTOS and a Debugging UART</a></td>
<td >Build a project using FreeRTOS including a debug console with the UART</td>
</tr>

<tr><td >4</td>
<td ><a href="https://iotexpert.com/2017/11/09/lesson-4-psoc-6-introduction-capsense/" rel="noopener">CapSense</a></td>
<td >Build a project using the Mutual Cap Buttons and Self Cap Slider</td>
</tr>

<tr><td >5</td>
<td ><a href="https://iotexpert.com/2017/11/09/lesson-5-psoc-6-introduction-bluetooth-low-energy/" rel="noopener">Bluetooth Low Energy</a></td>
<td >Build a CapSense project using BLE and CySmart</td>
</tr>
</tbody></table></div></p>
<p>Since I did the webinar several things have happened</p>
<ol>
<li>Lesson 4: I fixed an error in the stack size for FreeRTOS</li>
<li>Lesson 5: The PSoC Creator BLE PDL has been upgraded to greatly simplify the notifyCapSense function</li>
</ol>
<p>All of the projects are available at git@github.com:iotexpert/psoc-6-introduction.git or <a href="https://github.com/iotexpert/psoc-6-introduction" target="_blank" rel="noopener">www.github.com/iotexpert/psoc-6-introduction</a></p></span></p>
<h1>Summary</h1>
<p>This is an index with links to all of the PSoC 6 learning resources.  You can click the links to go the website or see screen captures of the resources.</p>
<ol>
<li><a href="http://www.cypress.com/products/32-bit-arm-cortex-m4-psoc-6" target="_blank" rel="noopener">PSoC 6 Product Page</a></li>
<li><a href="http://www.cypress.com/products/32-bit-arm-cortex-m4-psoc-6" target="_blank" rel="noopener">PSoC 6 Documentation</a></li>
<li><a href="https://community.cypress.com/community/psoc-6" target="_blank" rel="noopener">PSoC 6 Community</a></li>
<li><a href="http://www.cypress.com/documentation/development-kitsboards/psoc-6-ble-pioneer-kit" target="_blank" rel="noopener">CY8CKIT-062-BLE Development Kit Web Page</a></li>
<li><a href="http://www.cypress.com/file/390496/download" target="_blank" rel="noopener">CY8CKIT-062-BLE Development Kit Guide</a></li>
<li><a href="http://www.cypress.com/file/385921/download" target="_blank" rel="noopener">PSoC 6 Datasheet</a></li>
<li><a href="http://www.cypress.com/file/385621/download" target="_blank" rel="noopener">PSoC 6 Technical Reference Manuals</a></li>
<li><a href="http://www.cypress.com/search/all?f[0]=meta_type%3Atechnical_documents&amp;f[1]=resource_meta_type%3A574&amp;f[2]=field_related_products%3A114026" target="_blank" rel="noopener">Application Notes</a></li>
<li><a href="http://www.cypress.com/training/psoc-101-video-tutorial-series-how-use-arm-cortex-m4-based-psoc-6" target="_blank" rel="noopener">Videos</a></li>
<li><a href="http://www.cypress.com/documentation/code-examples/psoc-6-mcu-code-examples" target="_blank" rel="noopener">Code Examples</a></li>
<li><a href="https://community.cypress.com/community/knowledge-base-articles/content?filterID=contentstatus%5Bpublished%5D~category%5Bpsoc-6%5D" target="_blank" rel="noopener">Knowledge Base</a></li>
<li>PSoC Creator Help Page</li>
<li>PSoC Creator Component Datasheet</li>
<li>Peripheral Driver Library Documentation (Doxygen)</li>
</ol>
<h1>PSoC 6 Product Page</h1>
<p>You can find the PSoC 6 Product landing page for PSoC 6 <a href="http://www.cypress.com/products/32-bit-arm-cortex-m4-psoc-6" target="_blank" rel="noopener">here</a></p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.57.54-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.57.54-PM-1024x870.png" alt="" width="1024" height="870" class="alignnone size-large wp-image-4499" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.57.54-PM-1024x870.png 1024w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.57.54-PM-600x510.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.57.54-PM-300x255.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.57.54-PM-768x652.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.57.54-PM.png 1280w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<h1>PSoC 6 Documentation</h1>
<p>On the PSoC 6 Product Landing page there is a documentation tab that has links to all of the current documentation.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.16.16-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.16.16-PM-806x1024.png" alt="" width="806" height="1024" class="alignnone size-large wp-image-4502" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.16.16-PM-806x1024.png 806w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.16.16-PM-600x762.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.16.16-PM-236x300.png 236w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.16.16-PM-768x975.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.16.16-PM.png 834w" sizes="auto, (max-width: 806px) 100vw, 806px" /></a></p>
<h1>Community</h1>
<p>Cypress has an active development community and forum.  It can be found <a href="https://community.cypress.com/community/psoc-6" target="_blank" rel="noopener">here</a>.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.40.56-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.40.56-PM-1024x876.png" alt="" width="1024" height="876" class="alignnone size-large wp-image-4495" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.40.56-PM-1024x876.png 1024w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.40.56-PM-600x514.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.40.56-PM-300x257.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.40.56-PM-768x657.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.40.56-PM.png 1478w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<h1>Development Kit Web Page</h1>
<p>Every Cypress development kit has a web page that contains all of the information about it, including links to the documentation and store.  The CY8CKIT-062-BLE kit page is <a href="http://www.cypress.com/documentation/development-kitsboards/psoc-6-ble-pioneer-kit" target="_blank" rel="noopener">here</a>.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.44.14-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.44.14-PM-1024x984.png" alt="" width="1024" height="984" class="alignnone size-large wp-image-4496" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.44.14-PM-1024x984.png 1024w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.44.14-PM-600x576.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.44.14-PM-300x288.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.44.14-PM-768x738.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.44.14-PM.png 1065w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<h1>CY8CKIT-062-BLE Development Kit Guide</h1>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.48.45-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.48.45-PM-798x1024.png" alt="" width="798" height="1024" class="alignnone size-large wp-image-4497" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.48.45-PM-798x1024.png 798w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.48.45-PM-600x769.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.48.45-PM-234x300.png 234w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.48.45-PM-768x985.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.48.45-PM.png 995w" sizes="auto, (max-width: 798px) 100vw, 798px" /></a></p>
<h1>PSoC 6 Datasheet</h1>
<p>The PSoC 6 Datasheet is available on Cypress.com <a href="http://www.cypress.com/file/385921/download" target="_blank" rel="noopener">here</a>.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.50.27-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.50.27-PM-1024x603.png" alt="" width="1024" height="603" class="alignnone size-large wp-image-4498" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.50.27-PM-1024x603.png 1024w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.50.27-PM-600x353.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.50.27-PM-300x177.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.50.27-PM-768x452.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-2.50.27-PM.png 1249w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<h1>Technical Reference Manual</h1>
<p>Each of the PSoC 6 devices has a lengthy discussion of the Technical Resources.  These documents can be found <a href="http://www.cypress.com/file/385621/download" target="_blank" rel="noopener">here</a></p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.12.57-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.12.57-PM-1024x997.png" alt="" width="1024" height="997" class="alignnone size-large wp-image-4501" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.12.57-PM-1024x997.png 1024w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.12.57-PM-600x584.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.12.57-PM-300x292.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.12.57-PM-768x748.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.12.57-PM.png 1105w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<h1>Application Notes</h1>
<p>You can get them all on our website&#8230; here is a link to the filtered list of <a href="http://www.cypress.com/search/all?f[0]=meta_type%3Atechnical_documents&amp;f[1]=resource_meta_type%3A574&amp;f[2]=field_related_products%3A114026" target="_blank" rel="noopener">PSoC 6 Application Notes</a>.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-12.06.05-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-12.06.05-PM-1024x917.png" alt="" width="1024" height="917" class="alignnone size-large wp-image-4459" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-12.06.05-PM-1024x917.png 1024w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-12.06.05-PM-600x537.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-12.06.05-PM-300x269.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-12.06.05-PM-768x687.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-12.06.05-PM.png 1363w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>The best application note is always the &#8220;Getting Started&#8221;.  In this case it is <a href="http://www.cypress.com/documentation/application-notes/an210781-getting-started-psoc-6-mcu-bluetooth-low-energy-ble?source=search&amp;cat=technical_documents" target="_blank" rel="noopener">AN210781 &#8220;Getting Started with PSoC 6 MCU with Bluetooth Low Energy (BLE) Connectivity&#8221;</a></p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-12.08.11-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-12.08.11-PM-1024x940.png" alt="" width="1024" height="940" class="alignnone size-large wp-image-4460" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-12.08.11-PM-1024x940.png 1024w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-12.08.11-PM-600x551.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-12.08.11-PM-300x276.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-12.08.11-PM-768x705.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-12.08.11-PM.png 1421w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<h1>Code Examples</h1>
<p>You can find all of the PSoC 6 code examples on the <a href="http://www.cypress.com/documentation/code-examples/psoc-6-mcu-code-examples" target="_blank" rel="noopener">web</a>.  In addition they are built into PSoC Creator.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.01.49-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.01.49-PM-1024x770.png" alt="" width="1024" height="770" class="alignnone size-large wp-image-4500" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.01.49-PM-1024x770.png 1024w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.01.49-PM-600x451.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.01.49-PM-300x226.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.01.49-PM-768x577.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.01.49-PM.png 1342w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Or in PSoC Creator:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-11.55.26-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-11.55.26-AM.png" alt="" width="310" height="310" class="alignnone size-large wp-image-4455" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-11.55.26-AM.png 310w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-11.55.26-AM-300x300.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-11.55.26-AM-100x100.png 100w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-11.55.26-AM-150x150.png 150w" sizes="auto, (max-width: 310px) 100vw, 310px" /></a></p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-11.55.45-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-11.55.45-AM.png" alt="" width="626" height="476" class="alignnone size-large wp-image-4454" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-11.55.45-AM.png 626w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-11.55.45-AM-600x456.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-11.55.45-AM-300x228.png 300w" sizes="auto, (max-width: 626px) 100vw, 626px" /></a></p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-11.56.02-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-11.56.02-AM.png" alt="" width="626" height="477" class="alignnone size-full wp-image-4453" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-11.56.02-AM.png 626w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-11.56.02-AM-600x457.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-11.56.02-AM-300x229.png 300w" sizes="auto, (max-width: 626px) 100vw, 626px" /></a></p>
<h1>Videos</h1>
<p>Cypress has made a bunch of videos that take you step by step through an introduction to PSoC 6.  You can find them on the Cypress t<a href="http://www.cypress.com/training/psoc-101-video-tutorial-series-how-use-arm-cortex-m4-based-psoc-6" target="_blank" rel="noopener">raining website.</a></p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.51.56-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.51.56-PM-1024x944.png" alt="" width="1024" height="944" class="alignnone size-large wp-image-4506" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.51.56-PM-1024x944.png 1024w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.51.56-PM-600x553.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.51.56-PM-300x276.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.51.56-PM-768x708.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.51.56-PM.png 1121w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>https://www.youtube.com/watch?v=vefexHmf_Us</p>
<h1>Knowledge Base</h1>
<p>The Cypress technical support team writes &#8220;Knowledge Base&#8221; articles when there are repeated issues reported by customers.  You can find them <a href="https://community.cypress.com/community/knowledge-base-articles/content?filterID=contentstatus%5Bpublished%5D~category%5Bpsoc-6%5D" target="_blank" rel="noopener">here</a>.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.50.02-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.50.02-PM-1024x819.png" alt="" width="1024" height="819" class="alignnone size-large wp-image-4505" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.50.02-PM-1024x819.png 1024w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.50.02-PM-600x480.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.50.02-PM-300x240.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.50.02-PM-768x614.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-03-at-3.50.02-PM.png 1252w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<h1>PSoC Creator Help Page</h1>
<p>There is a bunch of help on the PSoC Creator Help Page.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-7.51.42-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-7.51.42-AM.png" alt="" width="603" height="646" class="alignnone size-full wp-image-4534" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-7.51.42-AM.png 603w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-7.51.42-AM-600x643.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-04-at-7.51.42-AM-280x300.png 280w" sizes="auto, (max-width: 603px) 100vw, 603px" /></a></p>
<p>On the PSoC Creator Help page there are tons of resources including</p>
<ul>
<li><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-3.52.32-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-3.52.32-PM-917x1024.png" alt="" width="917" height="1024" class="alignnone size-large wp-image-4616" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-3.52.32-PM-917x1024.png 917w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-3.52.32-PM-600x670.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-3.52.32-PM-269x300.png 269w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-3.52.32-PM-768x858.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-3.52.32-PM.png 1094w" sizes="auto, (max-width: 917px) 100vw, 917px" /></a></li>
</ul>
<h1>PSoC Creator Component Datasheet</h1>
<p>Every component in PSoC Creator can be right clicked -&gt; datasheet</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-3.56.56-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-3.56.56-PM-633x1024.png" alt="" width="633" height="1024" class="alignnone size-large wp-image-4617" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-3.56.56-PM-633x1024.png 633w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-3.56.56-PM-600x970.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-3.56.56-PM-185x300.png 185w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-3.56.56-PM.png 648w" sizes="auto, (max-width: 633px) 100vw, 633px" /></a></p>
<p>For example the datasheet for the UART</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-3.58.01-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-3.58.01-PM-1024x915.png" alt="" width="1024" height="915" class="alignnone size-large wp-image-4618" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-3.58.01-PM-1024x915.png 1024w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-3.58.01-PM-600x536.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-3.58.01-PM-300x268.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-3.58.01-PM-768x686.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-3.58.01-PM.png 1560w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<h1>Peripheral Driver Library Documentation (Doxygen)</h1>
<p>All of the APIs in the PDL are documented in a Doxygen generated HTML document.  You can get there from</p>
<ul>
<li>Help -&gt; Peripheral Driver Library (this link is live only when you have a PSoC 6 project open)</li>
<li>Right click on a component -&gt; Open PDL Documentation</li>
</ul>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-4.01.06-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-4.01.06-PM-1024x580.png" alt="" width="1024" height="580" class="alignnone size-large wp-image-4619" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-4.01.06-PM-1024x580.png 1024w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-4.01.06-PM-600x340.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-4.01.06-PM-300x170.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-4.01.06-PM-768x435.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/lesson-1-psoc-6-introduction-resources/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Lesson 0 &#8211; PSoC 6 Introduction: A Two Hour PSoC 6 Class</title>
		<link>https://iotexpert.com/lesson-0-psoc-6-introduction-a-two-hour-psoc-6-class/</link>
					<comments>https://iotexpert.com/lesson-0-psoc-6-introduction-a-two-hour-psoc-6-class/#comments</comments>
		
		<dc:creator><![CDATA[Alan Hawse]]></dc:creator>
		<pubDate>Tue, 07 Nov 2017 22:28:13 +0000</pubDate>
				<category><![CDATA[Mouser PSoC 6]]></category>
		<category><![CDATA[PSoC 6]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=4433</guid>

					<description><![CDATA[Summary This is the top level web page for a two hour class about getting started with PSoC 6.  I was initially a bit worried about how much could be covered in only two hours&#8230; then I remembered how awesome PSoC Creator is at getting people going.  Originally, I was planning on writing a lab [&#8230;]]]></description>
										<content:encoded><![CDATA[<h1>Summary</h1>
<p>This is the top level web page for a two hour class about getting started with <a href="http://www.cypress.com/products/32-bit-arm-cortex-m4-psoc-6" target="_blank" rel="noopener">PSoC 6</a>.  I was initially a bit worried about how much could be covered in only two hours&#8230; then I remembered how awesome PSoC Creator is at getting people going.  Originally, I was planning on writing a lab manual document describing all of the getting started exercises, but upon reflection, I decided to make a series of IoT Expert articles so that the content could be live.</p>
<p>I believe strongly that hands-on is best for real learning, so this class is built as four lab exercises for you to do by following along with my instructions.  I supplement the lab exercises with a survey of the PSoC 6 ecosystem&#8230; meaning all of the resources you can use to get help and learn.</p>
<p>You will need a few things for the class:</p>
<ul>
<li><a href="https://community.cypress.com/docs/DOC-13747" target="_blank" rel="noopener">PSoC Creator 4.2</a></li>
<li>Copies of the example projects. <a href="https://github.com/iotexpert/psoc-6-introduction" target="_blank" rel="noopener">GitHub</a> or <a href="https://iotexpert.com/wp-content/uploads/2017/11/PSoC-6-Introduction.cywrk_.Archive01.zip">zip</a></li>
<li>PSoC 6 BLE Pioneer Kit <a href="https://www.mouser.com/ProductDetail/Cypress-Semiconductor/CY8CKIT-062-BLE/?qs=%2fha2pyFadujougpOLomFMR1pSaaqZj9a4e%2fZzsGQMy3JZI6s168uTA%3d%3d" target="_blank" rel="noopener">(CY8CKIT-062-BLE)</a></li>
<li>A Terminal Program like <a href="http://www.putty.org" target="_blank" rel="noopener">Putty</a></li>
<li>A desire to be awesome! (instead of lame) by making amazing products</li>
</ul>
<p>Todays virtual workshop agenda is as follows:</p>
<p><span><h1>PSoC 6 Introduction</h1>
<p><div class="table-responsive"><table  style="width:95%; "  class="easy-table easy-table-default " border="1">
<thead>
<tr><th >#</th>
<th >Title</th>
<th >Comment</th>
</tr>
</thead>
<tbody>
<tr><td >0</td>
<td ><a href="https://iotexpert.com/2017/11/07/lesson-0-psoc-6-introduction-a-two-hour-psoc-6-class/">A Two Hour PSoC 6 Class</a></td>
<td >An introduction to the PSoC 6 class with links to all of the documents</td>
</tr>

<tr><td >1</td>
<td ><a href="https://iotexpert.com/2017/11/08/lesson-1-psoc-6-introduction-resources/" rel="noopener">Resources</a></td>
<td >Links to all of the Cypress PSoC 6 information including videos, application notes etc.</td>
</tr>

<tr><td >2</td>
<td ><a href="https://iotexpert.com/2017/11/08/lesson-2-psoc-6-introduction-first-project/">Your First Project</a></td>
<td >Learn how to build a PSoC 6 project and program your CY8CKIT-062-BLE development kit</td>
</tr>

<tr><td >3</td>
<td ><a href="https://iotexpert.com/2017/11/09/lesson-3-psoc-6-introduction-freertos-and-a-debugging-uart/" rel="noopener">FreeRTOS and a Debugging UART</a></td>
<td >Build a project using FreeRTOS including a debug console with the UART</td>
</tr>

<tr><td >4</td>
<td ><a href="https://iotexpert.com/2017/11/09/lesson-4-psoc-6-introduction-capsense/" rel="noopener">CapSense</a></td>
<td >Build a project using the Mutual Cap Buttons and Self Cap Slider</td>
</tr>

<tr><td >5</td>
<td ><a href="https://iotexpert.com/2017/11/09/lesson-5-psoc-6-introduction-bluetooth-low-energy/" rel="noopener">Bluetooth Low Energy</a></td>
<td >Build a CapSense project using BLE and CySmart</td>
</tr>
</tbody></table></div></p>
<p>Since I did the webinar several things have happened</p>
<ol>
<li>Lesson 4: I fixed an error in the stack size for FreeRTOS</li>
<li>Lesson 5: The PSoC Creator BLE PDL has been upgraded to greatly simplify the notifyCapSense function</li>
</ol>
<p>All of the projects are available at git@github.com:iotexpert/psoc-6-introduction.git or <a href="https://github.com/iotexpert/psoc-6-introduction" target="_blank" rel="noopener">www.github.com/iotexpert/psoc-6-introduction</a></p></span></p>
<h1>PSoC Creator 4.2</h1>
<p>The class is built on PSoC Creator 4.2 which is currently in beta.  Here is a screenshot (of the class workspace) that includes the example projects (which you can <a href="https://github.com/iotexpert/psoc-6-introduction" target="_blank" rel="noopener">download</a>).  It also shows that some of the components are still prototypes.  Don&#8217;t worry, Cypress will be releasing production silicon and final development software soon.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-3.03.39-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-3.03.39-PM-1024x648.png" alt="PSoC Creator" width="1024" height="648" class="alignnone wp-image-4603 size-large" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-3.03.39-PM-1024x648.png 1024w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-3.03.39-PM-600x380.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-3.03.39-PM-300x190.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-06-at-3.03.39-PM-768x486.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<h1>CY8CKIT-062-BLE</h1>
<p>The class is built for the CY8CKIT-062-BLE.  Here is a picture of my development kit taken from the table at Starbucks where I am finishing the material for this class.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/IMG_5095.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/IMG_5095-1024x768.jpg" alt="CY8CKIT-062-BLE PSoC 6 Development Kit" width="1024" height="768" class="alignnone wp-image-4622 size-large" srcset="https://iotexpert.com/wp-content/uploads/2017/11/IMG_5095-1024x768.jpg 1024w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_5095-600x450.jpg 600w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_5095-300x225.jpg 300w, https://iotexpert.com/wp-content/uploads/2017/11/IMG_5095-768x576.jpg 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>And here is the nice picture from our website (that the marketing guys made me use)</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/CY8CKIT-062-BLE.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/11/CY8CKIT-062-BLE.jpg" alt="CY8CKIT-062-BLE" width="720" height="600" class="alignnone wp-image-4614 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/11/CY8CKIT-062-BLE.jpg 720w, https://iotexpert.com/wp-content/uploads/2017/11/CY8CKIT-062-BLE-600x500.jpg 600w, https://iotexpert.com/wp-content/uploads/2017/11/CY8CKIT-062-BLE-300x250.jpg 300w" sizes="auto, (max-width: 720px) 100vw, 720px" /></a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/lesson-0-psoc-6-introduction-a-two-hour-psoc-6-class/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
