<?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>Chad Huard</title>
	<atom:link href="http://www.chadhuard.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chadhuard.com</link>
	<description>Wayne State University</description>
	<lastBuildDate>Thu, 27 May 2010 19:04:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Accelerometer Testing</title>
		<link>http://www.chadhuard.com/2010/05/accelerometer-testing/</link>
		<comments>http://www.chadhuard.com/2010/05/accelerometer-testing/#comments</comments>
		<pubDate>Thu, 27 May 2010 18:59:19 +0000</pubDate>
		<dc:creator>Chad</dc:creator>
				<category><![CDATA[Final Project]]></category>
		<category><![CDATA[accelerometer]]></category>
		<category><![CDATA[filters]]></category>
		<category><![CDATA[matlab]]></category>
		<category><![CDATA[signal processing]]></category>

		<guid isPermaLink="false">http://www.chadhuard.com/?p=494</guid>
		<description><![CDATA[This post looks into the actual output of the accelerometer and investigates several filters that can be used to smooth the data.
I am slowly working towards the second phase of my microcontroller project.  I hope to have a new proposal ready soon, but for now I have been working on my signal processing.  I am very [...]]]></description>
			<content:encoded><![CDATA[<p>This post looks into the actual output of the accelerometer and investigates several filters that can be used to smooth the data.</p>
<p>I am slowly working towards the second phase of my microcontroller project.  I hope to have a new proposal ready soon, but for now I have been working on my signal processing.  I am very new to this, and I am trying to teach myself as much as possible with this project.  I currently have the accelerometer from the servo arm project running on an arduino kit.  Since the arduino has an easy to use serial library I set it up to work as a data logger for the accelerometer.  I sampled the accelerometer at 50Hz, which is the same as in the previous project.  I have not decided if this will be the sample frequency I use in the next project or not, but the results were informative.</p>
<p>The graph below shows the actual sampled data and the results of three different filters.  The first filter, labeled Box, is the filter I used on the last project; an 8 sample rectangular rolling average.  The Triangle filter is a 5 sample triangular weighted rolling average.  The Butterworth filter is 2nd order with a cutoff of 2Hz.</p>
<p style="text-align: left;"><a href="http://www.chadhuard.com/wp-content/uploads/2010/05/Accelerometer_Data.png" rel="lightbox[494]"><img class="aligncenter size-full wp-image-495" title="Accelerometer_Data" src="http://www.chadhuard.com/wp-content/uploads/2010/05/Accelerometer_Data.png" alt="" width="588" height="455" /></a>Between the Box and Triangle filters, both lag the signal by similar amounts, but the triangular is much smoother.  The butterworth is my first attempt at a real filter, it is much smoother but at the expense of a little more lag.  The lag on these filters ranges from 100ms for the triangle and box, to about 140ms for the butterworth.  I am not sure if this is a deal breaker, but it seems like a lot of lag.</p>
<p style="text-align: left;">My original thought with the very low sample frequency was that there was no point in sampling the accelerometer faster than I could update the servo (once every 20ms).  Now, I am thinking I will investigate faster sampling times to see if I will be able to create a smooth signal with less lag than the filters presented here.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chadhuard.com/2010/05/accelerometer-testing/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Final Project</title>
		<link>http://www.chadhuard.com/2010/05/final-project/</link>
		<comments>http://www.chadhuard.com/2010/05/final-project/#comments</comments>
		<pubDate>Wed, 12 May 2010 14:48:29 +0000</pubDate>
		<dc:creator>Chad</dc:creator>
				<category><![CDATA[Final Project]]></category>
		<category><![CDATA[68HC11]]></category>
		<category><![CDATA[accelerometer]]></category>
		<category><![CDATA[assembly]]></category>
		<category><![CDATA[HC11]]></category>
		<category><![CDATA[robot]]></category>
		<category><![CDATA[robotic arm]]></category>

		<guid isPermaLink="false">http://www.chadhuard.com/?p=483</guid>
		<description><![CDATA[
Class: ECE 2620 &#8211; Intro to Microcomputers
Semester: Winter 2010
Instructor: Dr. Hassoun

Essentially this project is a two degree of freedom robotic arm controlled by an accelerometer.  The accelerometer is mounted on a breadboard that the user can tilt in space controlling the direction of a laser pointer mounted to the arm.  The entire project is programed in assembly [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li><strong>Class</strong>: ECE 2620 &#8211; Intro to Microcomputers</li>
<li><strong>Semester:</strong> Winter 2010</li>
<li><strong>Instructor:</strong> <a title="Computation and Neural Network Lab" href="http://neuron.eng.wayne.edu/" target="_blank">Dr. Hassoun</a></li>
</ul>
<p>Essentially this project is a two degree of freedom robotic arm controlled by an accelerometer.  The accelerometer is mounted on a breadboard that the user can tilt in space controlling the direction of a laser pointer mounted to the arm.  The entire project is programed in assembly language on the Motorola 68HC11 microprocessor.</p>
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="601" height="338" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=11658575&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=ffffff&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="601" height="338" src="http://vimeo.com/moogaloop.swf?clip_id=11658575&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=ffffff&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p style="text-align: center;">&#8212;</p>
<p style="text-align: center;">
<p style="text-align: center;">
<iframe src="http://www.chadhuard.com/wp-content/plugins/google-document-embedder/proxy.php?url=http%3A%2F%2Fwww.chadhuard.com%2Fwp-content%2Fuploads%2F2010%2F05%2FChad_Huard_Final_Project.pdf&hl=en_US&gdet=&embedded=true" width="100%" height="500" frameborder="0" style="min-width:305px;" class="gde-frame"></iframe>

<p class="gde-text"><a href="http://www.chadhuard.com/wp-content/uploads/2010/05/Chad_Huard_Final_Project.pdf" target="_blank" class="gde-link">Download (PDF, 296.5KB)</a></p></p>
<p style="text-align: center;">
<p style="text-align: center;">
]]></content:encoded>
			<wfw:commentRss>http://www.chadhuard.com/2010/05/final-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Switch Bounce</title>
		<link>http://www.chadhuard.com/2010/04/switch-bounce/</link>
		<comments>http://www.chadhuard.com/2010/04/switch-bounce/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 00:26:19 +0000</pubDate>
		<dc:creator>Chad</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Microcomputers]]></category>
		<category><![CDATA[bounce]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[HC11]]></category>
		<category><![CDATA[oscilloscope]]></category>

		<guid isPermaLink="false">http://www.chadhuard.com/?p=451</guid>
		<description><![CDATA[Most people who have dabbled in embedded design know that all mechanical switches have some amount of &#8220;bounce&#8221; where they are not making solid contact for a short time after being pressed or released.  If you manage to read the button fast enough that you make more than one reading while the button is still [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Most people who have dabbled in embedded design know that all mechanical switches have some amount of &#8220;bounce&#8221; where they are not making solid contact for a short time after being pressed or released.  If you manage to read the button fast enough that you make more than one reading while the button is still bouncing you can get erroneous readings.  I was working on a lab for my microcomputer class that used a flip-flop to de-bounce the rising edge of the button press, but I was still getting extra button press readings when I was releasing the button.  This was obviously a job for <a href="http://www.chadhuard.com/2010/04/introducing-scopezilla-hp-54720a/">scopezilla</a>.  What I found was interesting:</p>
<p style="text-align: left;">
<div class="mceTemp mceIEcenter" style="text-align: left;">
<dl class="wp-caption aligncenter" style="width: 210px;">
<dt class="wp-caption-dt" style="text-align: left;"><a href="http://www.sparkfun.com/commerce/product_info.php?products_id=97"><img title="button" src="http://static.sparkfun.com/images/products/00097-03-L.jpg" alt="" width="200" height="200" /></a></dt>
<dd class="wp-caption-dd">The Culprit!</dd>
</dl>
</div>
<p style="text-align: left;">
<p style="text-align: left;">
<div class="mceTemp mceIEcenter" style="text-align: left;">
<dl id="attachment_452" class="wp-caption aligncenter" style="width: 469px;">
<dt class="wp-caption-dt"><a href="http://www.chadhuard.com/wp-content/uploads/2010/04/Bounce-Up.png" rel="lightbox[451]"><img class="size-full wp-image-452" title="Bounce Up" src="http://www.chadhuard.com/wp-content/uploads/2010/04/Bounce-Up.png" alt="" width="459" height="366" /></a></dt>
<dd class="wp-caption-dd">Rising Edge</dd>
</dl>
</div>
<p style="text-align: left;">
<p style="text-align: left;">
<div class="mceTemp mceIEcenter" style="text-align: left;">
<dl id="attachment_453" class="wp-caption aligncenter" style="width: 472px;">
<dt class="wp-caption-dt"><a href="http://www.chadhuard.com/wp-content/uploads/2010/04/Bounce-Down.png" rel="lightbox[451]"><img class="size-full wp-image-453" title="Bounce Down" src="http://www.chadhuard.com/wp-content/uploads/2010/04/Bounce-Down.png" alt="" width="462" height="367" /></a></dt>
<dd class="wp-caption-dd">Falling Edge</dd>
</dl>
</div>
<p style="text-align: left;">
<p style="text-align: left;">So, the big problem?  Well, it turns out that the glitch that can be seen in the falling edge image was really the problem, not bouncing on the rising edge.  It didn&#8217;t occur every time I pressed and released the button, but frequently enough to be a real pain (perhaps 10%).  All of the de-bouncing in the world on the leading edge could not keep the processor from interpreting the high after the glitch as a second button press.  Obviously more sophisticated de-bouncing is required.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chadhuard.com/2010/04/switch-bounce/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing Scopezilla: HP 54720A</title>
		<link>http://www.chadhuard.com/2010/04/introducing-scopezilla-hp-54720a/</link>
		<comments>http://www.chadhuard.com/2010/04/introducing-scopezilla-hp-54720a/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 23:42:03 +0000</pubDate>
		<dc:creator>Chad</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[School]]></category>
		<category><![CDATA[oscilloscope]]></category>
		<category><![CDATA[test equipment]]></category>

		<guid isPermaLink="false">http://www.chadhuard.com/?p=444</guid>
		<description><![CDATA[I decided that I needed a scope for my projects a few weeks ago.  After searching for a little while I decided on a used HP 54720A.  This thing is a monster!  It is about the size of tall kitchen trash-can and weighs a whopping 75lbs.  For all that massiveness you get 1.1GHz bandwidth, 4GS/s (thats four [...]]]></description>
			<content:encoded><![CDATA[<p>I decided that I needed a scope for my projects a few weeks ago.  After searching for a little while I decided on a used HP 54720A.  This thing is a monster!  It is about the size of tall kitchen trash-can and weighs a whopping 75lbs.  For all that massiveness you get 1.1GHz bandwidth, 4GS/s (thats four Billion&#8230; with a B, samples per second folks) and 32kS record length!  I have been playing around with it for a few days now and I can say that it is fairly easy to use and provides incredible resolution and detail.  I will take a few pictures of it for posterity when I finally move it upstairs (right now it is on the dining table&#8230; a setup that my wife just barely tolerates, bless her heart) until then you I will just post some screen captures.</p>
<div id="attachment_445" class="wp-caption aligncenter" style="width: 586px"><a href="http://www.chadhuard.com/wp-content/uploads/2010/04/Noise.png" rel="lightbox[444]"><img class="size-full wp-image-445" title="Noise" src="http://www.chadhuard.com/wp-content/uploads/2010/04/Noise.png" alt="" width="576" height="368" /></a><p class="wp-caption-text">Regulated Power Supply Noise</p></div>
<div id="attachment_446" class="wp-caption aligncenter" style="width: 470px"><a href="http://www.chadhuard.com/wp-content/uploads/2010/04/PortE-Reading-Timing.png" rel="lightbox[444]"><img class="size-full wp-image-446" title="PortE Reading Timing" src="http://www.chadhuard.com/wp-content/uploads/2010/04/PortE-Reading-Timing.png" alt="" width="460" height="346" /></a><p class="wp-caption-text">Monitoring Event Timing on HC11 Board</p></div>
<div id="attachment_447" class="wp-caption aligncenter" style="width: 470px"><a href="http://www.chadhuard.com/wp-content/uploads/2010/04/ScopeTest.png" rel="lightbox[444]"><img class="size-full wp-image-447" title="ScopeTest" src="http://www.chadhuard.com/wp-content/uploads/2010/04/ScopeTest.png" alt="" width="460" height="320" /></a><p class="wp-caption-text">HC11 EVB E-clock (top) and A0 Address Bus Pin (bottom)</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.chadhuard.com/2010/04/introducing-scopezilla-hp-54720a/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Project Proposal</title>
		<link>http://www.chadhuard.com/2010/04/project-proposal/</link>
		<comments>http://www.chadhuard.com/2010/04/project-proposal/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 17:27:37 +0000</pubDate>
		<dc:creator>Chad</dc:creator>
				<category><![CDATA[Final Project]]></category>
		<category><![CDATA[accelerometer]]></category>
		<category><![CDATA[arm]]></category>
		<category><![CDATA[assembly]]></category>
		<category><![CDATA[HC11]]></category>
		<category><![CDATA[robot]]></category>

		<guid isPermaLink="false">http://www.chadhuard.com/?p=438</guid>
		<description><![CDATA[I have just gotten approval on my project proposal.  Eventually this contraption will be a 2 degree of freedom robotic arm that will be able to balance a tennis ball on a plate even when the base is tipped.  For now it will just look like a simplified arm that responds to the input of an accelerometer. [...]]]></description>
			<content:encoded><![CDATA[<p>I have just gotten approval on my project proposal.  Eventually this contraption will be a 2 degree of freedom robotic arm that will be able to balance a tennis ball on a plate even when the base is tipped.  For now it will just look like a simplified arm that responds to the input of an accelerometer.  Now the hard part&#8230; getting the thing to actually work!</p>

<iframe src="http://www.chadhuard.com/wp-content/plugins/google-document-embedder/proxy.php?url=http%3A%2F%2Fwww.chadhuard.com%2Fwp-content%2Fuploads%2F2010%2F04%2FChad_Huard_Proposal.pdf&hl=en_US&gdet=&embedded=true" width="100%" height="500" frameborder="0" style="min-width:305px;" class="gde-frame"></iframe>

<p class="gde-text"><a href="http://www.chadhuard.com/wp-content/uploads/2010/04/Chad_Huard_Proposal.pdf" target="_blank" class="gde-link">Download (PDF, 294.11KB)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.chadhuard.com/2010/04/project-proposal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BE1200 &#8211; Arduino Project</title>
		<link>http://www.chadhuard.com/2010/04/be1200-arduino-project/</link>
		<comments>http://www.chadhuard.com/2010/04/be1200-arduino-project/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 17:07:49 +0000</pubDate>
		<dc:creator>Chad</dc:creator>
				<category><![CDATA[BE1200]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[BlinkM]]></category>

		<guid isPermaLink="false">http://www.chadhuard.com/?p=431</guid>
		<description><![CDATA[This is the final report for a project in BE1200.  The problem statement was given to us by the professor.  The project uses quite a few arduino peripherals, including a BlinkM programable tricolor LED, a light sensor and a temperature sensor.  We even did a simple study to see how many degrees the internal temperature in [...]]]></description>
			<content:encoded><![CDATA[<p>This is the final report for a project in BE1200.  The problem statement was given to us by the professor.  The project uses quite a few arduino peripherals, including a BlinkM programable tricolor LED, a light sensor and a temperature sensor.  We even did a simple study to see how many degrees the internal temperature in a refrigerator rises with different periods of the door being open, and how long it takes to return to standard operating temperature.  This study was not statistically accurate, it was only performed on one refrigerator, the sample size was small and the length of time between tests was not enough for the refrigerator to return to an equilibrium, it gave us some understanding of the lengths of time involved.  Here is one of the samples shown as Temp vs Time:</p>
<p><a href="http://www.chadhuard.com/wp-content/uploads/2010/04/Temp-Graph-small.png" rel="lightbox[431]"><img class="aligncenter size-full wp-image-434" title="Temp Graph small" src="http://www.chadhuard.com/wp-content/uploads/2010/04/Temp-Graph-small.png" alt="" width="500" height="300" /></a></p>

<iframe src="http://www.chadhuard.com/wp-content/plugins/google-document-embedder/proxy.php?url=http%3A%2F%2Fwww.chadhuard.com%2Fwp-content%2Fuploads%2F2010%2F04%2FReport.pdf&hl=en_US&gdet=&embedded=true" width="100%" height="500" frameborder="0" style="min-width:305px;" class="gde-frame"></iframe>

<p class="gde-text"><a href="http://www.chadhuard.com/wp-content/uploads/2010/04/Report.pdf" target="_blank" class="gde-link">Download (PDF, 273.55KB)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.chadhuard.com/2010/04/be1200-arduino-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Equate File for HC11 Registers</title>
		<link>http://www.chadhuard.com/2010/03/equate-file-for-hc11-registers/</link>
		<comments>http://www.chadhuard.com/2010/03/equate-file-for-hc11-registers/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 14:51:54 +0000</pubDate>
		<dc:creator>Chad</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Microcomputers]]></category>
		<category><![CDATA[68HC11]]></category>
		<category><![CDATA[assembly]]></category>
		<category><![CDATA[EQU]]></category>
		<category><![CDATA[equate]]></category>
		<category><![CDATA[HC11]]></category>
		<category><![CDATA[registers]]></category>

		<guid isPermaLink="false">http://www.chadhuard.com/?p=412</guid>
		<description><![CDATA[I couldn&#8217;t find an equate file of the registers for the 68HC11 anywhere online, so I just typed it all in myself.  To spare others from the same tedium I am posting it here in hopes that anyone who needs it can find it easily.  The file includes both the extended addresses of each of [...]]]></description>
			<content:encoded><![CDATA[<p>I couldn&#8217;t find an equate file of the registers for the 68HC11 anywhere online, so I just typed it all in myself.  To spare others from the same tedium I am posting it here in hopes that anyone who needs it can find it easily.  The file includes both the extended addresses of each of the HC11 registers, but also the offsets from $1000 for use with indexed addressing.  To use it, just put the file in the same folder as your program and insert the following code at the top of your assembly program and you will be able to call all of the registers by name:<br />
<code>#include "EQU.txt"</code></p>
<p>Hopefully you find it useful.</p>
<p><a href="http://www.chadhuard.com/wp-content/uploads/2010/03/EQU.txt">EQU.txt</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.chadhuard.com/2010/03/equate-file-for-hc11-registers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PWM / Motor Control Update</title>
		<link>http://www.chadhuard.com/2010/03/pwm-motor-control-update/</link>
		<comments>http://www.chadhuard.com/2010/03/pwm-motor-control-update/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 14:05:50 +0000</pubDate>
		<dc:creator>Chad</dc:creator>
				<category><![CDATA[Final Project]]></category>
		<category><![CDATA[assembly]]></category>
		<category><![CDATA[HC11]]></category>
		<category><![CDATA[PWM]]></category>
		<category><![CDATA[servo]]></category>

		<guid isPermaLink="false">http://www.chadhuard.com/?p=394</guid>
		<description><![CDATA[As it turns out, the ubiquitous little servo motors that seem to be everywhere are more sensitive to the PWM signal being sent to them than I originally thought.  At first I thought that as long as you were sending them a pulse that was the appropriate length that the frequency did not matter much, but try [...]]]></description>
			<content:encoded><![CDATA[<p>As it turns out, the ubiquitous little servo motors that seem to be everywhere are more sensitive to the PWM signal being sent to them than I originally thought.  At first I thought that as long as you were sending them a pulse that was the appropriate length that the frequency did not matter much, but try as I might, I could not get my servo to work with a 32.7ms delay (thats the time between TOIs on the HC11).  It actually required a very precise 20ms period before I could get my servo to do anything slam itself into the left hand side of its range.  Perhaps my servo is particularly picky, or perhaps it wasn&#8217;t the period at all and I just happened to change something else that made it work at the same time as I changed the period to 20ms (it was kind of one of those &#8220;I&#8217;ll do anything to get this damn thing to work&#8221; moments, so I was flailing around changing anything I could think of, all at the same time).</p>
<p>At any rate, I did eventually get the HC11 to control the servo motor based on the ADC input reading the pot on the evaluation board.  I still have a lot of tuning to do.  I am currently splitting up the functions and trying to work out a good way to organize things so that I can keep the PWM stuff in a separate file and link it to the main program.  I also need to calibrate the range of the servo, but that will come later.</p>
<p>Here is the code:</p>
<p><code></p>
<div id="_mcePaste">*=========================================</div>
<div id="_mcePaste">* TAKE ANALOG INPUT ON PE0</div>
<div id="_mcePaste">* CONVERT TO PWM ON PA6</div>
<div id="_mcePaste">*=========================================</div>
<div id="_mcePaste">ORG $C000</div>
<div id="_mcePaste">PORTB_OF    EQU $04</div>
<div id="_mcePaste">ADR_OF      EQU $31</div>
<div id="_mcePaste">ADCTL_OF    EQU $30</div>
<div id="_mcePaste">TCNT        EQU $100E</div>
<div id="_mcePaste">P_WIDTH     EQU $1018</div>
<div id="_mcePaste">OC1         EQU $1016</div>
<div id="_mcePaste">TFLG1       EQU $1023</div>
<div id="_mcePaste">TMSK1       EQU $1022</div>
<div id="_mcePaste">RAW_READ    RMB 1</div>
<div id="_mcePaste">DELAY       RMB 2</div>
<div id="_mcePaste">FREQ        EQU $9C40</div>
<div id="_mcePaste">LDS #$8fff</div>
<div id="_mcePaste">LDX #$1000</div>
<div id="_mcePaste">* TURN ON A/D CONVERTER:</div>
<div id="_mcePaste">*====================================</div>
<div id="_mcePaste">LDAA    $1039</div>
<div id="_mcePaste">ORAA    #%10000000</div>
<div id="_mcePaste">STAA    $1039</div>
<div id="_mcePaste">* SET UP TIMER:</div>
<div id="_mcePaste">*====================================</div>
<div id="_mcePaste">* SET OC1 INTERRUPT:</div>
<div id="_mcePaste">LDAA    #%10000000</div>
<div id="_mcePaste">STAA    $1022</div>
<div id="_mcePaste">* SET OC2 TO CLEAR ON FLAG:</div>
<div id="_mcePaste">LDAA    #%10000000</div>
<div id="_mcePaste">STAA    $1020</div>
<div id="_mcePaste">* SET OC1 TO SET OC2:</div>
<div id="_mcePaste">LDAA    #%01000000</div>
<div id="_mcePaste">STAA    $100C</div>
<div id="_mcePaste">STAA    $100D</div>
<div id="_mcePaste">* ENABLE INTERRUPTS:</div>
<div id="_mcePaste">CLI</div>
<div id="_mcePaste">*====================================</div>
<div id="_mcePaste">* MAIN PROGRAM</div>
<div id="_mcePaste">*====================================</div>
<div id="_mcePaste">LOOP        JSR GET_PE0</div>
<div id="_mcePaste">JSR PRC_DELAY</div>
<div id="_mcePaste">BRA LOOP</div>
<div id="_mcePaste">*====================================</div>
<div id="_mcePaste">* SUB-ROUTINES:</div>
<div id="_mcePaste">*====================================</div>
<div id="_mcePaste">ORG $D000</div>
<div id="_mcePaste">*====================================</div>
<div id="_mcePaste">* D/A CONVERSION ON PIN 0</div>
<div id="_mcePaste">* AVERAGE RESULTS AND RETURN IN ACCB</div>
<div id="_mcePaste">*====================================</div>
<div id="_mcePaste">GET_PE0     LDAA    #%00000111</div>
<div id="_mcePaste">STAA    $1030</div>
<div id="_mcePaste">CLRA</div>
<div id="_mcePaste">CLRB</div>
<div id="_mcePaste">SELF1       BRCLR   ADCTL_OF,X $80 SELF1</div>
<div id="_mcePaste">LDAB    ADR_OF,X</div>
<div id="_mcePaste">ADDB    ADR_OF+1,X</div>
<div id="_mcePaste">ADCA    #$00</div>
<div id="_mcePaste">ADDB    ADR_OF+2,X</div>
<div id="_mcePaste">ADCA    #$00</div>
<div id="_mcePaste">ADDB    ADR_OF+3,X</div>
<div id="_mcePaste">ADCA    #$00</div>
<div id="_mcePaste">LSRD</div>
<div id="_mcePaste">LSRD</div>
<div id="_mcePaste">STAB    RAW_READ</div>
<div id="_mcePaste">RTS</div>
<div id="_mcePaste">*====================================</div>
<div id="_mcePaste">* CONVERT READING TO DELAY</div>
<div id="_mcePaste">*====================================</div>
<div id="_mcePaste">PRC_DELAY   CLRA</div>
<div id="_mcePaste">CLRB</div>
<div id="_mcePaste">LDAB    RAW_READ</div>
<div id="_mcePaste">ASLD</div>
<div id="_mcePaste">ASLD</div>
<div id="_mcePaste">ASLD</div>
<div id="_mcePaste">ADDD    #1800</div>
<div id="_mcePaste">STD     DELAY</div>
<div id="_mcePaste">RTS</div>
<div id="_mcePaste">*====================================</div>
<div id="_mcePaste">* OC1 INTERRUPT ROUTINE:</div>
<div id="_mcePaste">*====================================</div>
<div id="_mcePaste">ORG     $00DF</div>
<div id="_mcePaste">JMP     $D100</div>
<div id="_mcePaste">ORG     $D100</div>
<div id="_mcePaste">OC1_I       LDD     TCNT</div>
<div id="_mcePaste">ADDD    DELAY</div>
<div id="_mcePaste">STD     P_WIDTH</div>
<div id="_mcePaste">LDD     TCNT</div>
<div id="_mcePaste">ADDD    #FREQ</div>
<div id="_mcePaste">STD     OC1</div>
<div id="_mcePaste">LDAA    #%10000000</div>
<div id="_mcePaste">STAA    TFLG1</div>
<div id="_mcePaste">STAA    TMSK1</div>
<div id="_mcePaste">RTI</div>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.chadhuard.com/2010/03/pwm-motor-control-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Preliminary Investigation</title>
		<link>http://www.chadhuard.com/2010/03/preliminary-investigation/</link>
		<comments>http://www.chadhuard.com/2010/03/preliminary-investigation/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 17:25:56 +0000</pubDate>
		<dc:creator>Chad</dc:creator>
				<category><![CDATA[Final Project]]></category>
		<category><![CDATA[HC11]]></category>
		<category><![CDATA[I2C]]></category>
		<category><![CDATA[servo]]></category>
		<category><![CDATA[wii nunchuk]]></category>

		<guid isPermaLink="false">http://www.chadhuard.com/?p=381</guid>
		<description><![CDATA[I am currently trying to come up with some interesting ideas for my final project in Intro to Microcomputers.  The project is pretty much open ended just providing that you use most of what we have learned in class.  Two things I am looking at, even though I am not sure what exactly I plan [...]]]></description>
			<content:encoded><![CDATA[<p>I am currently trying to come up with some interesting ideas for my final project in Intro to Microcomputers.  The project is pretty much open ended just providing that you use most of what we have learned in class.  Two things I am looking at, even though I am not sure what exactly I plan to do with them, are my wii nunchuk and servo motors.  I have <a href="http://www.youtube.com/watch?v=MD_-YnFZFP8">seen nunchuk/servo projects</a> before using arduino, but with all of the libraries available on that platform the task seems much more manageable.  Programing the HC11 is essentially like starting with a blank piece of paper.</p>
<p>I am currently trying to decide if I will be able to make my nunchuk work with the HC11 or not.  Unfortunately the chip does not natively support the I2c protocol that the nunchuk uses.  I have found a chip that essentially allows a processor to <a href="http://www.google.com/url?q=http://www.silabs.com/Support%2520Documents/TechnicalDocs/CP2120.pdf&amp;ei=fTOyS8X0H5LcNezprZsE&amp;sa=X&amp;oi=nshc&amp;resnum=1&amp;ct=result&amp;cd=1&amp;ved=0CAsQzgQoAA&amp;usg=AFQjCNGru-YLjUS7urX5iekcUycJ4nPTOw">communicate with I2C devices using SPI</a>, but it is in a really tiny package and my soldering is probably not up to it.  We will see.</p>
<p>On the other front, the servo research is going much better.  I will post my progress on this soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chadhuard.com/2010/03/preliminary-investigation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lab 8 &#8211; Interrupts</title>
		<link>http://www.chadhuard.com/2010/03/lab-8-interrupts/</link>
		<comments>http://www.chadhuard.com/2010/03/lab-8-interrupts/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 19:01:14 +0000</pubDate>
		<dc:creator>Chad</dc:creator>
				<category><![CDATA[Microcomputers]]></category>
		<category><![CDATA[assembly]]></category>
		<category><![CDATA[HC11]]></category>
		<category><![CDATA[interrupt]]></category>

		<guid isPermaLink="false">http://www.chadhuard.com/?p=471</guid>
		<description><![CDATA[This lab explores the interrupt, its uses and its use of the stack.  Without interrupts, a processor is required to poll each condition that it is required to react to.  Whether it is checking to see if a button is pressed, or if a bit has been received on a serial pin, the processor is [...]]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste">This lab explores the interrupt, its uses and its use of the stack.  Without interrupts, a processor is required to poll each condition that it is required to react to.  Whether it is checking to see if a button is pressed, or if a bit has been received on a serial pin, the processor is spending valuable time checking on environmental conditions when it it may have other things that are waiting to be done.  To solve the problem of needing to constantly poll the status of certain conditions the HC11 implements an interrupt system.  This interrupt system allows specific events to grab the processor away from what it is doing and handle the event.  The ability to do this is crucial for events where timing is important (such as serial or parallel data transfer).</div>
<div></div>
<div id="_mcePaste">This lab will deal with the IRQ interrupt, which will be used to react to a button press, and the SWI interrupt, which will be used to illustrate the interrupt’s use of the stack to store the environment.</div>
<div></div>
<div>
<iframe src="http://www.chadhuard.com/wp-content/plugins/google-document-embedder/proxy.php?url=http%3A%2F%2Fwww.chadhuard.com%2Fwp-content%2Fuploads%2F2010%2F04%2Flab8.pdf&hl=en_US&gdet=&embedded=true" width="100%" height="500" frameborder="0" style="min-width:305px;" class="gde-frame"></iframe>

<p class="gde-text"><a href="http://www.chadhuard.com/wp-content/uploads/2010/04/lab8.pdf" target="_blank" class="gde-link">Download (PDF, 199.93KB)</a></p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.chadhuard.com/2010/03/lab-8-interrupts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
