<?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>Embedded Design &#8211; IoT Expert</title>
	<atom:link href="https://iotexpert.com/category/embedded-design/feed/" rel="self" type="application/rss+xml" />
	<link>https://iotexpert.com</link>
	<description>Engineering for the Internet of Things</description>
	<lastBuildDate>Fri, 09 Feb 2018 22:32:49 +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>Embedded Design &#8211; IoT Expert</title>
	<link>https://iotexpert.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>The Lost Art of Assembly Language Programming</title>
		<link>https://iotexpert.com/lost-art-assembly-language-programming/</link>
					<comments>https://iotexpert.com/lost-art-assembly-language-programming/#comments</comments>
		
		<dc:creator><![CDATA[Darrin Vallis]]></dc:creator>
		<pubDate>Fri, 09 Feb 2018 19:53:37 +0000</pubDate>
				<category><![CDATA[CY8CKIT-042]]></category>
		<category><![CDATA[CY8CKIT-044]]></category>
		<category><![CDATA[Cy8CKIT-145]]></category>
		<category><![CDATA[Embedded Design]]></category>
		<category><![CDATA[PSoC 4000S]]></category>
		<category><![CDATA[PSoC 4200]]></category>
		<category><![CDATA[PSoC Creator]]></category>
		<category><![CDATA[ARM]]></category>
		<category><![CDATA[Assembly. Machine Code]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=4992</guid>

					<description><![CDATA[Cypress introduced it&#8217;s first mass market microcontroller in 2001. It used a Cypress designed 8 bit CISC processor running at 24 MHz, with as little as 4 KB Flash and 256 bytes RAM. Wrapped around that was a neat array of programmable analog and digital blocks. This may not sound like much, but with a [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Cypress introduced it&#8217;s first mass market microcontroller in 2001. It used a Cypress designed 8 bit CISC processor running at 24 MHz, with as little as 4 KB Flash and 256 bytes RAM. Wrapped around that was a neat array of programmable analog and digital blocks. This may not sound like much, but with a creative mindset you could get these parts to do amazing things. For instance, I once implemented a complete ultrasonic ranging sensor with full wave analog demodulation in a single PSOC1 as shown below.</p>
<figure id="attachment_4993" aria-describedby="caption-attachment-4993" style="width: 1024px" class="wp-caption aligncenter"><a href="https://iotexpert.com/wp-content/uploads/2018/02/UltrasonicRangingPSOC1.jpg"><img fetchpriority="high" decoding="async" width="1024" height="430" class="size-large wp-image-4993" alt="" src="https://iotexpert.com/wp-content/uploads/2018/02/UltrasonicRangingPSOC1-1024x430.jpg" srcset="https://iotexpert.com/wp-content/uploads/2018/02/UltrasonicRangingPSOC1-1024x430.jpg 1024w, https://iotexpert.com/wp-content/uploads/2018/02/UltrasonicRangingPSOC1-600x252.jpg 600w, https://iotexpert.com/wp-content/uploads/2018/02/UltrasonicRangingPSOC1-300x126.jpg 300w, https://iotexpert.com/wp-content/uploads/2018/02/UltrasonicRangingPSOC1-768x323.jpg 768w, https://iotexpert.com/wp-content/uploads/2018/02/UltrasonicRangingPSOC1.jpg 1040w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption id="caption-attachment-4993" class="wp-caption-text">PSOC1 Ultrasonic Ranging</figcaption></figure>
<p>With CPU resources at a premium, you had to write tight, efficient code to get the most out of PSOC1. A single C library could consume the entire Flash. Consequently, I wrote a <em>lot</em> of assembly code. That&#8217;s not so bad, since I actually enjoy it more than C. There&#8217;s a certain elegance to well written, fully commented machine code. In the case of PSOC1, here&#8217;s what you had to work with: 5 registers, some RAM and Flash. That&#8217;s it. Real Men Write In Assembly.</p>
<figure id="attachment_4995" aria-describedby="caption-attachment-4995" style="width: 518px" class="wp-caption aligncenter"><a href="https://iotexpert.com/wp-content/uploads/2018/02/M8Carch.jpg"><img decoding="async" width="518" height="341" class="size-full wp-image-4995" alt="" src="https://iotexpert.com/wp-content/uploads/2018/02/M8Carch.jpg" srcset="https://iotexpert.com/wp-content/uploads/2018/02/M8Carch.jpg 518w, https://iotexpert.com/wp-content/uploads/2018/02/M8Carch-300x197.jpg 300w" sizes="(max-width: 518px) 100vw, 518px" /></a><figcaption id="caption-attachment-4995" class="wp-caption-text">M8C Architecture</figcaption></figure>
<p>&nbsp;</p>
<p>We&#8217;ll start with simple machine code instruction to make the CPU do something. You can reference the M8C assembly language user guide <a href="http://www.cypress.com/file/72341/download">here</a> for more details. To get the M8C to execute 2+3=5 we write:</p>
<p><span style="font-family: Courier New;color: black">mov A,2       ;Load A with 2<br />
add A,3       ;Add 3 to A. Result=5 is in A<br />
</span></p>
<p>We can get fancy by using variables. Let&#8217;s add R=P+Q. Assume P is at RAM location 0x20 and Q is at location 0x21, and R is at 0x22</p>
<p><span style="font-family: Courier New;color: black">;Initialize variables<br />
mov [0x20],2  ;Load P with 2<br />
mov [0x21],3  ;Load Q with 3</span></p>
<p><span style="font-family: Courier New;color: black">;Add variables<br />
mov X,[0x20]  ;X &lt;- P<br />
mov A,[0x21]  ;A &lt;- Q<br />
adc [X],A     ;X &lt;- P + Q<br />
mov [0x22],X  ;R &lt;- X<br />
</span><br />
The fun thing about assembly is you can always dream up cool ways of doing things in less operations based on the machine&#8217;s instruction set. For example, we can simplify the above code as follows:</p>
<p><span style="font-family: Courier New;color: black">;Add variables<br />
mov [0x20],[0x22]   ;R &lt;- P<br />
adc [0x22],[0x21]   ;R &lt;- P + Q</span></p>
<p>In my experience, a good programmer with expert knowledge of the instruction set and CPU resources can always write better code than a compiler. There&#8217;s a certain human creativity that algorithms can&#8217;t match.</p>
<p>All that being said, I had not seen a good &#8220;machine code 101&#8221; tutorial for writing assembly in PSOC Creator on modern ARM M0 processors. So let&#8217;s walk through one now. We&#8217;ll use a CY8CKIT-145 and blink the LED. It&#8217;s just what happens to be laying around on the lab bench. Any PSOC4 kit will do.</p>
<p><img decoding="async" width="518" height="341" class="size-full wp-image-4995 aligncenter" alt="CY8CKIT-145-40XX" src="http://www.cypress.com/sites/default/files/media-embed/263821/CY8CKIT-145_image.png" /></p>
<p>We&#8217;ll start by creating a standard project in PSOC Creator, drop a Digital Output pin on the schematic and call it &#8220;LED&#8221;</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2018/02/1.jpg"><img loading="lazy" decoding="async" width="1023" height="585" class="alignnone wp-image-5014 size-full" alt="" src="https://iotexpert.com/wp-content/uploads/2018/02/1.jpg" srcset="https://iotexpert.com/wp-content/uploads/2018/02/1.jpg 1023w, https://iotexpert.com/wp-content/uploads/2018/02/1-600x343.jpg 600w, https://iotexpert.com/wp-content/uploads/2018/02/1-300x172.jpg 300w, https://iotexpert.com/wp-content/uploads/2018/02/1-768x439.jpg 768w" sizes="auto, (max-width: 1023px) 100vw, 1023px" /></a></p>
<p>Then open the .CYDWR file and drag pin LED to P2[5], since that&#8217;s where it is on the LED board. Yours may be in a different place on whatever board you are using.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2018/02/2.jpg"><img loading="lazy" decoding="async" width="871" height="579" class="alignnone size-full wp-image-5015" alt="" src="https://iotexpert.com/wp-content/uploads/2018/02/2.jpg" srcset="https://iotexpert.com/wp-content/uploads/2018/02/2.jpg 871w, https://iotexpert.com/wp-content/uploads/2018/02/2-600x399.jpg 600w, https://iotexpert.com/wp-content/uploads/2018/02/2-300x199.jpg 300w, https://iotexpert.com/wp-content/uploads/2018/02/2-768x511.jpg 768w" sizes="auto, (max-width: 871px) 100vw, 871px" /></a></p>
<p>Now under &#8220;Source Files&#8221; in the workspace directory you will delete main.c and replace with main.s</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2018/02/3JPG.jpg"><img loading="lazy" decoding="async" width="343" height="567" class="alignnone size-full wp-image-5016" alt="" src="https://iotexpert.com/wp-content/uploads/2018/02/3JPG.jpg" srcset="https://iotexpert.com/wp-content/uploads/2018/02/3JPG.jpg 343w, https://iotexpert.com/wp-content/uploads/2018/02/3JPG-181x300.jpg 181w" sizes="auto, (max-width: 343px) 100vw, 343px" /></a></p>
<p>Now right clock on &#8220;Source Files&#8221;, select &#8220;Add New File&#8221; and select &#8220;GNU ARM Assembly File&#8221; in the dialog. Rename the file from GNUArmAssembly01.s to main.s</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2018/02/4.jpg"><img loading="lazy" decoding="async" width="524" height="402" class="alignnone size-full wp-image-5017" alt="" src="https://iotexpert.com/wp-content/uploads/2018/02/4.jpg" srcset="https://iotexpert.com/wp-content/uploads/2018/02/4.jpg 524w, https://iotexpert.com/wp-content/uploads/2018/02/4-300x230.jpg 300w" sizes="auto, (max-width: 524px) 100vw, 524px" /></a></p>
<p>Your workspace ends up looking like this:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2018/02/5.jpg"><img loading="lazy" decoding="async" width="319" height="339" class="alignnone size-full wp-image-5018" alt="" src="https://iotexpert.com/wp-content/uploads/2018/02/5.jpg" srcset="https://iotexpert.com/wp-content/uploads/2018/02/5.jpg 319w, https://iotexpert.com/wp-content/uploads/2018/02/5-282x300.jpg 282w" sizes="auto, (max-width: 319px) 100vw, 319px" /></a></p>
<p>So far, so good. Now open main.s, delete everything if it&#8217;s not empty and add the following code. This sets up the IDE for M0 assembly architecture</p>
<p><span style="font-family: Courier New;color: black">// ==============================================<br />
// ARM M0 Assembly Tutorial<br />
//<br />
// 01 &#8211; Blink LED<br />
// ==============================================<br />
.syntax unified<br />
.text<br />
.thumb<br />
</span><br />
Next we need to include register definitions for the chip we are using. These are all from the PSOC4 Technical Reference Manual (TRM)</p>
<p><span style="font-family: Courier New;color: black">// ==============================================<br />
// Includes<br />
// ==============================================<br />
.include &#8220;cydevicegnu_trm.inc&#8221;<br />
</span></p>
<p>Then we are going to do some .equ statements, same as #define in C. This identifies the Port 2 GPIO data register plus bits for the LED pin in on and off state</p>
<p><span style="font-family: Courier New;color: black">// ==============================================<br />
// Defines<br />
// ==============================================<br />
.equ LED_DR,CYREG_GPIO_PRT2_DR          // LED data reg address<br />
.equ LED_PIN,5                          // P2.5<br />
.equ LED_OFF,1&lt;&lt;led_pin                 // 0010 0000<br />
.equ LED_ON,~LED_OFF                    // 1101 1111<br />
</span></p>
<p>Now you add the right syntax to set up main()</p>
<p><span style="font-family: Courier New;color: black">// ==============================================<br />
// main<br />
// ==============================================<br />
.global main<br />
.func main, main<br />
.type main, %function<br />
.thumb_func<br />
</span></p>
<p>Finally we add the code for main, which is pretty simple:</p>
<p><span style="font-family: Courier New;color: black">main:<br />
ldr r5,=LED_DR      // Load GPIO port addr to r5</span></p>
<p><span style="font-family: Courier New;color: black">loop0:<br />
ldr r6,=LED_ON      // Move led data to r6<br />
str r6,[r5]         // Write r6 data to r5 addr</span></p>
<p><span style="font-family: Courier New;color: black">ldr r0,=0xFFFFFF    // Argument passed in r0<br />
bl CyDelayCycles    // Delay for N cycles</span></p>
<p><span style="font-family: Courier New;color: black">ldr r6,=LED_OFF     // Move led data to r6<br />
str r6,[r5]         // Write r6 data to r5 addr</span></p>
<p><span style="font-family: Courier New;color: black">ldr r0,=0xFFFFFF    // Argument passed in r0<br />
bl CyDelayCycles    // Delay for N cycles</span></p>
<p><span style="font-family: Courier New;color: black">b loop0             // Branch loop0</span></p>
<p><span style="font-family: Courier New;color: black">.endfunc            // End of main<br />
.end                // End of code<br />
</span></p>
<p>One thing to note: The function CyDelayCycles is defined CyBootAsmGnu.s. Any function in assembly gets its arguments passed by the first 4 registers r0,r1,r2 and r3. Before calling the function you simply load r0 with the argument then do a bl (branch with link). This is also why I avoided the first 4 registers when messing with LED data. If you&#8217;re interested in doing more with ARM assembly, definitely read the <a href="https://iotexpert.com/wp-content/uploads/2018/02/m0p_trm.pdf">Cortex M0+ Technical Reference Manual</a>. It&#8217;s a great primer for the M0+ instruction set.</p>
<p>That&#8217;s it. End result is a blinking LED. Cool thing is you can use PSOC Creator with all it&#8217;s nice features, but sill access the power of machine code.</p>
<p>You can get the project ZIP file <a href="https://iotexpert.com/wp-content/uploads/2018/02/M0_ASM_v2.zip">here</a>.</p>
<p>Regards<br />
Darrin Vallis</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2018/02/20180209_133339.jpg"><img loading="lazy" decoding="async" width="1024" height="768" class="alignnone size-large wp-image-5022" alt="" src="https://iotexpert.com/wp-content/uploads/2018/02/20180209_133339-1024x768.jpg" srcset="https://iotexpert.com/wp-content/uploads/2018/02/20180209_133339-1024x768.jpg 1024w, https://iotexpert.com/wp-content/uploads/2018/02/20180209_133339-600x450.jpg 600w, https://iotexpert.com/wp-content/uploads/2018/02/20180209_133339-300x225.jpg 300w, https://iotexpert.com/wp-content/uploads/2018/02/20180209_133339-768x576.jpg 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><a href="https://iotexpert.com/wp-content/uploads/2018/02/M0_ASM_v2.zip"></a><a href="https://iotexpert.com/wp-content/uploads/2018/02/20180209_133339.jpg"></a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/lost-art-assembly-language-programming/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
		<item>
		<title>Serial Wire View with PSOC4</title>
		<link>https://iotexpert.com/serial-wire-view-with-psoc4/</link>
					<comments>https://iotexpert.com/serial-wire-view-with-psoc4/#respond</comments>
		
		<dc:creator><![CDATA[Darrin Vallis]]></dc:creator>
		<pubDate>Sat, 18 Nov 2017 01:17:08 +0000</pubDate>
				<category><![CDATA[CY8CKIT-042]]></category>
		<category><![CDATA[CY8CKIT-044]]></category>
		<category><![CDATA[Devices]]></category>
		<category><![CDATA[Embedded Design]]></category>
		<category><![CDATA[PSoC 4000S]]></category>
		<category><![CDATA[PSoC 4200]]></category>
		<category><![CDATA[PSoC Creator]]></category>
		<category><![CDATA[PSoC4 BLE]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=4707</guid>

					<description><![CDATA[I use PSOC4 to invent all kinds of unique solutions for customers. Usually, they want them field upgradeable to deploy new features or fix bugs. Fortunately Cypress has a great I2C boot loader to meet this need, so I use the heck out of it. Cypress has a great debugger built into PSOC Creator which [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I use PSOC4 to invent all kinds of unique solutions for customers. Usually, they want them field upgradeable to deploy new features or fix bugs. Fortunately Cypress has a great <a href="http://www.cypress.com/documentation/application-notes/an86526-psocr-4-and-psoc-analog-coprocessor-i2c-bootloader-zh">I2C boot loader</a> to meet this need, so I use the heck out of it.</p>
<p>Cypress has a great debugger built into <a href="http://www.cypress.com/products/psoc-creator-integrated-design-environment-ide">PSOC Creator</a> which fully supports all the ARM Serial Wire Debug protocols such as breakpoints, single step, memory, register viewing etc. However, when you are running a boot loader <em>the debugger does not work!</em> Why not? Because with a boot loader there are two applications resident in PSOC4: The boot loader and application. This is not supported by Cypress implementation of SWD.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/bootloader.jpg"><img loading="lazy" decoding="async" width="300" height="155" class="alignnone wp-image-4710 size-medium" alt="" src="https://iotexpert.com/wp-content/uploads/2017/11/bootloader-300x155.jpg" srcset="https://iotexpert.com/wp-content/uploads/2017/11/bootloader-300x155.jpg 300w, https://iotexpert.com/wp-content/uploads/2017/11/bootloader-600x311.jpg 600w, https://iotexpert.com/wp-content/uploads/2017/11/bootloader.jpg 653w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Where does this leave you, the intrepid code developer, when debugging a boot loader project? Personally, I have used all kinds of methods: debug UART interface, debug I2C interface, bang out states on pins, debug Bluetooth interface &#8230; and on and on. You get the idea. All these methods burn a communications interface and require extra pins on the chip. Sometimes that&#8217;s not possible.</p>
<p>The issue recently came to a head when a customer very nearly in production experienced a boot loader failure. One system out of a few thousand was &#8220;bricked&#8221; when they tried to field  update in the lab. Their pinout is frozen, they can&#8217;t add new hardware so how do we look inside PSOC4 and see what&#8217;s going on?</p>
<p>I woke up at 2 AM and thought &#8220;Ah Ha! SWV!&#8221; (Yes, I Am A Geek) Serial Wire View is an ARM native debug protocol that let&#8217;s you XRAY the insides of any ARM MCU <em>with the right interface</em>. SWV is a protocol which runs on the SWD pins (clock and data) but also needs the Serial Wire Output (SWO) pin. Cypress left the SWO pin and associated IP off of PSOC4 to save die cost, foiling my great idea. Brief interlude to drink and bang head on desk.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/3272886-coresight-debug.png"><img loading="lazy" decoding="async" width="300" height="222" class="aligncenter wp-image-4712 size-medium" alt="" src="https://iotexpert.com/wp-content/uploads/2017/11/3272886-coresight-debug-300x222.png" srcset="https://iotexpert.com/wp-content/uploads/2017/11/3272886-coresight-debug-300x222.png 300w, https://iotexpert.com/wp-content/uploads/2017/11/3272886-coresight-debug-600x443.png 600w, https://iotexpert.com/wp-content/uploads/2017/11/3272886-coresight-debug-768x567.png 768w, https://iotexpert.com/wp-content/uploads/2017/11/3272886-coresight-debug-1024x756.png 1024w, https://iotexpert.com/wp-content/uploads/2017/11/3272886-coresight-debug.png 1190w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Fortunately, I don&#8217;t give up easily. At least my subconscious does not. Woke up the next night thinking &#8220;Ah Ha!&#8221; again. Wife was mildly annoyed, but tolerates my idiosyncrasies.</p>
<p>Cypress has a nice software UART transmitter implementation. I shamelessly stole it, modified for my purposes and created a custom component. (It&#8217;s pretty easy to do this by the way) Baud rate was modified to 230 KBps and the output pin forced to a specific pin with a control file.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/dtview2.jpg"><img loading="lazy" decoding="async" width="767" height="301" class="alignnone wp-image-4717 size-full" alt="" src="https://iotexpert.com/wp-content/uploads/2017/11/dtview2.jpg" srcset="https://iotexpert.com/wp-content/uploads/2017/11/dtview2.jpg 767w, https://iotexpert.com/wp-content/uploads/2017/11/dtview2-600x235.jpg 600w, https://iotexpert.com/wp-content/uploads/2017/11/dtview2-300x118.jpg 300w" sizes="auto, (max-width: 767px) 100vw, 767px" /></a></p>
<p>Once the component is in place, you can use its _DView_Printf( ) API call to display any debug data. Here is an example:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/code.jpg"><img loading="lazy" decoding="async" width="816" height="227" class="alignnone size-full wp-image-4723" alt="" src="https://iotexpert.com/wp-content/uploads/2017/11/code.jpg" srcset="https://iotexpert.com/wp-content/uploads/2017/11/code.jpg 816w, https://iotexpert.com/wp-content/uploads/2017/11/code-600x167.jpg 600w, https://iotexpert.com/wp-content/uploads/2017/11/code-300x83.jpg 300w, https://iotexpert.com/wp-content/uploads/2017/11/code-768x214.jpg 768w" sizes="auto, (max-width: 816px) 100vw, 816px" /></a></p>
<p>More about that output pin. Cypress sells a tool for programming and debugging PSOC called <a href="http://www.cypress.com/documentation/development-kitsboards/cy8ckit-002-psoc-miniprog3-program-and-debug-kit">CY8CKIT-002</a>, aka MiniProg3. The programming connector consists of VDD, GND, reset, SWD clock and SWD data as shown below.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/Header.jpg"><img loading="lazy" decoding="async" width="300" height="192" class="alignnone size-medium wp-image-4719" alt="" src="https://iotexpert.com/wp-content/uploads/2017/11/Header-300x192.jpg" srcset="https://iotexpert.com/wp-content/uploads/2017/11/Header-300x192.jpg 300w, https://iotexpert.com/wp-content/uploads/2017/11/Header-600x384.jpg 600w, https://iotexpert.com/wp-content/uploads/2017/11/Header-768x492.jpg 768w, https://iotexpert.com/wp-content/uploads/2017/11/Header.jpg 814w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Since we can&#8217;t use SWD protocol for debugging anyway, we can change the pins from SWD to normal GPIO. <em>The pins still function for programming</em>. By default they are in SWD mode as shown.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/SWD_Pins.jpg"><img loading="lazy" decoding="async" width="300" height="194" class="alignnone size-medium wp-image-4720" alt="" src="https://iotexpert.com/wp-content/uploads/2017/11/SWD_Pins-300x194.jpg" srcset="https://iotexpert.com/wp-content/uploads/2017/11/SWD_Pins-300x194.jpg 300w, https://iotexpert.com/wp-content/uploads/2017/11/SWD_Pins.jpg 587w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Going to the system tab of the .CYDWR file, we can change them to GPIO.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/ChangeToGPIO.jpg"><img loading="lazy" decoding="async" width="634" height="258" class="alignnone wp-image-4721 size-full" alt="" src="https://iotexpert.com/wp-content/uploads/2017/11/ChangeToGPIO.jpg" srcset="https://iotexpert.com/wp-content/uploads/2017/11/ChangeToGPIO.jpg 634w, https://iotexpert.com/wp-content/uploads/2017/11/ChangeToGPIO-600x244.jpg 600w, https://iotexpert.com/wp-content/uploads/2017/11/ChangeToGPIO-300x122.jpg 300w" sizes="auto, (max-width: 634px) 100vw, 634px" /></a></p>
<p>Once we do that, the pins look like this. Here&#8217;s the trick. We now assign the TX output of our DTView component to pin 3[2], which is available  on the SWD programming header, pin 5.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/TX-UART.jpg"><img loading="lazy" decoding="async" width="300" height="204" class="alignnone size-medium wp-image-4722" alt="" src="https://iotexpert.com/wp-content/uploads/2017/11/TX-UART-300x204.jpg" srcset="https://iotexpert.com/wp-content/uploads/2017/11/TX-UART-300x204.jpg 300w, https://iotexpert.com/wp-content/uploads/2017/11/TX-UART.jpg 533w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Can you see where we are going with this? Printf( ) data is now coming out of PSOC4 on pin 3[2], easily accessible on our debug header. This is where MiniProg3 comes in. It can actually receive data as a 230 KBps RX UART on its XRES pin. Weird, right? By building a simple interface cable we can get the data from your debug header into MiniProg3.</p>
<p>MiniProg3 XRES &#8212;&#8212; SWD HEADER pin 5</p>
<p>MiniProg3   GND &#8212;&#8212; SWD HEADER pin 2</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/20171114_102729.jpg"><img loading="lazy" decoding="async" width="653" height="490" class="alignnone wp-image-4726 size-full" alt="" src="https://iotexpert.com/wp-content/uploads/2017/11/20171114_102729.jpg" srcset="https://iotexpert.com/wp-content/uploads/2017/11/20171114_102729.jpg 653w, https://iotexpert.com/wp-content/uploads/2017/11/20171114_102729-600x450.jpg 600w, https://iotexpert.com/wp-content/uploads/2017/11/20171114_102729-300x225.jpg 300w" sizes="auto, (max-width: 653px) 100vw, 653px" /></a></p>
<p>However, MiniProg3 does not show up as a COM port on your PC, so how do we the data? It needs to be accessed by a host application running the PP_COM API. This is documented under <em>PSOC Programmer Component Object Model COM Interface Guide</em>, Cypress specification <span style="font-family: Arial;font-size: xx-small"></span>001-45209. If you installed PSOC Creator or Programmer, this document is actually on your PC under C:\Program Files (x86)\Cypress\Programmer\Documents. Engineers don&#8217;t like to read instructions. Amazing what you can find when you do.</p>
<p>I wrote a simple  console application which opens MiniProg3 using PP_COM, retrieves data from the serial RX pin via USB and displays it like a simple terminal program. Voila! You now have a serial debugger that works for any PSOC4 project using MiniProg3 as your USB to serial dongle.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/DTViewOutput.jpg"><img loading="lazy" decoding="async" width="1024" height="388" class="alignnone size-large wp-image-4728" alt="" src="https://iotexpert.com/wp-content/uploads/2017/11/DTViewOutput-1024x388.jpg" srcset="https://iotexpert.com/wp-content/uploads/2017/11/DTViewOutput-1024x388.jpg 1024w, https://iotexpert.com/wp-content/uploads/2017/11/DTViewOutput-600x227.jpg 600w, https://iotexpert.com/wp-content/uploads/2017/11/DTViewOutput-300x114.jpg 300w, https://iotexpert.com/wp-content/uploads/2017/11/DTViewOutput-768x291.jpg 768w, https://iotexpert.com/wp-content/uploads/2017/11/DTViewOutput.jpg 1111w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Customer was really happy with this. We were able to immediately see his problem and fixed it in about 5 minutes.</p>
<p>Finally, here are all the source files</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/DTView-Firmware.zip">DTView Firmware</a> : PSOC Creator example project and DTView component</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/DTViewer-Setup.zip">DTViewer Binary</a> : Installer for DTViewer console</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/11/ViewerSource.zip">ViewerSource</a> : Complete source code for DTViewer console (Requires Visual Studio 2015)</p>
<p>That&#8217;s all. Have fun with the new debugging tool.</p>
<p>DTV</p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/serial-wire-view-with-psoc4/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>PSoC4000s &#038; The SmartIO &#8211; Part 1</title>
		<link>https://iotexpert.com/psoc4000s-the-smartio-part-1/</link>
					<comments>https://iotexpert.com/psoc4000s-the-smartio-part-1/#comments</comments>
		
		<dc:creator><![CDATA[Alan Hawse]]></dc:creator>
		<pubDate>Tue, 08 Mar 2016 15:42:45 +0000</pubDate>
				<category><![CDATA[Cy8CKIT-145]]></category>
		<category><![CDATA[Devices]]></category>
		<category><![CDATA[Embedded Design]]></category>
		<category><![CDATA[PSoC 4000S]]></category>
		<category><![CDATA[PSoC Creator]]></category>
		<category><![CDATA[SmartIO]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=748</guid>

					<description><![CDATA[In the previous four posts I talked about building an IOT device using the new CY8CKIT145.  You might remember from the first post that my original objective in picking up the board was to try a new feature of PSoC Creator.  Well, over the last few days I have been trying out that feature. Actually, it isn&#8217;t [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In the <a href="https://iotexpert.com/2016/02/29/psoc4000s-and-the-cy8ckit145-stamp-board-part-1/" target="_blank">previous</a> four posts I talked about building an IOT device using the new CY8CKIT145.  You might remember from the first post that my original objective in picking up the board was to try a new feature of PSoC Creator.  Well, over the last few days I have been trying out that feature. Actually, it isn&#8217;t a feature of the software, it is a feature of some of the new chips called the Smart IO.  The Smart IO is a programmable logic bock that sits between the High Speed IO Matrix (HSIOM) of the chip and the Input/Output Port.  The HSIOM has all of the peripherals (SCB, TCPWM etc) of the chips attached to it.  The Smart IO will allow you to take signals from inside or outside of the chip, perform logic functions on them, and then drive those signals into or out of the chip.  Some of examples of why you might want to do this include:</p>
<ul>
<li>Combining several inputs (from the outside) to trigger an interrupt</li>
<li>Inverting a signal entering the chip</li>
<li>Inverting a signal exiting the chip</li>
<li>Remapping an input from one pin to a different input (e.g. flipping Tx, Rx pins)</li>
<li>Buffering one signal into multiple output pins (to increase the drive strength)</li>
</ul>
<p>As usual with Cypress programmable logic, you can do a jaw dropping number of clever things.  This block includes sequential logic as well as combinational logic, so it is possible to make state machines in the fabric.  It also includes more surprises which have not been shown yet.</p>
<p>The Smart IO works the same as other peripheral blocks, you start by dragging the component onto the schematic and double clicking to start the customizer.</p>
<p>When you start the customizer you get the screen below.  The first thing to decide is which Port is going to use the Smart IO.  The Smart IO completely takes over an entire port.  On this chip there are two Smart IOs, one on Port 2 and one on Port 3.   When you look at the customizer there are some things to notice:</p>
<ul>
<li>On the right side of the customizer you can see the 8 GPIO pins.  The dropdown menus that are currently labeled &#8220;Bypass&#8221; allow you to select the mode of the pin (Bypass, Input, Output, None).</li>
<li>On the bottom of the customizer you can see the 8 LUTs and select their inputs.</li>
<li>On the left side of the customizer you can see the the 8 connections to/from the HSIOM.  The drop down menu that is currently labeled &#8220;Bypass&#8221; allows you to select the mode of that connection to the HSIOM (Bypass, Input, Output, None).   I will talk about the &#8220;Undefined&#8221; menu in the with the next picture</li>
<li>In the middle of the customizer is the routing matrix.  Horizontally on the routing matrix there are 8 groups of three wires.  The top wire in each group is a wire that originates with the GPIO.  The middle wire originates from the corresponding LUT.  The bottom wire originates from the HSIOM.  For example the top three wires in the picture are
<ul>
<li>Line 1: from GPIO7</li>
<li>Line 2: from LUT 7</li>
<li>Line 3: from Data7</li>
</ul>
</li>
<li>You can &#8220;make&#8221; the connection by either by clicking the solder dot or by choosing from the coresponding drop down menu (more on that below)</li>
</ul>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/03/basicsmartio.png" rel="attachment wp-att-752"><img loading="lazy" decoding="async" class="alignnone size-large wp-image-752" src="https://iotexpert.com/wp-content/uploads/2016/03/basicsmartio-1024x686.png" alt="basicsmartio" width="1024" height="686" srcset="https://iotexpert.com/wp-content/uploads/2016/03/basicsmartio-1024x686.png 1024w, https://iotexpert.com/wp-content/uploads/2016/03/basicsmartio-600x402.png 600w, https://iotexpert.com/wp-content/uploads/2016/03/basicsmartio-300x201.png 300w, https://iotexpert.com/wp-content/uploads/2016/03/basicsmartio-768x514.png 768w, https://iotexpert.com/wp-content/uploads/2016/03/basicsmartio.png 1027w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>The other menu on the HSIOM side of the customizer says &#8220;Undefined&#8221;.  This menu has a list of each fixed function device and the inputs/outputs of that device that can be connected to that input/output.  This menu doesn&#8217;t actually change anything in your design, it is only for information.  For example you can see in the screen shot below that  data4 can connect to:</p>
<ul>
<li>TCPWM0: Line_Out</li>
<li>LCD0: COM[20]</li>
<li>LCD0: SEG[20]</li>
<li>SCB1: Spi Select[1]</li>
</ul>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/03/smartio-dataselect.png" rel="attachment wp-att-756"><img loading="lazy" decoding="async" class="alignnone size-large wp-image-756" src="https://iotexpert.com/wp-content/uploads/2016/03/smartio-dataselect-1024x684.png" alt="smartio-dataselect" width="1024" height="684" srcset="https://iotexpert.com/wp-content/uploads/2016/03/smartio-dataselect-1024x684.png 1024w, https://iotexpert.com/wp-content/uploads/2016/03/smartio-dataselect-600x401.png 600w, https://iotexpert.com/wp-content/uploads/2016/03/smartio-dataselect-300x200.png 300w, https://iotexpert.com/wp-content/uploads/2016/03/smartio-dataselect-768x513.png 768w, https://iotexpert.com/wp-content/uploads/2016/03/smartio-dataselect.png 1029w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>The best way to show you how all this works is with an example.  One of the frustrating things for me in the PSoC 4 Family has always been that the fixed function blocks (TCPWM, SCB) are only allowed to connect to a few pins on the chip.  This can be a bit of a pain if you have a board that is already wired and you need to remap a pin.  Take for example, on the Cy8CKIT-145 the user LED on the main board is connected to P2[5].  If I want to drive that LED with the Line out (instead of the Line_Out_N) I would create a schematic like this:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/03/BlueLEDSchematic.png" rel="attachment wp-att-758"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-758" src="https://iotexpert.com/wp-content/uploads/2016/03/BlueLEDSchematic.png" alt="BlueLEDSchematic" width="534" height="377" srcset="https://iotexpert.com/wp-content/uploads/2016/03/BlueLEDSchematic.png 534w, https://iotexpert.com/wp-content/uploads/2016/03/BlueLEDSchematic-300x212.png 300w" sizes="auto, (max-width: 534px) 100vw, 534px" /></a></p>
<p>When I go to the DWR to assign the pins I would see that the BlueLED cannot be attached to P2[5].  You can see all of the legal placements of that pin because they are highlighted in green.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/03/blueledpinassignment.png" rel="attachment wp-att-759"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-759" src="https://iotexpert.com/wp-content/uploads/2016/03/blueledpinassignment.png" alt="blueledpinassignment" width="992" height="240" srcset="https://iotexpert.com/wp-content/uploads/2016/03/blueledpinassignment.png 992w, https://iotexpert.com/wp-content/uploads/2016/03/blueledpinassignment-600x145.png 600w, https://iotexpert.com/wp-content/uploads/2016/03/blueledpinassignment-300x73.png 300w, https://iotexpert.com/wp-content/uploads/2016/03/blueledpinassignment-768x186.png 768w" sizes="auto, (max-width: 992px) 100vw, 992px" /></a></p>
<p>If I try to do it anyway, I will get the following error when I build.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/03/pwm_error.png" rel="attachment wp-att-757"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-757" src="https://iotexpert.com/wp-content/uploads/2016/03/pwm_error.png" alt="pwm_error" width="773" height="714" srcset="https://iotexpert.com/wp-content/uploads/2016/03/pwm_error.png 773w, https://iotexpert.com/wp-content/uploads/2016/03/pwm_error-600x554.png 600w, https://iotexpert.com/wp-content/uploads/2016/03/pwm_error-300x277.png 300w, https://iotexpert.com/wp-content/uploads/2016/03/pwm_error-768x709.png 768w" sizes="auto, (max-width: 773px) 100vw, 773px" /></a></p>
<p>This error says that I cannot connect the &#8220;line&#8221; output of the TCPWM to P2[5] (the pin with the LED).  That sucks.  But, with the Smart IO, I can &#8220;remap&#8221; the TCPWM Line output to P2[5].  To do this, I will start with a by adding a SmartIO to my schematic and configuring it.</p>
<ol>
<li>Select Port 2</li>
<li>Configure GPIO 5 to &#8220;Output&#8221;.  This can be done by either clicking on the &#8220;solder dot&#8221; or by selecting output from the drop down menu</li>
<li>Select data 4 as &#8220;Input&#8221;</li>
<li>Select data 4 as &#8220;TCPWM[0].line.  Remember that this is ONLY for your information and doesn&#8217;t actually change anything in the project.</li>
<li>Select the 3 inputs to LUT5 to be the data4 line which can be done from the three drop down menus or by clicking the three corresponding solder dots.</li>
</ol>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/03/Screen-Shot-2016-03-06-at-9.53.10-AM.png" rel="attachment wp-att-761"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-761" src="https://iotexpert.com/wp-content/uploads/2016/03/Screen-Shot-2016-03-06-at-9.53.10-AM.png" alt="Screen Shot 2016-03-06 at 9.53.10 AM" width="1022" height="686" srcset="https://iotexpert.com/wp-content/uploads/2016/03/Screen-Shot-2016-03-06-at-9.53.10-AM.png 1022w, https://iotexpert.com/wp-content/uploads/2016/03/Screen-Shot-2016-03-06-at-9.53.10-AM-600x403.png 600w, https://iotexpert.com/wp-content/uploads/2016/03/Screen-Shot-2016-03-06-at-9.53.10-AM-300x201.png 300w, https://iotexpert.com/wp-content/uploads/2016/03/Screen-Shot-2016-03-06-at-9.53.10-AM-768x516.png 768w" sizes="auto, (max-width: 1022px) 100vw, 1022px" /></a>Next, I configure the LUT to &#8220;passthrough&#8221; by setting up 000 = 0 and 111=1 (which are the only two possible combinations as the three inputs are tied together).  You change the &#8220;Out&#8221;s from 0-&gt;1 and 1-&gt;0 by clicking on it.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/03/LUT5.png" rel="attachment wp-att-762"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-762" src="https://iotexpert.com/wp-content/uploads/2016/03/LUT5.png" alt="LUT5" width="611" height="444" srcset="https://iotexpert.com/wp-content/uploads/2016/03/LUT5.png 611w, https://iotexpert.com/wp-content/uploads/2016/03/LUT5-600x436.png 600w, https://iotexpert.com/wp-content/uploads/2016/03/LUT5-300x218.png 300w" sizes="auto, (max-width: 611px) 100vw, 611px" /></a></p>
<p>Then I will re-wire up the schematic to look like this:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/03/blue-led-schematic-smartio.png" rel="attachment wp-att-764"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-764" src="https://iotexpert.com/wp-content/uploads/2016/03/blue-led-schematic-smartio.png" alt="blue-led-schematic-smartio" width="636" height="328" srcset="https://iotexpert.com/wp-content/uploads/2016/03/blue-led-schematic-smartio.png 636w, https://iotexpert.com/wp-content/uploads/2016/03/blue-led-schematic-smartio-600x309.png 600w, https://iotexpert.com/wp-content/uploads/2016/03/blue-led-schematic-smartio-300x155.png 300w, https://iotexpert.com/wp-content/uploads/2016/03/blue-led-schematic-smartio-348x180.png 348w" sizes="auto, (max-width: 636px) 100vw, 636px" /></a></p>
<p>The firmware is trivial,  just start the PWM and the SmartIO</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/03/blue-led-firmware.png" rel="attachment wp-att-766"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-766" src="https://iotexpert.com/wp-content/uploads/2016/03/blue-led-firmware.png" alt="blue-led-firmware" width="879" height="316" srcset="https://iotexpert.com/wp-content/uploads/2016/03/blue-led-firmware.png 879w, https://iotexpert.com/wp-content/uploads/2016/03/blue-led-firmware-600x216.png 600w, https://iotexpert.com/wp-content/uploads/2016/03/blue-led-firmware-300x108.png 300w, https://iotexpert.com/wp-content/uploads/2016/03/blue-led-firmware-768x276.png 768w" sizes="auto, (max-width: 879px) 100vw, 879px" /></a></p>
<p>When I program the kit the blue LED starts blinking.  Cool.</p>
<p>In the <a href="https://iotexpert.com/2016/03/10/psoc4000s-csx-mutual-capsense-buttons-part-1/">next posts</a> I will teach you how to use some other configurations of the Smart IO and how to use the CapSense block to create inputs for the Smart IO.</p>
<p>You can find this PSoC Creator workspace on <a href="https://github.com/iotexpert/CY8CKIT-145-Examples" target="_blank">github</a> in the directory called &#8220;SmartIO&#8221;.  This project is called &#8220;SimpleSmartIO&#8221;.</p>
<p><span><p><div class="table-responsive"><table  style="width:95%; "  class="easy-table easy-table-default " border="1">
<thead>
<tr><th >Index</th>
<th >Description</th>
</tr>
</thead>
<tbody>
<tr><td ><a href="https://iotexpert.com/2016/03/08/psoc4000s-the-smartio-part-1/" target="_blank">PSoC4000s &amp; The SmartIO – Part 1</a></td>
<td > An introduction to the SmartIO and first project</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/03/10/psoc4000s-csx-mutual-capsense-buttons-part-1/" target="_blank">PSoC4000s &amp; CSX Mutual CapSense Buttons Part 1</a></td>
<td > Using mutual capacitance</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/03/12/psoc4000s-csx-mutual-capsense-buttons-part-2/">PSoC4000s &amp; CSX Mutual CapSense Buttons Part 2</a></td>
<td > Using the CapSense tuner</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/03/14/psoc4000s-the-smartio-part-2/" target="_blank">PSoC4000s &amp; The SmartIO – Part 2</a></td>
<td > A 3 input XOR logic gate</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/03/16/psoc4000s-the-smartio-part-3/">PSoC4000s &amp; The SmartIO – Part 3</a></td>
<td > A 3 bit up counter state machine</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/03/19/psoc4000s-the-smartio-part-4/">PSoC4000s &amp; The SmartIO – Part 4</a></td>
<td > Using an external clock with the Smart IO</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/03/20/psoc4000s-the-smartio-part-5/">PSoC4000s &amp; The SmartIO – Part 5</a></td>
<td > Triggering an interrupt</td>
</tr>
</tbody></table></div></p></span></p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/psoc4000s-the-smartio-part-1/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>PSoC4000s and the CY8CKIT145 Stamp Board &#8211; Part 4</title>
		<link>https://iotexpert.com/psoc4000s-and-the-cy8ckit145-stamp-board-part-4/</link>
					<comments>https://iotexpert.com/psoc4000s-and-the-cy8ckit145-stamp-board-part-4/#respond</comments>
		
		<dc:creator><![CDATA[Alan Hawse]]></dc:creator>
		<pubDate>Sat, 05 Mar 2016 13:02:08 +0000</pubDate>
				<category><![CDATA[Cy8CKIT-145]]></category>
		<category><![CDATA[Devices]]></category>
		<category><![CDATA[Embedded Design]]></category>
		<category><![CDATA[PSoC 4000S]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=649</guid>

					<description><![CDATA[OK.  We&#8217;re ready for the big moment: the user test.  I was feeling pretty cool.  I had spent the week talking to 100s of people and putting on a pretty good show.  I was the master of all things PSoC, a geek rockstar.  So I programmed the firmware.  The slider worked.  I was able to [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>OK.  We&#8217;re ready for the big moment: the user test.  I was feeling pretty cool.  I had spent the week talking to 100s of people and putting on a pretty good show.  I was the master of all things PSoC, a geek rockstar.  So I programmed the firmware.  The slider worked.  I was able to connect to the PRoC BLE from my app.  But for some stupid reason the the PSoC and PRoC just were not talking and I had no idea why.  And to make matters worse, I didn&#8217;t have anything I could (easily) use to debug the problem.   So much for being the king of PSoC.  I assumed that I had firmware bugs. I tried a bunch of different things, single stepping code, trying different pins, etc.  But nothing worked.  I couldn&#8217;t figure it out.  It was intensely frustrating to be stuck on the airplane with a broken design.</p>
<p>As soon as I landed in Detroit, I logged in to get my email.  I looked for messages from Rajesh (the PSoC Kit Manager) and sure enough, he had emailed me the missing schematic.  After digging through the schematic, I found the error.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/02/schematic-resistors.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-652" src="https://iotexpert.com/wp-content/uploads/2016/02/schematic-resistors.png" alt="schematic-resistors" width="260" height="198" /></a></p>
<p>The connection between the PRoC and PSoC had a 0 Ohm resistor that was &#8220;No Load,&#8221; meaning the footprint was there, but the board manufacturer had not put on the resistor.  This was done so that the pin could be used as a GPIO for something else.</p>
<p>Here is a zoomed-in picture of the PCB:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/02/missing-resistors.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-651" src="https://iotexpert.com/wp-content/uploads/2016/02/missing-resistors.png" alt="missing-resistors" width="145" height="136" /></a></p>
<p>The good news was, I was only one plane ride and an hour drive from my soldering iron.  As soon as I walked in the door, I went straight to my lab.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/02/fixed-resistors.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-653" src="https://iotexpert.com/wp-content/uploads/2016/02/fixed-resistors.png" alt="fixed-resistors" width="225" height="170" /></a></p>
<p>Now everything works.</p>
<p>There are two morals to this story:</p>
<ol>
<li>Don&#8217;t go to immediately to your lab after being gone for a week, as it really irritates your wife.</li>
<li>Look closely at the schematic.</li>
</ol>
<p>You can find the PSoC Creator workspace on <a href="https://github.com/iotexpert/CY8CKIT-145-Examples" target="_blank">github</a> in the directory called &#8220;capsenseble-145.&#8221;</p>
<p><span><p><div class="table-responsive"><table  style="width:95%; "  class="easy-table easy-table-default " border="1">
<thead>
<tr><th >Index</th>
<th >Description</th>
</tr>
</thead>
<tbody>
<tr><td ><a href="https://iotexpert.com/2016/02/29/psoc4000s-and-the-cy8ckit145-stamp-board-part-1/">PSoC4000s and the CY8CKIT145 Stamp Board - Part 1</a></td>
<td > The board and schematics</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/03/01/psoc4000s-and-the-cy8ckit145-stamp-board-part-2/">PSoC4000s and the CY8CKIT145 Stamp Board - Part 2</a></td>
<td > PSoC4000S Firmware</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/03/02/psoc4000s-and-the-cy8ckit145-stamp-board-part-3/">PSoC4000s and the CY8CKIT145 Stamp Board - Part 3</a></td>
<td > PRoC BLE Firmware</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/03/05/psoc4000s-and-the-cy8ckit145-stamp-board-part-4/">PSoC4000s and the CY8CKIT145 Stamp Board - Part 4</a></td>
<td > Debugging the problem</td>
</tr>
</tbody></table></div></p></span></p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/psoc4000s-and-the-cy8ckit145-stamp-board-part-4/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>PSoC4000s and the CY8CKIT145 Stamp Board &#8211; Part 3</title>
		<link>https://iotexpert.com/psoc4000s-and-the-cy8ckit145-stamp-board-part-3/</link>
					<comments>https://iotexpert.com/psoc4000s-and-the-cy8ckit145-stamp-board-part-3/#respond</comments>
		
		<dc:creator><![CDATA[Alan Hawse]]></dc:creator>
		<pubDate>Wed, 02 Mar 2016 13:01:25 +0000</pubDate>
				<category><![CDATA[Bluetooth]]></category>
		<category><![CDATA[Cy8CKIT-145]]></category>
		<category><![CDATA[Devices]]></category>
		<category><![CDATA[Embedded Design]]></category>
		<category><![CDATA[PSoC 4000S]]></category>
		<category><![CDATA[PSoC Creator]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=638</guid>

					<description><![CDATA[In this post, I will take you through the PRoC BLE schematic and firmware.  I describe a very similar version to this in great detail in the video you can find on the Cypress Video Training website. First, I create a new project in my workspace called &#8220;145capsenseled-ble.&#8221;  Then, I add the UART component (the [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post, I will take you through the PRoC BLE schematic and firmware.  I describe a very similar version to this in great detail in the video you can find on the <a href="http://www.cypress.com/products/how-make-ios-app-control-robot-using-bluetooth-low-energy-ble" target="_blank">Cypress Video Training website</a>.</p>
<p>First, I create a new project in my workspace called &#8220;145capsenseled-ble.&#8221;  Then, I add the UART component (the SCB version) and the BLE component.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/02/schematic.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-647" src="https://iotexpert.com/wp-content/uploads/2016/02/schematic.png" alt="schematic" width="358" height="269" srcset="https://iotexpert.com/wp-content/uploads/2016/02/schematic.png 358w, https://iotexpert.com/wp-content/uploads/2016/02/schematic-300x225.png 300w" sizes="auto, (max-width: 358px) 100vw, 358px" /></a></p>
<p>Next, I configure the component to be a GATT server with a custom profile and a GAP client.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/02/overall-profile.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-640" src="https://iotexpert.com/wp-content/uploads/2016/02/overall-profile.png" alt="overall-profile" width="727" height="693" srcset="https://iotexpert.com/wp-content/uploads/2016/02/overall-profile.png 727w, https://iotexpert.com/wp-content/uploads/2016/02/overall-profile-600x572.png 600w, https://iotexpert.com/wp-content/uploads/2016/02/overall-profile-300x286.png 300w" sizes="auto, (max-width: 727px) 100vw, 727px" /></a></p>
<p>Then I create a custom service with two characteristics:</p>
<ul>
<li>The &#8220;led&#8221; characteristic, which is set up as a uint8 that is writeable and readable.</li>
<li>The &#8220;capsense&#8221; characteristic, which is set up as uint16 that is readable and has a &#8220;notify.&#8221;</li>
</ul>
<p>Next, I configure the UUIDs of the service and characteristics to match what is hard-coded in the iOS app.  Then, I add &#8220;Client User Descriptions&#8221; that describe the characteristics in plain text.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/02/gatt-settings.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-641" src="https://iotexpert.com/wp-content/uploads/2016/02/gatt-settings.png" alt="gatt-settings" width="727" height="694" srcset="https://iotexpert.com/wp-content/uploads/2016/02/gatt-settings.png 727w, https://iotexpert.com/wp-content/uploads/2016/02/gatt-settings-600x573.png 600w, https://iotexpert.com/wp-content/uploads/2016/02/gatt-settings-300x286.png 300w" sizes="auto, (max-width: 727px) 100vw, 727px" /></a></p>
<p>Next I configure the GAP settings, specifically the advertising packet.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/02/advertising-packet.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-639" src="https://iotexpert.com/wp-content/uploads/2016/02/advertising-packet.png" alt="advertising-packet" width="726" height="693" srcset="https://iotexpert.com/wp-content/uploads/2016/02/advertising-packet.png 726w, https://iotexpert.com/wp-content/uploads/2016/02/advertising-packet-600x573.png 600w, https://iotexpert.com/wp-content/uploads/2016/02/advertising-packet-300x286.png 300w" sizes="auto, (max-width: 726px) 100vw, 726px" /></a></p>
<p>I make the pin I assignments, which is just the UART Rx and Tx lines.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/02/dwr-pin-assignment.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-646" src="https://iotexpert.com/wp-content/uploads/2016/02/dwr-pin-assignment.png" alt="dwr-pin-assignment" width="980" height="596" srcset="https://iotexpert.com/wp-content/uploads/2016/02/dwr-pin-assignment.png 980w, https://iotexpert.com/wp-content/uploads/2016/02/dwr-pin-assignment-600x365.png 600w, https://iotexpert.com/wp-content/uploads/2016/02/dwr-pin-assignment-300x182.png 300w" sizes="auto, (max-width: 980px) 100vw, 980px" /></a></p>
<p>Finally, I write the firmware.  I started with main.  In the infinite loop (line 116), if I have received a byte from other side, then I assign it to the global variable &#8220;fingerPos&#8221; (line 118). Next, call updateCapsense() (line 119), to update the GATT database with the new value of the slider.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/02/main.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-645" src="https://iotexpert.com/wp-content/uploads/2016/02/main.png" alt="main" width="840" height="502" srcset="https://iotexpert.com/wp-content/uploads/2016/02/main.png 840w, https://iotexpert.com/wp-content/uploads/2016/02/main-600x359.png 600w, https://iotexpert.com/wp-content/uploads/2016/02/main-300x179.png 300w" sizes="auto, (max-width: 840px) 100vw, 840px" /></a></p>
<p>The updateCapsense function:</p>
<p>Lines 31/32 If there is no connection, then don&#8217;t update the GATT database.</p>
<p>Lines 33-39 Update the GATT database with the current fingerPosition.</p>
<p>Lines 42-43 If the iPhone side has asked for notification and the position has changed, then send a notification.</p>
<p>Line 44 Save the last position.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/02/update-capsense.png"><img loading="lazy" decoding="async" class="alignnone size-large wp-image-642" src="https://iotexpert.com/wp-content/uploads/2016/02/update-capsense-1024x382.png" alt="update-capsense" width="1024" height="382" srcset="https://iotexpert.com/wp-content/uploads/2016/02/update-capsense-1024x382.png 1024w, https://iotexpert.com/wp-content/uploads/2016/02/update-capsense-600x224.png 600w, https://iotexpert.com/wp-content/uploads/2016/02/update-capsense-300x112.png 300w, https://iotexpert.com/wp-content/uploads/2016/02/update-capsense.png 1115w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>The BleCallBack is the most complicated section of firmware.  It uses a &#8220;switch&#8221; statement to handle the different event &#8220;cases.&#8221; The cases are:</p>
<ul>
<li>CYBLE_EVT_STACK_ON &amp; CYBLE_EVT_GAP_DEVICE_DISCONNECTED:  In either of these cases you want to start the advertising function.</li>
<li>CYBLE_EVT_GATT_CONNECT_IND: When there is a connection made, update the GATT database with the current state of the CapSense and the LED.  This allows the iOS side to read the correct values.</li>
<li>CYBLE_EVT_WRITE_REQ: There are two kinds of write requests that are valid.
<ul>
<li>CYBLE_LED_CAPSENSE_LED_CHAR_HANDLE:  If the remote side writes into the LED value, then send that data to the PSoC4000S via the UART.</li>
<li>CYBLE_LEDCAPSENSE_CAPSENSE_CAPSENSECCCD: If the remote side has been asked to notify (or un-notify), then save that in the global variable capsenseNotify.</li>
</ul>
</li>
</ul>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/02/ble-callback.png"><img loading="lazy" decoding="async" class="alignnone size-large wp-image-644" src="https://iotexpert.com/wp-content/uploads/2016/02/ble-callback-1024x685.png" alt="ble-callback" width="1024" height="685" srcset="https://iotexpert.com/wp-content/uploads/2016/02/ble-callback-1024x685.png 1024w, https://iotexpert.com/wp-content/uploads/2016/02/ble-callback-600x401.png 600w, https://iotexpert.com/wp-content/uploads/2016/02/ble-callback-300x201.png 300w, https://iotexpert.com/wp-content/uploads/2016/02/ble-callback.png 1639w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>That is all of the firmware.</p>
<p>In the next post, I&#8217;ll take you through the debugging I had to do.</p>
<p>You can find the PSoC Creator workspace on <a href="https://github.com/iotexpert/CY8CKIT-145-Examples" target="_blank">github</a> in the directory called &#8220;capsenseble-145.&#8221;</p>
<p><span><p><div class="table-responsive"><table  style="width:95%; "  class="easy-table easy-table-default " border="1">
<thead>
<tr><th >Index</th>
<th >Description</th>
</tr>
</thead>
<tbody>
<tr><td ><a href="https://iotexpert.com/2016/02/29/psoc4000s-and-the-cy8ckit145-stamp-board-part-1/">PSoC4000s and the CY8CKIT145 Stamp Board - Part 1</a></td>
<td > The board and schematics</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/03/01/psoc4000s-and-the-cy8ckit145-stamp-board-part-2/">PSoC4000s and the CY8CKIT145 Stamp Board - Part 2</a></td>
<td > PSoC4000S Firmware</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/03/02/psoc4000s-and-the-cy8ckit145-stamp-board-part-3/">PSoC4000s and the CY8CKIT145 Stamp Board - Part 3</a></td>
<td > PRoC BLE Firmware</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/03/05/psoc4000s-and-the-cy8ckit145-stamp-board-part-4/">PSoC4000s and the CY8CKIT145 Stamp Board - Part 4</a></td>
<td > Debugging the problem</td>
</tr>
</tbody></table></div></p></span></p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/psoc4000s-and-the-cy8ckit145-stamp-board-part-3/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>PSoC4000s and the CY8CKIT145 Stamp Board &#8211; Part 2</title>
		<link>https://iotexpert.com/psoc4000s-and-the-cy8ckit145-stamp-board-part-2/</link>
					<comments>https://iotexpert.com/psoc4000s-and-the-cy8ckit145-stamp-board-part-2/#comments</comments>
		
		<dc:creator><![CDATA[Alan Hawse]]></dc:creator>
		<pubDate>Tue, 01 Mar 2016 15:47:41 +0000</pubDate>
				<category><![CDATA[Cy8CKIT-145]]></category>
		<category><![CDATA[Devices]]></category>
		<category><![CDATA[Embedded Design]]></category>
		<category><![CDATA[PSoC 4000S]]></category>
		<category><![CDATA[PSoC Creator]]></category>
		<category><![CDATA[Capsense]]></category>
		<category><![CDATA[PSoC]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=617</guid>

					<description><![CDATA[In the previous post, I unboxed the CY8CKIT145 and showed you the schematics.   In this post, I will show you how to build the CapSense firmware that runs on the PSoC4000S.  The first decision I needed to make was how to connect the PSoC and the PRoC chips.  So I looked at the back [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In the <a href="https://iotexpert.com/2016/02/29/psoc4000s-and-the-cy8ckit145-stamp-board-part-1/">previous post</a>, I unboxed the CY8CKIT145 and showed you the schematics.   In this post, I will show you how to build the CapSense firmware that runs on the PSoC4000S.  The first decision I needed to make was how to connect the PSoC and the PRoC chips.  So I looked at the back of the kit and there was a handy-dandy picture of the schematic in the silkscreen.  Here is a zoomed in view:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/02/zoom-145.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-625" src="https://iotexpert.com/wp-content/uploads/2016/02/zoom-145.png" alt="zoom-145" width="233" height="206" /></a></p>
<p>I didn&#8217;t have the schematic on the airplane, but here is a more &#8220;schematic&#8221; view of the chips on the board.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/02/systemschematic-c.png"><img loading="lazy" decoding="async" class="alignnone size-large wp-image-623" src="https://iotexpert.com/wp-content/uploads/2016/02/systemschematic-c-1024x701.png" alt="systemschematic-c" width="1024" height="701" srcset="https://iotexpert.com/wp-content/uploads/2016/02/systemschematic-c-1024x701.png 1024w, https://iotexpert.com/wp-content/uploads/2016/02/systemschematic-c-600x410.png 600w, https://iotexpert.com/wp-content/uploads/2016/02/systemschematic-c-300x205.png 300w, https://iotexpert.com/wp-content/uploads/2016/02/systemschematic-c.png 1067w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>I knew that the UART source code would be slightly easier, so I picked that as the mechanism to connect the chips.  On my computer I had the &#8220;capsenseled&#8221; workspace from the videos.  So, I created a new PSoC4000S project in that workspace called &#8220;145capsenseled.&#8221;  I started with the schematic:</p>
<ol>
<li>Add the new CapSense component.  I am currently running a &#8220;nightly build&#8221; of PSoC Creator 3.3 that supports the new chip.  You can see in the PSoC Creator release I&#8217;m using there is a prototype version of the CapSense component.</li>
<li>Add 5 Digital Output Pins under software control to drive the LEDs that are next to the slider</li>
<li>Add 1 Digital Output pin to drive the blue LED</li>
<li>Add a Serial Communication Block (SCB) configured as a UART</li>
</ol>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/02/capsenseled-schematic.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-627" src="https://iotexpert.com/wp-content/uploads/2016/02/capsenseled-schematic.png" alt="capsenseled-schematic" width="456" height="464" srcset="https://iotexpert.com/wp-content/uploads/2016/02/capsenseled-schematic.png 456w, https://iotexpert.com/wp-content/uploads/2016/02/capsenseled-schematic-295x300.png 295w" sizes="auto, (max-width: 456px) 100vw, 456px" /></a></p>
<p>Here is a screenshot of the new CapSense component configuration wizard.  You can see I added a linear slider and set up the component to use SmartSense full-auto tuning.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/02/capsense-configuration.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-631" src="https://iotexpert.com/wp-content/uploads/2016/02/capsense-configuration.png" alt="capsense-configuration" width="639" height="483" srcset="https://iotexpert.com/wp-content/uploads/2016/02/capsense-configuration.png 639w, https://iotexpert.com/wp-content/uploads/2016/02/capsense-configuration-600x454.png 600w, https://iotexpert.com/wp-content/uploads/2016/02/capsense-configuration-300x227.png 300w" sizes="auto, (max-width: 639px) 100vw, 639px" /></a></p>
<p>After configuring the CapSense, I set up the pin assignments using the DWR:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/02/capsenseled-pinassignment1.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-632" src="https://iotexpert.com/wp-content/uploads/2016/02/capsenseled-pinassignment1.png" alt="capsenseled-pinassignment" width="921" height="365" srcset="https://iotexpert.com/wp-content/uploads/2016/02/capsenseled-pinassignment1.png 921w, https://iotexpert.com/wp-content/uploads/2016/02/capsenseled-pinassignment1-600x238.png 600w, https://iotexpert.com/wp-content/uploads/2016/02/capsenseled-pinassignment1-300x119.png 300w" sizes="auto, (max-width: 921px) 100vw, 921px" /></a></p>
<p>Then I wrote the firmware, which was pretty straight forward.</p>
<ul>
<li>10-11 start the CapSense</li>
<li>12 start the UART</li>
<li>16: If the CapSense block is done scanning and is idle, then read the CapSense and do something with it (lines 17 -&gt; 41).</li>
<li>18: figure out where the person is touching</li>
<li>19: if they have actually touched the block</li>
<li>22-26 light up the LEDs</li>
<li>30-35 If there is no touch, then turn off the LEDs.</li>
<li>36-37 start the next scan</li>
<li>38-39: If the UART is not busy&#8230; then send the position (0-100) or (0xFF if there is no touch).</li>
<li>41-42: If there is a byte in the UART receive buffer, then light up or turn off the Blue LED. (Notice that the LED is active low so I use the &#8220;!&#8221; operation to flip the state of the signal.</li>
</ul>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/02/capsense-firmware.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-633" src="https://iotexpert.com/wp-content/uploads/2016/02/capsense-firmware.png" alt="capsense-firmware" width="952" height="898" srcset="https://iotexpert.com/wp-content/uploads/2016/02/capsense-firmware.png 952w, https://iotexpert.com/wp-content/uploads/2016/02/capsense-firmware-600x566.png 600w, https://iotexpert.com/wp-content/uploads/2016/02/capsense-firmware-300x283.png 300w" sizes="auto, (max-width: 952px) 100vw, 952px" /></a></p>
<p>After that, I programmed the kit and tested it.  It seemed like everything was good.  In the <a href="https://iotexpert.com/2016/03/02/psoc4000s-and-the-cy8ckit145-stamp-board-part-3/" target="_blank">next post</a>, I&#8217;ll show you the schematic and firmware that runs on the PRoC BLE.</p>
<p>You can find the PSoC Creator workspace on <a href="https://github.com/iotexpert/CY8CKIT-145-Examples" target="_blank">github</a> in the directory called &#8220;capsenseble-145.&#8221;</p>
<p><span><p><div class="table-responsive"><table  style="width:95%; "  class="easy-table easy-table-default " border="1">
<thead>
<tr><th >Index</th>
<th >Description</th>
</tr>
</thead>
<tbody>
<tr><td ><a href="https://iotexpert.com/2016/02/29/psoc4000s-and-the-cy8ckit145-stamp-board-part-1/">PSoC4000s and the CY8CKIT145 Stamp Board - Part 1</a></td>
<td > The board and schematics</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/03/01/psoc4000s-and-the-cy8ckit145-stamp-board-part-2/">PSoC4000s and the CY8CKIT145 Stamp Board - Part 2</a></td>
<td > PSoC4000S Firmware</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/03/02/psoc4000s-and-the-cy8ckit145-stamp-board-part-3/">PSoC4000s and the CY8CKIT145 Stamp Board - Part 3</a></td>
<td > PRoC BLE Firmware</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/03/05/psoc4000s-and-the-cy8ckit145-stamp-board-part-4/">PSoC4000s and the CY8CKIT145 Stamp Board - Part 4</a></td>
<td > Debugging the problem</td>
</tr>
</tbody></table></div></p></span></p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/psoc4000s-and-the-cy8ckit145-stamp-board-part-2/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>PSoC4000s and the CY8CKIT145 Stamp Board &#8211; Part 1</title>
		<link>https://iotexpert.com/psoc4000s-and-the-cy8ckit145-stamp-board-part-1/</link>
					<comments>https://iotexpert.com/psoc4000s-and-the-cy8ckit145-stamp-board-part-1/#comments</comments>
		
		<dc:creator><![CDATA[Alan Hawse]]></dc:creator>
		<pubDate>Mon, 29 Feb 2016 10:00:35 +0000</pubDate>
				<category><![CDATA[Bluetooth]]></category>
		<category><![CDATA[Cy8CKIT-145]]></category>
		<category><![CDATA[Devices]]></category>
		<category><![CDATA[Embedded Design]]></category>
		<category><![CDATA[PSoC 4000S]]></category>
		<category><![CDATA[Capsense]]></category>
		<category><![CDATA[PSoC]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=581</guid>

					<description><![CDATA[One of the cool things about my job is I get to try out lots of new development kits before they are released to the general public.  In the previous post I talked about the demonstration I gave at the Embedded World conference using the CY8CKIT-042 BLE.  You can find a complete video tutorial for that [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>One of the cool things about my job is I get to try out lots of new development kits before they are released to the general public.  In the <a href="https://iotexpert.com/2016/02/28/embedded-world-2016/" target="_blank">previous post</a> I talked about the demonstration I gave at the Embedded World conference using the CY8CKIT-042 BLE.  You can find a complete video tutorial for that project on the cypress.com <a href="http://www.cypress.com/products/how-make-ios-app-control-robot-using-bluetooth-low-energy-ble" target="_blank">video tutorial</a> website.  While I was at the conference, I picked up an engineering sample of a new development kit and put it into my backpack because I wanted to try a new feature of PSoC Creator on the way home.  But, when I got on the airplane, I thought I would build the same project I had demonstrated at the conference using this kit.  So, in the next few posts, I am going to show you the new CY8CKIT145 Stamp Board and how to build an IOT solution with it.</p>
<p>It is called a &#8220;stamp board&#8221; because it comes in a flat postage stamp-like postcard mailer.  Here is a picture of the front and the back (you can see that it has already lived a hard life riding around in my backpack).</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/02/IMG_2720.jpg"><img loading="lazy" decoding="async" class="alignnone size-large wp-image-585" src="https://iotexpert.com/wp-content/uploads/2016/02/IMG_2720-1024x768.jpg" alt="IMG_2720" width="1024" height="768" srcset="https://iotexpert.com/wp-content/uploads/2016/02/IMG_2720-1024x768.jpg 1024w, https://iotexpert.com/wp-content/uploads/2016/02/IMG_2720-600x450.jpg 600w, https://iotexpert.com/wp-content/uploads/2016/02/IMG_2720-300x225.jpg 300w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Here is the back of the mailer:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/02/IMG_2722.jpg"><img loading="lazy" decoding="async" class="alignnone size-large wp-image-584" src="https://iotexpert.com/wp-content/uploads/2016/02/IMG_2722-1024x768.jpg" alt="IMG_2722" width="1024" height="768" srcset="https://iotexpert.com/wp-content/uploads/2016/02/IMG_2722-1024x768.jpg 1024w, https://iotexpert.com/wp-content/uploads/2016/02/IMG_2722-600x450.jpg 600w, https://iotexpert.com/wp-content/uploads/2016/02/IMG_2722-300x225.jpg 300w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>In the picture you can see the yellow label proclaiming this to be an engineering sample.  It doesn&#8217;t seem like much, but when you pull back the front of the package you get to see the surprise:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/02/IMG_2721-1.jpg"><img loading="lazy" decoding="async" class="alignnone size-large wp-image-586" src="https://iotexpert.com/wp-content/uploads/2016/02/IMG_2721-1-1024x768.jpg" alt="IMG_2721-1" width="1024" height="768" srcset="https://iotexpert.com/wp-content/uploads/2016/02/IMG_2721-1-1024x768.jpg 1024w, https://iotexpert.com/wp-content/uploads/2016/02/IMG_2721-1-600x450.jpg 600w, https://iotexpert.com/wp-content/uploads/2016/02/IMG_2721-1-300x225.jpg 300w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>The kit can literally be broken into four separate pieces:</p>
<ol>
<li>The main board:
<ul>
<li>The <a href="http://www.cypress.com/products/32-bit-arm-cortex-m0-psoc-4-s-series" target="_blank">PSoC4000S</a></li>
<li>A reset switch</li>
<li>A user LED</li>
<li>A user push button</li>
<li>A programming selector (to pick either the PSoC4000s or the PRoC BLE (that is on the back of the kit)) as the target of the programmer</li>
<li>All of the PSoC4000S pins are available on the 100mil center headers</li>
<li>A PCB footprint for a 10-pin ARM programming header</li>
</ul>
</li>
<li>A programmer board:
<ul>
<li>A PSoC5LP programmed with KitProg2 Firmware</li>
<li>A programmer mode button</li>
<li>100mil center header with some of the PSoC5LP pins</li>
</ul>
</li>
<li>A Capsense slider user interface board with a 5 Segment Slider and 5 LEDs</li>
<li>A Capsense button user interface board with 3 mutual capacitance buttons and 3 LEDs</li>
</ol>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/02/145front-e.png"><img loading="lazy" decoding="async" class="alignnone size-large wp-image-615" src="https://iotexpert.com/wp-content/uploads/2016/02/145front-e-1024x764.png" alt="145front-e" width="1024" height="764" srcset="https://iotexpert.com/wp-content/uploads/2016/02/145front-e-1024x764.png 1024w, https://iotexpert.com/wp-content/uploads/2016/02/145front-e-600x448.png 600w, https://iotexpert.com/wp-content/uploads/2016/02/145front-e-300x224.png 300w, https://iotexpert.com/wp-content/uploads/2016/02/145front-e.png 1508w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>And the back, with the tiny 10mm X 10mm PRoC BLE module:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/02/IMG_2706.jpg"><img loading="lazy" decoding="async" class="alignnone size-large wp-image-588" src="https://iotexpert.com/wp-content/uploads/2016/02/IMG_2706-1024x768.jpg" alt="IMG_2706" width="1024" height="768" srcset="https://iotexpert.com/wp-content/uploads/2016/02/IMG_2706-1024x768.jpg 1024w, https://iotexpert.com/wp-content/uploads/2016/02/IMG_2706-300x225.jpg 300w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Here is the schematic for the board:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/02/CY8CKIT-145_PSOC_4A-S1-page1.png"><img loading="lazy" decoding="async" class="alignnone size-large wp-image-606" src="https://iotexpert.com/wp-content/uploads/2016/02/CY8CKIT-145_PSOC_4A-S1-page1-1024x791.png" alt="CY8CKIT-145_PSOC_4A-S1-page1" width="1024" height="791" srcset="https://iotexpert.com/wp-content/uploads/2016/02/CY8CKIT-145_PSOC_4A-S1-page1-1024x791.png 1024w, https://iotexpert.com/wp-content/uploads/2016/02/CY8CKIT-145_PSOC_4A-S1-page1-600x464.png 600w, https://iotexpert.com/wp-content/uploads/2016/02/CY8CKIT-145_PSOC_4A-S1-page1-300x232.png 300w, https://iotexpert.com/wp-content/uploads/2016/02/CY8CKIT-145_PSOC_4A-S1-page1.png 1650w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/02/CY8CKIT-145_PSOC_4A-S1-page-2.png"><img loading="lazy" decoding="async" class="alignnone size-large wp-image-608" src="https://iotexpert.com/wp-content/uploads/2016/02/CY8CKIT-145_PSOC_4A-S1-page-2-1024x791.png" alt="CY8CKIT-145_PSOC_4A-S1 page 2" width="1024" height="791" srcset="https://iotexpert.com/wp-content/uploads/2016/02/CY8CKIT-145_PSOC_4A-S1-page-2-1024x791.png 1024w, https://iotexpert.com/wp-content/uploads/2016/02/CY8CKIT-145_PSOC_4A-S1-page-2-600x464.png 600w, https://iotexpert.com/wp-content/uploads/2016/02/CY8CKIT-145_PSOC_4A-S1-page-2-300x232.png 300w, https://iotexpert.com/wp-content/uploads/2016/02/CY8CKIT-145_PSOC_4A-S1-page-2.png 1650w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/02/CY8CKIT-145_PSOC_4A-S1-page3.png"><img loading="lazy" decoding="async" class="alignnone size-large wp-image-609" src="https://iotexpert.com/wp-content/uploads/2016/02/CY8CKIT-145_PSOC_4A-S1-page3-1024x791.png" alt="CY8CKIT-145_PSOC_4A-S1-page3" width="1024" height="791" srcset="https://iotexpert.com/wp-content/uploads/2016/02/CY8CKIT-145_PSOC_4A-S1-page3-1024x791.png 1024w, https://iotexpert.com/wp-content/uploads/2016/02/CY8CKIT-145_PSOC_4A-S1-page3-600x464.png 600w, https://iotexpert.com/wp-content/uploads/2016/02/CY8CKIT-145_PSOC_4A-S1-page3-300x232.png 300w, https://iotexpert.com/wp-content/uploads/2016/02/CY8CKIT-145_PSOC_4A-S1-page3.png 1650w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>I wanted to build a project that would have two-way communication between my iPhone and the board, and would be compatible with the Swift App I had written.  The user of the board would have a capsense slider (and LEDs) of which the iPhone App could read the position.  In addition, it would have an LED that the iOS app could turn on and off.  Here is a demonstration that I filmed with my iPhone on the airplane:</p>

<a href='https://iotexpert.com/wp-content/uploads/2016/02/IMG_2708.mov'>145 Demo Video</a>

<p>In the <a href="https://iotexpert.com/2016/03/01/psoc4000s-and-the-cy8ckit145-stamp-board-part-2/">next post</a> I will describe the overall system and show you the firmware.</p>
<p><span><p><div class="table-responsive"><table  style="width:95%; "  class="easy-table easy-table-default " border="1">
<thead>
<tr><th >Index</th>
<th >Description</th>
</tr>
</thead>
<tbody>
<tr><td ><a href="https://iotexpert.com/2016/02/29/psoc4000s-and-the-cy8ckit145-stamp-board-part-1/">PSoC4000s and the CY8CKIT145 Stamp Board - Part 1</a></td>
<td > The board and schematics</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/03/01/psoc4000s-and-the-cy8ckit145-stamp-board-part-2/">PSoC4000s and the CY8CKIT145 Stamp Board - Part 2</a></td>
<td > PSoC4000S Firmware</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/03/02/psoc4000s-and-the-cy8ckit145-stamp-board-part-3/">PSoC4000s and the CY8CKIT145 Stamp Board - Part 3</a></td>
<td > PRoC BLE Firmware</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/03/05/psoc4000s-and-the-cy8ckit145-stamp-board-part-4/">PSoC4000s and the CY8CKIT145 Stamp Board - Part 4</a></td>
<td > Debugging the problem</td>
</tr>
</tbody></table></div></p></span></p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/psoc4000s-and-the-cy8ckit145-stamp-board-part-1/feed/</wfw:commentRss>
			<slash:comments>12</slash:comments>
		
		
			</item>
		<item>
		<title>The Creek: CYPI, a Raspberry Pi to Arduino Bridge</title>
		<link>https://iotexpert.com/cypi/</link>
					<comments>https://iotexpert.com/cypi/#comments</comments>
		
		<dc:creator><![CDATA[Alan Hawse]]></dc:creator>
		<pubDate>Sun, 21 Feb 2016 19:50:24 +0000</pubDate>
				<category><![CDATA[Eagle]]></category>
		<category><![CDATA[Elkhorn Creek]]></category>
		<category><![CDATA[Embedded Design]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=412</guid>

					<description><![CDATA[In the summer of 2013, I decided that I needed to design a printed circuit board.  I had worked on sections of chips but no PCBs.  I didnt really know which tool to use, but after looking around a bit it seemed like Eagle was a good simple choice as it had wide adoption in [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In the summer of 2013, I decided that I needed to design a printed circuit board.  I had worked on sections of chips but no PCBs.  I didnt really know which tool to use, but after looking around a bit it seemed like Eagle was a good simple choice as it had wide adoption in the Maker community.  At that point in time the Elkhorn Creek Measuring System was being run off a Raspberry PI and a <a href="http://www.cypress.com/products/psoc-5lp" target="_blank">PSoC5LP</a> but Cypress had just released a new family of chips called the <a href="http://www.cypress.com/products/psoc-4200" target="_blank">PSoC4200</a>.  I thought that it would be a cool idea to have a PSoC to Raspberry PI bridge board.  So this is what I did.</p>
<p>On the bottom of the board I wanted female pins that matched the Raspberry PI, and on the top I wanted an Arduino pins.  Bottom line, I decided to build a board that was very similar to the <a href="http://www.cypress.com/documentation/development-kitsboards/cy8ckit-042-psoc-4-pioneer-kit" target="_blank">CY8CKIT-042</a> except for having Raspberry PI GPIOs on the bottom of the board.</p>
<p>My board has:</p>
<ul>
<li>Power System: Both 3.3v and 5.0v for the PSoC as well as 5.0v@1.0A for the Raspberry PI.</li>
<li>Reset System: A RPi connection to the PSoC and Arduino XRES.</li>
<li>An I2C connection between the RPi and the PSoC including the pullup resistors</li>
<li>A 3-Color LED</li>
<li>Arduino pins that match the pinout of the <a href="http://www.cypress.com/documentation/development-kitsboards/cy8ckit-042-psoc-4-pioneer-kit" target="_blank">CY8CKIT-042</a></li>
</ul>
<p>The overall schematic</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.18.14-PM.png"><img loading="lazy" decoding="async" class="alignnone size-large wp-image-427" src="https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.18.14-PM-1024x640.png" alt="Overall CYPI Schematic" width="1024" height="640" srcset="https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.18.14-PM-1024x640.png 1024w, https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.18.14-PM-600x375.png 600w, https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.18.14-PM-300x188.png 300w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>I used the same RGB 3 Color LED (<a href="http://www.digikey.com/product-detail/en/CLV1A-FKB-CJ1M1F1BB7R4S3/CLV1A-FKB-CJ1M1F1BB7R4S3CT-ND/1987488" target="_blank">CLV1A-FKB- CJ1M1F1BB7R4S3</a>) as exists on the CY8CKIT-042.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.29.32-PM.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-417" src="https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.29.32-PM.png" alt="Screen Shot 2016-01-30 at 8.29.32 PM" width="864" height="366" srcset="https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.29.32-PM.png 864w, https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.29.32-PM-600x254.png 600w, https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.29.32-PM-300x127.png 300w" sizes="auto, (max-width: 864px) 100vw, 864px" /></a></p>
<p>I wanted to be able to reset PSoC and Arduino from the Raspberry Pi so I attached the RPi GPIO 1_11 to a pulldown transistor that is connected to the XRES of the Arduino and PSoC.  I also attached a small pushbutton to enable a user reset.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.29.19-PM.png"><img loading="lazy" decoding="async" class="alignnone size-large wp-image-418" src="https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.29.19-PM.png" alt="Screen Shot 2016-01-30 at 8.29.19 PM" width="714" height="886" srcset="https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.29.19-PM.png 714w, https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.29.19-PM-600x745.png 600w, https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.29.19-PM-242x300.png 242w" sizes="auto, (max-width: 714px) 100vw, 714px" /></a></p>
<p>I copied the Arduino pin out of the CY8CKIT-042.  This would allow me to easily use all of the projects that I had already developed that that development kit.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.29.03-PM.png"><img loading="lazy" decoding="async" class="alignnone size-large wp-image-419" src="https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.29.03-PM.png" alt="Screen Shot 2016-01-30 at 8.29.03 PM" width="866" height="708" srcset="https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.29.03-PM.png 866w, https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.29.03-PM-600x491.png 600w, https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.29.03-PM-300x245.png 300w" sizes="auto, (max-width: 866px) 100vw, 866px" /></a></p>
<p>This section of the schematic has the required power supply decoupling capacitors.  It also has the ARM standard <a href="http://www.digikey.com/product-detail/en/FTSH-105-01-F-DV-K/SAM8796-ND/2649974" target="_blank">10 Pin</a> programming header which allows me to program the PSoC using a <a href="http://www.cypress.com/documentation/development-kitsboards/cy8ckit-002-psoc-miniprog3-program-and-debug-kit" target="_blank">MiniProg-3</a>.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.28.46-PM.png"><img loading="lazy" decoding="async" class="alignnone size-large wp-image-420" src="https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.28.46-PM-658x1024.png" alt="Screen Shot 2016-01-30 at 8.28.46 PM" width="658" height="1024" srcset="https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.28.46-PM-658x1024.png 658w, https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.28.46-PM-600x934.png 600w, https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.28.46-PM-193x300.png 193w, https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.28.46-PM.png 958w" sizes="auto, (max-width: 658px) 100vw, 658px" /></a></p>
<p>I provided pull up resistors on the PSoC P4[0] and P4[1] to easily enable the PSoC to serve as an I2C Master for the Arduino shield.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.28.18-PM.png"><img loading="lazy" decoding="async" class="alignnone size-large wp-image-421" src="https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.28.18-PM.png" alt="Screen Shot 2016-01-30 at 8.28.18 PM" width="774" height="590" srcset="https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.28.18-PM.png 774w, https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.28.18-PM-600x457.png 600w, https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.28.18-PM-300x229.png 300w" sizes="auto, (max-width: 774px) 100vw, 774px" /></a></p>
<p>The connection to get data between the RPi and the PSoC is I2C.  The PSoC is setup as an I2C slave and the RPi is the master.  The connection on the RPi uses the RPI1_3 and RPI1_4 GPIOs.  On the PSoC it is connected to P3[0] and P3[1].</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.28.01-PM.png"><img loading="lazy" decoding="async" class="alignnone size-large wp-image-423" src="https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.28.01-PM-928x1024.png" alt="Screen Shot 2016-01-30 at 8.28.01 PM" width="928" height="1024" srcset="https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.28.01-PM-928x1024.png 928w, https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.28.01-PM-600x662.png 600w, https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.28.01-PM-272x300.png 272w, https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.28.01-PM.png 1222w" sizes="auto, (max-width: 928px) 100vw, 928px" /></a></p>
<p>The power supply turned out to be by far the most difficult part of the project.  In the first version of the board I chose a regulator that was to small to supply the Raspberry PI.  When the RPi was plugged in, the regulator immediately went into thermal shutdown.  In general this sucked as the PSoC Applications Manager warned me to pick a big enough regulator.  Oh well.  In the final version of the board I used a <a href="http://www.digikey.com/product-detail/en/MC7805BDTRKG/MC7805BDTRKGOSCT-ND/1139742" target="_blank">7805</a> to supply the RPi, this regulator has a giant tab which allows you to sink heat into the ground plane of the board.  On the board I also provide a 5.0V supply and a 3.3V supply for the PSoC using a <a href="http://www.digikey.com/product-detail/en/NCP1117LPST33T3G/NCP1117LPST33T3GOSCT-ND/3462387" target="_blank">1117</a> regulator.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.27.34-PM.png"><img loading="lazy" decoding="async" class="alignnone size-large wp-image-424" src="https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.27.34-PM-1024x272.png" alt="Screen Shot 2016-01-30 at 8.27.34 PM" width="1024" height="272" srcset="https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.27.34-PM-1024x272.png 1024w, https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.27.34-PM-600x159.png 600w, https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.27.34-PM-300x80.png 300w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Here is a picture of the final layout</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.19.12-PM.png"><img loading="lazy" decoding="async" class="alignnone size-large wp-image-426" src="https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.19.12-PM-1024x640.png" alt="Overall Layout" width="1024" height="640" srcset="https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.19.12-PM-1024x640.png 1024w, https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.19.12-PM-600x375.png 600w, https://iotexpert.com/wp-content/uploads/2016/01/Screen-Shot-2016-01-30-at-8.19.12-PM-300x188.png 300w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>And here is a picture of the first version of the board.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/01/IMG_1176-1.jpg"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-439" src="https://iotexpert.com/wp-content/uploads/2016/01/IMG_1176-1.jpg" alt="IMG_1176 (1)" width="520" height="311" srcset="https://iotexpert.com/wp-content/uploads/2016/01/IMG_1176-1.jpg 520w, https://iotexpert.com/wp-content/uploads/2016/01/IMG_1176-1-300x179.jpg 300w" sizes="auto, (max-width: 520px) 100vw, 520px" /></a></p>
<p>On thing that you might notice on this board is that the vias are exposed.  What I didnt know is that you need to tell Eagle to &#8220;tent&#8221; the vias so that they are covered with solder mask.</p>
<p>There is a lot going on in the layout and it is probably easiest to review the layout using eagle.  You can get the design from github at <a href="https://github.com/iotexpert/cypi" target="_blank">https://github.com/iotexpert/cypi</a></p>
<p><span><p><div class="table-responsive"><table  style="width:95%; "  class="easy-table easy-table-default " border="1">
<thead>
<tr><th >Index</th>
<th >Description</th>
</tr>
</thead>
<tbody>
<tr><td ><a class="row-title" href="https://iotexpert.com/2016/01/25/the-elkhorn-creek/" title="Edit “The Creek: IOT for the Elkhorn Creek”">The Creek: IOT for the Elkhorn Creek</a></td>
<td >Introduction</td>
</tr>

<tr><td ><a class="row-title" href="https://iotexpert.com/2016/01/30/creek-architecture-1-0/" title="Edit “The Creek: Solution Architecture 1.0”">The Creek: Solution Architecture 1.0</a></td>
<td >Overall architecture</td>
</tr>

<tr><td ><a class="row-title" href="https://iotexpert.com/2016/02/07/the-creek-board-1-1/" title="Edit “The Creek: Creek Board 1.1”">The Creek: Creek Board 1.1</a></td>
<td >Eagle layout of the board</td>
</tr>

<tr><td ><a class="row-title" href="https://iotexpert.com/2016/02/14/creek-board-1-0-rcca/" title="Edit “The Creek: Creek Board 1.0 – RCCA”">The Creek: Creek Board 1.0 – RCCA</a></td>
<td >A discussion of the errors in the 1.0 board</td>
</tr>

<tr><td ><a class="row-title" href="https://iotexpert.com/2016/02/21/cypi/" title="Edit “The Creek: CYPI</td>
<td > a Raspberry Pi to Arduino Bridge”">The Creek: CYPI, a Raspberry Pi to Arduino Bridge</a></td>
<td > PSoC4 &lt;--&gt; Raspberry Pi Bridge Board</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/03/26/the-creek-psoc-4-creator-schematic-firmware/">The Creek: PSoC4 Creator Schematic and Firmware</a></td>
<td > Firmware to interface with the temperature and pressure sensors</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/04/10/the-creek-testing-the-firmware-2/">The Creek: Testing the Firmware</a></td>
<td > Using tools to verify that the PSoC 4 Firmware is working correctly</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/04/17/the-creek-testing-the-firmware/">The Creek: Testing the Bootloader</a></td>
<td > Make sure that you can load new firmware into the PSoC</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/04/24/the-creek-server-software-architecture/">The Creek: Software Architecture</a></td>
<td >All of the Raspberry Pi software connections</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/06/19/the-creek-install-mysql/">The Creek: Install MySql</a></td>
<td >Instruction to configure MySql</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/07/10/the-creek-install-tomcat/">The Creek: Install Tomcat</a></td>
<td >Instruction to configure Tomcat JSP Server</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/06/26/the-creek-collect-data-part-1/">The Creek: Data Collection Java (Part 1)</a></td>
<td >The Java program that reads the I2C and saves it in the database</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/07/03/the-creek-collect-data-part-2/">The Creek: Data Collection Java (Part 2)</a></td>
<td >The Java program that reads the I2C and saves it in the database</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/07/17/the-creek-create-the-chart-with-jfreechart/">The Creek: Create the Chart with JFreeChart</a></td>
<td >Using open source Java charting software to create plots of the Creek Depth</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/07/31/the-creek-flood-event-data-processor/">The Creek: Flood Event Data Processor</a></td>
<td >A batch program to create analyze the database and create a table of flood events</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/07/31/the-creek-flood-event-web-page/">The Creek: Flood Event Web Page</a></td>
<td > A batch program to create the flood event web page</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/08/07/the-creek-creek-server-1-1/">The Creek: Creek Server 1.1</a></td>
<td >Updates to all of the back off server programs to integrate charts</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/08/14/the-creek-web-pages-with-java-server-pages-jsp/">The Creek: JSP Web Page for www.elkhorn-creek.org</a></td>
<td >The JSP program to make the table and display the website</td>
</tr>

<tr><td >The Creek: Raspberry Pi Clock Stretching</td>
<td >Sorting out a bug in the system having to do with the Broadcomm Raspberry Pi Master not functioning well with clock stretching</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/08/28/the-creek-creek-server-1-2/">The Creek: Creek Server 1.2</a></td>
<td >Caching the web pages to make them faster</td>
</tr>
</tbody></table></div></p></span></p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/cypi/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>The Creek: Creek Board 1.0 &#8211; RCCA</title>
		<link>https://iotexpert.com/creek-board-1-0-rcca/</link>
					<comments>https://iotexpert.com/creek-board-1-0-rcca/#respond</comments>
		
		<dc:creator><![CDATA[Alan Hawse]]></dc:creator>
		<pubDate>Sun, 14 Feb 2016 16:58:05 +0000</pubDate>
				<category><![CDATA[Eagle]]></category>
		<category><![CDATA[Elkhorn Creek]]></category>
		<category><![CDATA[Embedded Design]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=379</guid>

					<description><![CDATA[At my company Cypress, &#8220;RCCA&#8221; is an abbreviation for &#8220;Root Cause Corrective Action&#8221;.  It is a formal process for changing the way that you work to prevent an error from happening again. Unfortunately the title of this post is &#8220;Creek Board 1.0 &#8211; RCCA&#8221;.  What that means is that the first time I sent the Creek [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>At my company Cypress, &#8220;RCCA&#8221; is an abbreviation for &#8220;Root Cause Corrective Action&#8221;.  It is a formal process for changing the way that you work to prevent an error from happening again.</p>
<p>Unfortunately the title of this post is &#8220;Creek Board 1.0 &#8211; RCCA&#8221;.  What that means is that the first time I sent the Creek Board to be manufactured I made an error, in fact a really stupid error.  Specifically,  the error that I made was a fundamental failure of not having an LVS (Layout versus Schematic) clean design.  If you google &#8220;blue wire pcb&#8221; the first search result you will find is <a href="http://www.circuitrework.com/guides/guides.shtml" target="_blank">&#8220;Printed Circuit Board Repair and Rework Guides&#8221;</a>,  I had no idea why blue wires were used to fix printed circuit boards so I called my friend Dave Van Ness.  He is an old grey beard type of guy.  He told me that the blue wire was traditionally an &#8220;official fix&#8221; to a circuit board.  It was used because other colors were already assigned (Red to power, Black to ground) etc.  I guess that I thumbed my nose at tradition by fixing my PCB with a red wire.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/01/IMG_2024.jpg"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-356" src="https://iotexpert.com/wp-content/uploads/2016/01/IMG_2024.jpg" alt="IMG_2024" width="2448" height="3264" /></a></p>
<p>After laying out a printed circuit board, the last step is to surround the board with a ground plane on the top and bottom of the board.  Then you press the &#8220;ratsnest&#8221; button on Eagle.  Then Eagle does a &#8220;pour&#8221; which fills in the empty space of the board with a ground plane.  It then will update the bottom of the screen with the message &#8220;Ratsnet: Nothing to do!&#8221; which means all of the schematic and layout connections are complete.  Or, if there are connections that still need to be made, it will update the layout with yellow &#8220;air wires&#8221; and it will give you a message like &#8220;Ratsnest: 1 airwires.&#8221;  If you send the board to be made with an airwire, that is exactly what you will get.  I will tell you that air doesn&#8217;t conduct electricity very well and you will end up needing your soldering iron.</p>
<p>In this case I missed seeing the tiny little airwire.  See if you can see it:<a href="https://iotexpert.com/wp-content/uploads/2016/01/creek1.0board1.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-382" src="https://iotexpert.com/wp-content/uploads/2016/01/creek1.0board1.png" alt="creek1.0board" width="2136" height="1682" srcset="https://iotexpert.com/wp-content/uploads/2016/01/creek1.0board1.png 2136w, https://iotexpert.com/wp-content/uploads/2016/01/creek1.0board1-600x472.png 600w, https://iotexpert.com/wp-content/uploads/2016/01/creek1.0board1-300x236.png 300w, https://iotexpert.com/wp-content/uploads/2016/01/creek1.0board1-1024x806.png 1024w" sizes="auto, (max-width: 2136px) 100vw, 2136px" /></a></p>
<p>It is hard to see, eh?  In the next picture I turned off the ground layer and zoomed in so you can see that I am missing a power connection between the top and the bottom of the board.  I highlighted this issue by clicking on the &#8220;Show Objects&#8221; at the top of the toolbar, then clicking on yellow wire.  When I do that, Eagle tells me what the net is that is unconnected and it highlights every object that is attached to that net.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/01/zoom-of-error.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-380" src="https://iotexpert.com/wp-content/uploads/2016/01/zoom-of-error.png" alt="zoom-of-error" width="1572" height="1282" srcset="https://iotexpert.com/wp-content/uploads/2016/01/zoom-of-error.png 1572w, https://iotexpert.com/wp-content/uploads/2016/01/zoom-of-error-600x489.png 600w, https://iotexpert.com/wp-content/uploads/2016/01/zoom-of-error-300x245.png 300w, https://iotexpert.com/wp-content/uploads/2016/01/zoom-of-error-1024x835.png 1024w" sizes="auto, (max-width: 1572px) 100vw, 1572px" /></a></p>
<p>So now what?</p>
<p>What I ended up doing is the normal Cypress thing.  I created a &#8220;tapeout checklist&#8221;.  The checklist contains a list of all of the things that I double check before I send a PCB to be manufactured.  Here is my current (and short) checklist:</p>
<ul>
<li>No remaining airwires</li>
<li>Vias tented (or not)</li>
<li>Silkscreen on all connections</li>
<li>Test points on key nets</li>
<li>No DRC errors</li>
</ul>
<p><span><p><div class="table-responsive"><table  style="width:95%; "  class="easy-table easy-table-default " border="1">
<thead>
<tr><th >Index</th>
<th >Description</th>
</tr>
</thead>
<tbody>
<tr><td ><a class="row-title" href="https://iotexpert.com/2016/01/25/the-elkhorn-creek/" title="Edit “The Creek: IOT for the Elkhorn Creek”">The Creek: IOT for the Elkhorn Creek</a></td>
<td >Introduction</td>
</tr>

<tr><td ><a class="row-title" href="https://iotexpert.com/2016/01/30/creek-architecture-1-0/" title="Edit “The Creek: Solution Architecture 1.0”">The Creek: Solution Architecture 1.0</a></td>
<td >Overall architecture</td>
</tr>

<tr><td ><a class="row-title" href="https://iotexpert.com/2016/02/07/the-creek-board-1-1/" title="Edit “The Creek: Creek Board 1.1”">The Creek: Creek Board 1.1</a></td>
<td >Eagle layout of the board</td>
</tr>

<tr><td ><a class="row-title" href="https://iotexpert.com/2016/02/14/creek-board-1-0-rcca/" title="Edit “The Creek: Creek Board 1.0 – RCCA”">The Creek: Creek Board 1.0 – RCCA</a></td>
<td >A discussion of the errors in the 1.0 board</td>
</tr>

<tr><td ><a class="row-title" href="https://iotexpert.com/2016/02/21/cypi/" title="Edit “The Creek: CYPI</td>
<td > a Raspberry Pi to Arduino Bridge”">The Creek: CYPI, a Raspberry Pi to Arduino Bridge</a></td>
<td > PSoC4 &lt;--&gt; Raspberry Pi Bridge Board</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/03/26/the-creek-psoc-4-creator-schematic-firmware/">The Creek: PSoC4 Creator Schematic and Firmware</a></td>
<td > Firmware to interface with the temperature and pressure sensors</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/04/10/the-creek-testing-the-firmware-2/">The Creek: Testing the Firmware</a></td>
<td > Using tools to verify that the PSoC 4 Firmware is working correctly</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/04/17/the-creek-testing-the-firmware/">The Creek: Testing the Bootloader</a></td>
<td > Make sure that you can load new firmware into the PSoC</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/04/24/the-creek-server-software-architecture/">The Creek: Software Architecture</a></td>
<td >All of the Raspberry Pi software connections</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/06/19/the-creek-install-mysql/">The Creek: Install MySql</a></td>
<td >Instruction to configure MySql</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/07/10/the-creek-install-tomcat/">The Creek: Install Tomcat</a></td>
<td >Instruction to configure Tomcat JSP Server</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/06/26/the-creek-collect-data-part-1/">The Creek: Data Collection Java (Part 1)</a></td>
<td >The Java program that reads the I2C and saves it in the database</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/07/03/the-creek-collect-data-part-2/">The Creek: Data Collection Java (Part 2)</a></td>
<td >The Java program that reads the I2C and saves it in the database</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/07/17/the-creek-create-the-chart-with-jfreechart/">The Creek: Create the Chart with JFreeChart</a></td>
<td >Using open source Java charting software to create plots of the Creek Depth</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/07/31/the-creek-flood-event-data-processor/">The Creek: Flood Event Data Processor</a></td>
<td >A batch program to create analyze the database and create a table of flood events</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/07/31/the-creek-flood-event-web-page/">The Creek: Flood Event Web Page</a></td>
<td > A batch program to create the flood event web page</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/08/07/the-creek-creek-server-1-1/">The Creek: Creek Server 1.1</a></td>
<td >Updates to all of the back off server programs to integrate charts</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/08/14/the-creek-web-pages-with-java-server-pages-jsp/">The Creek: JSP Web Page for www.elkhorn-creek.org</a></td>
<td >The JSP program to make the table and display the website</td>
</tr>

<tr><td >The Creek: Raspberry Pi Clock Stretching</td>
<td >Sorting out a bug in the system having to do with the Broadcomm Raspberry Pi Master not functioning well with clock stretching</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/08/28/the-creek-creek-server-1-2/">The Creek: Creek Server 1.2</a></td>
<td >Caching the web pages to make them faster</td>
</tr>
</tbody></table></div></p></span></p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/creek-board-1-0-rcca/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>The Creek: Creek Board 1.1</title>
		<link>https://iotexpert.com/the-creek-board-1-1/</link>
					<comments>https://iotexpert.com/the-creek-board-1-1/#respond</comments>
		
		<dc:creator><![CDATA[Alan Hawse]]></dc:creator>
		<pubDate>Sun, 07 Feb 2016 17:00:18 +0000</pubDate>
				<category><![CDATA[Eagle]]></category>
		<category><![CDATA[Elkhorn Creek]]></category>
		<category><![CDATA[Embedded Design]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=340</guid>

					<description><![CDATA[In the previous post I described the entire system architecture.  In this post, I am going to describe the Arduino shield that I unfortunately call &#8220;Elkhorn Creek Water Level 1.1&#8221;.  It is unfortunate because in version 1.0 I made a really stupid error which ruined the first run of printed circuit boards.  You can read [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In the <a href="https://iotexpert.com/2016/01/30/creek-architecture-1-0/" target="_blank">previous post</a> I described the entire system architecture.  In this post, I am going to describe the Arduino shield that I unfortunately call &#8220;Elkhorn Creek Water Level 1.1&#8221;.  It is unfortunate because in version 1.0 I made a really stupid error which ruined the first run of printed circuit boards.  You can read more about how I made the error and what I am doing in the future in the post <a href="https://iotexpert.com/2016/02/14/creek-board-1-0-rcca/">Creek Board 1.0 RCCA</a>.</p>
<p>To make this system work I need to be able to interface the PSoC4200 with two sensors:</p>
<ul>
<li>The <a href="http://www.meas-spec.com/product/t_product.aspx?id=2894&amp;LangType=1033&amp;LangInit=y" target="_blank">US381-000005-015PG</a> pressure sensor</li>
<li>A <a href="https://www.digikey.com/product-detail/en/TMP36GT9Z/TMP36GT9Z-ND/820404" target="_blank">TMP036</a> temperature sensor</li>
</ul>
<p>Both of these sensors are subject to environmental noise so they both have capacitive or RC filters connected to them.  I originally built a prototype of this board using a proto board.  However, it was a PITA because the wires would come loose and the system would stop working.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/01/IMG_2655.jpg"><img loading="lazy" decoding="async" class="alignnone size-large wp-image-403" src="https://iotexpert.com/wp-content/uploads/2016/01/IMG_2655-768x1024.jpg" alt="IMG_2655" width="768" height="1024" srcset="https://iotexpert.com/wp-content/uploads/2016/01/IMG_2655-768x1024.jpg 768w, https://iotexpert.com/wp-content/uploads/2016/01/IMG_2655-600x800.jpg 600w, https://iotexpert.com/wp-content/uploads/2016/01/IMG_2655-225x300.jpg 225w, https://iotexpert.com/wp-content/uploads/2016/01/IMG_2655-scaled.jpg 1920w" sizes="auto, (max-width: 768px) 100vw, 768px" /></a></p>
<p>So I decided to make a real PCB.  To do the design, I used the <a href="http://www.cadsoftusa.com" target="_blank">Eagle</a> 7.2 PCB editor as it seemed like it had the most support from the maker community.  The schematic for the system is fairly simple.  It has</p>
<ul>
<li><strong>Pressure Sensor</strong>
<ul>
<li>X1: A <a href="http://www.molex.com/molex/products/family?key=microfit_30&amp;channel=products&amp;chanName=family&amp;pageTitle=Introduction" target="_blank">Molex Microfit 3.0 </a>Connector to attach the two wires from the pressure sensor</li>
<li>R1: A 51.1 Ohm resistor to group to convert the 4-20mA &#8211;&gt;  0.204mV to 1.022V</li>
<li>C1/R2: A low pass filter</li>
<li>TVS1: A ESD diode to clamp any ESD event to ground to prevent it from blowing up the PSoC4A or the Sensor</li>
</ul>
</li>
<li><b>Temperature Sensor</b>
<ul>
<li><a href="http://www.analog.com/media/en/technical-documentation/data-sheets/TMP35_36_37.pdf" target="_blank">TMP36</a>: A sensor that turns temperature into a voltage.  The equation for temperature is T=0.5V+10mV/degreeC.  For 25 degrees C the Voltage = 750mV</li>
<li>C2 + C3: Two decoupling capacitors to filter power supply noise</li>
</ul>
</li>
<li><strong>Arduino Interface</strong>
<ul>
<li>A standard Arduino interface set of pins + the additional Cypress CY8CKIT-042 pins.  I only used the A0 and A1 pins for signals and the Vin pin (which is 12v) to drive the current loop</li>
</ul>
</li>
<li><strong>Measurement Test Points</strong>
<ul>
<li><a href="https://www.digikey.com/product-detail/en/5000/36-5000-ND/255326" target="_blank">Keystone 5000</a> test points.  These test points are a little loop of wire that sticks up from the surface of the PCB to make  it easy to probe a voltage with your DMM.  <a href="https://iotexpert.com/wp-content/uploads/2016/01/5000_sml.jpg"><img loading="lazy" decoding="async" class="alignnone size-thumbnail wp-image-398" src="https://iotexpert.com/wp-content/uploads/2016/01/5000_sml-150x150.jpg" alt="5000_sml" width="150" height="150" srcset="https://iotexpert.com/wp-content/uploads/2016/01/5000_sml-150x150.jpg 150w, https://iotexpert.com/wp-content/uploads/2016/01/5000_sml-100x100.jpg 100w, https://iotexpert.com/wp-content/uploads/2016/01/5000_sml.jpg 200w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a></li>
</ul>
</li>
</ul>
<p>Here is the final Eagle Schematic for the board.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/01/CreekBoardSchematic.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-370" src="https://iotexpert.com/wp-content/uploads/2016/01/CreekBoardSchematic.png" alt="CreekBoardSchematic" width="2288" height="1598" srcset="https://iotexpert.com/wp-content/uploads/2016/01/CreekBoardSchematic.png 2288w, https://iotexpert.com/wp-content/uploads/2016/01/CreekBoardSchematic-600x419.png 600w, https://iotexpert.com/wp-content/uploads/2016/01/CreekBoardSchematic-300x210.png 300w, https://iotexpert.com/wp-content/uploads/2016/01/CreekBoardSchematic-1024x715.png 1024w" sizes="auto, (max-width: 2288px) 100vw, 2288px" /></a></p>
<p>And the layout:<a href="https://iotexpert.com/wp-content/uploads/2016/01/CreekBoard2.0Layout.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-371" src="https://iotexpert.com/wp-content/uploads/2016/01/CreekBoard2.0Layout.png" alt="CreekBoard2.0Layout" width="1962" height="1662" srcset="https://iotexpert.com/wp-content/uploads/2016/01/CreekBoard2.0Layout.png 1962w, https://iotexpert.com/wp-content/uploads/2016/01/CreekBoard2.0Layout-600x508.png 600w, https://iotexpert.com/wp-content/uploads/2016/01/CreekBoard2.0Layout-300x254.png 300w, https://iotexpert.com/wp-content/uploads/2016/01/CreekBoard2.0Layout-1024x867.png 1024w" sizes="auto, (max-width: 1962px) 100vw, 1962px" /></a></p>
<p>Once I completed the layout I sent the board to <a href="http://www.oshpark.com" target="_blank">OSH Park</a> to be manufactured.  I have <a href="https://oshpark.com/shared_projects/1F5aGZ5X" target="_blank">shared</a> the project on their website.  OSH Park is an excellent company that is easy to do business with.  They charged me $22.55 for three of the boards.  The fit and finish of the boards is very nice.  Here is the board:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/01/creekboard1.1.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-338" src="https://iotexpert.com/wp-content/uploads/2016/01/creekboard1.1.png" alt="creekboard1.1" width="1125" height="1002" srcset="https://iotexpert.com/wp-content/uploads/2016/01/creekboard1.1.png 1125w, https://iotexpert.com/wp-content/uploads/2016/01/creekboard1.1-600x534.png 600w, https://iotexpert.com/wp-content/uploads/2016/01/creekboard1.1-300x267.png 300w, https://iotexpert.com/wp-content/uploads/2016/01/creekboard1.1-1024x912.png 1024w" sizes="auto, (max-width: 1125px) 100vw, 1125px" /></a></p>
<p>Here is the assembled board:</p>
<p>&nbsp;</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/01/IMG_2652.jpg"><img loading="lazy" decoding="async" class="alignnone size-large wp-image-401" src="https://iotexpert.com/wp-content/uploads/2016/01/IMG_2652-1024x768.jpg" alt="IMG_2652" width="1024" height="768" srcset="https://iotexpert.com/wp-content/uploads/2016/01/IMG_2652-1024x768.jpg 1024w, https://iotexpert.com/wp-content/uploads/2016/01/IMG_2652-600x450.jpg 600w, https://iotexpert.com/wp-content/uploads/2016/01/IMG_2652-300x225.jpg 300w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>I have posted all of the project files at github.  You can &#8220;git&#8221; them from <a href="https://github.com/iotexpert/TheCreek">https://github.com/iotexpert/TheCreek</a>  The Eagle project is in the CreekBoard directory.</p>
<p><span><p><div class="table-responsive"><table  style="width:95%; "  class="easy-table easy-table-default " border="1">
<thead>
<tr><th >Index</th>
<th >Description</th>
</tr>
</thead>
<tbody>
<tr><td ><a class="row-title" href="https://iotexpert.com/2016/01/25/the-elkhorn-creek/" title="Edit “The Creek: IOT for the Elkhorn Creek”">The Creek: IOT for the Elkhorn Creek</a></td>
<td >Introduction</td>
</tr>

<tr><td ><a class="row-title" href="https://iotexpert.com/2016/01/30/creek-architecture-1-0/" title="Edit “The Creek: Solution Architecture 1.0”">The Creek: Solution Architecture 1.0</a></td>
<td >Overall architecture</td>
</tr>

<tr><td ><a class="row-title" href="https://iotexpert.com/2016/02/07/the-creek-board-1-1/" title="Edit “The Creek: Creek Board 1.1”">The Creek: Creek Board 1.1</a></td>
<td >Eagle layout of the board</td>
</tr>

<tr><td ><a class="row-title" href="https://iotexpert.com/2016/02/14/creek-board-1-0-rcca/" title="Edit “The Creek: Creek Board 1.0 – RCCA”">The Creek: Creek Board 1.0 – RCCA</a></td>
<td >A discussion of the errors in the 1.0 board</td>
</tr>

<tr><td ><a class="row-title" href="https://iotexpert.com/2016/02/21/cypi/" title="Edit “The Creek: CYPI</td>
<td > a Raspberry Pi to Arduino Bridge”">The Creek: CYPI, a Raspberry Pi to Arduino Bridge</a></td>
<td > PSoC4 &lt;--&gt; Raspberry Pi Bridge Board</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/03/26/the-creek-psoc-4-creator-schematic-firmware/">The Creek: PSoC4 Creator Schematic and Firmware</a></td>
<td > Firmware to interface with the temperature and pressure sensors</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/04/10/the-creek-testing-the-firmware-2/">The Creek: Testing the Firmware</a></td>
<td > Using tools to verify that the PSoC 4 Firmware is working correctly</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/04/17/the-creek-testing-the-firmware/">The Creek: Testing the Bootloader</a></td>
<td > Make sure that you can load new firmware into the PSoC</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/04/24/the-creek-server-software-architecture/">The Creek: Software Architecture</a></td>
<td >All of the Raspberry Pi software connections</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/06/19/the-creek-install-mysql/">The Creek: Install MySql</a></td>
<td >Instruction to configure MySql</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/07/10/the-creek-install-tomcat/">The Creek: Install Tomcat</a></td>
<td >Instruction to configure Tomcat JSP Server</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/06/26/the-creek-collect-data-part-1/">The Creek: Data Collection Java (Part 1)</a></td>
<td >The Java program that reads the I2C and saves it in the database</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/07/03/the-creek-collect-data-part-2/">The Creek: Data Collection Java (Part 2)</a></td>
<td >The Java program that reads the I2C and saves it in the database</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/07/17/the-creek-create-the-chart-with-jfreechart/">The Creek: Create the Chart with JFreeChart</a></td>
<td >Using open source Java charting software to create plots of the Creek Depth</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/07/31/the-creek-flood-event-data-processor/">The Creek: Flood Event Data Processor</a></td>
<td >A batch program to create analyze the database and create a table of flood events</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/07/31/the-creek-flood-event-web-page/">The Creek: Flood Event Web Page</a></td>
<td > A batch program to create the flood event web page</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/08/07/the-creek-creek-server-1-1/">The Creek: Creek Server 1.1</a></td>
<td >Updates to all of the back off server programs to integrate charts</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/08/14/the-creek-web-pages-with-java-server-pages-jsp/">The Creek: JSP Web Page for www.elkhorn-creek.org</a></td>
<td >The JSP program to make the table and display the website</td>
</tr>

<tr><td >The Creek: Raspberry Pi Clock Stretching</td>
<td >Sorting out a bug in the system having to do with the Broadcomm Raspberry Pi Master not functioning well with clock stretching</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/08/28/the-creek-creek-server-1-2/">The Creek: Creek Server 1.2</a></td>
<td >Caching the web pages to make them faster</td>
</tr>
</tbody></table></div></p></span></p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/the-creek-board-1-1/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
