<?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>Pinball &#8211; IoT Expert</title>
	<atom:link href="https://iotexpert.com/category/solutions/pinball/feed/" rel="self" type="application/rss+xml" />
	<link>https://iotexpert.com</link>
	<description>Engineering for the Internet of Things</description>
	<lastBuildDate>Mon, 13 Feb 2017 12:55:16 +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>Pinball &#8211; IoT Expert</title>
	<link>https://iotexpert.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Pinball: Debugging the LM317 Power Supply- A Tale of Getting Lucky</title>
		<link>https://iotexpert.com/pinball-debugging-lm317-power-supply-tale-getting-lucky/</link>
					<comments>https://iotexpert.com/pinball-debugging-lm317-power-supply-tale-getting-lucky/#respond</comments>
		
		<dc:creator><![CDATA[Alan Hawse]]></dc:creator>
		<pubDate>Thu, 16 Feb 2017 11:00:49 +0000</pubDate>
				<category><![CDATA[Pinball]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=2562</guid>

					<description><![CDATA[Summary My father always says he would rather be lucky than good.  I always assume that had something to do with his age.  I never liked that sentiment.  Actually &#8220;not like&#8221; doesn&#8217;t even begin to cover my dislike of that idea.  I guess that I am always distrustful of luck.  But todays post is a [&#8230;]]]></description>
										<content:encoded><![CDATA[<h2>Summary</h2>
<p>My father always says he would rather be lucky than good.  I always assume that had something to do with his age.  I never liked that sentiment.  Actually &#8220;not like&#8221; doesn&#8217;t even begin to cover my dislike of that idea.  I guess that I am always distrustful of luck.  But todays post is a story of good luck.  In my post about testing the PCB I showed a picture of my Fluke Meter showing 4.153V DC.  That is cool, expect the power supply in my system is supposed to be regulating the power to 3.3v.  I didn&#8217;t sweat the number at the time, but that is a long way from 3.3v.  In fact it is enough to put 3.3V chips-like my accelertomer-at risk of blowing up.  So now what?</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3590-e1483803789766.jpg"><img fetchpriority="high" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3590-e1483803789766.jpg" alt="" width="3024" height="4032" class="alignnone size-full wp-image-2606" /></a></p>
<h2>LM317 Power LDO Power Supply</h2>
<p>Well, on my board I used an LM317 Low Drop Out adjustable regulator.    When I went to setup things up I googled and found this <a href="https://roboticsclub.org/redmine/projects/infotron/wiki/LM317" target="_blank">schematic</a> and table of values.  So that is what I put in my design.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-05-at-9.45.35-AM.png"><img decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-05-at-9.45.35-AM.png" alt="LM317 Circuit" width="646" height="569" class="alignnone wp-image-2564 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-05-at-9.45.35-AM.png 646w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-05-at-9.45.35-AM-600x528.png 600w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-05-at-9.45.35-AM-300x264.png 300w" sizes="(max-width: 646px) 100vw, 646px" /></a></p>
<p>I knew that the regulator is adjustable and the feedback resistor network sets the voltage of the output.  When I had the wrong voltage I assumed that I had the wrong size resistors.  So I unsoldered the damn resistors and measured them.  They were dead on, so I put them back on the board.  This left me really wondering, so I went and looked at the datasheet for the <a href="http://www.onsemi.com/pub_link/Collateral/LM317-D.PDF" target="_blank">LM317</a>.  This is what it says:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-05-at-9.43.53-AM.png"><img decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-05-at-9.43.53-AM.png" alt="" width="1196" height="411" class="alignnone size-full wp-image-2565" srcset="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-05-at-9.43.53-AM.png 1196w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-05-at-9.43.53-AM-600x206.png 600w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-05-at-9.43.53-AM-300x103.png 300w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-05-at-9.43.53-AM-768x264.png 768w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-05-at-9.43.53-AM-1024x352.png 1024w" sizes="(max-width: 1196px) 100vw, 1196px" /></a></p>
<p>There are a bunch of LM317 calculators on the web.  When I looked at them I realized that something might be really bad.  Specifically the resistors from the table (R1=1.2k, R2=1.8k) were probably too large.  That means that there was probably no enough current going back into regulator.  So, this could be the source of my problem.  As I was soldering and unsoldering I realized something really BAD.  I did not put a LM317 on the board.  I put a LM117 on the board.  Holy shit batman!  Why does that work at ALL?</p>
<p>The basic answer is that the LM117 that I used was a 3.3V regulator and had the feedback resistors built in.  Meaning, it wasn&#8217;t adjustable at all.  I got totally totally luck as the pinout was exactly the same as the LM317 and ALL I had to do was connect the ADJ resistor to ground instead of the stack.  Moreover, the &#8220;tab&#8221; was not connected to anything so the output voltage wasn&#8217;t shorted to ground either.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-05-at-10.04.45-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-05-at-10.04.45-AM.png" alt="" width="258" height="216" class="alignnone size-full wp-image-2567" /></a></p>
<p>As I read the datasheet I learned something else.  My layout is a long long way from optimal.  Here is a picture from the datasheet.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/lm1117-n-layout-example.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/lm1117-n-layout-example.png" alt="LM117 Datasheet Layout" width="781" height="445" class="alignnone wp-image-2571 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/01/lm1117-n-layout-example.png 781w, https://iotexpert.com/wp-content/uploads/2017/01/lm1117-n-layout-example-600x342.png 600w, https://iotexpert.com/wp-content/uploads/2017/01/lm1117-n-layout-example-300x171.png 300w, https://iotexpert.com/wp-content/uploads/2017/01/lm1117-n-layout-example-768x438.png 768w" sizes="auto, (max-width: 781px) 100vw, 781px" /></a></p>
<p>And here is my layout.</p>
<p><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-05-at-10.51.42-AM.png" alt="LM317 Layout" width="598" height="809" class="alignnone wp-image-2569 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-05-at-10.51.42-AM.png 598w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-05-at-10.51.42-AM-222x300.png 222w" sizes="auto, (max-width: 598px) 100vw, 598px" /></p>
<p>Oh well.  I got lucky.  Totally.  I don&#8217;t like it.  But there it is.  When I tapeout the board again Ill fix the regulator layout.</p>
<p><span><p>You can find all of the source code and files at the <a href="https://github.com/iotexpert/Pinball" target="_blank">IOTEXPERT</a> site on github.</p>
<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/09/05/pinball-newtons-attic-pinball/">Pinball: Newton's Attic Pinball</a></td>
<td >An introduction to the project and the goals</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/06/pinball-lotsa-blinking-leds/">Pinball: Lotsa Blinking LEDs</a></td>
<td >Everyone needs a bunch of LEDs on their Pinball Machine</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/07/pinball-matrix-leds-part-1/">Pinball: Matrix LEDs (Part 1)</a></td>
<td >Saving PSoC pins by using a matrix scheme</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/08/pinball-matrix-leds-part-2/" target="_blank">Pinball: Matrix LEDs (Part 2)</a></td>
<td >Solving some problems with the matrix</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/09/pinball-matrix-leds-component/" target="_blank">Pinball: Matrix LEDs Component</a></td>
<td >How to turn the Matrix LED into a component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/10/pinball-a-switch-matrix/">Pinball: A Switch Matrix</a></td>
<td >Implementing a bunch of switches</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/12/pinball-switch-matrix-component-part-1/" target="_blank">Pinball: Switch Matrix Component (Part 1)</a></td>
<td >The switch matrix component implementation</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/13/pinball-switch-matrix-component-part-2/" target="_blank">Pinball: Switch Matrix Component (Part 2)</a></td>
<td >The firmware for matrix component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/14/pinball-switch-matrix-component-part-3/" target="_blank">Pinball: Switch Matrix Component (Part 3)</a></td>
<td >Test firmware for the matrix component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/20/pinball-the-music-player-part-1/" target="_blank">Pinball: The Music Player (Part 1)</a></td>
<td >The schematic and symbol for a Music Player component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/21/pinball-the-music-player-part-2/" target="_blank">Pinball: The Music Player (Part 2)</a></td>
<td >The Public API for the Music Player component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/22/pinball-the-music-player-part-3/" target="_blank">Pinball: The Music Player (Part 3)</a></td>
<td >The firmware to make the sweet sweet music</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/23/pinball-the-music-player-part-4/">Pinball: The Music Player (Part 4)</a></td>
<td >The test program for the music player</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/26/pinball-the-motors-hbridge/" target="_blank">Pinball: The Motors + HBridge</a></td>
<td >Using an Bridge to control DC Motors</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/27/pinball-the-eagle-schematic/" target="_blank">Pinball: The Eagle Schematic</a></td>
<td >All of the circuits into an Eagle schematic</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/29/pinball-the-printed-circuit-board-version-1-0/" target="_blank">Pinball: The Printed Circuit Board 1.0</a></td>
<td >The first Eagle PCB layout of the printed circuit board</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/30/pinball-the-pcb-version-1-0-fail/" target="_blank">Pinball: The PCB Version 1.0 Fail</a></td>
<td >Problems with the first version of the Eagle PCB layout</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/05/pinball-pcb-1-2-updates-using-eagle/" target="_blank">Pinball: PCB Layout 1.2 Updates using Eagle</a></td>
<td >Fixing the errors on the first two versions of the Eagle PCB</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/12/pinball-pcb-solder-reflow-osh-park-eagle/">Pinball: Assemble and Reflow the 1.2 PCB</a></td>
<td >Assembling the Eagle PCB</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/23/pinball-testing-the-eagle-pcb/" target="_blank">Pinball: Testing the Eagle PCB</a></td>
<td > Firmware to test the newly built Pinball printed circuit board</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/09/pinball-debugging-psoc-motor-driver/" target="_blank">Pinball: Debugging the Motor Driver</a></td>
<td > Fixing the motor driver PSoC project</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/13/hot-air-solder-reworking-the-accelerometer/" target="_blank">Pinball: Hot-Air Reworking the Accelerometer Solder</a></td>
<td >Using a Hot-Air Rework tool to reflow a QFN</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/16/pinball-debugging-lm317-power-supply-tale-getting-lucky/" target="_blank">Pinball: Debugging the LM317 Power Supply- A Tale of Getting Lucky</a></td>
<td >Debugging the LM317/LM117 power supply</td>
</tr>
</tbody></table></div></p></span></p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/pinball-debugging-lm317-power-supply-tale-getting-lucky/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Pinball: Hot Air Solder Reworking the Accelerometer</title>
		<link>https://iotexpert.com/hot-air-solder-reworking-the-accelerometer/</link>
					<comments>https://iotexpert.com/hot-air-solder-reworking-the-accelerometer/#respond</comments>
		
		<dc:creator><![CDATA[Alan Hawse]]></dc:creator>
		<pubDate>Mon, 13 Feb 2017 11:00:25 +0000</pubDate>
				<category><![CDATA[Pinball]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=2454</guid>

					<description><![CDATA[Summary If you have to use a hot air solder tool, you are probably having a bad day.  But when you need a hot air solder rework tool, you are very, very glad to have one.  I am sure that there are people who can get a QFN off a printed circuit board without one, [&#8230;]]]></description>
										<content:encoded><![CDATA[<h2>Summary</h2>
<p>If you have to use a hot air solder tool, you are probably having a bad day.  But when you need a hot air solder rework tool, you are very, very glad to have one.  I am sure that there are people who can get a QFN off a printed circuit board without one, but I am not one of them.  It is even more fun to put a QFN back on a board without one.  But, once again, I am not one of those people.</p>
<h2>Hot Air Solder</h2>
<p>I have a <a href="http://www.okinternational.com/Convection_Rework_System/id-HCT-900-11/HCT-900-11_Hand_Held_Convection_Tool_115V" target="_blank">Metcal HCT-900-11</a> Hand Held Convection Rework tool aka Hot Air Solder tool.  This machine can blow out hot air &#8230; really, really hot air, up to about 950 degrees Fahrenheit.  I&#8217;m pretty sure you could cut your arm off with it.  The tool has a bunch of nozzles of different shapes and sizes.  Using one of these things is an art form because you need to get the temperature right, the airflow right, the distance from the board right or you will find yourself blowing components off the board and making things worse.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3545.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3545.jpg" alt="Metcal HCT-900 Hot Air Solder Tool" width="4032" height="3024" class="alignnone wp-image-2472 size-full" /></a></p>
<h2>Pinball machine PCB Solder Problem</h2>
<p>In the post where I discussed the first test of the Pinball board I told you that the power supply was not working.  It turns out that the cause of the problem was a big blob of solder under the accelerometer.  To fix that problem I had to remove the tiny little 3x3mm QFN accelerometer using the hot air solder tool.  Once I did, there was a big mess of solder under the package which I cleaned up with a braided copper wick and a soldering iron.  I suspect that I put too much solder onto the pads with the metal stencil when I built the board.</p>
<p>Here is what the board looked like after I cleaned it up:</p>
<p><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/accelerometer.jpg" alt="Pinball PCB Solder Problem" width="1280" height="852" class="alignnone wp-image-2460 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/01/accelerometer.jpg 1280w, https://iotexpert.com/wp-content/uploads/2017/01/accelerometer-600x399.jpg 600w, https://iotexpert.com/wp-content/uploads/2017/01/accelerometer-300x200.jpg 300w, https://iotexpert.com/wp-content/uploads/2017/01/accelerometer-768x511.jpg 768w, https://iotexpert.com/wp-content/uploads/2017/01/accelerometer-1024x682.jpg 1024w" sizes="auto, (max-width: 1280px) 100vw, 1280px" /></p>
<p>And here is a picture of the damn tiny chip.  The problem with all of these chips is they are meant to be used in cell phones, so they are as small and thin as possible.  And to make matters worse, the pads are on 0.5mm pitch or smaller.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-1.53-PM.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-1.53-PM.jpg" alt="0.5mm QFN with solder problems" width="1280" height="852" class="alignnone wp-image-2459 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-1.53-PM.jpg 1280w, https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-1.53-PM-600x399.jpg 600w, https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-1.53-PM-300x200.jpg 300w, https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-1.53-PM-768x511.jpg 768w, https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-1.53-PM-1024x682.jpg 1024w" sizes="auto, (max-width: 1280px) 100vw, 1280px" /></a></p>
<h2>Hot Air Solder Rework</h2>
<p>When I first started fighting with these QFN problems, I talked to the guys in the Cypress Development Kit team in India.  The manager of the group recorded this video of Jesudasan Moses, who is a wizard with hot air solder tools and a soldering irons.  This video was a huge help and I am grateful to them for recording it.</p>
<div class="jupiterx-oembed"><iframe loading="lazy" title="Hand Solder using Hot Air of Cypress BLE Radio Module" width="500" height="281" src="https://www.youtube.com/embed/VKbrGUlWZkQ?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></div>
<p>To fix my problem I followed the same process.  Here is the video:</p>
<div class="jupiterx-oembed"><iframe loading="lazy" title="Using Metcal Hot Air Tool to Reflow QFN" width="500" height="281" src="https://www.youtube.com/embed/tclRPtdBBK8?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></div>
<p>After three attempts, I got the chip  mostly on.  As you can see in the picture below, I was missing a connection to one of the pins.  The other problem was that I melted the screen with the hot air.  Suck.</p>
<p><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-2.09-PM.jpg" alt="Hot Air Solder rework of 5mm QFN" width="1280" height="852" class="alignnone wp-image-2458 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-2.09-PM.jpg 1280w, https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-2.09-PM-600x399.jpg 600w, https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-2.09-PM-300x200.jpg 300w, https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-2.09-PM-768x511.jpg 768w, https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-2.09-PM-1024x682.jpg 1024w" sizes="auto, (max-width: 1280px) 100vw, 1280px" /></p>
<p>After I touched up that pin with a soldering iron I still couldn&#8217;t talk to it with the PSoC, and I didn&#8217;t have easy access to the I2C bus to figure out what was going on.  In the future I need to make sure that there is a place to plug into the I2C bus to debug network traffic.  I will add this to my <a href="https://iotexpert.com/2016/11/16/eagle-pcb-layout-guidelines-osh-park/" target="_blank">PCB design guidelines</a>.</p>
<p>Back to the soldering iron to fix it.  I started by putting some flux on the pins of the QFN package.  Then, I draged a very fine tipped iron with a little bit of solder on it across the pins.  After a couple of rounds of this, I got the chip working.  I still need to cleanup the flux, but here is a picture of one side:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-4.11-PM.jpg"></a><a href="https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-4.11-PM.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-4.11-PM.jpg" alt="Shorts between pins in 0.5mm QFN" width="1280" height="852" class="alignnone wp-image-2456 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-4.11-PM.jpg 1280w, https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-4.11-PM-600x399.jpg 600w, https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-4.11-PM-300x200.jpg 300w, https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-4.11-PM-768x511.jpg 768w, https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-4.11-PM-1024x682.jpg 1024w" sizes="auto, (max-width: 1280px) 100vw, 1280px" /></a></p>
<p>And here is a picture of the other side.  You can see that I mangled the capacitor to the right during the rework process.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-4.11-PM-2.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-4.11-PM-2.jpg" alt="Hot Air Solder Repaired QFN" width="1280" height="852" class="alignnone wp-image-2455 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-4.11-PM-2.jpg 1280w, https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-4.11-PM-2-600x399.jpg 600w, https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-4.11-PM-2-300x200.jpg 300w, https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-4.11-PM-2-768x511.jpg 768w, https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-4.11-PM-2-1024x682.jpg 1024w" sizes="auto, (max-width: 1280px) 100vw, 1280px" /></a></p>
<p>I think that a significant source of problems was not having the entire underside of the QFN with Solder Mask.  That would have helped repel the solder and kept the blob from forming.  I think that I will add that to the checklist as well.</p>
<p>Unfortunately when I was looking at the layout trying to figure out what was going on, I realized that the accelerometer interrupt pin was not connected to the PSoC.  This happened because I had the pins connected by &#8220;name&#8221; in the schematic.  This is something else that I will add to the checklist.</p>
<p>Using a hot air solder tool is definitely an art form.  One that I will need to practice quite a bit before I get to anywhere near Jesusdan level of skill.</p>
<p><span><p>You can find all of the source code and files at the <a href="https://github.com/iotexpert/Pinball" target="_blank">IOTEXPERT</a> site on github.</p>
<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/09/05/pinball-newtons-attic-pinball/">Pinball: Newton's Attic Pinball</a></td>
<td >An introduction to the project and the goals</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/06/pinball-lotsa-blinking-leds/">Pinball: Lotsa Blinking LEDs</a></td>
<td >Everyone needs a bunch of LEDs on their Pinball Machine</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/07/pinball-matrix-leds-part-1/">Pinball: Matrix LEDs (Part 1)</a></td>
<td >Saving PSoC pins by using a matrix scheme</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/08/pinball-matrix-leds-part-2/" target="_blank">Pinball: Matrix LEDs (Part 2)</a></td>
<td >Solving some problems with the matrix</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/09/pinball-matrix-leds-component/" target="_blank">Pinball: Matrix LEDs Component</a></td>
<td >How to turn the Matrix LED into a component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/10/pinball-a-switch-matrix/">Pinball: A Switch Matrix</a></td>
<td >Implementing a bunch of switches</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/12/pinball-switch-matrix-component-part-1/" target="_blank">Pinball: Switch Matrix Component (Part 1)</a></td>
<td >The switch matrix component implementation</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/13/pinball-switch-matrix-component-part-2/" target="_blank">Pinball: Switch Matrix Component (Part 2)</a></td>
<td >The firmware for matrix component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/14/pinball-switch-matrix-component-part-3/" target="_blank">Pinball: Switch Matrix Component (Part 3)</a></td>
<td >Test firmware for the matrix component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/20/pinball-the-music-player-part-1/" target="_blank">Pinball: The Music Player (Part 1)</a></td>
<td >The schematic and symbol for a Music Player component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/21/pinball-the-music-player-part-2/" target="_blank">Pinball: The Music Player (Part 2)</a></td>
<td >The Public API for the Music Player component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/22/pinball-the-music-player-part-3/" target="_blank">Pinball: The Music Player (Part 3)</a></td>
<td >The firmware to make the sweet sweet music</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/23/pinball-the-music-player-part-4/">Pinball: The Music Player (Part 4)</a></td>
<td >The test program for the music player</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/26/pinball-the-motors-hbridge/" target="_blank">Pinball: The Motors + HBridge</a></td>
<td >Using an Bridge to control DC Motors</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/27/pinball-the-eagle-schematic/" target="_blank">Pinball: The Eagle Schematic</a></td>
<td >All of the circuits into an Eagle schematic</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/29/pinball-the-printed-circuit-board-version-1-0/" target="_blank">Pinball: The Printed Circuit Board 1.0</a></td>
<td >The first Eagle PCB layout of the printed circuit board</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/30/pinball-the-pcb-version-1-0-fail/" target="_blank">Pinball: The PCB Version 1.0 Fail</a></td>
<td >Problems with the first version of the Eagle PCB layout</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/05/pinball-pcb-1-2-updates-using-eagle/" target="_blank">Pinball: PCB Layout 1.2 Updates using Eagle</a></td>
<td >Fixing the errors on the first two versions of the Eagle PCB</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/12/pinball-pcb-solder-reflow-osh-park-eagle/">Pinball: Assemble and Reflow the 1.2 PCB</a></td>
<td >Assembling the Eagle PCB</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/23/pinball-testing-the-eagle-pcb/" target="_blank">Pinball: Testing the Eagle PCB</a></td>
<td > Firmware to test the newly built Pinball printed circuit board</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/09/pinball-debugging-psoc-motor-driver/" target="_blank">Pinball: Debugging the Motor Driver</a></td>
<td > Fixing the motor driver PSoC project</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/13/hot-air-solder-reworking-the-accelerometer/" target="_blank">Pinball: Hot-Air Reworking the Accelerometer Solder</a></td>
<td >Using a Hot-Air Rework tool to reflow a QFN</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/16/pinball-debugging-lm317-power-supply-tale-getting-lucky/" target="_blank">Pinball: Debugging the LM317 Power Supply- A Tale of Getting Lucky</a></td>
<td >Debugging the LM317/LM117 power supply</td>
</tr>
</tbody></table></div></p></span></p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/hot-air-solder-reworking-the-accelerometer/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Pinball: Debugging the PSoC Motor Driver</title>
		<link>https://iotexpert.com/pinball-debugging-psoc-motor-driver/</link>
					<comments>https://iotexpert.com/pinball-debugging-psoc-motor-driver/#respond</comments>
		
		<dc:creator><![CDATA[Alan Hawse]]></dc:creator>
		<pubDate>Thu, 09 Feb 2017 10:00:05 +0000</pubDate>
				<category><![CDATA[Pinball]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=2429</guid>

					<description><![CDATA[Summary I spent a lot of time the last few days building and testing the Pinball board.  This morning when I plugged in my oscilloscope to test the PSoC motor driver, I saw this: Here is a screenshot directly from the oscilloscope.  When I saw this, I wondered what was going on.  Why does the [&#8230;]]]></description>
										<content:encoded><![CDATA[<h2>Summary</h2>
<p>I spent a lot of time the last few days building and testing the <a href="https://iotexpert.com/category/solutions/pinball/" target="_blank">Pinball</a> board.  This morning when I plugged in my oscilloscope to test the PSoC motor driver, I saw this:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3537.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3537.jpg" alt="Pinball Machine PSoC Motor Driver Bug" width="4032" height="3024" class="alignnone wp-image-2433 size-full" /></a></p>
<p>Here is a screenshot directly from the oscilloscope.  When I saw this, I wondered what was going on.  Why does the driver pull-up very quickly, but have some kind of RC delay on the pull-down?  This was particularly troubling as the PWM was set to 50 Hz (see on the picture where the (1) Freq is showing the measurement)</p>
<p><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/TEK00001.png" alt="Broken Motor Driver Output" width="480" height="234" class="alignnone wp-image-2431 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/01/TEK00001.png 480w, https://iotexpert.com/wp-content/uploads/2017/01/TEK00001-300x146.png 300w" sizes="auto, (max-width: 480px) 100vw, 480px" /></p>
<p>Things got much worse when I increased the frequency to 500 Hz.  In fact, the motor driver doesn&#8217;t pull-down at all.</p>
<p><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/TEK00002.png" alt="Crazy PWM Output" width="480" height="234" class="alignnone wp-image-2430 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/01/TEK00002.png 480w, https://iotexpert.com/wp-content/uploads/2017/01/TEK00002-300x146.png 300w" sizes="auto, (max-width: 480px) 100vw, 480px" /></p>
<h2>PSoC Motor Driver</h2>
<p>So where do I start debugging?  First I looked at the PSoC Creator schematic.  When you look at the schematic you can see that I took the PWM output and steered it to either M0L or M0R (or M1L or M1R).  Then I used a control register to flip it.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-01-at-2.17.55-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-01-at-2.17.55-PM.png" alt="PSoC Motor Driver Schematic (broken)" width="968" height="586" class="alignnone wp-image-2435 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-01-at-2.17.55-PM.png 968w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-01-at-2.17.55-PM-600x363.png 600w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-01-at-2.17.55-PM-300x182.png 300w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-01-at-2.17.55-PM-768x465.png 768w" sizes="auto, (max-width: 968px) 100vw, 968px" /></a></p>
<p>The M0R/M0L signals are used to control the switches on the H-Bridge.  Here is the actual schematic from the PCB:</p>
<p><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-01-at-10.04.12-AM.png" alt="PSoC Motor Driver Schematic" width="1390" height="1234" class="alignnone wp-image-2437 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-01-at-10.04.12-AM.png 1390w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-01-at-10.04.12-AM-600x533.png 600w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-01-at-10.04.12-AM-300x266.png 300w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-01-at-10.04.12-AM-768x682.png 768w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-01-at-10.04.12-AM-1024x909.png 1024w" sizes="auto, (max-width: 1390px) 100vw, 1390px" /></p>
<p>I chose the <a href="http://toshiba.semicon-storage.com/ap-en/product/linear/motordriver/detail.TB6612FNG.html" target="_blank">Toshiba TB6612FNG</a> motor driver chip for this design.  It has two H-Bridges built in and is the same one that we used on the PSoC 211 Robot.  You can see from the schematics above that I save 1 pin by attaching the PWM input to &#8220;H(igh)&#8221; and that I pulse either In1 or In2.</p>
<p><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-01-at-2.20.49-PM.png" alt="Hbridge Schematic" width="1239" height="485" class="alignnone wp-image-2439 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-01-at-2.20.49-PM.png 1239w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-01-at-2.20.49-PM-600x235.png 600w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-01-at-2.20.49-PM-300x117.png 300w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-01-at-2.20.49-PM-768x301.png 768w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-01-at-2.20.49-PM-1024x401.png 1024w" sizes="auto, (max-width: 1239px) 100vw, 1239px" /></p>
<p>When you look at this table, or the schematic, you&#8217;ll see my problem.  I connected one of the inputs to &#8220;L&#8221;  That means that the NMOS switch that controls the pull-down is always off.  When the PWM is low, there is no pull-down.  That explains the funny RC pull-down, which is just some leakage on that node.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-01-at-2.21.13-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-01-at-2.21.13-PM.png" alt="HBridge Truth Table" width="1133" height="576" class="alignnone wp-image-2438 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-01-at-2.21.13-PM.png 1133w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-01-at-2.21.13-PM-600x305.png 600w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-01-at-2.21.13-PM-300x153.png 300w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-01-at-2.21.13-PM-768x390.png 768w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-01-at-2.21.13-PM-1024x521.png 1024w" sizes="auto, (max-width: 1133px) 100vw, 1133px" /></a></p>
<p>&nbsp;</p>
<p>To fix this, I make this change to my PSoC Creator schematic.  In this configuration I get the following:</p>
<p>CR=00 the output = 00 (stop)</p>
<p>CR=02 the output = 1PWM = CCW</p>
<p>CR=03 the output = PWM1 = CW</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-01-at-2.17.07-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-01-at-2.17.07-PM.png" alt="PSoC Motor Driver Schematic" width="970" height="471" class="alignnone wp-image-2436 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-01-at-2.17.07-PM.png 970w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-01-at-2.17.07-PM-600x291.png 600w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-01-at-2.17.07-PM-300x146.png 300w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-01-at-2.17.07-PM-768x373.png 768w" sizes="auto, (max-width: 970px) 100vw, 970px" /></a></p>
<p>Now when I run this thing, here is what I get (at my desired 20KHz):</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/TEK00003.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/TEK00003.png" alt="Oscilloscope of functioning PSoC Motor Driver" width="480" height="234" class="alignnone wp-image-2432 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/01/TEK00003.png 480w, https://iotexpert.com/wp-content/uploads/2017/01/TEK00003-300x146.png 300w" sizes="auto, (max-width: 480px) 100vw, 480px" /></a></p>
<p>And finally a video showing the PSoC Motor Driver working:</p>
<div class="jupiterx-oembed"><iframe loading="lazy" title="Motor Driver Test" width="500" height="281" src="https://www.youtube.com/embed/cXxIu_CHWGw?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></div>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/pinball-debugging-psoc-motor-driver/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Pinball: Driving the OLED using the U8G2 Library</title>
		<link>https://iotexpert.com/pinball-driving-oled-using-u8g2-library/</link>
					<comments>https://iotexpert.com/pinball-driving-oled-using-u8g2-library/#comments</comments>
		
		<dc:creator><![CDATA[Alan Hawse]]></dc:creator>
		<pubDate>Wed, 01 Feb 2017 10:54:26 +0000</pubDate>
				<category><![CDATA[Pinball]]></category>
		<category><![CDATA[PSoC4 BLE]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=2357</guid>

					<description><![CDATA[In the previous Pinball post, I wrote about getting the OLED going and getting the footprint onto my printed circuit board.  Now I need to make PSoC firmware to drive the display.  I turns out that there are a number of different driver chips out there including at least SSD1306, SH1106, LD7032, SSD1325, and ST7920 that [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In the<a href="https://iotexpert.com/2016/12/26/pinball-oled-display/"> previous Pinball post</a>, I wrote about getting the OLED going and getting the footprint onto my printed circuit board.  Now I need to make PSoC firmware to drive the display.  I turns out that there are a number of different driver chips out there including at least <a href="https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf" target="_blank">SSD1306</a>, <a href="https://www.elecrow.com/download/SH1106%20datasheet.pdf" target="_blank">SH1106</a>, <a href="http://www.seeedstudio.com/document/pdf/LD7032%20Device%20Spec%20(Rev%202.0).pdf" target="_blank">LD7032</a>, <a href="http://pdf.masters.com.pl/SOLOMON%20SYSTECH/SSD1325.pdf" target="_blank">SSD1325</a>, and <a href="http://www.fordata.cn/pdf/ic/st7920v30.pdf" target="_blank">ST7920</a> that handle multiplexing the columns/rows, managing frame buffers, power management, etc.  To make matters more fun, these chips support I2C, 3&amp;4 wire SPI and a couple of different parallel interfaces (6800, 8080).  I certainly didn&#8217;t want to go down the rathole of building up a complete driver library.  But I didn&#8217;t have to, as it turns out that that Oliver Kraus built and open-sourced a very nice library that you can get at <a href="https://github.com/olikraus/u8g2" target="_blank">www.github.com/olikraus/u8g2</a>.  This library (and its predecessor u8glib) seem to be in pretty wide use in Arduino and Raspberry Pi.</p>
<p>In order to make the library work with the PSoC I had to do several things</p>
<ol>
<li>Download it from GitHub (git clone git@github.com:olikraus/u8g2.git)</li>
<li>Created a new PSoC4200M project for the CY8CKIT-044 (which was the devkit that I happened to have sitting next to my computer)</li>
<li>Change the build settings (right click on the project and select building settings) then add the directory in &#8220;Additional Include Directories&#8221; and include the &#8220;u8g2/csrc&#8221; directory.<a href="https://iotexpert.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-26-at-11.57.43-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-26-at-11.57.43-AM.png" alt="" width="860" height="575" class="alignnone size-full wp-image-2354" srcset="https://iotexpert.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-26-at-11.57.43-AM.png 860w, https://iotexpert.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-26-at-11.57.43-AM-600x401.png 600w, https://iotexpert.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-26-at-11.57.43-AM-300x201.png 300w, https://iotexpert.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-26-at-11.57.43-AM-768x513.png 768w" sizes="auto, (max-width: 860px) 100vw, 860px" /></a></li>
<li>Add the header files to the project by right clicking and selecting &#8220;Add-&gt;Existing item&#8221; so that the project can f<a href="https://iotexpert.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-26-at-12.00.11-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-26-at-12.00.11-PM.png" alt="" width="355" height="232" class="alignnone size-full wp-image-2355" srcset="https://iotexpert.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-26-at-12.00.11-PM.png 355w, https://iotexpert.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-26-at-12.00.11-PM-300x196.png 300w" sizes="auto, (max-width: 355px) 100vw, 355px" /></a></li>
<li>Add the U8G2 C-Files to the project (same as step 4 but add the C files)</li>
<li>Build a schematic which has an I2C (for the display) and a debugging UART.  The I2C is configured as a master with 400kbs data rate.  The UART uses the default configuration.<a href="https://iotexpert.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-27-at-6.10.45-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-27-at-6.10.45-AM.png" alt="" width="742" height="721" class="alignnone size-full wp-image-2374" srcset="https://iotexpert.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-27-at-6.10.45-AM.png 742w, https://iotexpert.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-27-at-6.10.45-AM-600x583.png 600w, https://iotexpert.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-27-at-6.10.45-AM-300x292.png 300w" sizes="auto, (max-width: 742px) 100vw, 742px" /></a></li>
<li>Assign the pins<a href="https://iotexpert.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-27-at-6.12.32-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-27-at-6.12.32-AM.png" alt="" width="780" height="126" class="alignnone size-full wp-image-2376" srcset="https://iotexpert.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-27-at-6.12.32-AM.png 780w, https://iotexpert.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-27-at-6.12.32-AM-600x97.png 600w, https://iotexpert.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-27-at-6.12.32-AM-300x48.png 300w, https://iotexpert.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-27-at-6.12.32-AM-768x124.png 768w" sizes="auto, (max-width: 780px) 100vw, 780px" /></a></li>
</ol>
<p>Now I am ready to build some firmware that will drive the display.  In order to use the library with a PSoC I need to create two functions for the U8G2 HAL to use as an interface to the PSoC hardware.  You initialize the U8G2 system with a call to the u8x8_Setup function.  In that call you need to provide function pointers too the two HAL functions</p>
<ol>
<li>The GPIO and Delay Interface</li>
<li>The byte oriented communication interface</li>
</ol>
<p>This is an example of the setup required:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2018/01/Screen-Shot-2017-01-25-at-6.20.10-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2018/01/Screen-Shot-2017-01-25-at-6.20.10-AM.png" alt="" width="973" height="40" class="alignnone size-full wp-image-2775" srcset="https://iotexpert.com/wp-content/uploads/2018/01/Screen-Shot-2017-01-25-at-6.20.10-AM.png 973w, https://iotexpert.com/wp-content/uploads/2018/01/Screen-Shot-2017-01-25-at-6.20.10-AM-600x25.png 600w, https://iotexpert.com/wp-content/uploads/2018/01/Screen-Shot-2017-01-25-at-6.20.10-AM-300x12.png 300w, https://iotexpert.com/wp-content/uploads/2018/01/Screen-Shot-2017-01-25-at-6.20.10-AM-768x32.png 768w" sizes="auto, (max-width: 973px) 100vw, 973px" /></a></p>
<p>The GPIO and Delay interface is used by the byte oriented communication functions to read/write the GPIOs and provide delays.  This function provides the underpinnings of a bit-banged I2C, UART, SPI etc.  Because I am only going to use PSoC Hardware to provide the I2C interface I will only respond to the delay messages.  All of the delay functions are implemented as busy wait loops, which I am not a big fan of.  The input to the function is a &#8220;message&#8221; that is one of a sprawling list of #defines in the file u8x8.h.  I believe that I found all of the possible cases, but I am not sure.</p>
<p>The first message, UX8X8_MSG_GPIO_AND_DELAY_INIT doesnt need to do anything because the GPIOs are configured correctly by the default.</p>
<p>I did not respond to the messages of the form U8X8_MSG_GPIO_X which are the read and write of the GPIOs as I am not going to use the bit-banged interface.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2018/01/Screen-Shot-2017-01-25-at-6.21.38-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2018/01/Screen-Shot-2017-01-25-at-6.21.38-AM.png" alt="" width="788" height="804" class="alignnone size-full wp-image-2776" srcset="https://iotexpert.com/wp-content/uploads/2018/01/Screen-Shot-2017-01-25-at-6.21.38-AM.png 788w, https://iotexpert.com/wp-content/uploads/2018/01/Screen-Shot-2017-01-25-at-6.21.38-AM-600x612.png 600w, https://iotexpert.com/wp-content/uploads/2018/01/Screen-Shot-2017-01-25-at-6.21.38-AM-294x300.png 294w, https://iotexpert.com/wp-content/uploads/2018/01/Screen-Shot-2017-01-25-at-6.21.38-AM-768x784.png 768w" sizes="auto, (max-width: 788px) 100vw, 788px" /></a></p>
<p>The other function that needs to be provided is the byte-oriented communication function.  This function needs to respond to the messages to start, send, and end communication.  I just mapped those messages onto the PSoC hardware APIs.  While I was trying to understand what was happening with the system I implemented a debugging UART which you can see in the #ifdef DEBUG_UART sections.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2018/01/Screen-Shot-2017-01-25-at-6.22.45-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2018/01/Screen-Shot-2017-01-25-at-6.22.45-AM.png" alt="" width="797" height="741" class="alignnone size-full wp-image-2777" srcset="https://iotexpert.com/wp-content/uploads/2018/01/Screen-Shot-2017-01-25-at-6.22.45-AM.png 797w, https://iotexpert.com/wp-content/uploads/2018/01/Screen-Shot-2017-01-25-at-6.22.45-AM-600x558.png 600w, https://iotexpert.com/wp-content/uploads/2018/01/Screen-Shot-2017-01-25-at-6.22.45-AM-300x279.png 300w, https://iotexpert.com/wp-content/uploads/2018/01/Screen-Shot-2017-01-25-at-6.22.45-AM-768x714.png 768w" sizes="auto, (max-width: 797px) 100vw, 797px" /></a></p>
<p><span><p>You can find all of the source code and files at the <a href="https://github.com/iotexpert/Pinball" target="_blank">IOTEXPERT</a> site on github.</p>
<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/09/05/pinball-newtons-attic-pinball/">Pinball: Newton's Attic Pinball</a></td>
<td >An introduction to the project and the goals</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/06/pinball-lotsa-blinking-leds/">Pinball: Lotsa Blinking LEDs</a></td>
<td >Everyone needs a bunch of LEDs on their Pinball Machine</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/07/pinball-matrix-leds-part-1/">Pinball: Matrix LEDs (Part 1)</a></td>
<td >Saving PSoC pins by using a matrix scheme</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/08/pinball-matrix-leds-part-2/" target="_blank">Pinball: Matrix LEDs (Part 2)</a></td>
<td >Solving some problems with the matrix</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/09/pinball-matrix-leds-component/" target="_blank">Pinball: Matrix LEDs Component</a></td>
<td >How to turn the Matrix LED into a component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/10/pinball-a-switch-matrix/">Pinball: A Switch Matrix</a></td>
<td >Implementing a bunch of switches</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/12/pinball-switch-matrix-component-part-1/" target="_blank">Pinball: Switch Matrix Component (Part 1)</a></td>
<td >The switch matrix component implementation</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/13/pinball-switch-matrix-component-part-2/" target="_blank">Pinball: Switch Matrix Component (Part 2)</a></td>
<td >The firmware for matrix component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/14/pinball-switch-matrix-component-part-3/" target="_blank">Pinball: Switch Matrix Component (Part 3)</a></td>
<td >Test firmware for the matrix component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/20/pinball-the-music-player-part-1/" target="_blank">Pinball: The Music Player (Part 1)</a></td>
<td >The schematic and symbol for a Music Player component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/21/pinball-the-music-player-part-2/" target="_blank">Pinball: The Music Player (Part 2)</a></td>
<td >The Public API for the Music Player component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/22/pinball-the-music-player-part-3/" target="_blank">Pinball: The Music Player (Part 3)</a></td>
<td >The firmware to make the sweet sweet music</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/23/pinball-the-music-player-part-4/">Pinball: The Music Player (Part 4)</a></td>
<td >The test program for the music player</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/26/pinball-the-motors-hbridge/" target="_blank">Pinball: The Motors + HBridge</a></td>
<td >Using an Bridge to control DC Motors</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/27/pinball-the-eagle-schematic/" target="_blank">Pinball: The Eagle Schematic</a></td>
<td >All of the circuits into an Eagle schematic</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/29/pinball-the-printed-circuit-board-version-1-0/" target="_blank">Pinball: The Printed Circuit Board 1.0</a></td>
<td >The first Eagle PCB layout of the printed circuit board</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/30/pinball-the-pcb-version-1-0-fail/" target="_blank">Pinball: The PCB Version 1.0 Fail</a></td>
<td >Problems with the first version of the Eagle PCB layout</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/05/pinball-pcb-1-2-updates-using-eagle/" target="_blank">Pinball: PCB Layout 1.2 Updates using Eagle</a></td>
<td >Fixing the errors on the first two versions of the Eagle PCB</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/12/pinball-pcb-solder-reflow-osh-park-eagle/">Pinball: Assemble and Reflow the 1.2 PCB</a></td>
<td >Assembling the Eagle PCB</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/23/pinball-testing-the-eagle-pcb/" target="_blank">Pinball: Testing the Eagle PCB</a></td>
<td > Firmware to test the newly built Pinball printed circuit board</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/09/pinball-debugging-psoc-motor-driver/" target="_blank">Pinball: Debugging the Motor Driver</a></td>
<td > Fixing the motor driver PSoC project</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/13/hot-air-solder-reworking-the-accelerometer/" target="_blank">Pinball: Hot-Air Reworking the Accelerometer Solder</a></td>
<td >Using a Hot-Air Rework tool to reflow a QFN</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/16/pinball-debugging-lm317-power-supply-tale-getting-lucky/" target="_blank">Pinball: Debugging the LM317 Power Supply- A Tale of Getting Lucky</a></td>
<td >Debugging the LM317/LM117 power supply</td>
</tr>
</tbody></table></div></p></span></p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/pinball-driving-oled-using-u8g2-library/feed/</wfw:commentRss>
			<slash:comments>16</slash:comments>
		
		
			</item>
		<item>
		<title>Pinball: Testing the Eagle PCB</title>
		<link>https://iotexpert.com/pinball-testing-the-eagle-pcb/</link>
					<comments>https://iotexpert.com/pinball-testing-the-eagle-pcb/#respond</comments>
		
		<dc:creator><![CDATA[Alan Hawse]]></dc:creator>
		<pubDate>Mon, 23 Jan 2017 11:31:03 +0000</pubDate>
				<category><![CDATA[Pinball]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=2551</guid>

					<description><![CDATA[Summary In the previous post I talked about my process for assembling the Pinball PCB.  In this post I will take you through all of the steps that I took while testing the Eagle PCB functionality.  I have not yet written the full Pinball game firmware, so I used a small test program, an Oscilloscope [&#8230;]]]></description>
										<content:encoded><![CDATA[<h2>Summary</h2>
<p>In the <a href="https://iotexpert.com/2017/01/12/pinball-pcb-solder-reflow-osh-park-eagle/">previous post</a> I talked about my process for assembling the Pinball PCB.  In this post I will take you through all of the steps that I took while testing the Eagle PCB functionality.  I have not yet written the full Pinball game firmware, so I used a small test program, an Oscilloscope and a multimeter to test each of the subsystems.  In order these are the systems that i tested:</p>
<ol>
<li>Power Supply</li>
<li>I2C OLED LCD Screen</li>
<li>CapSense (creator bug)</li>
<li>Buzzers</li>
<li>Motor Driver</li>
<li>LEDs</li>
<li>Switches</li>
<li>Accelerometer</li>
<li>Bluetooth</li>
</ol>
<h2>Test the Power Supply</h2>
<p>My first step was to plug in the Eagle PCB and see what happens.  There was no smoke, but when I measured the power supply I got this:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3590.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3590-e1483803789766.jpg" width="3024" height="4032" class="alignnone wp-image-2606 size-full" alt="fluke power supply measurement" /></a></p>
<p>Not perfect and I wondered why I got 4.1v instead of 3.3v.  But, the system will work at 4.1v so I deferred solving the problem until later.  [Edit: It turns out that I did something really stupid and then got lucky.  I will post soon about exactly what happened and how I fixed it.]</p>
<h2>Test the OLED LCD Screen</h2>
<p>Before I soldered in the LCD display, I decided to measure the I2C pins to make sure they were what I was expecting.  Unfortunately, when I measured them, I had about 800 ohms of resistance between the VCC and Ground which didn&#8217;t make a bit of sense.  To make matters worse the SDA and SCL were essentially shorted to ground.  After thinking about it for a while, I decided that the most likely culprit was the QFN accelerometer (which is also attached to the I2C bus).  That tiny little chip, with no-visible leads and 0.5mm pitch pads is an absolute beast to solder (more on this problem in a future post).  The accelerometer looked &#8220;OK&#8221;, but I decided to remove it anyway using my hot air tool.  As soon as I got it off the board I could see a big blob of solder on the pads.  After I cleaned up the blob of solder with a copper braid and soldering iron, I retested all of the pins.  They were now fine.  So I went ahead and soldered the display into the board (which also turned out to be a bad idea).  You can see the (unpopulated) accelerometer footprint just to the left of the display.</p>
<p><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3528.jpg" alt="OLED Screen Test" width="4032" height="3024" class="alignnone wp-image-2560 size-full" /></p>
<p>To test the display I ported Oliver Kraus&#8217; <a href="https://github.com/olikraus/u8g2" target="_blank">U8G2 library</a> to the PSoC.  This library lets you use an I2C to interface with a bunch of different small OLEDs.  You can read more about using the display in a future post.  Here is the block of code that makes the display work:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-22-at-11.59.59-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-22-at-11.59.59-AM.png" alt="" width="924" height="169" class="alignnone size-full wp-image-2698" srcset="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-22-at-11.59.59-AM.png 924w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-22-at-11.59.59-AM-600x110.png 600w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-22-at-11.59.59-AM-300x55.png 300w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-22-at-11.59.59-AM-768x140.png 768w" sizes="auto, (max-width: 924px) 100vw, 924px" /></a></p>
<h2>Test the CapSense</h2>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3530-1.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3530-1.jpg" alt="PSoC CapSense Test" width="4032" height="3024" class="alignnone wp-image-2559 size-full" /></a></p>
<p>In order to test the CapSense buttons I wrote a simple block of firmware to read the state of the buttons and display that state on the screen:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-22-at-12.05.12-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-22-at-12.05.12-PM.png" alt="" width="585" height="159" class="alignnone size-full wp-image-2697" srcset="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-22-at-12.05.12-PM.png 585w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-22-at-12.05.12-PM-300x82.png 300w" sizes="auto, (max-width: 585px) 100vw, 585px" /></a></p>
<h2>Test the Buzzers</h2>
<p>In order to test the buzzers, I just connected them to the PWMs and drove a square wave of 262Hz and 440Hz.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/TEK00005.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/TEK00005.png" alt="Buzzer 0 PWM Test" width="480" height="234" class="alignnone wp-image-2619 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/01/TEK00005.png 480w, https://iotexpert.com/wp-content/uploads/2017/01/TEK00005-300x146.png 300w" sizes="auto, (max-width: 480px) 100vw, 480px" /></a></p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/TEK00004.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/TEK00004.png" alt="Buzzer 1 PWM Test" width="480" height="234" class="alignnone wp-image-2620 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/01/TEK00004.png 480w, https://iotexpert.com/wp-content/uploads/2017/01/TEK00004-300x146.png 300w" sizes="auto, (max-width: 480px) 100vw, 480px" /></a></p>
<p>Here is the schematic for that circuit:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-22-at-12.08.19-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-22-at-12.08.19-PM.png" alt="Buzzer PWM Test Circuit" width="534" height="612" class="alignnone wp-image-2699 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-22-at-12.08.19-PM.png 534w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-22-at-12.08.19-PM-262x300.png 262w" sizes="auto, (max-width: 534px) 100vw, 534px" /></a></p>
<h2>Test the Motor Driver</h2>
<p>In order to test the motor drivers, I used a PWM to drive a 50Hz Square wave onto the output.  Unfortunately, I got this:</p>
<h2><a href="https://iotexpert.com/wp-content/uploads/2017/01/TEK00001.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/TEK00001.png" alt="Motor Driver Oscilloscope Measurement" width="480" height="234" class="alignnone wp-image-2431 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/01/TEK00001.png 480w, https://iotexpert.com/wp-content/uploads/2017/01/TEK00001-300x146.png 300w" sizes="auto, (max-width: 480px) 100vw, 480px" /></a></h2>
<p>Something is wrong.  When I first saw this waveform I wasn&#8217;t too happy.  But after doing some digging I figured out how to fix it.  This will be the subject of an upcoming post.  The good thing about this waveform is that my daughter, Anna, is studying exponentials functions in Calculus right now.  She recently asked me if there was an useful application of f(x) = e^x.  This was a perfect way to show her a practical application of a differential equation.</p>
<h2>Test the LEDs</h2>
<p>To test the LEDs I used the <a href="https://iotexpert.com/2016/09/09/pinball-matrix-leds-component/" target="_blank">switching LED matrix</a> component program that I showed in an earlier post.  To make things easier, I just stuck an LED in each pair of holes to make sure that they were working.  Here is a picture:</p>
<p><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3533.jpg" alt="Matrix LED Test" width="4032" height="3024" class="alignnone wp-image-2553 size-full" /></p>
<h2>Test the Switches</h2>
<p>To test the switches, I used the <a href="https://iotexpert.com/2016/09/10/pinball-a-switch-matrix/" target="_blank">Switch Matrix Component</a> that I talked about in detail in a previous post.  In order to see the switches in their on state, I just plugged in a wire.  Here is a picture of a few of them being tested.</p>
<h2><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3535.jpg" alt="Switch Matrix Component Test" width="4032" height="3024" class="alignnone wp-image-2552 size-full" /></h2>
<h2>Test the Accelerometer</h2>
<p>As I mentioned earlier in this post, the accelerometer had a big nasty blob of solder under it which shorted SDA/SCL to ground.  I am going to dedicate an entire post to fixing this problem.</p>
<h2>Test the Bluetooth</h2>
<p>The very last sub-system to test is the Bluetooth.  I decided to put in enough firmware that the device could:</p>
<ol>
<li>Advertise</li>
<li>Disconnect</li>
<li>Restart advertising</li>
</ol>
<p>And display all of that on the OLED.  Here is a picture:</p>
<p><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3560-e1483711583485-768x1024.jpg" alt="OLED Display showing BLE Advertising State" width="768" height="1024" class="alignnone wp-image-2585 size-large" srcset="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3560-e1483711583485-768x1024.jpg 768w, https://iotexpert.com/wp-content/uploads/2017/01/IMG_3560-e1483711583485-600x800.jpg 600w, https://iotexpert.com/wp-content/uploads/2017/01/IMG_3560-e1483711583485-225x300.jpg 225w, https://iotexpert.com/wp-content/uploads/2017/01/IMG_3560-e1483711583485-scaled.jpg 1920w" sizes="auto, (max-width: 768px) 100vw, 768px" /></p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3559.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3559-576x1024.png" alt="iPhone Light Blue BLE Browser Showing Advertising Devices" width="576" height="1024" class="alignnone wp-image-2581 size-large" srcset="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3559-576x1024.png 576w, https://iotexpert.com/wp-content/uploads/2017/01/IMG_3559-600x1067.png 600w, https://iotexpert.com/wp-content/uploads/2017/01/IMG_3559-169x300.png 169w, https://iotexpert.com/wp-content/uploads/2017/01/IMG_3559-768x1365.png 768w, https://iotexpert.com/wp-content/uploads/2017/01/IMG_3559.png 1242w" sizes="auto, (max-width: 576px) 100vw, 576px" /></a></p>
<p><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3561-e1483711711738-768x1024.jpg" width="768" height="1024" class="alignnone wp-image-2584 size-large" alt="Bluetooth Advertising Test" srcset="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3561-e1483711711738-768x1024.jpg 768w, https://iotexpert.com/wp-content/uploads/2017/01/IMG_3561-e1483711711738-600x800.jpg 600w, https://iotexpert.com/wp-content/uploads/2017/01/IMG_3561-e1483711711738-225x300.jpg 225w, https://iotexpert.com/wp-content/uploads/2017/01/IMG_3561-e1483711711738-scaled.jpg 1920w" sizes="auto, (max-width: 768px) 100vw, 768px" /></p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3558.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3558-576x1024.png" alt="Light Blue BLE GATT Database Explorer" width="576" height="1024" class="alignnone wp-image-2582 size-large" srcset="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3558-576x1024.png 576w, https://iotexpert.com/wp-content/uploads/2017/01/IMG_3558-600x1067.png 600w, https://iotexpert.com/wp-content/uploads/2017/01/IMG_3558-169x300.png 169w, https://iotexpert.com/wp-content/uploads/2017/01/IMG_3558-768x1365.png 768w, https://iotexpert.com/wp-content/uploads/2017/01/IMG_3558.png 1242w" sizes="auto, (max-width: 576px) 100vw, 576px" /></a></p>
<p><span><p>You can find all of the source code and files at the <a href="https://github.com/iotexpert/Pinball" target="_blank">IOTEXPERT</a> site on github.</p>
<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/09/05/pinball-newtons-attic-pinball/">Pinball: Newton's Attic Pinball</a></td>
<td >An introduction to the project and the goals</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/06/pinball-lotsa-blinking-leds/">Pinball: Lotsa Blinking LEDs</a></td>
<td >Everyone needs a bunch of LEDs on their Pinball Machine</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/07/pinball-matrix-leds-part-1/">Pinball: Matrix LEDs (Part 1)</a></td>
<td >Saving PSoC pins by using a matrix scheme</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/08/pinball-matrix-leds-part-2/" target="_blank">Pinball: Matrix LEDs (Part 2)</a></td>
<td >Solving some problems with the matrix</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/09/pinball-matrix-leds-component/" target="_blank">Pinball: Matrix LEDs Component</a></td>
<td >How to turn the Matrix LED into a component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/10/pinball-a-switch-matrix/">Pinball: A Switch Matrix</a></td>
<td >Implementing a bunch of switches</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/12/pinball-switch-matrix-component-part-1/" target="_blank">Pinball: Switch Matrix Component (Part 1)</a></td>
<td >The switch matrix component implementation</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/13/pinball-switch-matrix-component-part-2/" target="_blank">Pinball: Switch Matrix Component (Part 2)</a></td>
<td >The firmware for matrix component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/14/pinball-switch-matrix-component-part-3/" target="_blank">Pinball: Switch Matrix Component (Part 3)</a></td>
<td >Test firmware for the matrix component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/20/pinball-the-music-player-part-1/" target="_blank">Pinball: The Music Player (Part 1)</a></td>
<td >The schematic and symbol for a Music Player component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/21/pinball-the-music-player-part-2/" target="_blank">Pinball: The Music Player (Part 2)</a></td>
<td >The Public API for the Music Player component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/22/pinball-the-music-player-part-3/" target="_blank">Pinball: The Music Player (Part 3)</a></td>
<td >The firmware to make the sweet sweet music</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/23/pinball-the-music-player-part-4/">Pinball: The Music Player (Part 4)</a></td>
<td >The test program for the music player</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/26/pinball-the-motors-hbridge/" target="_blank">Pinball: The Motors + HBridge</a></td>
<td >Using an Bridge to control DC Motors</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/27/pinball-the-eagle-schematic/" target="_blank">Pinball: The Eagle Schematic</a></td>
<td >All of the circuits into an Eagle schematic</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/29/pinball-the-printed-circuit-board-version-1-0/" target="_blank">Pinball: The Printed Circuit Board 1.0</a></td>
<td >The first Eagle PCB layout of the printed circuit board</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/30/pinball-the-pcb-version-1-0-fail/" target="_blank">Pinball: The PCB Version 1.0 Fail</a></td>
<td >Problems with the first version of the Eagle PCB layout</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/05/pinball-pcb-1-2-updates-using-eagle/" target="_blank">Pinball: PCB Layout 1.2 Updates using Eagle</a></td>
<td >Fixing the errors on the first two versions of the Eagle PCB</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/12/pinball-pcb-solder-reflow-osh-park-eagle/">Pinball: Assemble and Reflow the 1.2 PCB</a></td>
<td >Assembling the Eagle PCB</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/23/pinball-testing-the-eagle-pcb/" target="_blank">Pinball: Testing the Eagle PCB</a></td>
<td > Firmware to test the newly built Pinball printed circuit board</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/09/pinball-debugging-psoc-motor-driver/" target="_blank">Pinball: Debugging the Motor Driver</a></td>
<td > Fixing the motor driver PSoC project</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/13/hot-air-solder-reworking-the-accelerometer/" target="_blank">Pinball: Hot-Air Reworking the Accelerometer Solder</a></td>
<td >Using a Hot-Air Rework tool to reflow a QFN</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/16/pinball-debugging-lm317-power-supply-tale-getting-lucky/" target="_blank">Pinball: Debugging the LM317 Power Supply- A Tale of Getting Lucky</a></td>
<td >Debugging the LM317/LM117 power supply</td>
</tr>
</tbody></table></div></p></span></p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/pinball-testing-the-eagle-pcb/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Pinball: PCB Solder Reflow the OSH Park &#8211; Eagle 1.2 Board</title>
		<link>https://iotexpert.com/pinball-pcb-solder-reflow-osh-park-eagle/</link>
					<comments>https://iotexpert.com/pinball-pcb-solder-reflow-osh-park-eagle/#respond</comments>
		
		<dc:creator><![CDATA[Alan Hawse]]></dc:creator>
		<pubDate>Thu, 12 Jan 2017 12:11:21 +0000</pubDate>
				<category><![CDATA[Pinball]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=2534</guid>

					<description><![CDATA[Summary of my PCB Solder Reflow Process Getting the purple envelope from OSH Park is always exciting.  The big question is,  &#8220;After all those hours studying the Eagle PCB editor, did I make the same error three times in a row, or did I finally get it right?&#8221;  In this post, I will take you through [&#8230;]]]></description>
										<content:encoded><![CDATA[<h2>Summary of my PCB Solder Reflow Process</h2>
<p>Getting the purple envelope from <a href="http://www.oshpark.com" target="_blank">OSH Park</a> is always exciting.  The big question is,  &#8220;After all those hours studying the Eagle PCB editor, did I make the same error three times in a row, or did I finally get it right?&#8221;  In this post, I will take you through all of the steps that I follow in in my PCB reflow solder assembly process.  I use a Qinsi QS-5100 PCB Solder Reflow Oven which I talked about in detail in a <a href="https://iotexpert.com/2016/11/28/qinsi-qs5100-sn63pb37-solder-profile/" target="_blank">previous post</a>.  One of the interesting things about this blog website is that it has driven me to write down some of my procedures and move away from the &#8220;just wing it&#8221; method.  I believe this will pay long term dividends for me.  So, Thank You!</p>
<p>My board assembly process is as follows:</p>
<ol>
<li>Take solder paste out of the refrigerator and let it warm up (probably at least 2 hours)</li>
<li>Test fit the through hole and major surface mount components</li>
<li>Print out the parts list to use as a checklist</li>
<li>Setup all of the parts on the desk in some order (using checklist)</li>
<li>Tape the board holders to the desk</li>
<li>Make sure the solder stencil registers correctly</li>
<li>Screen on the solder paste (video)</li>
<li>Inspect the solder paste with a microscope</li>
<li>Place all of the parts</li>
<li>Reflow the PCB in the <a href="https://iotexpert.com/2016/11/28/qinsi-qs5100-sn63pb37-solder-profile/" target="_blank">Qinsi QS-5100</a> oven</li>
<li>Visually inspect the solder and clean up any solder balls</li>
<li>Solder in the programmer connector and program the board</li>
<li>Cleanup the disaster area</li>
</ol>
<h2>Take the Solder Paste out of the Refrigerator</h2>
<p>You need to have solder paste at room temperature as cold solder paste does not spread very well.  I recommend that you take the solder paste out of the refrigerator at least two hours before you use it.  I use <a href="http://www.kester.com/products/product/ep256-solder-paste" target="_blank">Kester EP256</a> solder which comes in a syringe or a tub.  In this case, I purchased it from <a href="https://www.oshstencils.com/" target="_blank">OSH Stencils</a> when I bought the original stencil.  In two of the videos I watched on the internet, the person put extra solder back into the tub but obviously that cannot be done with a syringe.  My experience has been that older solder paste that has been exposed to air will not reflow properly.  That will make you crazy, and is the reason why I have not gone down the road of saving extra solder.  I cannot emphasize enough to keep your solder cool and fresh.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/FullSizeRender-4.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/FullSizeRender-4-1024x768.jpg" width="1024" height="768" class="alignnone wp-image-2545 size-large" srcset="https://iotexpert.com/wp-content/uploads/2017/01/FullSizeRender-4-1024x768.jpg 1024w, https://iotexpert.com/wp-content/uploads/2017/01/FullSizeRender-4-600x450.jpg 600w, https://iotexpert.com/wp-content/uploads/2017/01/FullSizeRender-4-300x225.jpg 300w, https://iotexpert.com/wp-content/uploads/2017/01/FullSizeRender-4-768x576.jpg 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<h2>Test Fit Components onto the OSH Park /Eagle PCB</h2>
<p>When I get a new board, the first thing that I do is make sure that the major parts align to their footprint.  You don&#8217;t want to get down the road with paste on your PCB and find that you screwed up the size or placement of a component.  Here is a picture of my lab assistant test fitting the PSoC.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3581-e1483803957487.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3581-e1483803957487.jpg" alt="" width="3024" height="4032" class="alignnone size-full wp-image-2609" /></a></p>
<h2>Parts Checklist</h2>
<p>While I am designing the PCB in Eagle I always create a BOM spreadsheet with the names of the parts, the part number, the label on PCB silkscreen, etc.  I use this spreadsheet to ensure that I have all of the parts available to put on the board.  It sucks to get a PCB with solder paste on it, then be missing a part that you need.  Moreover, you need to move reasonably quickly once you have paste on the board (or the paste will harden) so making sure you have everything at hand is critical.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3589.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3589-e1483804005322.jpg" width="3024" height="4032" class="alignnone wp-image-2610 size-full" /></a></p>
<h2>Setup all of the parts on the desk in some order</h2>
<p>For some strange reason, it always feels stressful placing the parts onto the PCB.  In order to make the process smoother, I arrange the parts on my desk in some order.  In this case, all of the parts are by type i.e the resistors are all together.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3585-e1483804062184.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3585-e1483804062184.jpg" alt="" width="3024" height="4032" class="alignnone size-full wp-image-2611" /></a></p>
<h2>Tape the PCB Brackets onto the Table</h2>
<p>Once I have things setup, I use angled brackets (which came from <a href="http://www.oshstencils.com" target="_blank">oshstencils</a>)  to hold the board.  I use blue painters tape from Lowes to hold it all together.  The other thing that I do during this step is remove the tabs from the PCB manufacturing process and file off the rough edges.  The file is just a finger nail file I bootlegged from my wife (don&#8217;t tell).</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3571-e1483804135897.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3571-e1483804135897.jpg" alt="" width="3024" height="4032" class="alignnone size-full wp-image-2612" /></a></p>
<h2>Make sure the Stencil Registers Correctly</h2>
<p>The next step is to insure that the stencil registers properly with the board.  You need to verify that the stencil is aligned in both the x-y and angle directions.  It is easy to be &#8220;close&#8221; but twisted which will give you bad results.  For this build I am using a metal stencil from <a href="http://oshstencils.com" target="_blank">OSH Stencils</a>.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3515.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3515.jpg" alt="" width="4032" height="3024" class="alignnone size-full wp-image-2538" /></a></p>
<h2>Screen on the PCB Solder Paste</h2>
<p>Once every is lined up, you screen on the solder page.  Here is a video of me doing it for this PCB.</p>
<div class="jupiterx-oembed"><iframe loading="lazy" title="Screen Solder Paste" width="500" height="281" src="https://www.youtube.com/embed/E8lGSYftMlY?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></div>
<p>When I was originally trying to figure out how to make this whole process work I found this video from <a href="http://www.sparkfun.com" target="_blank">SparkFun</a> which was very useful.</p>
<div class="jupiterx-oembed"><iframe loading="lazy" title="Stenciling Tutorial" width="500" height="281" src="https://www.youtube.com/embed/WDIqtGMROjM?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></div>
<h2>Inspect the PCB Solder Paste with Microscope</h2>
<p>Once you have the solder paste screened onto the board, you should look at it carefully.  I typically use my microscope because my vision is not that great.  However, this blowup picture of the board works pretty well.  The only real problem in this picture is the blob of solder on U2 (the Accelerometer) which will cause problems in the reflow.  It is very tough to not get too much solder on the 0.5mm pitch pads.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3516.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3516.jpg" alt="" width="4032" height="3024" class="alignnone size-full wp-image-2539" /></a></p>
<h2>Place all of the Parts onto the PCB</h2>
<p>I was originally planning on making a video of placing the parts onto the board.  But, I need to look in the microscope while I am placing the parts on the board and I didn&#8217;t have a good way to record video.  I use a pair of <a href="https://www.amazon.com/Hakko-7-SA-Stainless-Non-Magnetic-Precision/dp/B00FZPFQHM/ref=sr_1_1?s=industrial&amp;ie=UTF8&amp;qid=1483827228&amp;sr=1-1&amp;keywords=hakko+7-sa" target="_blank">Hakko 7-sa</a> non-static tweezers  which I bought from Amazon.  I have a bunch of different pairs of tweezers and these are by far the best.  This is a picture after all of the parts are placed:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3587.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3587.jpg" alt="" width="4032" height="3024" class="alignnone size-full wp-image-2613" /></a></p>
<h2>Place in Qinsi QS-5100 PCB Solder Reflow Oven</h2>
<p>Now that you have the parts placed onto the PCB, it is time to place it in the PCB solder reflow oven.  I have found that it works best to have my PCB sitting on another board in the middle of the tray (a tip that I got from Ian Lesnet of <a href="http://www.dangerousprotypes.com" target="_blank">Dangerous Prototypes</a>).</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3520.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3520.jpg" alt="" width="4032" height="3024" class="alignnone size-full wp-image-2540" /></a></p>
<h2>Visually Inspect the Solder and Clean up any Solder Balls</h2>
<p>I almost always end up with 1 or 2 solder balls stuck between the pins of one of the chips.  When you are running the reflow, solder that isn&#8217;t attached to anything will ball up because of the surface tension.  Murphy&#8217;s law says that the solder balls will not end up anyplace good, and will for sure short some pins together.  You should look carefully for these balls or bridges and clean them up with your soldering iron.  This is a picture of a solder ball from another project.  You can see it between the right two pins on U6 (the chip labeled LTAJT).  The easy way to fix the ball is to squirt a little bit of flux on it, then touch it with your soldering iron.  That will melt the ball onto the pins next to it.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/FullSizeRender-5.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/FullSizeRender-5.jpg" alt="" width="3264" height="2448" class="alignnone size-full wp-image-2624" /></a></p>
<h2>Solder the Programmer Connector into the PCB</h2>
<p>The (almost) last step is to solder on the header for the Miniprog-3.  Then let it rip with a blank program program.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3524.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3524.jpg" alt="" width="4032" height="3024" class="alignnone size-full wp-image-2541" /></a></p>
<h2>Cleanup the Disaster Area</h2>
<p>Once all of that is done, my office is a complete and total disaster area.  Yes, I use gloves when I work with solder and you should as well.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3525.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/IMG_3525.jpg" alt="" width="4032" height="3024" class="alignnone size-full wp-image-2543" /></a></p>
<p>In the next post I will take you through the steps I followed to test the Pinball PCB.</p>
<p>You can find all of the source code and files at the <a href="https://github.com/iotexpert/Pinball" target="_blank">IOTEXPERT</a> site on github.</p>
<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/09/05/pinball-newtons-attic-pinball/">Pinball: Newton's Attic Pinball</a></td>
<td >An introduction to the project and the goals</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/06/pinball-lotsa-blinking-leds/">Pinball: Lotsa Blinking LEDs</a></td>
<td >Everyone needs a bunch of LEDs on their Pinball Machine</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/07/pinball-matrix-leds-part-1/">Pinball: Matrix LEDs (Part 1)</a></td>
<td >Saving PSoC pins by using a matrix scheme</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/08/pinball-matrix-leds-part-2/" target="_blank">Pinball: Matrix LEDs (Part 2)</a></td>
<td >Solving some problems with the matrix</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/09/pinball-matrix-leds-component/" target="_blank">Pinball: Matrix LEDs Component</a></td>
<td >How to turn the Matrix LED into a component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/10/pinball-a-switch-matrix/">Pinball: A Switch Matrix</a></td>
<td >Implementing a bunch of switches</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/12/pinball-switch-matrix-component-part-1/" target="_blank">Pinball: Switch Matrix Component (Part 1)</a></td>
<td >The switch matrix component implementation</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/13/pinball-switch-matrix-component-part-2/" target="_blank">Pinball: Switch Matrix Component (Part 2)</a></td>
<td >The firmware for matrix component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/14/pinball-switch-matrix-component-part-3/" target="_blank">Pinball: Switch Matrix Component (Part 3)</a></td>
<td >Test firmware for the matrix component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/20/pinball-the-music-player-part-1/" target="_blank">Pinball: The Music Player (Part 1)</a></td>
<td >The schematic and symbol for a Music Player component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/21/pinball-the-music-player-part-2/" target="_blank">Pinball: The Music Player (Part 2)</a></td>
<td >The Public API for the Music Player component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/22/pinball-the-music-player-part-3/" target="_blank">Pinball: The Music Player (Part 3)</a></td>
<td >The firmware to make the sweet sweet music</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/23/pinball-the-music-player-part-4/">Pinball: The Music Player (Part 4)</a></td>
<td >The test program for the music player</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/26/pinball-the-motors-hbridge/" target="_blank">Pinball: The Motors + HBridge</a></td>
<td >Using an Bridge to control DC Motors</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/27/pinball-the-eagle-schematic/" target="_blank">Pinball: The Eagle Schematic</a></td>
<td >All of the circuits into an Eagle schematic</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/29/pinball-the-printed-circuit-board-version-1-0/" target="_blank">Pinball: The Printed Circuit Board 1.0</a></td>
<td >The first Eagle PCB layout of the printed circuit board</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/30/pinball-the-pcb-version-1-0-fail/" target="_blank">Pinball: The PCB Version 1.0 Fail</a></td>
<td >Problems with the first version of the Eagle PCB layout</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/05/pinball-pcb-1-2-updates-using-eagle/" target="_blank">Pinball: PCB Layout 1.2 Updates using Eagle</a></td>
<td >Fixing the errors on the first two versions of the Eagle PCB</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/12/pinball-pcb-solder-reflow-osh-park-eagle/">Pinball: Assemble and Reflow the 1.2 PCB</a></td>
<td >Assembling the Eagle PCB</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/23/pinball-testing-the-eagle-pcb/" target="_blank">Pinball: Testing the Eagle PCB</a></td>
<td > Firmware to test the newly built Pinball printed circuit board</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/09/pinball-debugging-psoc-motor-driver/" target="_blank">Pinball: Debugging the Motor Driver</a></td>
<td > Fixing the motor driver PSoC project</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/13/hot-air-solder-reworking-the-accelerometer/" target="_blank">Pinball: Hot-Air Reworking the Accelerometer Solder</a></td>
<td >Using a Hot-Air Rework tool to reflow a QFN</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/16/pinball-debugging-lm317-power-supply-tale-getting-lucky/" target="_blank">Pinball: Debugging the LM317 Power Supply- A Tale of Getting Lucky</a></td>
<td >Debugging the LM317/LM117 power supply</td>
</tr>
</tbody></table></div></p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/pinball-pcb-solder-reflow-osh-park-eagle/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Pinball: PCB Layout 1.2 Updates using Eagle</title>
		<link>https://iotexpert.com/pinball-pcb-1-2-updates-using-eagle/</link>
					<comments>https://iotexpert.com/pinball-pcb-1-2-updates-using-eagle/#respond</comments>
		
		<dc:creator><![CDATA[Alan Hawse]]></dc:creator>
		<pubDate>Thu, 05 Jan 2017 10:00:43 +0000</pubDate>
				<category><![CDATA[Pinball]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=2488</guid>

					<description><![CDATA[Goals for fixing the PCB Layout using Eagle In the last Pinball post I talked about the 1.0 version of the Eagle PCB not working.  You might notice that the version number on this post is 1.2.  It seems strange to skip a version number.  Well, it turns out that I didn&#8217;t skip a version [&#8230;]]]></description>
										<content:encoded><![CDATA[<h2>Goals for fixing the PCB Layout using Eagle</h2>
<p>In the last <a href="https://iotexpert.com/2016/09/30/pinball-the-pcb-version-1-0-fail/" target="_blank">Pinball</a> post I talked about the 1.0 version of the Eagle PCB not working.  You might notice that the version number on this post is 1.2.  It seems strange to skip a version number.  Well, it turns out that I didn&#8217;t skip a version number in fact,  I did the most ridiculous thing possible, I made exactly the same error twice in a row on the PCB layout. That is, I flipped a chip footprint.  Enough about that.</p>
<p>In this post I am going to talk about the new printed circuit board.  As I updated the PCB design for this version of the board I had the following objectives</p>
<ol>
<li>Fix the flipped footprint</li>
<li>Put a 1&#8243; LCD screen on the board</li>
<li>Move the whole system to 3.3v and simplify the power routing</li>
<li>Provide a jumper selectable 5v/3.3v source for the motors</li>
<li>Fix the USB footprint to a USB plug that can be purchased</li>
<li>Make the silkscreen more readable (and fix the errors)</li>
<li>Fix the ground plane grid on the CapSense Buttons</li>
</ol>
<p>Here is the OSH park rendering of the new PCB layout.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/12/64d2f7acd81af523361182740421ae5c.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/12/64d2f7acd81af523361182740421ae5c.png" alt="OSH Park Rendering of Pinball 1.2 Eagle PCB Layout" width="1466" height="831" class="alignnone wp-image-2347 size-full" srcset="https://iotexpert.com/wp-content/uploads/2016/12/64d2f7acd81af523361182740421ae5c.png 1466w, https://iotexpert.com/wp-content/uploads/2016/12/64d2f7acd81af523361182740421ae5c-600x340.png 600w, https://iotexpert.com/wp-content/uploads/2016/12/64d2f7acd81af523361182740421ae5c-300x170.png 300w, https://iotexpert.com/wp-content/uploads/2016/12/64d2f7acd81af523361182740421ae5c-768x435.png 768w, https://iotexpert.com/wp-content/uploads/2016/12/64d2f7acd81af523361182740421ae5c-1024x580.png 1024w" sizes="auto, (max-width: 1466px) 100vw, 1466px" /></a></p>
<h2>Fix the flipped footprint</h2>
<p>I would have bet money that I fixed the Eagle library to have the correct foot print when I did PCB 1.1.  However, after I renumbered the pins in the package editor, I did not unhook and then rehook them in the library editor.  The result was a flipped footprint, again.  What is particularly frustrating is that I didn&#8217;t recheck it on the PCB.  I now have added that to my <a href="https://iotexpert.com/2016/11/16/eagle-pcb-layout-guidelines-osh-park/" target="_blank">PCB checklist</a>.</p>
<h2>Put a 1&#8243; LCD screen on the board</h2>
<p>On one of our WICED WiFi development kits, the IoT team put a really cool 1&#8243; OLED LCD screen.</p>
<p><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/08/IMG_3048-e1471874331612.jpg" alt="Internal WICED 943907 WiFi Development Kit with OLED Screen" width="3024" height="4032" class="alignnone wp-image-1859 size-full" /></p>
<p>After I looked around a little bit, I found that the little screen was very available for $3-ish on <a href="http://www.ebay.com/sch/?_nkw=oled+0.96+iic" target="_blank">eBay</a>.  My original plan was to use a bigger screen with an external connector.  But these aren&#8217;t as cool and they cost $8.  See what I am saying?</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/07/IMG_2983.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/07/IMG_2983.jpg" width="3024" height="3024" class="alignnone wp-image-1682 size-full" alt="16x2 Hitachi LCD Screen with PSoC 4200M Development Kit" /></a></p>
<p>In the upper right hand part of the PCB, I extended it a little bit and put on the footprint.  The only hitch is that it appears sometimes the pins are &#8220;VCC/GND&#8221; and sometimes the pins are &#8220;GND/VCC&#8221;.  In order to handle this, I setup four 0-Ohm resistors to allow me to switch the pins.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-4.57.57-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-4.57.57-PM.png" alt="PCB Layout with 0 Ohm Resistors to select SDA/SCL and GND/VCC" width="1961" height="1154" class="alignnone wp-image-2490 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-4.57.57-PM.png 1961w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-4.57.57-PM-600x353.png 600w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-4.57.57-PM-300x177.png 300w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-4.57.57-PM-768x452.png 768w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-4.57.57-PM-1024x603.png 1024w" sizes="auto, (max-width: 1961px) 100vw, 1961px" /></a></p>
<h2>Move the whole system to 3.3v and simplify the power routing</h2>
<p>There was no reason to run the system on 5V other than giving a little bit of extra power to the motors.  So, to simplify things I moved the PSoC to 3.3V (which it will happily do).  That allowed me to remove the level translator that I was using for the accelerometer.  By doing this, I could move all of the 5V power to the far left of the PCB, and not route it all over the place.  Here is a screen shot of the PCB layout.  You can see that the power comes in from the USB connector, then goes straight to three places</p>
<ol>
<li>The 3.3v Regulator</li>
<li>The Mini-Prog-3 Connector</li>
<li>The Motor Power Selector</li>
</ol>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.27.49-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.27.49-PM.png" alt="Eagle PCB layout of 5.0v power supply" width="466" height="678" class="alignnone wp-image-2495 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.27.49-PM.png 466w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.27.49-PM-206x300.png 206w" sizes="auto, (max-width: 466px) 100vw, 466px" /></a></p>
<h2>Provide a programmable 5v source for the motors</h2>
<p>I setup the motor power to be either 3.3v or 5.0v based on the selection of a jumper.  The jumper is a 3-position header on 100 mil spacing.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.33.41-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.33.41-PM.png" alt="Eagle PCB layout of motor power supply selection jumper" width="1752" height="1340" class="alignnone wp-image-2497 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.33.41-PM.png 1752w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.33.41-PM-600x459.png 600w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.33.41-PM-300x229.png 300w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.33.41-PM-768x587.png 768w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.33.41-PM-1024x783.png 1024w" sizes="auto, (max-width: 1752px) 100vw, 1752px" /></a></p>
<h2>Fix the USB footprint to a USB plug that can be purchased</h2>
<p>In the first version of the Pinball PCB layout I used a USB footprint that I found on the internet.  But, it turns out that footprint was not available.  In fact, I had to search and search for those parts.  I finally found a scrap shop in Poland that had a few of them available.  That was a bad idea.  Here is the new footprint:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.36.24-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.36.24-PM.png" alt="Eagle PCB layout footprint of USB connector" width="1466" height="1446" class="alignnone wp-image-2499 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.36.24-PM.png 1466w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.36.24-PM-100x100.png 100w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.36.24-PM-600x592.png 600w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.36.24-PM-300x296.png 300w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.36.24-PM-768x758.png 768w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.36.24-PM-1024x1010.png 1024w" sizes="auto, (max-width: 1466px) 100vw, 1466px" /></a></p>
<h2>Make the silkscreen more readable (and fix the errors)</h2>
<p>My eyes really don&#8217;t like any silkscreen that is less than 30mils tall.   There are some people who can see a smaller font, but I am just not one of them.  I really prefer 40mil tall letters to occur in my PCB layout.  I have updated the checklist with a chart of what is legible and illegible.  In addition I had a few errors like the one below (there aren&#8217;t two V50 pins next to each other, one is supposed to be ground.)</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.42.54-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.42.54-PM.png" alt="silkscreen error in original PCB layout" width="788" height="420" class="alignnone wp-image-2502 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.42.54-PM.png 788w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.42.54-PM-600x320.png 600w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.42.54-PM-300x160.png 300w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.42.54-PM-768x409.png 768w" sizes="auto, (max-width: 788px) 100vw, 788px" /></a></p>
<h2>Fix the ground plane grid on the CapSense Buttons</h2>
<p>To get the best CapSense performance you should not use a solid ground plane in your PCB layout (like the one below).  You should use a cross hatched ground (like the picture at the bottom).  You can read about this in the Cypress <a href="http://www.cypress.com/file/46081/download" target="_blank">application note</a> or in my <a href="https://iotexpert.com/2016/11/16/eagle-pcb-layout-guidelines-osh-park/" target="_blank">design guidelines</a>.</p>
<p><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.44.14-PM.png" alt="solid ground pour around PSoC Capsense PCB layout" width="636" height="1306" class="alignnone wp-image-2504 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.44.14-PM.png 636w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.44.14-PM-600x1232.png 600w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.44.14-PM-146x300.png 146w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.44.14-PM-499x1024.png 499w" sizes="auto, (max-width: 636px) 100vw, 636px" /></p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.44.38-PM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.44.38-PM.png" alt="Cross hatched ground pour around Cypress PSoC Capsense PCB layout" width="1164" height="592" class="alignnone wp-image-2503 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.44.38-PM.png 1164w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.44.38-PM-600x305.png 600w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.44.38-PM-300x153.png 300w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.44.38-PM-768x391.png 768w, https://iotexpert.com/wp-content/uploads/2017/01/Screen-Shot-2017-01-03-at-7.44.38-PM-1024x521.png 1024w" sizes="auto, (max-width: 1164px) 100vw, 1164px" /></a></p>
<p><span><p>You can find all of the source code and files at the <a href="https://github.com/iotexpert/Pinball" target="_blank">IOTEXPERT</a> site on github.</p>
<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/09/05/pinball-newtons-attic-pinball/">Pinball: Newton's Attic Pinball</a></td>
<td >An introduction to the project and the goals</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/06/pinball-lotsa-blinking-leds/">Pinball: Lotsa Blinking LEDs</a></td>
<td >Everyone needs a bunch of LEDs on their Pinball Machine</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/07/pinball-matrix-leds-part-1/">Pinball: Matrix LEDs (Part 1)</a></td>
<td >Saving PSoC pins by using a matrix scheme</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/08/pinball-matrix-leds-part-2/" target="_blank">Pinball: Matrix LEDs (Part 2)</a></td>
<td >Solving some problems with the matrix</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/09/pinball-matrix-leds-component/" target="_blank">Pinball: Matrix LEDs Component</a></td>
<td >How to turn the Matrix LED into a component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/10/pinball-a-switch-matrix/">Pinball: A Switch Matrix</a></td>
<td >Implementing a bunch of switches</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/12/pinball-switch-matrix-component-part-1/" target="_blank">Pinball: Switch Matrix Component (Part 1)</a></td>
<td >The switch matrix component implementation</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/13/pinball-switch-matrix-component-part-2/" target="_blank">Pinball: Switch Matrix Component (Part 2)</a></td>
<td >The firmware for matrix component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/14/pinball-switch-matrix-component-part-3/" target="_blank">Pinball: Switch Matrix Component (Part 3)</a></td>
<td >Test firmware for the matrix component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/20/pinball-the-music-player-part-1/" target="_blank">Pinball: The Music Player (Part 1)</a></td>
<td >The schematic and symbol for a Music Player component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/21/pinball-the-music-player-part-2/" target="_blank">Pinball: The Music Player (Part 2)</a></td>
<td >The Public API for the Music Player component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/22/pinball-the-music-player-part-3/" target="_blank">Pinball: The Music Player (Part 3)</a></td>
<td >The firmware to make the sweet sweet music</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/23/pinball-the-music-player-part-4/">Pinball: The Music Player (Part 4)</a></td>
<td >The test program for the music player</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/26/pinball-the-motors-hbridge/" target="_blank">Pinball: The Motors + HBridge</a></td>
<td >Using an Bridge to control DC Motors</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/27/pinball-the-eagle-schematic/" target="_blank">Pinball: The Eagle Schematic</a></td>
<td >All of the circuits into an Eagle schematic</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/29/pinball-the-printed-circuit-board-version-1-0/" target="_blank">Pinball: The Printed Circuit Board 1.0</a></td>
<td >The first Eagle PCB layout of the printed circuit board</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/30/pinball-the-pcb-version-1-0-fail/" target="_blank">Pinball: The PCB Version 1.0 Fail</a></td>
<td >Problems with the first version of the Eagle PCB layout</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/05/pinball-pcb-1-2-updates-using-eagle/" target="_blank">Pinball: PCB Layout 1.2 Updates using Eagle</a></td>
<td >Fixing the errors on the first two versions of the Eagle PCB</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/12/pinball-pcb-solder-reflow-osh-park-eagle/">Pinball: Assemble and Reflow the 1.2 PCB</a></td>
<td >Assembling the Eagle PCB</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/23/pinball-testing-the-eagle-pcb/" target="_blank">Pinball: Testing the Eagle PCB</a></td>
<td > Firmware to test the newly built Pinball printed circuit board</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/09/pinball-debugging-psoc-motor-driver/" target="_blank">Pinball: Debugging the Motor Driver</a></td>
<td > Fixing the motor driver PSoC project</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/13/hot-air-solder-reworking-the-accelerometer/" target="_blank">Pinball: Hot-Air Reworking the Accelerometer Solder</a></td>
<td >Using a Hot-Air Rework tool to reflow a QFN</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/16/pinball-debugging-lm317-power-supply-tale-getting-lucky/" target="_blank">Pinball: Debugging the LM317 Power Supply- A Tale of Getting Lucky</a></td>
<td >Debugging the LM317/LM117 power supply</td>
</tr>
</tbody></table></div></p></span></p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/pinball-pcb-1-2-updates-using-eagle/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Pinball: OLED Display</title>
		<link>https://iotexpert.com/pinball-oled-display/</link>
					<comments>https://iotexpert.com/pinball-oled-display/#respond</comments>
		
		<dc:creator><![CDATA[Alan Hawse]]></dc:creator>
		<pubDate>Mon, 26 Dec 2016 17:50:43 +0000</pubDate>
				<category><![CDATA[Eagle]]></category>
		<category><![CDATA[Pinball]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=2344</guid>

					<description><![CDATA[I screwed up the Pinball board design AGAIN!!!  It is so frustrating.  Ill write about the new design soon (and punish myself for the error.) As I worked on redoing the design I decided to put a footprint on the PCB for a small OLED LCD.   The display has an I2C interface, is about [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I screwed up the Pinball board design AGAIN!!!  It is so frustrating.  Ill write about the new design soon (and punish myself for the error.) As I worked on redoing the design I decided to put a footprint on the PCB for a small OLED LCD.   The display has an I2C interface, is about an inch wide and has 128&#215;64 pixels&#8230; But, best of all can be purchased on <a href="http://www.ebay.com/itm/White-0-96-inch-128X64-OLED-Display-Module-For-arduino-0-96-IIC-SPI-SSD1306-/222297606908?hash=item33c1f84afc:g:DPkAAOSw8w1X7idG" target="_blank">eBay from China for about $3.00</a>.  Here is a picture of the display with a PSoC4M driving it:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/12/IMG_3503.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/12/IMG_3503-e1482770486288.jpg" width="3024" height="4032" class="alignnone wp-image-2345 size-full" /></a></p>
<p>The display will go on the right side of the board.  Here is a rendering of the new board from the OSH Parks website:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/12/64d2f7acd81af523361182740421ae5c.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/12/64d2f7acd81af523361182740421ae5c.png" alt="" width="1466" height="831" class="alignnone size-full wp-image-2347" srcset="https://iotexpert.com/wp-content/uploads/2016/12/64d2f7acd81af523361182740421ae5c.png 1466w, https://iotexpert.com/wp-content/uploads/2016/12/64d2f7acd81af523361182740421ae5c-600x340.png 600w, https://iotexpert.com/wp-content/uploads/2016/12/64d2f7acd81af523361182740421ae5c-300x170.png 300w, https://iotexpert.com/wp-content/uploads/2016/12/64d2f7acd81af523361182740421ae5c-768x435.png 768w, https://iotexpert.com/wp-content/uploads/2016/12/64d2f7acd81af523361182740421ae5c-1024x580.png 1024w" sizes="auto, (max-width: 1466px) 100vw, 1466px" /></a></p>
<p>After I decided to put the footprint on the board I bought several displays from Amazon to try out, and to make sure that I knew how to make them work.  I immediately ran into some drama which caused me an evening of frustration.  If you look at the picture closely you can see that the power and ground pins are swapped:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/12/IMG_3504-2.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/12/IMG_3504-2.jpg" alt="" width="4032" height="3024" class="alignnone size-full wp-image-2348" /></a></p>
<p>After I realized that was going to be a potential problem I put in a set of 0 ohm resistors on the upper right hand part of the board so that I could swap power/ground and scl/sda connections.  Here is a snapshot of the schematic and layout:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-26-at-11.49.54-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-26-at-11.49.54-AM.png" alt="" width="332" height="532" class="alignnone size-full wp-image-2350" srcset="https://iotexpert.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-26-at-11.49.54-AM.png 332w, https://iotexpert.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-26-at-11.49.54-AM-187x300.png 187w" sizes="auto, (max-width: 332px) 100vw, 332px" /></a></p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-26-at-11.51.08-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-26-at-11.51.08-AM.png" alt="" width="991" height="557" class="alignnone size-full wp-image-2351" srcset="https://iotexpert.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-26-at-11.51.08-AM.png 991w, https://iotexpert.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-26-at-11.51.08-AM-600x337.png 600w, https://iotexpert.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-26-at-11.51.08-AM-300x169.png 300w, https://iotexpert.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-26-at-11.51.08-AM-768x432.png 768w" sizes="auto, (max-width: 991px) 100vw, 991px" /></a></p>
<p>This left me with what software to use to drive the display which I will address in the next post.</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/pinball-oled-display/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Eagle PCB Layout Guidelines + OSH Park</title>
		<link>https://iotexpert.com/eagle-pcb-layout-guidelines-osh-park/</link>
					<comments>https://iotexpert.com/eagle-pcb-layout-guidelines-osh-park/#comments</comments>
		
		<dc:creator><![CDATA[Alan Hawse]]></dc:creator>
		<pubDate>Wed, 16 Nov 2016 12:18:21 +0000</pubDate>
				<category><![CDATA[Eagle]]></category>
		<category><![CDATA[Pinball]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=1873</guid>

					<description><![CDATA[Summary of Eagle PCB Layout Guidelines I typically design my PCB&#8217;s in Eagle and have them manufactured at OSH Park.  Each new PCB layout feels like I am starting nearly from scratch because I only do about 1 or 2 boards per year.  Every time, as I go through the process, I promise myself that I [&#8230;]]]></description>
										<content:encoded><![CDATA[<h1>Summary of Eagle PCB Layout Guidelines</h1>
<p>I typically design my PCB&#8217;s in Eagle and have them manufactured at <a href="http://www.oshpark.com">OSH Park</a>.  Each new PCB layout feels like I am starting nearly from scratch because I only do about 1 or 2 boards per year.  Every time, as I go through the process, I promise myself that I am going to write down the list of things that I always need to relearn.  But, I never seem to get the list written down.  Today things change.  Here is my list:</p>
<ol>
<li>Make sure that you can actually purchase the components you put in your design</li>
<li>No Airwires</li>
<li>Vias tented (or not)</li>
<li>Ideally no more than 2 vias on a net</li>
<li>Power nets &gt; 40mil</li>
<li>Auto router setup</li>
<li>Fill on the ground plane</li>
<li>Ground fill around CapSense Widgets</li>
<li>Test points on key nets &#8211; at very least power and ground</li>
<li>Silkscreen font size</li>
<li>Silkscreen labels on key nets</li>
<li>Silkscreen key information onto the board</li>
<li>Put in power supply jumper</li>
<li>If there is I2C then put in a blank header to connect a mini-prog-3</li>
<li>Extend the QFN footprints enough to be able to rework them</li>
<li>Try not to route under QFNs</li>
<li>Try not to use QFN with 0.5mm pitch</li>
<li>Use the eye tool to compare every net in the schematic and layout</li>
<li>DRC</li>
<li>ERC</li>
<li>CAM Job</li>
<li>Don&#8217;t forget about the stencil</li>
</ol>
<h2>Make sure that you can actually purchase the components you put in your design</h2>
<p>I used a footprint I found on the internet assuming that there was good availability for it.  But, I ended up having to order some weird USB connectors from a salvage shop in Poland.  I guess that I felt lucky to have been able to find them at all.  Unfortunately, I did the whole board and sent it to the shop before I was sure that I could buy everything.  Always always check to make sure you can purchase the device you place on the board.</p>
<h2>No Airwires (seems like it would be obvious&#8230; but)</h2>
<p>Airwires show the connectivity that is drawn in the schematic.  Unfortunately they don&#8217;t conduct electricity.  Until a REAL connection is made you will have a yellow flight line connecting between the pins in your layout.  Before you tapeout the board you MUST MUST press the Ratsnest button and get the message &#8220;Ratsnest: Nothing to do!&#8221;</p>
<h2><a href="https://iotexpert.com/wp-content/uploads/2016/08/airwires.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/08/airwires.png" alt="Eagle PCB message when all connections are made i.e. no airwires exist" width="900" height="412" class="alignnone wp-image-1880 size-full" srcset="https://iotexpert.com/wp-content/uploads/2016/08/airwires.png 900w, https://iotexpert.com/wp-content/uploads/2016/08/airwires-600x275.png 600w, https://iotexpert.com/wp-content/uploads/2016/08/airwires-300x137.png 300w, https://iotexpert.com/wp-content/uploads/2016/08/airwires-768x352.png 768w" sizes="auto, (max-width: 900px) 100vw, 900px" /></a></h2>
<p>If you do this:</p>
<p><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/01/zoom-of-error.png" width="1572" height="1282" alt="An example of an air wire that will make you Eagle PCB not be connected." class="alignnone" /></p>
<p>Then you will need this:</p>
<p><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/01/IMG_2024.jpg" width="2448" height="3264" alt="An example in Eagle PCB of what happens if you leave an airwire unconnected" class="alignnone" /></p>
<h2>Vias tented (or not)</h2>
<p>A tented via or a plugged via is a connection between the top and bottom of the printed circuit board that is covered with solder mask.  In general there are probably enough vias on your board that if you don&#8217;t cover them you will not be able to see the silkscreen (either because it won&#8217;t print on copper or because the PCB vendor will trim it).  Here is a picture of one of the versions of Physics Lab where I forgot to tent the vias.  In the upper left where it says &#8220;Elkhorn Creek Engineering&#8221; you can see that the &#8220;l&#8221; in Elkhorn and the &#8220;g&#8221; in Engineering is partially missing where there is a via in the board.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/08/IMG_3064.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/08/IMG_3064-1024x768.jpg" alt="An example of an Eagle PCB with untented vias.  This board was made at OSHPark" width="1024" height="768" class="alignnone wp-image-1882 size-large" srcset="https://iotexpert.com/wp-content/uploads/2016/08/IMG_3064-1024x768.jpg 1024w, https://iotexpert.com/wp-content/uploads/2016/08/IMG_3064-300x225.jpg 300w, https://iotexpert.com/wp-content/uploads/2016/08/IMG_3064-768x576.jpg 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>In Eagle PCB, Vias (and Pads) are automatically covered with the &#8220;tStop&#8221; mask.  Here is a screen shot of a PCB that I am working on with just the &#8220;Pads&#8221;, &#8220;Vias&#8221; and &#8220;tStop&#8221; layers shown.  You can see the &#8220;big&#8221; holes which are Pads for through-hole components.  You can see that they have the diagonal white lines through them that represents the &#8220;tStop&#8221; mask.  tStop is the mask that prevents the solder mask from being applied.  In the picture you can also see the tStop on places where there are SMD pads.  And, you can see a bunch of the smaller vias which are not covered.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-8.05.00-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-8.05.00-AM.png" alt="An example of an Eagle PCB with via and stop mask turned on." width="610" height="440" class="alignnone wp-image-1884 size-full" srcset="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-8.05.00-AM.png 610w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-8.05.00-AM-600x433.png 600w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-8.05.00-AM-300x216.png 300w" sizes="auto, (max-width: 610px) 100vw, 610px" /></a></p>
<p>To tell Eagle PCB to turn off the tStop for vias you need to change the design rules on the &#8220;Tools-&gt;DRC-&gt;Masks&#8221; screen.  The limit parameter tells Eagle PCB to NOT create &#8220;tStop&#8221; for any via/pad that is less than 30mil in diameter.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/08/tentedvias.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/08/tentedvias.png" alt="Eagle PCB DRC rules screen where tented vias are specified." width="900" height="529" class="alignnone wp-image-1885 size-full" srcset="https://iotexpert.com/wp-content/uploads/2016/08/tentedvias.png 900w, https://iotexpert.com/wp-content/uploads/2016/08/tentedvias-600x353.png 600w, https://iotexpert.com/wp-content/uploads/2016/08/tentedvias-300x176.png 300w, https://iotexpert.com/wp-content/uploads/2016/08/tentedvias-768x451.png 768w" sizes="auto, (max-width: 900px) 100vw, 900px" /></a></p>
<h2>No more than 2 vias on a net</h2>
<p>I always strive to keep all of the nets on my two layer print circuit boards to have no more than 2 vias.   To look for this I click on the &#8220;eye&#8221; tool to probe each net of the layout, then I manually trace the net.  Here is a screen shot of a net that I try to avoid.  You can see that the net starts on the SMD pad in the lower right, then winds its way to the top left.  It goes through 4 vias.  Unfortunately it goes through one more via before reaching the SMD pad just below the upper left.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-8.39.13-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-8.39.13-AM.png" alt="An example of proving a network using the Eagle PCB eye tool to look for more than 2 vias on a net." width="551" height="491" class="alignnone wp-image-1887 size-full" srcset="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-8.39.13-AM.png 551w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-8.39.13-AM-300x267.png 300w" sizes="auto, (max-width: 551px) 100vw, 551px" /></a></p>
<h2>Power nets &gt; 40mil</h2>
<p>I like the power and ground nets to be routed in at least 40mil wires.  To do this, you first need to create another net class in the &#8220;Edit&#8211;&gt;Net classes&#8221; menu.  I always create a class called &#8220;power&#8221;.  Then I set the minimum width to 40mil.  If for some reason you want to have a minimum clearance or drill you can set this here as well.  If you leave it at 0,  Eagle PCB will use the default rules.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/08/netclass.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/08/netclass.png" alt="How to specify 40mil spacing on a power net in Eagle PCB." width="900" height="655" class="alignnone wp-image-1888 size-full" srcset="https://iotexpert.com/wp-content/uploads/2016/08/netclass.png 900w, https://iotexpert.com/wp-content/uploads/2016/08/netclass-600x437.png 600w, https://iotexpert.com/wp-content/uploads/2016/08/netclass-300x218.png 300w, https://iotexpert.com/wp-content/uploads/2016/08/netclass-768x559.png 768w" sizes="auto, (max-width: 900px) 100vw, 900px" /></a></p>
<p>After you have created the power net class, you then need to assign the correct nets to the net class.  You do this in the schematic by selecting the &#8220;I&#8221; tool, then clicking on the net.  Then you can select the &#8220;Net Class&#8221; for that net.  In this case I am editing the V50 net.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-8.52.58-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-8.52.58-AM.png" alt="How to attach a signal to a specific net class in Eagle PCB." width="588" height="517" class="alignnone wp-image-1889 size-full" srcset="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-8.52.58-AM.png 588w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-8.52.58-AM-300x264.png 300w" sizes="auto, (max-width: 588px) 100vw, 588px" /></a></p>
<h2>Auto Router Setup</h2>
<p>I am absolutely terrible at designing PCBs.  This frustrates me to no end.  One of the crutches that I like to use the the Eagle PCB Autorouter.  The only change that I currently make is to use the &#8220;*&#8221; option to let the router go whatever direction it thinks that it should.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.34.23-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.34.23-AM.png" alt="Configuring the Eagle PCB Auto Router." width="558" height="371" class="alignnone wp-image-1898 size-full" srcset="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.34.23-AM.png 558w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.34.23-AM-300x199.png 300w" sizes="auto, (max-width: 558px) 100vw, 558px" /></a></p>
<h2>Fill on the ground plane</h2>
<p>To create a ground plan you need to:</p>
<ul>
<li>Draw a &#8220;polygon&#8221; around your board in the &#8220;top and bottom&#8221; layers.</li>
<li>Attach those polygons to the correct net e.g. &#8220;gnd&#8221; by typing the &#8220;name&#8221; command and then clicking on the ground polygon</li>
</ul>
<p>When you press the &#8220;ratsnest&#8221; button Eagle will fill the ground plane.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.48.32-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.48.32-AM.png" alt="An example of the ground plan pour in Eagle PCB." width="309" height="332" class="alignnone wp-image-1902 size-full" srcset="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.48.32-AM.png 309w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.48.32-AM-279x300.png 279w" sizes="auto, (max-width: 309px) 100vw, 309px" /></a></p>
<p>If you want it to unpour it you can run &#8220;ripup @;&#8221;.  When the ground plane is not filled it will appear as a dotted line around the board:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.47.42-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.47.42-AM.png" alt="Eagle PCB ground plane pour example" width="301" height="285" class="alignnone wp-image-1901 size-full" srcset="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.47.42-AM.png 301w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.47.42-AM-300x284.png 300w" sizes="auto, (max-width: 301px) 100vw, 301px" /></a></p>
<p>To attach the top and the bottom ground planes together you need to put a via on the correct net.  To do this:</p>
<ul>
<li>Click on the &#8220;via&#8221;</li>
<li>Click where you want it to attach the top and bottom</li>
<li>Add to the the right net using the &#8220;name&#8221; command and then typing the signal name</li>
</ul>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.46.07-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.46.07-AM.png" alt="How to attach a polygon to the ground plan in Eagle PCB." width="423" height="512" class="alignnone wp-image-1900 size-full" srcset="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.46.07-AM.png 423w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.46.07-AM-248x300.png 248w" sizes="auto, (max-width: 423px) 100vw, 423px" /></a></p>
<h2>Ground Fill Around CapSense Widgets</h2>
<p>In order to get the best CapSense performance you want to have a &#8220;hatched&#8221; ground plane surrounding your widgets.  The methods for doing this are documented in the <a href="http://www.cypress.com/file/46081/download" target="_blank">CapSense Design Guideline Section 6.4.9 &#8220;Ground Plane&#8221;</a>.  Here is an idealized view of the back of the front and back of the board:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/11/Screen-Shot-2016-11-19-at-6.13.12-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/11/Screen-Shot-2016-11-19-at-6.13.12-AM.png" alt="PSoC CapSense ground plane" width="656" height="474" class="alignnone wp-image-2258 size-full" srcset="https://iotexpert.com/wp-content/uploads/2016/11/Screen-Shot-2016-11-19-at-6.13.12-AM.png 656w, https://iotexpert.com/wp-content/uploads/2016/11/Screen-Shot-2016-11-19-at-6.13.12-AM-600x434.png 600w, https://iotexpert.com/wp-content/uploads/2016/11/Screen-Shot-2016-11-19-at-6.13.12-AM-300x217.png 300w" sizes="auto, (max-width: 656px) 100vw, 656px" /></a></p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/11/Screen-Shot-2016-11-19-at-6.11.02-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/11/Screen-Shot-2016-11-19-at-6.11.02-AM.png" alt="PSoC CapSense ground plane example" width="728" height="507" class="alignnone wp-image-2257 size-full" srcset="https://iotexpert.com/wp-content/uploads/2016/11/Screen-Shot-2016-11-19-at-6.11.02-AM.png 728w, https://iotexpert.com/wp-content/uploads/2016/11/Screen-Shot-2016-11-19-at-6.11.02-AM-600x418.png 600w, https://iotexpert.com/wp-content/uploads/2016/11/Screen-Shot-2016-11-19-at-6.11.02-AM-300x209.png 300w" sizes="auto, (max-width: 728px) 100vw, 728px" /></a></p>
<p>The guidelines go on to recommend that you use 25% (7 width 45 spacing) coverage on the top and 17% (7 width 70 spacing) on the back.  To do this in Eagle PCB you draw a normal polygon on the top and bottom.  Then you use the name command to give it the &#8220;ground&#8221; name.  Then you click the &#8220;i&#8221; to set the parameters.</p>
<ul>
<li>Set the width to 7 (mil)</li>
<li>Set the polygon pour to &#8220;hatch&#8221;</li>
<li>Set the Spacing to 52 (mil).  The only trick is that the Eagle PCB spacing isn&#8217;t actually the spacing between the lines but the Pitch between the hatched cells.  So to achieve 45 mil spacing with a 7mil line you need 45+7=52 &#8220;spacing&#8221;</li>
</ul>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/11/Screen-Shot-2016-11-19-at-6.23.49-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/11/Screen-Shot-2016-11-19-at-6.23.49-AM.png" alt="Specifying the ground plane pour for a PSoC Capsense in Eagle PCB" width="827" height="893" class="alignnone wp-image-2261 size-full" srcset="https://iotexpert.com/wp-content/uploads/2016/11/Screen-Shot-2016-11-19-at-6.23.49-AM.png 827w, https://iotexpert.com/wp-content/uploads/2016/11/Screen-Shot-2016-11-19-at-6.23.49-AM-600x648.png 600w, https://iotexpert.com/wp-content/uploads/2016/11/Screen-Shot-2016-11-19-at-6.23.49-AM-278x300.png 278w, https://iotexpert.com/wp-content/uploads/2016/11/Screen-Shot-2016-11-19-at-6.23.49-AM-768x829.png 768w" sizes="auto, (max-width: 827px) 100vw, 827px" /></a></p>
<h2>Test points on key nets &#8211; at very least power and ground</h2>
<p>It is a serious PITA to debug a board if there is no place to attach test leads.  I like to use a looped wire that you can install onto the board through a PAD.  Here is a red one that I use on power nets that I bought from <a href="http://www.digikey.com/product-search/en?keywords=36-5000-nd" target="_blank">digikey.com</a></p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/01/5000_sml.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/01/5000_sml.jpg" alt="PCB Probe Point" width="200" height="200" class="alignnone wp-image-398 size-full" srcset="https://iotexpert.com/wp-content/uploads/2016/01/5000_sml.jpg 200w, https://iotexpert.com/wp-content/uploads/2016/01/5000_sml-100x100.jpg 100w, https://iotexpert.com/wp-content/uploads/2016/01/5000_sml-150x150.jpg 150w" sizes="auto, (max-width: 200px) 100vw, 200px" /></a></p>
<h2>Silkscreen Font Size (don&#8217;t go less than 30mil@15%)</h2>
<p>I believe that the best practice for your silkscreen fonts is to first tell Eagle PCB to use &#8220;Always vector font&#8221; on the &#8220;Options&#8211;&gt;User Interface&#8221; menu.  This will make what you see on the board much closer to what you see on the screen.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.05.07-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.05.07-AM.png" alt="Eagle PCB Vector Font" width="655" height="478" class="alignnone wp-image-1891 size-full" srcset="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.05.07-AM.png 655w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.05.07-AM-600x438.png 600w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.05.07-AM-300x219.png 300w" sizes="auto, (max-width: 655px) 100vw, 655px" /></a></p>
<p>There are two issues with font size.</p>
<ul>
<li>First, what can you see (Im 48&#8230; so my fine vision is going away) so I think 30mil is the absolute minimum.  40mil or 50mil is even better.</li>
<li>Second, what your PCB design house can print (about 5mil at OSH Park)</li>
</ul>
<p>I am having my current PCB made at <a href="http://www.oshpark.com">www.oshpark.com</a>.  I could not find their silkscreen spec on their website&#8230; but an OSH Park Person &#8220;tweeted&#8221; that they can print 5mil silkscreen.</p>
<p>Given all of that.  Your best bet is to use a &#8220;vector font&#8221;.  When you select a vector font, you specify how tall the characters are, and how thick the lines are as a % of the height.  Here is a screenshot of my &#8220;SDAT&#8221; label.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.07.16-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.07.16-AM.png" alt="Creating a silkscreen in Eagle PCB" width="395" height="632" class="alignnone wp-image-1892 size-full" srcset="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.07.16-AM.png 395w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.07.16-AM-188x300.png 188w" sizes="auto, (max-width: 395px) 100vw, 395px" /></a></p>
<p>I made this table of what I think is a safe range:</p>
<h2><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-6.05.04-AM-1024x239.png" alt="Eagle PCB Font Size Guidelines" width="1024" height="239" class="alignnone wp-image-1878 size-large" srcset="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-6.05.04-AM-1024x239.png 1024w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-6.05.04-AM-600x140.png 600w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-6.05.04-AM-300x70.png 300w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-6.05.04-AM-768x179.png 768w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-6.05.04-AM.png 1834w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></h2>
<p>On the the <a href="http://lukemiller.org/index.php/2015/07/pcb-silkscreen-sizes/" target="_blank">lukemiller.org blog</a> I found a picture of an OSH park board with some different vector combinations:</p>
<p><img loading="lazy" decoding="async" src="http://lukemiller.org/wp-content/uploads/2015/07/Oshpark_printing_sizes_20150609_version_labeled.jpg" width="1481" height="1386" alt="Example PCB Font Sizes" class="alignnone" /></p>
<p>On the <a href="http://www.justgeek.de/simple-silkscreen-reference-board/" target="_blank">justgeek.de blog</a> I found another board:</p>
<h2><img loading="lazy" decoding="async" src="http://www.justgeek.de/wp-content/uploads/2013/04/IMG_8514.jpg" width="1200" height="800" alt="Example PCB Font Sizes" class="alignnone" /></h2>
<h2>Silkscreen on key nets</h2>
<p>You should make sure and label every pin that you would need to interact with or debug.  For example, the board below has a place to plug in a miniprog-3 in 5-pin mode:  The connection is directional so labeling the pins is key: [Note: A friend of mine noticed that I labeled the MiniProg-3 connection INCORRECTLY!!!! notice that there are two V50 (when in reality the inboard one is supposed to be ground]</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.25.26-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.25.26-AM.png" alt="Example of an error in an Eagle PCB Silkscreen" width="316" height="198" class="alignnone wp-image-1895 size-full" srcset="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.25.26-AM.png 316w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.25.26-AM-300x188.png 300w" sizes="auto, (max-width: 316px) 100vw, 316px" /></a></p>
<p>Don&#8217;t forget about the back of the board.  If you don&#8217;t put labels on the back, you will endup trying to figure out what the holes are (like the ones in the lower right) by flipping the board back and forth.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.42.32-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.42.32-AM.png" alt="Example of Eagle PCB Silkscreen" width="296" height="405" class="alignnone wp-image-1899 size-full" srcset="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.42.32-AM.png 296w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.42.32-AM-219x300.png 219w" sizes="auto, (max-width: 296px) 100vw, 296px" /></a></p>
<h2>Silkscreen key information onto the board</h2>
<p>You should definitely &#8220;comment&#8221; your board on the silkscreen with at very least:</p>
<ul>
<li>Name of the board</li>
<li>Version number of the board</li>
<li>Name of the maker e.g. www.iotexpert.com</li>
</ul>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.27.03-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.27.03-AM-e1472390894784.png" alt="Key information on Eagle PCB Silkscreen" width="791" height="237" class="alignnone wp-image-1896 size-full" srcset="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.27.03-AM-e1472390894784.png 791w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.27.03-AM-e1472390894784-600x180.png 600w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.27.03-AM-e1472390894784-300x90.png 300w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-9.27.03-AM-e1472390894784-768x230.png 768w" sizes="auto, (max-width: 791px) 100vw, 791px" /></a></p>
<h2>Put on Power Jumper</h2>
<p>You should also put in a 2x100mil spaced jumpers with a 0 ohm resistor shorting them in the path of the power so that you can measure the power supply current.</p>
<h2>If there is I2C then put in a blank header to connect a mini-prog-3</h2>
<p>If you have an I2C bus in your design, and you have room on the board, you should provide a place to plug in the 5-pin mini-prog3 to help you debug.  This will let you interact with chips on the bus without having completed the firmware for the central MCU.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/11/IMG_3551.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/11/IMG_3551.jpg" alt="Cypress Miniprog-3" width="4032" height="3024" class="alignnone wp-image-2508 size-full" /></a></p>
<h2>Extend the QFN footprints enough to be able to rework them</h2>
<p>If you extend the edge of a QFN pad by 0.3mm past the edge of the chip, you will have some chance to be able to see that the original reflow worked (or didn&#8217;t).  In addition you will give yourself a small chance to be able to rework it with a soldering iron.  For example in the picture below you can see the pin one in from the left has no solder on it.  I was able to successfully rework this pin with a soldering iron.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-2.09-PM.jpg"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-2.09-PM.jpg" alt="Eagle PCB QFN Footprint" width="1280" height="852" class="alignnone wp-image-2458 size-full" srcset="https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-2.09-PM.jpg 1280w, https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-2.09-PM-600x399.jpg 600w, https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-2.09-PM-300x200.jpg 300w, https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-2.09-PM-768x511.jpg 768w, https://iotexpert.com/wp-content/uploads/2017/01/Photo-on-1-2-17-at-2.09-PM-1024x682.jpg 1024w" sizes="auto, (max-width: 1280px) 100vw, 1280px" /></a></p>
<h2>Try not to route under QFNs</h2>
<p>If you have all solder mask under your QFNs it will be much easier to do the original reflow as it will push solder out from under the chip.  On tiny pitch QFNs if you have routing you may end up with a messy blob of solder.  Here is an example of what not to do.</p>
<p><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/11/Screen-Shot-2017-01-04-at-7.11.38-AM.png" alt="Example Eagle PCB QFN Footprint" width="1188" height="1091" class="alignnone wp-image-2509 size-full" srcset="https://iotexpert.com/wp-content/uploads/2016/11/Screen-Shot-2017-01-04-at-7.11.38-AM.png 1188w, https://iotexpert.com/wp-content/uploads/2016/11/Screen-Shot-2017-01-04-at-7.11.38-AM-600x551.png 600w, https://iotexpert.com/wp-content/uploads/2016/11/Screen-Shot-2017-01-04-at-7.11.38-AM-300x276.png 300w, https://iotexpert.com/wp-content/uploads/2016/11/Screen-Shot-2017-01-04-at-7.11.38-AM-768x705.png 768w, https://iotexpert.com/wp-content/uploads/2016/11/Screen-Shot-2017-01-04-at-7.11.38-AM-1024x940.png 1024w" sizes="auto, (max-width: 1188px) 100vw, 1188px" /></p>
<h2>Try not to use QFN with 0.5mm pitch</h2>
<p>Try to use 0.65mm pitch QFNs as they are much easier to reflow.  If you use 0.5mm pitch QFNs you are going to struggle to get them correct.  If you use a pitch less than 0.5mm then good luck to you.</p>
<h2>Use the eye tool to compare the schematic and layout</h2>
<p>I always open up the schematic and layout in side by side windows.  Then I click on each device in the schematic and look at the results in the layout.  In the picture below I clicked on &#8220;SWCOL2&#8221;.  This is called cross probing.  You should look at each net one by one to make sure that nothing funky happened.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-10.01.32-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-10.01.32-AM-1024x705.png" alt="Eagle PCB Eye Tool for net cross probing" width="1024" height="705" class="alignnone wp-image-1904 size-large" srcset="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-10.01.32-AM-1024x705.png 1024w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-10.01.32-AM-600x413.png 600w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-10.01.32-AM-300x206.png 300w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-10.01.32-AM-768x529.png 768w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-10.01.32-AM.png 1081w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<h2>DRC</h2>
<p>The Design Rule Checker (DRC) in Eagle PCB works pretty well.  USE IT.  You can get a rules file from OSH Park (for their two layer process) from their <a href="http://docs.oshpark.com/design-tools/eagle/design-rules-files/" target="_blank">website</a></p>
<p>You can also use the <a href="http://www.freedfm.com" target="_blank">freedfm.com</a> website to check your files.</p>
<p>Two things that you should be aware of when you run your final DRC.</p>
<ol>
<li>If you setup a special rule for the power net-clasesses that is greater than the minimum rule you may want to turn it back to the minimum when you run the final DRC.  For example, when I setup the ground layer as a power layer, I set the minimum rule to be 40.  Before I run the final DRC I set it back to 6.</li>
<li>For any polygon that is setup as a pour, you will need to set the minimum width of that polygon to be the same as the minimum for the layer.  For example: the minimum top metal width at OSH park is 6mil.  This means you need to set the minimum width of the ground pour to be 6mil.  Here is a screenshot of the corner of the board:</li>
</ol>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/11/Screen-Shot-2016-11-17-at-7.32.08-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/11/Screen-Shot-2016-11-17-at-7.32.08-AM.png" alt="Eagle PCB DRC" width="598" height="977" class="alignnone wp-image-2254 size-full" srcset="https://iotexpert.com/wp-content/uploads/2016/11/Screen-Shot-2016-11-17-at-7.32.08-AM.png 598w, https://iotexpert.com/wp-content/uploads/2016/11/Screen-Shot-2016-11-17-at-7.32.08-AM-184x300.png 184w" sizes="auto, (max-width: 598px) 100vw, 598px" /></a></p>
<h2>ERC</h2>
<p>The Eagle Electrical Rule Checker (ERC) typically catches some problems.  By far my biggest problem with the schematics in Eagle is that I occasionally make two wires &#8220;connect&#8221; by touching, but Eagle doesn&#8217;t think that they are connected.  The ERC seems to catch this problem pretty well.  You should at least run it and go through the errors to make sure that they are false.</p>
<h2>CAM Job</h2>
<p>In order for OSH Park to make your PCB you need to make Gerber files.  Actually, OSH Park can do that for you, but I recommend you do it for yourself so that you are sure what is going to get made.  Gerber files are the lingua franca of the PCB business.  One file contains one layer for manufacturing, so you will need one file for each layer.</p>
<p>To do maker the Gerbers you need to run the &#8220;CAM Processor&#8221; which can be found on the tools menu.  I reccomend that you start with a preexisting CAM job (like the one that you can <a href="http://docs.oshpark.com/design-tools/eagle/cam-job/" target="_blank">download</a> from OSH Park)</p>
<p>The CAM job will have one &#8220;tab&#8221; for each layer that it creates.  In the picture below you can see that I am making the Top Silkscreen.  That layer is created by combining &#8220;tPlace&#8221; and &#8220;tNames&#8221; onto one layer and then writing it to the file &#8220;&#8230;/&#8230;/&#8230;/gerber/.GTO&#8221; in the GERBER_RS274X format.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-10.23.16-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-10.23.16-AM.png" alt="Eagle PCB CAM Job Configuration" width="1006" height="765" class="alignnone wp-image-1907 size-full" srcset="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-10.23.16-AM.png 1006w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-10.23.16-AM-600x456.png 600w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-10.23.16-AM-300x228.png 300w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-10.23.16-AM-768x584.png 768w" sizes="auto, (max-width: 1006px) 100vw, 1006px" /></a></p>
<p>The file naming convention is:</p>
<div class="table-responsive"><table  style="width:95%; "  class="easy-table easy-table-default " border="1">
<thead>
<tr><th >File Extension</th>
<th >Description</th>
</tr>
</thead>
<tbody>
<tr><td >.GTO</td>
<td >Top silkscreen</td>
</tr>

<tr><td >.GTL</td>
<td >Top copper</td>
</tr>

<tr><td >.GBL</td>
<td >Bottom copper</td>
</tr>

<tr><td >.GTP</td>
<td >Top Paste (aka the solder paste layer.. you make the solder stencil from this layer)</td>
</tr>

<tr><td >.GBO</td>
<td >Bottom silkscreen</td>
</tr>

<tr><td >.GTS</td>
<td >Top Solder Mask</td>
</tr>

<tr><td >.GBS</td>
<td >Bottom Solder Mask</td>
</tr>

<tr><td >.TXT</td>
<td >Drill file &#8211; used for CNC mill that drills the holes in your board.. this is not a Gerber file</td>
</tr>
</tbody></table></div>
<p>After you have the Gerber files you can look at them in <a href="http://gerbv.geda-project.org">gerb</a>v which is an open source tool.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-10.55.23-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-10.55.23-AM.png" alt="Gerbv Gerber Viewer" width="923" height="694" class="alignnone wp-image-1911 size-full" srcset="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-10.55.23-AM.png 923w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-10.55.23-AM-600x451.png 600w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-10.55.23-AM-300x226.png 300w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-28-at-10.55.23-AM-768x577.png 768w" sizes="auto, (max-width: 923px) 100vw, 923px" /></a></p>
<h2>Stencils</h2>
<p>Lastly, don&#8217;t forget your stencil.  I buy mine from <a href="http://www.oshstencils.com" target="_blank">www.oshstencils.com</a> which is linked to www.oshpark.com, so you can just select your solder mask from the project that you already uploaded.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/eagle-pcb-layout-guidelines-osh-park/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Pinball: The PCB Version 1.0 &#8211; Fail</title>
		<link>https://iotexpert.com/pinball-the-pcb-version-1-0-fail/</link>
					<comments>https://iotexpert.com/pinball-the-pcb-version-1-0-fail/#respond</comments>
		
		<dc:creator><![CDATA[Alan Hawse]]></dc:creator>
		<pubDate>Fri, 30 Sep 2016 10:43:59 +0000</pubDate>
				<category><![CDATA[Eagle]]></category>
		<category><![CDATA[Pinball]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=2065</guid>

					<description><![CDATA[I got the boards back and assembled several of them&#8230; and they do not work.  It has been a really really frustrating few days trying to figure out what was going on.  I started with the assumption that I had a soldering problem so I soldered it and resoldered it about 10 times.   I used [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I got the boards back and assembled several of them&#8230; and they do not work.  It has been a really really frustrating few days trying to figure out what was going on.  I started with the assumption that I had a soldering problem so I soldered it and resoldered it about 10 times.   I used the soldering iron, I used hot-air, I reflow&#8217;ed the board, and I did 3 different complete board re-dos.  None worked.  I really wanted this to work before Maker Faire.</p>
<p>Finally I gave up and sent my board to our kit team in India.  This is not such a simple thing to do as you need to have commercial invoices for all of the stuff that I sent them&#8230; after getting it rolling and patiently waiting for three days for Fed-Ex to get it through all of the customs hoops etc. I get this email from the Kit Manager:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/09/email.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/email-881x1024.png" alt="email" width="881" height="1024" class="alignnone size-large wp-image-2081" srcset="https://iotexpert.com/wp-content/uploads/2016/09/email-881x1024.png 881w, https://iotexpert.com/wp-content/uploads/2016/09/email-600x697.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/email-258x300.png 258w, https://iotexpert.com/wp-content/uploads/2016/09/email-768x893.png 768w, https://iotexpert.com/wp-content/uploads/2016/09/email.png 968w" sizes="auto, (max-width: 881px) 100vw, 881px" /></a></p>
<p>Damn damn damn&#8230; I know that I double checked the package.  That is such an amateur mistake&#8230; alway always always check your footprints.  But Ronak is right, here is a screen shot of the Eagle Layout which I clicked on Pin 2. (I rotate the image to make it line up with the data sheet)<a href="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.16.22-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.16.22-AM-e1474720053545.png" alt="screen-shot-2016-09-24-at-8-16-22-am" width="894" height="808" class="alignnone wp-image-2071 size-full" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.16.22-AM-e1474720053545.png 894w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.16.22-AM-e1474720053545-600x542.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.16.22-AM-e1474720053545-300x271.png 300w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.16.22-AM-e1474720053545-768x694.png 768w" sizes="auto, (max-width: 894px) 100vw, 894px" /></a></p>
<p>And it matches the the picture from the data sheet for the module&#8230; However&#8230; notice that it says &#8220;Bottom View&#8221; which means I flipped it.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.13.47-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.14.43-AM-1024x734.png" alt="screen-shot-2016-09-24-at-8-14-43-am" width="1024" height="734" class="alignnone size-large wp-image-2068" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.14.43-AM-1024x734.png 1024w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.14.43-AM-600x430.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.14.43-AM-300x215.png 300w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.14.43-AM-768x551.png 768w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.14.43-AM.png 1170w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Here is a screenshot of the package in the eagle library&#8230; sure enough. It is flipped.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.13.47-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.24.47-AM-901x1024.png" alt="screen-shot-2016-09-24-at-8-24-47-am" width="901" height="1024" class="alignnone size-large wp-image-2072" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.24.47-AM-901x1024.png 901w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.24.47-AM-600x682.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.24.47-AM-264x300.png 264w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.24.47-AM-768x873.png 768w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.24.47-AM.png 928w" sizes="auto, (max-width: 901px) 100vw, 901px" /></a></p>
<p>More evidence, here is the top view:</p>
<p>&nbsp;</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.13.47-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.13.47-AM.png" alt="screen-shot-2016-09-24-at-8-13-47-am" width="703" height="558" class="alignnone size-large wp-image-2069" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.13.47-AM.png 703w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.13.47-AM-600x476.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.13.47-AM-300x238.png 300w" sizes="auto, (max-width: 703px) 100vw, 703px" /></a></p>
<p>So, I need to fix the package and then re-do the layout.  I start this process by making a new branch in git.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.41.00-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.41.00-AM.png" alt="screen-shot-2016-09-24-at-8-41-00-am" width="513" height="62" class="alignnone size-full wp-image-2073" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.41.00-AM.png 513w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.41.00-AM-300x36.png 300w" sizes="auto, (max-width: 513px) 100vw, 513px" /></a></p>
<p>Then open the library and the package:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.40.10-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.40.10-AM.png" alt="screen-shot-2016-09-24-at-8-40-10-am" width="687" height="958" class="alignnone size-full wp-image-2074" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.40.10-AM.png 687w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.40.10-AM-600x837.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.40.10-AM-215x300.png 215w" sizes="auto, (max-width: 687px) 100vw, 687px" /></a></p>
<p>To make things easier I turn off all of the layers except for Top.  This allows me to easily click on each pad.  One thing that is a bit of a PITA is that you have to change of all of the pads to something else before you can change each one to what you want e.g. you can&#8217;t rename the pad currently named 1 to be 32 because there is already a 32.  So, what I do is rename each pad to the new name with an A on the end (see the image below).  Once that is done I go back around and remove the &#8220;A&#8221;s.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.51.18-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.51.18-AM.png" alt="screen-shot-2016-09-24-at-8-51-18-am" width="582" height="536" class="alignnone size-full wp-image-2075" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.51.18-AM.png 582w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.51.18-AM-300x276.png 300w" sizes="auto, (max-width: 582px) 100vw, 582px" /></a></p>
<p>Once my package is fixed, I update the library that I am using in my layout.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.59.55-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.59.55-AM.png" alt="screen-shot-2016-09-24-at-8-59-55-am" width="573" height="262" class="alignnone size-large wp-image-2077" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.59.55-AM.png 573w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.59.55-AM-300x137.png 300w" sizes="auto, (max-width: 573px) 100vw, 573px" /></a></p>
<p>Eagle immediately tells me that I have a problem&#8230; which is true, so true.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.57.45-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-9.00.20-AM.png" alt="screen-shot-2016-09-24-at-9-00-20-am" width="412" height="163" class="alignnone size-full wp-image-2076" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-9.00.20-AM.png 412w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-9.00.20-AM-300x119.png 300w" sizes="auto, (max-width: 412px) 100vw, 412px" /></a></p>
<p>Then I ripup all of the nets, which is so sad.  The problem is that all of the things I had on the left are now on the right and visa-versa so I need to think about the whole placement.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.57.45-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.57.45-AM-1024x862.png" alt="screen-shot-2016-09-24-at-8-57-45-am" width="1024" height="862" class="alignnone size-large wp-image-2078" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.57.45-AM-1024x862.png 1024w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.57.45-AM-600x505.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.57.45-AM-300x253.png 300w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.57.45-AM-768x647.png 768w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-8.57.45-AM.png 1147w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Once I have ripped up all of the nets, I then cross probe all of the nets (In this case M1R which is also pin 31) to make sure that I have the connections in the right place.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-9.04.12-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-9.04.12-AM-1024x451.png" alt="screen-shot-2016-09-24-at-9-04-12-am" width="1024" height="451" class="alignnone size-large wp-image-2079" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-9.04.12-AM-1024x451.png 1024w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-9.04.12-AM-600x264.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-9.04.12-AM-300x132.png 300w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-9.04.12-AM-768x339.png 768w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-24-at-9.04.12-AM.png 1536w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>OK.  Looks good.  Not commit the changes and put them back to the github with a change request.</p>
<p>In the next post Ill talk about the new layout.</p>
<p><span><p>You can find all of the source code and files at the <a href="https://github.com/iotexpert/Pinball" target="_blank">IOTEXPERT</a> site on github.</p>
<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/09/05/pinball-newtons-attic-pinball/">Pinball: Newton's Attic Pinball</a></td>
<td >An introduction to the project and the goals</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/06/pinball-lotsa-blinking-leds/">Pinball: Lotsa Blinking LEDs</a></td>
<td >Everyone needs a bunch of LEDs on their Pinball Machine</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/07/pinball-matrix-leds-part-1/">Pinball: Matrix LEDs (Part 1)</a></td>
<td >Saving PSoC pins by using a matrix scheme</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/08/pinball-matrix-leds-part-2/" target="_blank">Pinball: Matrix LEDs (Part 2)</a></td>
<td >Solving some problems with the matrix</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/09/pinball-matrix-leds-component/" target="_blank">Pinball: Matrix LEDs Component</a></td>
<td >How to turn the Matrix LED into a component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/10/pinball-a-switch-matrix/">Pinball: A Switch Matrix</a></td>
<td >Implementing a bunch of switches</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/12/pinball-switch-matrix-component-part-1/" target="_blank">Pinball: Switch Matrix Component (Part 1)</a></td>
<td >The switch matrix component implementation</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/13/pinball-switch-matrix-component-part-2/" target="_blank">Pinball: Switch Matrix Component (Part 2)</a></td>
<td >The firmware for matrix component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/14/pinball-switch-matrix-component-part-3/" target="_blank">Pinball: Switch Matrix Component (Part 3)</a></td>
<td >Test firmware for the matrix component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/20/pinball-the-music-player-part-1/" target="_blank">Pinball: The Music Player (Part 1)</a></td>
<td >The schematic and symbol for a Music Player component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/21/pinball-the-music-player-part-2/" target="_blank">Pinball: The Music Player (Part 2)</a></td>
<td >The Public API for the Music Player component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/22/pinball-the-music-player-part-3/" target="_blank">Pinball: The Music Player (Part 3)</a></td>
<td >The firmware to make the sweet sweet music</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/23/pinball-the-music-player-part-4/">Pinball: The Music Player (Part 4)</a></td>
<td >The test program for the music player</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/26/pinball-the-motors-hbridge/" target="_blank">Pinball: The Motors + HBridge</a></td>
<td >Using an Bridge to control DC Motors</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/27/pinball-the-eagle-schematic/" target="_blank">Pinball: The Eagle Schematic</a></td>
<td >All of the circuits into an Eagle schematic</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/29/pinball-the-printed-circuit-board-version-1-0/" target="_blank">Pinball: The Printed Circuit Board 1.0</a></td>
<td >The first Eagle PCB layout of the printed circuit board</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/30/pinball-the-pcb-version-1-0-fail/" target="_blank">Pinball: The PCB Version 1.0 Fail</a></td>
<td >Problems with the first version of the Eagle PCB layout</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/05/pinball-pcb-1-2-updates-using-eagle/" target="_blank">Pinball: PCB Layout 1.2 Updates using Eagle</a></td>
<td >Fixing the errors on the first two versions of the Eagle PCB</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/12/pinball-pcb-solder-reflow-osh-park-eagle/">Pinball: Assemble and Reflow the 1.2 PCB</a></td>
<td >Assembling the Eagle PCB</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/23/pinball-testing-the-eagle-pcb/" target="_blank">Pinball: Testing the Eagle PCB</a></td>
<td > Firmware to test the newly built Pinball printed circuit board</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/09/pinball-debugging-psoc-motor-driver/" target="_blank">Pinball: Debugging the Motor Driver</a></td>
<td > Fixing the motor driver PSoC project</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/13/hot-air-solder-reworking-the-accelerometer/" target="_blank">Pinball: Hot-Air Reworking the Accelerometer Solder</a></td>
<td >Using a Hot-Air Rework tool to reflow a QFN</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/16/pinball-debugging-lm317-power-supply-tale-getting-lucky/" target="_blank">Pinball: Debugging the LM317 Power Supply- A Tale of Getting Lucky</a></td>
<td >Debugging the LM317/LM117 power supply</td>
</tr>
</tbody></table></div></p></span></p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/pinball-the-pcb-version-1-0-fail/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Pinball: The Printed Circuit Board Version 1.0</title>
		<link>https://iotexpert.com/pinball-the-printed-circuit-board-version-1-0/</link>
					<comments>https://iotexpert.com/pinball-the-printed-circuit-board-version-1-0/#respond</comments>
		
		<dc:creator><![CDATA[Alan Hawse]]></dc:creator>
		<pubDate>Thu, 29 Sep 2016 10:48:09 +0000</pubDate>
				<category><![CDATA[Eagle]]></category>
		<category><![CDATA[Pinball]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=1920</guid>

					<description><![CDATA[I am supposed to be good at this stuff.  What is this stuff?  Simple, everything engineering.  Unfortunately, I suck at PCB layout.  This is something that I am loath to admit because it is so frustrating. There it is.  But I need a PCB to make this work, so here we go again.  What also [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I am supposed to be good at this stuff.  What is this stuff?  Simple, everything engineering.  Unfortunately, I suck at PCB layout.  This is something that I am loath to admit because it is so frustrating. There it is.  But I need a PCB to make this work, so here we go again.  What also sucks is that I entitled this post &#8220;Pinball: The Printed Circuit Board Version 1.0&#8221; because I know that it is going to take multiple versions.  I don&#8217;t know what the exact cause is going to be this time.  But it will be something.  Enough whining.  Onto the task at hand.</p>
<p>When you start from an empty board Eagle gives you the tantalizing picture of a blank board with the components you need laid out neatly.  All you need to do is move them onto the tabla rosa.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-29-at-5.21.40-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-29-at-5.21.40-AM.png" alt="Screen Shot 2016-08-29 at 5.21.40 AM" width="881" height="729" class="alignnone size-full wp-image-1923" srcset="https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-29-at-5.21.40-AM.png 881w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-29-at-5.21.40-AM-600x496.png 600w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-29-at-5.21.40-AM-300x248.png 300w, https://iotexpert.com/wp-content/uploads/2016/08/Screen-Shot-2016-08-29-at-5.21.40-AM-768x635.png 768w" sizes="auto, (max-width: 881px) 100vw, 881px" /></a></p>
<p>Initially there are several constraints that I am trying to satisfy.</p>
<ol>
<li>I want the board to cost &lt;$5 so it needs to be &lt;5 Sq. Inches</li>
<li>The Pinball machine has space on the front for something roughly the shape of a deck of cards (2.5&#8243; x 3.5&#8243;)</li>
<li>The power connector needs to be at the bottom</li>
<li>The user interface needs to be at the right (buzzers, capsense buttons) because Billy is going to cover the left side with some acrylic.</li>
</ol>
<p>We had originally thought about making a 3-D printed box for the design, but decided that it would be cool to be able to see the board.  It also saves several dollars in cost to get rid of the box.</p>
<p>All right, I suppose that it is time to get to it.  First I move all of the component from &#8220;off the board&#8221; onto the board.  They all need to appear inside of the dimension layer.  If you look at the pinball machine I want all of the wire to come from the top and then go down into the machine.  So I place the holes for the LEDs and the Switches at the top of the board.  I want the user interface to be on the right side of the board (since most of the world is right handed&#8230; sorry about the left handed people).  So, I place the capsense buttons and the reset button on the right side of the board.  The BLE Module needs to have the space under the antenna without a ground plane and without signals, so I decide to put it at the bottom of the board.  I decide that the I2C port for the LCD will go on the left side of the board as that will make the connection to the LCD on the left side of the pinball machine easier.  Finally I put the accelerometer and all of the stuff that it takes to run it on left left side as well.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.07.51-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.07.51-AM-1024x685.png" alt="screen-shot-2016-09-25-at-10-07-51-am" width="1024" height="685" class="alignnone size-large wp-image-2106" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.07.51-AM-1024x685.png 1024w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.07.51-AM-600x401.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.07.51-AM-300x201.png 300w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.07.51-AM-768x514.png 768w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.07.51-AM.png 1568w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Once the placement is all done, it is time to route the signals.  I do this through a combination of the autorouter and manual routes.  After I get all of the routes done, I place GND via(s) all over the board to connect the top and bottom ground pours.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.06.25-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.06.25-AM-1024x685.png" alt="screen-shot-2016-09-25-at-10-06-25-am" width="1024" height="685" class="alignnone size-large wp-image-2105" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.06.25-AM-1024x685.png 1024w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.06.25-AM-600x401.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.06.25-AM-300x201.png 300w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.06.25-AM-768x514.png 768w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.06.25-AM.png 1550w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>When I click the rats nest button the pours happen and I can see that there are no unrouted nets.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.05.40-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.05.40-AM-1024x684.png" alt="screen-shot-2016-09-25-at-10-05-40-am" width="1024" height="684" class="alignnone size-large wp-image-2104" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.05.40-AM-1024x684.png 1024w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.05.40-AM-600x401.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.05.40-AM-300x200.png 300w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.05.40-AM-768x513.png 768w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.05.40-AM.png 1537w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Next I  do the top silkscreen</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.10.09-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.10.09-AM-1024x692.png" alt="screen-shot-2016-09-25-at-10-10-09-am" width="1024" height="692" class="alignnone size-large wp-image-2107" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.10.09-AM-1024x692.png 1024w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.10.09-AM-600x405.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.10.09-AM-300x203.png 300w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.10.09-AM-768x519.png 768w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.10.09-AM.png 1306w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Finally the bottom silkscreen</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.11.31-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.11.31-AM-1024x672.png" alt="screen-shot-2016-09-25-at-10-11-31-am" width="1024" height="672" class="alignnone size-large wp-image-2108" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.11.31-AM-1024x672.png 1024w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.11.31-AM-600x394.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.11.31-AM-300x197.png 300w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.11.31-AM-768x504.png 768w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-10.11.31-AM.png 1318w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>The last step is to re-check all of my printed circuit board rules (the subject of the next post).  Now that I have a printed circuit board I can send to OSHPark to be made.</p>
<p><span><p>You can find all of the source code and files at the <a href="https://github.com/iotexpert/Pinball" target="_blank">IOTEXPERT</a> site on github.</p>
<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/09/05/pinball-newtons-attic-pinball/">Pinball: Newton's Attic Pinball</a></td>
<td >An introduction to the project and the goals</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/06/pinball-lotsa-blinking-leds/">Pinball: Lotsa Blinking LEDs</a></td>
<td >Everyone needs a bunch of LEDs on their Pinball Machine</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/07/pinball-matrix-leds-part-1/">Pinball: Matrix LEDs (Part 1)</a></td>
<td >Saving PSoC pins by using a matrix scheme</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/08/pinball-matrix-leds-part-2/" target="_blank">Pinball: Matrix LEDs (Part 2)</a></td>
<td >Solving some problems with the matrix</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/09/pinball-matrix-leds-component/" target="_blank">Pinball: Matrix LEDs Component</a></td>
<td >How to turn the Matrix LED into a component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/10/pinball-a-switch-matrix/">Pinball: A Switch Matrix</a></td>
<td >Implementing a bunch of switches</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/12/pinball-switch-matrix-component-part-1/" target="_blank">Pinball: Switch Matrix Component (Part 1)</a></td>
<td >The switch matrix component implementation</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/13/pinball-switch-matrix-component-part-2/" target="_blank">Pinball: Switch Matrix Component (Part 2)</a></td>
<td >The firmware for matrix component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/14/pinball-switch-matrix-component-part-3/" target="_blank">Pinball: Switch Matrix Component (Part 3)</a></td>
<td >Test firmware for the matrix component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/20/pinball-the-music-player-part-1/" target="_blank">Pinball: The Music Player (Part 1)</a></td>
<td >The schematic and symbol for a Music Player component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/21/pinball-the-music-player-part-2/" target="_blank">Pinball: The Music Player (Part 2)</a></td>
<td >The Public API for the Music Player component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/22/pinball-the-music-player-part-3/" target="_blank">Pinball: The Music Player (Part 3)</a></td>
<td >The firmware to make the sweet sweet music</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/23/pinball-the-music-player-part-4/">Pinball: The Music Player (Part 4)</a></td>
<td >The test program for the music player</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/26/pinball-the-motors-hbridge/" target="_blank">Pinball: The Motors + HBridge</a></td>
<td >Using an Bridge to control DC Motors</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/27/pinball-the-eagle-schematic/" target="_blank">Pinball: The Eagle Schematic</a></td>
<td >All of the circuits into an Eagle schematic</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/29/pinball-the-printed-circuit-board-version-1-0/" target="_blank">Pinball: The Printed Circuit Board 1.0</a></td>
<td >The first Eagle PCB layout of the printed circuit board</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/30/pinball-the-pcb-version-1-0-fail/" target="_blank">Pinball: The PCB Version 1.0 Fail</a></td>
<td >Problems with the first version of the Eagle PCB layout</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/05/pinball-pcb-1-2-updates-using-eagle/" target="_blank">Pinball: PCB Layout 1.2 Updates using Eagle</a></td>
<td >Fixing the errors on the first two versions of the Eagle PCB</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/12/pinball-pcb-solder-reflow-osh-park-eagle/">Pinball: Assemble and Reflow the 1.2 PCB</a></td>
<td >Assembling the Eagle PCB</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/23/pinball-testing-the-eagle-pcb/" target="_blank">Pinball: Testing the Eagle PCB</a></td>
<td > Firmware to test the newly built Pinball printed circuit board</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/09/pinball-debugging-psoc-motor-driver/" target="_blank">Pinball: Debugging the Motor Driver</a></td>
<td > Fixing the motor driver PSoC project</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/13/hot-air-solder-reworking-the-accelerometer/" target="_blank">Pinball: Hot-Air Reworking the Accelerometer Solder</a></td>
<td >Using a Hot-Air Rework tool to reflow a QFN</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/16/pinball-debugging-lm317-power-supply-tale-getting-lucky/" target="_blank">Pinball: Debugging the LM317 Power Supply- A Tale of Getting Lucky</a></td>
<td >Debugging the LM317/LM117 power supply</td>
</tr>
</tbody></table></div></p></span></p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/pinball-the-printed-circuit-board-version-1-0/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Pinball: The Eagle Schematic</title>
		<link>https://iotexpert.com/pinball-the-eagle-schematic/</link>
					<comments>https://iotexpert.com/pinball-the-eagle-schematic/#respond</comments>
		
		<dc:creator><![CDATA[Alan Hawse]]></dc:creator>
		<pubDate>Tue, 27 Sep 2016 09:06:52 +0000</pubDate>
				<category><![CDATA[Eagle]]></category>
		<category><![CDATA[Pinball]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=2084</guid>

					<description><![CDATA[In the last bunch of posts I have talked about the main systems of the pinball machine electronics package.  Now it is time to assemble all of those pieces into a complete system on an Eagle schematic which you can find in the &#8220;eagle&#8221; directory on the github site. I use the multipage capability of [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In the last bunch of posts I have talked about the main systems of the pinball machine electronics package.  Now it is time to assemble all of those pieces into a complete system on an Eagle schematic which you can find in the &#8220;eagle&#8221; directory on the <a href="https://github.com/iotexpert/Pinball" target="_blank">github site</a>.</p>
<p>I use the multipage capability of Eagle to partition the schematic into 7 pages.</p>
<ol>
<li>Main Page</li>
<li>LEDs</li>
<li>Switches</li>
<li>Accelerometer</li>
<li>Power</li>
<li>Motors</li>
<li>Test Points</li>
</ol>
<p>The main page contains the</p>
<ol>
<li>PSoCBLE module:  Notice that I used every single pin except for VRef.  Also notice that I overloaded SWD-Clock and SWD-IO pins by attaching capsense buttons to those pins.  This means that I will never be able to debug and use Capsense at the same time.</li>
<li>USB Connector:  When I was trying to figure out how to make the board less expensive my son suggested that everybody has a USB charger, so why don&#8217;t you just power the pinball machine with that?  I thought that this was a great idea as it eliminates a $5+ wall wart.</li>
<li>Two buzzers.  These are super simple low cost 12mm through hole buzzers which are used by the <a href="https://iotexpert.com/2016/09/20/pinball-the-music-player-part-1/" target="_blank">MusicPlayer</a> component.</li>
<li>Two capsense buttons multiplexed to the SWDCLK and SWDIO pins of the chip.  Notice that they have a 560Ohm series resistor</li>
<li>The reset button for the system which just pulls down the XRES when you press the button.  It also has the 10K pullup resistor which pulls up XRES when the button is not being pressed</li>
<li>Pull-up resistors for the 5V I2C bus.</li>
<li>A 5-Pin programming plug for the MiniProg-3 connected to SWDIO and SWDCLK and the Power/Ground</li>
<li>A plug for the I2C LCD to connect to the I2C Bus</li>
</ol>
<p><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.44.48-AM-1024x830.png" alt="screen-shot-2016-09-25-at-6-44-48-am" width="1024" height="830" class="alignnone size-large wp-image-2092" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.44.48-AM-1024x830.png 1024w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.44.48-AM-600x486.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.44.48-AM-300x243.png 300w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.44.48-AM-768x622.png 768w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.44.48-AM.png 1096w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></p>
<p>Page two of the schematic contains two connectors for the LEDs which I talked about in detail in the <a href="https://iotexpert.com/2016/09/07/pinball-matrix-leds-part-1/" target="_blank">Matrix LED</a> Posts .  It also contains the current limiting resistors.  In order to save money in the BOM I am not going to actually put connectors into the 100mil center holes, but will let the kids learn to solder by attaching the wires directly into the holes with solder.</p>
<p><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.45.06-AM.png" alt="screen-shot-2016-09-25-at-6-45-06-am" width="804" height="876" class="alignnone size-large wp-image-2091" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.45.06-AM.png 804w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.45.06-AM-600x654.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.45.06-AM-275x300.png 275w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.45.06-AM-768x837.png 768w" sizes="auto, (max-width: 804px) 100vw, 804px" /></p>
<p>Page three of the schematic contains the <a href="https://iotexpert.com/2016/09/12/pinball-switch-matrix-component-part-1/" target="_blank">switch matrix</a> connectors and diodes.</p>
<p><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.45.20-AM-1024x825.png" alt="screen-shot-2016-09-25-at-6-45-20-am" width="1024" height="825" class="alignnone size-large wp-image-2090" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.45.20-AM-1024x825.png 1024w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.45.20-AM-600x483.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.45.20-AM-300x242.png 300w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.45.20-AM-768x619.png 768w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.45.20-AM.png 1090w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></p>
<p>I thought that it would be a really cool idea to have an accelerometer on the board to provide a tilt functionality.  This actually turned out to be a serious PITA because I couldn&#8217;t find a cheap accelerometer that was 5v.  So, in addition to the accelerometer I have to provide a level translator for the I2C bus (PCA9306) and a level translator for the Accelerometer interrupt line (the mostfet and pull-up resistors).  I also have to provide a 3.3v power supply (next page of the schematic)</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.45.36-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.45.36-AM-1024x809.png" alt="screen-shot-2016-09-25-at-6-45-36-am" width="1024" height="809" class="alignnone size-large wp-image-2089" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.45.36-AM-1024x809.png 1024w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.45.36-AM-600x474.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.45.36-AM-300x237.png 300w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.45.36-AM-768x607.png 768w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.45.36-AM.png 1094w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>The 3.3v accelerometer requires a 3.3v power supply, so on this page I use an REG317 to create 3.3v from the VBUS power supply.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.45.20-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.45.54-AM-1024x812.png" alt="screen-shot-2016-09-25-at-6-45-54-am" width="1024" height="812" class="alignnone size-large wp-image-2088" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.45.54-AM-1024x812.png 1024w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.45.54-AM-600x476.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.45.54-AM-300x238.png 300w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.45.54-AM-768x609.png 768w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.45.54-AM.png 1091w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>In order to drive the two brushed DC motors I use a TB6621 motor driver chip that contains two H-Bridges.</p>
<p><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.46.04-AM-1024x829.png" alt="screen-shot-2016-09-25-at-6-46-04-am" width="1024" height="829" class="alignnone size-large wp-image-2087" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.46.04-AM-1024x829.png 1024w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.46.04-AM-600x486.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.46.04-AM-300x243.png 300w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.46.04-AM-768x622.png 768w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.46.04-AM.png 1096w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></p>
<p>Finally I like to have test points on the board to measure stuff while I am assembling the board.</p>
<p><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.46.15-AM.png" alt="screen-shot-2016-09-25-at-6-46-15-am" width="1008" height="869" class="alignnone size-full wp-image-2086" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.46.15-AM.png 1008w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.46.15-AM-600x517.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.46.15-AM-300x259.png 300w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-6.46.15-AM-768x662.png 768w" sizes="auto, (max-width: 1008px) 100vw, 1008px" /></p>
<p>In the next post Ill talk about the creation of the layout for the printed circuit board.</p>
<p><span><p>You can find all of the source code and files at the <a href="https://github.com/iotexpert/Pinball" target="_blank">IOTEXPERT</a> site on github.</p>
<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/09/05/pinball-newtons-attic-pinball/">Pinball: Newton's Attic Pinball</a></td>
<td >An introduction to the project and the goals</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/06/pinball-lotsa-blinking-leds/">Pinball: Lotsa Blinking LEDs</a></td>
<td >Everyone needs a bunch of LEDs on their Pinball Machine</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/07/pinball-matrix-leds-part-1/">Pinball: Matrix LEDs (Part 1)</a></td>
<td >Saving PSoC pins by using a matrix scheme</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/08/pinball-matrix-leds-part-2/" target="_blank">Pinball: Matrix LEDs (Part 2)</a></td>
<td >Solving some problems with the matrix</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/09/pinball-matrix-leds-component/" target="_blank">Pinball: Matrix LEDs Component</a></td>
<td >How to turn the Matrix LED into a component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/10/pinball-a-switch-matrix/">Pinball: A Switch Matrix</a></td>
<td >Implementing a bunch of switches</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/12/pinball-switch-matrix-component-part-1/" target="_blank">Pinball: Switch Matrix Component (Part 1)</a></td>
<td >The switch matrix component implementation</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/13/pinball-switch-matrix-component-part-2/" target="_blank">Pinball: Switch Matrix Component (Part 2)</a></td>
<td >The firmware for matrix component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/14/pinball-switch-matrix-component-part-3/" target="_blank">Pinball: Switch Matrix Component (Part 3)</a></td>
<td >Test firmware for the matrix component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/20/pinball-the-music-player-part-1/" target="_blank">Pinball: The Music Player (Part 1)</a></td>
<td >The schematic and symbol for a Music Player component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/21/pinball-the-music-player-part-2/" target="_blank">Pinball: The Music Player (Part 2)</a></td>
<td >The Public API for the Music Player component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/22/pinball-the-music-player-part-3/" target="_blank">Pinball: The Music Player (Part 3)</a></td>
<td >The firmware to make the sweet sweet music</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/23/pinball-the-music-player-part-4/">Pinball: The Music Player (Part 4)</a></td>
<td >The test program for the music player</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/26/pinball-the-motors-hbridge/" target="_blank">Pinball: The Motors + HBridge</a></td>
<td >Using an Bridge to control DC Motors</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/27/pinball-the-eagle-schematic/" target="_blank">Pinball: The Eagle Schematic</a></td>
<td >All of the circuits into an Eagle schematic</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/29/pinball-the-printed-circuit-board-version-1-0/" target="_blank">Pinball: The Printed Circuit Board 1.0</a></td>
<td >The first Eagle PCB layout of the printed circuit board</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/30/pinball-the-pcb-version-1-0-fail/" target="_blank">Pinball: The PCB Version 1.0 Fail</a></td>
<td >Problems with the first version of the Eagle PCB layout</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/05/pinball-pcb-1-2-updates-using-eagle/" target="_blank">Pinball: PCB Layout 1.2 Updates using Eagle</a></td>
<td >Fixing the errors on the first two versions of the Eagle PCB</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/12/pinball-pcb-solder-reflow-osh-park-eagle/">Pinball: Assemble and Reflow the 1.2 PCB</a></td>
<td >Assembling the Eagle PCB</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/23/pinball-testing-the-eagle-pcb/" target="_blank">Pinball: Testing the Eagle PCB</a></td>
<td > Firmware to test the newly built Pinball printed circuit board</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/09/pinball-debugging-psoc-motor-driver/" target="_blank">Pinball: Debugging the Motor Driver</a></td>
<td > Fixing the motor driver PSoC project</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/13/hot-air-solder-reworking-the-accelerometer/" target="_blank">Pinball: Hot-Air Reworking the Accelerometer Solder</a></td>
<td >Using a Hot-Air Rework tool to reflow a QFN</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/16/pinball-debugging-lm317-power-supply-tale-getting-lucky/" target="_blank">Pinball: Debugging the LM317 Power Supply- A Tale of Getting Lucky</a></td>
<td >Debugging the LM317/LM117 power supply</td>
</tr>
</tbody></table></div></p></span></p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/pinball-the-eagle-schematic/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Pinball: The Motors + Hbridge</title>
		<link>https://iotexpert.com/pinball-the-motors-hbridge/</link>
					<comments>https://iotexpert.com/pinball-the-motors-hbridge/#respond</comments>
		
		<dc:creator><![CDATA[Alan Hawse]]></dc:creator>
		<pubDate>Mon, 26 Sep 2016 09:05:35 +0000</pubDate>
				<category><![CDATA[Pinball]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=2097</guid>

					<description><![CDATA[When Billy and I talked about making the electronics package for the Pinball machine, I suggested that it would be cool to have some motors.  Mr. Mechanical Engineer&#8217;s eyes lit up when I made that suggestion.  There are tons of things that the kids to could with a couple of controllable motors.  You could imagine [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>When Billy and I talked about making the electronics package for the Pinball machine, I suggested that it would be cool to have some motors.  Mr. Mechanical Engineer&#8217;s eyes lit up when I made that suggestion.  There are tons of things that the kids to could with a couple of controllable motors.  You could imagine conveyor belts, spinning obstacles, and all manner of lift systems.</p>
<p>I wanted to use inexpensive DC Toy motors.  The problem with most motors is that they require higher voltages (5-9 volts) and currents (250mA for the one that I wanted) than the PSoC (or generally any MCU) is capable of delivering.  Well that&#8217;s OK, it turns out there is a whole class of Power Management ICs (PMICs) which provide translation between an MCU and a Motor.  The one that I am going to use is called the TB6612.  This chip has dual Hbridges that help you control both the speed and direction of two motors.</p>
<p>First, the chip uses NMOS transistors configured as switches to let you control higher power (voltage and current) circuits.  Here is a picture of the input to the PMIC from the <a href="https://toshiba.semicon-storage.com/info/docget.jsp?did=10660&amp;prodName=TB6612FNG" target="_blank">datasheet</a>:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-8.15.00-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-8.15.00-AM-1024x431.png" alt="screen-shot-2016-09-25-at-8-15-00-am" width="1024" height="431" class="alignnone size-large wp-image-2099" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-8.15.00-AM-1024x431.png 1024w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-8.15.00-AM-600x253.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-8.15.00-AM-300x126.png 300w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-8.15.00-AM-768x323.png 768w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-8.15.00-AM.png 1396w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Second you want to be able to control the speed and direction of the motor.  Here is a screen shot from the data sheet that shows the inputs and what happens with the motor.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-8.13.11-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-8.13.11-AM-1024x576.png" alt="screen-shot-2016-09-25-at-8-13-11-am" width="1024" height="576" class="alignnone size-large wp-image-2098" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-8.13.11-AM-1024x576.png 1024w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-8.13.11-AM-600x338.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-8.13.11-AM-300x169.png 300w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-8.13.11-AM-768x432.png 768w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-8.13.11-AM.png 1344w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Here is a picture that shows you how the current flows through the Hbridge as well as showing the circuit that keeps you from short circuiting between the phases.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-8.16.46-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-8.16.46-AM-1024x907.png" alt="screen-shot-2016-09-25-at-8-16-46-am" width="1024" height="907" class="alignnone size-large wp-image-2100" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-8.16.46-AM-1024x907.png 1024w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-8.16.46-AM-600x531.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-8.16.46-AM-300x266.png 300w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-8.16.46-AM-768x680.png 768w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-25-at-8.16.46-AM.png 1554w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>So, how do you control the speed?  Simple, you use a PWM to create a train of pulses that have different duty cycles.  The greater the duty cycle, the faster the motor goes.  The lower the duty cycle, the slower the motor goes.</p>
<p>One last problem.  The chip requires IN1, IN2, PWM and Standby, but I want to only use two outputs from the PSoC.  So, what I decide to do is</p>
<ul>
<li>Turn the standby off (so that the chip is always active)</li>
<li>Attach the PWM input to high so that the motor is always spinning</li>
<li>Attach In1 and In2 to the PSoC.  The PSoC will then set them to the correct value and PWM.</li>
</ul>
<p>In the next post Ill start the process of turning all of the different blocks into a schematic that can then be turned into a printed circuit board.</p>
<p><span><p>You can find all of the source code and files at the <a href="https://github.com/iotexpert/Pinball" target="_blank">IOTEXPERT</a> site on github.</p>
<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/09/05/pinball-newtons-attic-pinball/">Pinball: Newton's Attic Pinball</a></td>
<td >An introduction to the project and the goals</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/06/pinball-lotsa-blinking-leds/">Pinball: Lotsa Blinking LEDs</a></td>
<td >Everyone needs a bunch of LEDs on their Pinball Machine</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/07/pinball-matrix-leds-part-1/">Pinball: Matrix LEDs (Part 1)</a></td>
<td >Saving PSoC pins by using a matrix scheme</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/08/pinball-matrix-leds-part-2/" target="_blank">Pinball: Matrix LEDs (Part 2)</a></td>
<td >Solving some problems with the matrix</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/09/pinball-matrix-leds-component/" target="_blank">Pinball: Matrix LEDs Component</a></td>
<td >How to turn the Matrix LED into a component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/10/pinball-a-switch-matrix/">Pinball: A Switch Matrix</a></td>
<td >Implementing a bunch of switches</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/12/pinball-switch-matrix-component-part-1/" target="_blank">Pinball: Switch Matrix Component (Part 1)</a></td>
<td >The switch matrix component implementation</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/13/pinball-switch-matrix-component-part-2/" target="_blank">Pinball: Switch Matrix Component (Part 2)</a></td>
<td >The firmware for matrix component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/14/pinball-switch-matrix-component-part-3/" target="_blank">Pinball: Switch Matrix Component (Part 3)</a></td>
<td >Test firmware for the matrix component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/20/pinball-the-music-player-part-1/" target="_blank">Pinball: The Music Player (Part 1)</a></td>
<td >The schematic and symbol for a Music Player component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/21/pinball-the-music-player-part-2/" target="_blank">Pinball: The Music Player (Part 2)</a></td>
<td >The Public API for the Music Player component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/22/pinball-the-music-player-part-3/" target="_blank">Pinball: The Music Player (Part 3)</a></td>
<td >The firmware to make the sweet sweet music</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/23/pinball-the-music-player-part-4/">Pinball: The Music Player (Part 4)</a></td>
<td >The test program for the music player</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/26/pinball-the-motors-hbridge/" target="_blank">Pinball: The Motors + HBridge</a></td>
<td >Using an Bridge to control DC Motors</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/27/pinball-the-eagle-schematic/" target="_blank">Pinball: The Eagle Schematic</a></td>
<td >All of the circuits into an Eagle schematic</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/29/pinball-the-printed-circuit-board-version-1-0/" target="_blank">Pinball: The Printed Circuit Board 1.0</a></td>
<td >The first Eagle PCB layout of the printed circuit board</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/30/pinball-the-pcb-version-1-0-fail/" target="_blank">Pinball: The PCB Version 1.0 Fail</a></td>
<td >Problems with the first version of the Eagle PCB layout</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/05/pinball-pcb-1-2-updates-using-eagle/" target="_blank">Pinball: PCB Layout 1.2 Updates using Eagle</a></td>
<td >Fixing the errors on the first two versions of the Eagle PCB</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/12/pinball-pcb-solder-reflow-osh-park-eagle/">Pinball: Assemble and Reflow the 1.2 PCB</a></td>
<td >Assembling the Eagle PCB</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/23/pinball-testing-the-eagle-pcb/" target="_blank">Pinball: Testing the Eagle PCB</a></td>
<td > Firmware to test the newly built Pinball printed circuit board</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/09/pinball-debugging-psoc-motor-driver/" target="_blank">Pinball: Debugging the Motor Driver</a></td>
<td > Fixing the motor driver PSoC project</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/13/hot-air-solder-reworking-the-accelerometer/" target="_blank">Pinball: Hot-Air Reworking the Accelerometer Solder</a></td>
<td >Using a Hot-Air Rework tool to reflow a QFN</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/16/pinball-debugging-lm317-power-supply-tale-getting-lucky/" target="_blank">Pinball: Debugging the LM317 Power Supply- A Tale of Getting Lucky</a></td>
<td >Debugging the LM317/LM117 power supply</td>
</tr>
</tbody></table></div></p></span></p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/pinball-the-motors-hbridge/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Pinball: The Music Player (Part 4)</title>
		<link>https://iotexpert.com/pinball-the-music-player-part-4/</link>
					<comments>https://iotexpert.com/pinball-the-music-player-part-4/#respond</comments>
		
		<dc:creator><![CDATA[Alan Hawse]]></dc:creator>
		<pubDate>Fri, 23 Sep 2016 15:39:12 +0000</pubDate>
				<category><![CDATA[Pinball]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=2057</guid>

					<description><![CDATA[In the previous three posts I created a Music Player component by building the symbol+schematics, making a public interface, and writing the firmware.  In this post I will show you the test program called &#8220;MusicTestComponent&#8221;. In order to get access to the PinballComponents library project I first right click on my project and edit the dependencies. [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In the previous three posts I created a Music Player component by building the <a href="https://iotexpert.com/2016/09/20/pinball-the-music-player-part-1/" target="_blank">symbol+schematics</a>, <a href="https://iotexpert.com/2016/09/21/pinball-the-music-player-part-2/" target="_blank">making a public interface</a>, and <a href="https://iotexpert.com/2016/09/22/pinball-the-music-player-part-3/" target="_blank">writing the firmware</a>.  In this post I will show you the test program called &#8220;MusicTestComponent&#8221;.</p>
<p>In order to get access to the PinballComponents library project I first right click on my project and edit the dependencies.  Specifically, I click on the box that adds the &#8220;PinballComponents&#8221; as a dependency of the MusicTestComponent project.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-23-at-11.01.14-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-23-at-11.01.14-AM.png" alt="screen-shot-2016-09-23-at-11-01-14-am" width="560" height="768" class="alignnone size-full wp-image-2062" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-23-at-11.01.14-AM.png 560w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-23-at-11.01.14-AM-219x300.png 219w" sizes="auto, (max-width: 560px) 100vw, 560px" /></a></p>
<p>After setting up the dependencies you can then make a schematic with the MusicPlayer and a UART.  The UART will be used to trigger commands to be sent to the MusicPlayer Component.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-23-at-10.56.05-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-23-at-10.56.05-AM.png" alt="screen-shot-2016-09-23-at-10-56-05-am" width="538" height="364" class="alignnone size-full wp-image-2058" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-23-at-10.56.05-AM.png 538w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-23-at-10.56.05-AM-300x203.png 300w" sizes="auto, (max-width: 538px) 100vw, 538px" /></a></p>
<p>I start the main firmware by creating a test song called &#8220;scaleNotes&#8221; (lines 5-12).  I then turn that array of Notes into a Song by declaring  a Song and adding the scaleNotes to the song (lines 15-19).</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-23-at-10.54.51-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-23-at-10.54.51-AM.png" alt="screen-shot-2016-09-23-at-10-54-51-am" width="716" height="398" class="alignnone size-large wp-image-2060" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-23-at-10.54.51-AM.png 716w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-23-at-10.54.51-AM-600x334.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-23-at-10.54.51-AM-300x167.png 300w" sizes="auto, (max-width: 716px) 100vw, 716px" /></a></p>
<p>At the start of the program I turn on the interrupts and start the components (line 27-31).  Then I add my song to the component (so that it can play it) with line 33.</p>
<p>In the main loop of the program I grab characters from the UART and issue commands to the MusicPlayer component based on what button the users presses.</p>
<p>On lines 57-62 I have a debugging pinout that prints out the currently playing note number each time the note changes.</p>
<p><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-23-at-10.55.10-AM.png" alt="screen-shot-2016-09-23-at-10-55-10-am" width="961" height="890" class="alignnone size-large wp-image-2059" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-23-at-10.55.10-AM.png 961w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-23-at-10.55.10-AM-600x556.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-23-at-10.55.10-AM-300x278.png 300w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-23-at-10.55.10-AM-768x711.png 768w" sizes="auto, (max-width: 961px) 100vw, 961px" /></p>
<p>Thats it.  In the next post I will start taking you through the process of designing the printed circuit board.</p>
<p><span><p>You can find all of the source code and files at the <a href="https://github.com/iotexpert/Pinball" target="_blank">IOTEXPERT</a> site on github.</p>
<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/09/05/pinball-newtons-attic-pinball/">Pinball: Newton's Attic Pinball</a></td>
<td >An introduction to the project and the goals</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/06/pinball-lotsa-blinking-leds/">Pinball: Lotsa Blinking LEDs</a></td>
<td >Everyone needs a bunch of LEDs on their Pinball Machine</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/07/pinball-matrix-leds-part-1/">Pinball: Matrix LEDs (Part 1)</a></td>
<td >Saving PSoC pins by using a matrix scheme</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/08/pinball-matrix-leds-part-2/" target="_blank">Pinball: Matrix LEDs (Part 2)</a></td>
<td >Solving some problems with the matrix</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/09/pinball-matrix-leds-component/" target="_blank">Pinball: Matrix LEDs Component</a></td>
<td >How to turn the Matrix LED into a component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/10/pinball-a-switch-matrix/">Pinball: A Switch Matrix</a></td>
<td >Implementing a bunch of switches</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/12/pinball-switch-matrix-component-part-1/" target="_blank">Pinball: Switch Matrix Component (Part 1)</a></td>
<td >The switch matrix component implementation</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/13/pinball-switch-matrix-component-part-2/" target="_blank">Pinball: Switch Matrix Component (Part 2)</a></td>
<td >The firmware for matrix component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/14/pinball-switch-matrix-component-part-3/" target="_blank">Pinball: Switch Matrix Component (Part 3)</a></td>
<td >Test firmware for the matrix component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/20/pinball-the-music-player-part-1/" target="_blank">Pinball: The Music Player (Part 1)</a></td>
<td >The schematic and symbol for a Music Player component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/21/pinball-the-music-player-part-2/" target="_blank">Pinball: The Music Player (Part 2)</a></td>
<td >The Public API for the Music Player component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/22/pinball-the-music-player-part-3/" target="_blank">Pinball: The Music Player (Part 3)</a></td>
<td >The firmware to make the sweet sweet music</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/23/pinball-the-music-player-part-4/">Pinball: The Music Player (Part 4)</a></td>
<td >The test program for the music player</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/26/pinball-the-motors-hbridge/" target="_blank">Pinball: The Motors + HBridge</a></td>
<td >Using an Bridge to control DC Motors</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/27/pinball-the-eagle-schematic/" target="_blank">Pinball: The Eagle Schematic</a></td>
<td >All of the circuits into an Eagle schematic</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/29/pinball-the-printed-circuit-board-version-1-0/" target="_blank">Pinball: The Printed Circuit Board 1.0</a></td>
<td >The first Eagle PCB layout of the printed circuit board</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/30/pinball-the-pcb-version-1-0-fail/" target="_blank">Pinball: The PCB Version 1.0 Fail</a></td>
<td >Problems with the first version of the Eagle PCB layout</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/05/pinball-pcb-1-2-updates-using-eagle/" target="_blank">Pinball: PCB Layout 1.2 Updates using Eagle</a></td>
<td >Fixing the errors on the first two versions of the Eagle PCB</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/12/pinball-pcb-solder-reflow-osh-park-eagle/">Pinball: Assemble and Reflow the 1.2 PCB</a></td>
<td >Assembling the Eagle PCB</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/23/pinball-testing-the-eagle-pcb/" target="_blank">Pinball: Testing the Eagle PCB</a></td>
<td > Firmware to test the newly built Pinball printed circuit board</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/09/pinball-debugging-psoc-motor-driver/" target="_blank">Pinball: Debugging the Motor Driver</a></td>
<td > Fixing the motor driver PSoC project</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/13/hot-air-solder-reworking-the-accelerometer/" target="_blank">Pinball: Hot-Air Reworking the Accelerometer Solder</a></td>
<td >Using a Hot-Air Rework tool to reflow a QFN</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/16/pinball-debugging-lm317-power-supply-tale-getting-lucky/" target="_blank">Pinball: Debugging the LM317 Power Supply- A Tale of Getting Lucky</a></td>
<td >Debugging the LM317/LM117 power supply</td>
</tr>
</tbody></table></div></p></span></p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/pinball-the-music-player-part-4/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Pinball: The Music Player (Part 3)</title>
		<link>https://iotexpert.com/pinball-the-music-player-part-3/</link>
					<comments>https://iotexpert.com/pinball-the-music-player-part-3/#respond</comments>
		
		<dc:creator><![CDATA[Alan Hawse]]></dc:creator>
		<pubDate>Thu, 22 Sep 2016 10:59:46 +0000</pubDate>
				<category><![CDATA[Pinball]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=2042</guid>

					<description><![CDATA[In this previous posts I showed you the Schematic/Symbol and the public API for the Music Player.  In this post I will take you through the firmware.  The first section defines: Parameters of the system, specifically the clock frequency and PWM prescaler (line 4-5) The internal variables that are used to keep track with what is [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this previous posts I showed you the <a href="https://iotexpert.com/2016/09/20/pinball-the-music-player-part-1/" target="_blank">Schematic/Symbol</a> and the <a href="https://iotexpert.com/2016/09/21/pinball-the-music-player-part-2/" target="_blank">public API</a> for the Music Player.  In this post I will take you through the firmware.  The first section defines:</p>
<ul>
<li>Parameters of the system, specifically the clock frequency and PWM prescaler (line 4-5)</li>
<li>The internal variables that are used to keep track with what is happening on the son (lines 8-12).</li>
<li>The notes for twinkle twinkle little star (Lines 22-43)</li>
<li>An array to hold songs (line 47-48)</li>
</ul>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.18.09-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.18.09-AM.png" alt="screen-shot-2016-09-22-at-6-18-09-am" width="814" height="828" class="alignnone size-full wp-image-2043" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.18.09-AM.png 814w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.18.09-AM-600x610.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.18.09-AM-295x300.png 295w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.18.09-AM-768x781.png 768w" sizes="auto, (max-width: 814px) 100vw, 814px" /></a></p>
<p>The GetNote function just returns the current songs currently playing note number.  I used this function when I was trying to debug the player.</p>
<p>The FrequencyToPeriod uses the settings of the PWM and the desired frequency to calculate the Period/Compare values to achieve the desired output.  The PWM has three parameters that change its output.</p>
<ul>
<li>The input clock</li>
<li>The input prescaler (just a divider on the front end of the PWM)</li>
<li>The period (what you are trying to calculate)</li>
</ul>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.23.55-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.23.55-AM.png" alt="screen-shot-2016-09-22-at-6-23-55-am" width="841" height="398" class="alignnone size-full wp-image-2048" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.23.55-AM.png 841w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.23.55-AM-600x284.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.23.55-AM-300x142.png 300w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.23.55-AM-768x363.png 768w" sizes="auto, (max-width: 841px) 100vw, 841px" /></a></p>
<p>The next note function figures out the right settings for the PWM based on the desired frequency of the note, then sets up the PWM to the correct values (line 88-91), it then calculates how long to play the note (line 92).  Finally it sets thing up for the next note (line 97-101)</p>
<p><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.20.46-AM-1024x362.png" alt="screen-shot-2016-09-22-at-6-20-46-am" width="1024" height="362" class="alignnone size-large wp-image-2046" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.20.46-AM-1024x362.png 1024w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.20.46-AM-600x212.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.20.46-AM-300x106.png 300w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.20.46-AM-768x271.png 768w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.20.46-AM.png 1423w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></p>
<p>The SysTickCallBack function controls the amount of time that</p>
<ul>
<li>A note plays (lines 138-139)</li>
<li>The gap between the notes (lines 132-136)</li>
<li>The buzzer sounds (116-124) if the TWO_CHANNELS are enabled</li>
</ul>
<p><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.21.09-AM.png" alt="screen-shot-2016-09-22-at-6-21-09-am" width="869" height="631" class="alignnone size-large wp-image-2045" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.21.09-AM.png 869w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.21.09-AM-600x436.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.21.09-AM-300x218.png 300w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.21.09-AM-768x558.png 768w" sizes="auto, (max-width: 869px) 100vw, 869px" /></p>
<p>The Start function initializes all of the internal variables to turn off the songs.  The MusicPlayer uses the SysTick timer to keep track of how long the notes and the Buzzer have been on/off.</p>
<p>The Stop function turns off the Buzzers.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.21.31-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.21.31-AM.png" alt="screen-shot-2016-09-22-at-6-21-31-am" width="827" height="523" class="alignnone size-full wp-image-2044" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.21.31-AM.png 827w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.21.31-AM-600x379.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.21.31-AM-300x190.png 300w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.21.31-AM-768x486.png 768w" sizes="auto, (max-width: 827px) 100vw, 827px" /></a></p>
<p>The function PlaySong initializes all of the internal variables that are used to keep track of the song status.  It points at the first note, then it calls the NextNote function.  This function returns the ErrorCodes value which enables me to do a range check and existence check on the song number (lines 185-188).</p>
<p>The SetBPM changes the internal variable _BPM which is used to calculate the duration of notes.  This function also returns an ErrorCodes value after doing a range check.</p>
<p>The AddSong function allows the component user to define a new song and to assign it the list of Songs.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.26.49-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.26.49-AM-1024x936.png" alt="screen-shot-2016-09-22-at-6-26-49-am" width="1024" height="936" class="alignnone size-large wp-image-2049" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.26.49-AM-1024x936.png 1024w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.26.49-AM-600x548.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.26.49-AM-300x274.png 300w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.26.49-AM-768x702.png 768w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.26.49-AM.png 1030w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>The last section of code provides the buzzing functionality.  These function turn on and off the 2nd buzzer.  The first function turns on the 2nd buzzer at the requested frequency for either 0-means infinite time or a # of milliseconds.  Notice that this section of code only shows up if the user has turned on the second channel (line 230).</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.34.43-AM.png"><img loading="lazy" decoding="async" src="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.34.43-AM.png" alt="screen-shot-2016-09-22-at-6-34-43-am" width="747" height="688" class="alignnone size-full wp-image-2050" srcset="https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.34.43-AM.png 747w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.34.43-AM-600x553.png 600w, https://iotexpert.com/wp-content/uploads/2016/09/Screen-Shot-2016-09-22-at-6.34.43-AM-300x276.png 300w" sizes="auto, (max-width: 747px) 100vw, 747px" /></a></p>
<p>In the next post Ill show you the test code for the component.</p>
<p><span><p>You can find all of the source code and files at the <a href="https://github.com/iotexpert/Pinball" target="_blank">IOTEXPERT</a> site on github.</p>
<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/09/05/pinball-newtons-attic-pinball/">Pinball: Newton's Attic Pinball</a></td>
<td >An introduction to the project and the goals</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/06/pinball-lotsa-blinking-leds/">Pinball: Lotsa Blinking LEDs</a></td>
<td >Everyone needs a bunch of LEDs on their Pinball Machine</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/07/pinball-matrix-leds-part-1/">Pinball: Matrix LEDs (Part 1)</a></td>
<td >Saving PSoC pins by using a matrix scheme</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/08/pinball-matrix-leds-part-2/" target="_blank">Pinball: Matrix LEDs (Part 2)</a></td>
<td >Solving some problems with the matrix</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/09/pinball-matrix-leds-component/" target="_blank">Pinball: Matrix LEDs Component</a></td>
<td >How to turn the Matrix LED into a component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/10/pinball-a-switch-matrix/">Pinball: A Switch Matrix</a></td>
<td >Implementing a bunch of switches</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/12/pinball-switch-matrix-component-part-1/" target="_blank">Pinball: Switch Matrix Component (Part 1)</a></td>
<td >The switch matrix component implementation</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/13/pinball-switch-matrix-component-part-2/" target="_blank">Pinball: Switch Matrix Component (Part 2)</a></td>
<td >The firmware for matrix component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/14/pinball-switch-matrix-component-part-3/" target="_blank">Pinball: Switch Matrix Component (Part 3)</a></td>
<td >Test firmware for the matrix component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/20/pinball-the-music-player-part-1/" target="_blank">Pinball: The Music Player (Part 1)</a></td>
<td >The schematic and symbol for a Music Player component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/21/pinball-the-music-player-part-2/" target="_blank">Pinball: The Music Player (Part 2)</a></td>
<td >The Public API for the Music Player component</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/22/pinball-the-music-player-part-3/" target="_blank">Pinball: The Music Player (Part 3)</a></td>
<td >The firmware to make the sweet sweet music</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/23/pinball-the-music-player-part-4/">Pinball: The Music Player (Part 4)</a></td>
<td >The test program for the music player</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/26/pinball-the-motors-hbridge/" target="_blank">Pinball: The Motors + HBridge</a></td>
<td >Using an Bridge to control DC Motors</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/27/pinball-the-eagle-schematic/" target="_blank">Pinball: The Eagle Schematic</a></td>
<td >All of the circuits into an Eagle schematic</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/29/pinball-the-printed-circuit-board-version-1-0/" target="_blank">Pinball: The Printed Circuit Board 1.0</a></td>
<td >The first Eagle PCB layout of the printed circuit board</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2016/09/30/pinball-the-pcb-version-1-0-fail/" target="_blank">Pinball: The PCB Version 1.0 Fail</a></td>
<td >Problems with the first version of the Eagle PCB layout</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/05/pinball-pcb-1-2-updates-using-eagle/" target="_blank">Pinball: PCB Layout 1.2 Updates using Eagle</a></td>
<td >Fixing the errors on the first two versions of the Eagle PCB</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/12/pinball-pcb-solder-reflow-osh-park-eagle/">Pinball: Assemble and Reflow the 1.2 PCB</a></td>
<td >Assembling the Eagle PCB</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/01/23/pinball-testing-the-eagle-pcb/" target="_blank">Pinball: Testing the Eagle PCB</a></td>
<td > Firmware to test the newly built Pinball printed circuit board</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/09/pinball-debugging-psoc-motor-driver/" target="_blank">Pinball: Debugging the Motor Driver</a></td>
<td > Fixing the motor driver PSoC project</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/13/hot-air-solder-reworking-the-accelerometer/" target="_blank">Pinball: Hot-Air Reworking the Accelerometer Solder</a></td>
<td >Using a Hot-Air Rework tool to reflow a QFN</td>
</tr>

<tr><td ><a href="https://iotexpert.com/2017/02/16/pinball-debugging-lm317-power-supply-tale-getting-lucky/" target="_blank">Pinball: Debugging the LM317 Power Supply- A Tale of Getting Lucky</a></td>
<td >Debugging the LM317/LM117 power supply</td>
</tr>
</tbody></table></div></p></span></p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/pinball-the-music-player-part-3/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
