<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Building an Event Counter / Rotary Measurement device for $15</title><link>/technologies/test-and-measurement/b/blog/posts/building-an-event-counter-rotary-measurement-device-for-15</link><description>I recently needed a quick device to count pulses and measure distance/rotation and I thought it worth documenting in case others have similar requirements. If you’re building something mechanical (e.g. a robot) then this could become a standard ...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Building an Event Counter / Rotary Measurement device for $15</title><link>https://community.element14.com/technologies/test-and-measurement/b/blog/posts/building-an-event-counter-rotary-measurement-device-for-15</link><pubDate>Fri, 20 Sep 2013 16:14:58 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:06d8856e-38df-457d-bcf6-b15052876689</guid><dc:creator>shabaz</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Hello Tom,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I&amp;#39;m so sorry, it looks like I missed out a step :-(&lt;/p&gt;&lt;p&gt;Processor Expert has a set of features, but it is possible to increase them for greater functionality.&lt;/p&gt;&lt;p&gt;I had installed a set of features from &lt;a class="jive-link-external-small" href="http://mcuoneclipse.com/2013/05/09/processor-expert-component-peupd-files-on-github/" rel="nofollow ugc noopener" target="_blank"&gt;this site&lt;/a&gt; - but&amp;nbsp; &lt;a class="jive-link-external-small" href="https://github.com/ErichStyger/mcuoneclipse/archive/master.zip" rel="nofollow ugc noopener" target="_blank"&gt;use this direct link to the zip file&lt;/a&gt; (about 23 MByte).&lt;/p&gt;&lt;p&gt;This gives you some great features like a WAIT1_waitms. If that is the only one that is missing, in theory you could replace it with just a &amp;#39;for&amp;#39; loop (e.g. a loop of 100000), the time period is non-critical, and it will still work. The best way is to download the additional features from that site, and the wait feature will provide a sleep.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;By the way, when you download the file from that site, you may find you cannot extract it. The Windows built-in unzip capability did not work for me. I had to use 7-zip to extract it.&lt;/p&gt;&lt;p&gt;When you extract, it gives two files in the PEupd sub-folder in the zip file.&lt;/p&gt;&lt;p&gt;These can be imported into CodeWarrior using the menu Processor Expert-&amp;gt;Import Components.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I will add this information to the page.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;By the way, since you are building the code, don&amp;#39;t forget after you are done with Processor Expert changes, when you compile, afterwards, add the | 0x03 mentioned above (an example is pasted below) and compile again. This is to enable the pull-ups (otherwise you will need external pull-ups). The Processor Expert components that I used did not have a pull-up capability. If I add more components from Processor Expert, then the | 0x03 gets wiped since technically this is not advisable to modify the auto-generated code. I&amp;#39;m sure it is resolvable, but I didn&amp;#39;t spend time on that.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt; PORTC_PCR13 = (uint32_t)((PORTC_PCR13 &amp;amp; (uint32_t)~(uint32_t)(&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORT_PCR_IRQC(0x05)&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )) | (uint32_t)(&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORT_PCR_ISF_MASK |&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORT_PCR_IRQC(0x0A)&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )) | 0x03;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=16458&amp;AppID=13&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Building an Event Counter / Rotary Measurement device for $15</title><link>https://community.element14.com/technologies/test-and-measurement/b/blog/posts/building-an-event-counter-rotary-measurement-device-for-15</link><pubDate>Fri, 20 Sep 2013 15:58:39 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:06d8856e-38df-457d-bcf6-b15052876689</guid><dc:creator>e14 Contributor</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Line 134 in processorexpert.c gave me &amp;quot;undefined reference to WAIT1_waitms.&amp;nbsp; Seems the function isn&amp;#39;t declared anywhere.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=16458&amp;AppID=13&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Building an Event Counter / Rotary Measurement device for $15</title><link>https://community.element14.com/technologies/test-and-measurement/b/blog/posts/building-an-event-counter-rotary-measurement-device-for-15</link><pubDate>Sat, 14 Sep 2013 06:48:35 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:06d8856e-38df-457d-bcf6-b15052876689</guid><dc:creator>mcb1</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Shabaz&lt;/p&gt;&lt;p&gt;This is a great little tool, with many uses for quick and easy applications.&lt;/p&gt;&lt;p&gt;Thanks&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Mark&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=16458&amp;AppID=13&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>