<?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>Rotary Encoders - Part 5: Capturing Input on an FPGA</title><link>/members-area/personalblogs/b/blog/posts/rotary-encoders---part-5-capturing-input-on-an-fpga</link><description>I&amp;#39;ve removed the rotary encoder from the scroll button of a defect mouse. Let&amp;#39;s see how we can use that in a microcontroller design.In post 1, I wired up the electronics .In part 2, I&amp;#39;m capturing the encoder&amp;#39;s info on a Cypress PSoC4 .In the third blog</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Rotary Encoders - Part 5: Capturing Input on an FPGA</title><link>https://community.element14.com/members-area/personalblogs/b/blog/posts/rotary-encoders---part-5-capturing-input-on-an-fpga</link><pubDate>Sat, 05 Jun 2021 16:40:03 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:5be56f7a-b794-4c61-8fea-fb0ae504f84c</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I&amp;#39;m training Pynq and Zynq design.&lt;/p&gt;&lt;p&gt;I&amp;#39;ve tried to port the PWM module of this post to that architecture.&lt;/p&gt;&lt;p&gt;Instead of taking the input for PWM duty cycle from a rotary encoder, I take it from the embedded ARM controller.&lt;/p&gt;&lt;p&gt;Success:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/620x604/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-5be56f7a-b794-4c61-8fea-fb0ae504f84c/8358.contentimage_5F00_203902.png:620:604]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;I still have a lot to learn, but I managed to change the duty cycle from 6.5 to 15.5%, just like with the rotary encoder in the original post above&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/620x387/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-5be56f7a-b794-4c61-8fea-fb0ae504f84c/6215.contentimage_5F00_203903.png:620:387]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/620x378/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-5be56f7a-b794-4c61-8fea-fb0ae504f84c/5710.contentimage_5F00_203904.png:620:378]&lt;/span&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=21291&amp;AppID=293&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Rotary Encoders - Part 5: Capturing Input on an FPGA</title><link>https://community.element14.com/members-area/personalblogs/b/blog/posts/rotary-encoders---part-5-capturing-input-on-an-fpga</link><pubDate>Fri, 17 Jul 2015 15:19:15 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:5be56f7a-b794-4c61-8fea-fb0ae504f84c</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I finally managed to get that video uploaded.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span id="b989d7c5_e3a0_4928_b01d_aee845af189d"&gt;&lt;span&gt;[View:https://www.youtube.com/watch?v=gm-mlS4_pCQ:740:466]&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=21291&amp;AppID=293&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Rotary Encoders - Part 5: Capturing Input on an FPGA</title><link>https://community.element14.com/members-area/personalblogs/b/blog/posts/rotary-encoders---part-5-capturing-input-on-an-fpga</link><pubDate>Wed, 15 Jul 2015 13:15:19 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:5be56f7a-b794-4c61-8fea-fb0ae504f84c</guid><dc:creator>michaelkellett</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;It&amp;#39;s nice of you to invite me to comment&amp;nbsp; - I&amp;#39;m kind of busy right now so I&amp;#39;ll be brief.&lt;/p&gt;&lt;p&gt;First let me say that I appreciate the public service you do in posting this stuff so the last thing I want to do is nitpick about style.&lt;/p&gt;&lt;p&gt;There are two things that stand out:&lt;/p&gt;&lt;p&gt;1) You don&amp;#39;t reset in your code - the world is divided on this but I find it is often very useful to have a way of resetting the FPGA.&lt;/p&gt;&lt;p&gt;2) You don&amp;#39;t indent your if statements (may be an E14 problem)&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I use a top level block diagram (and possibly lower level diagrams too) to instantiate and wire up entities (in AldecHDL). I find this makes complex designs much more understandable.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;If your concern re PulseCount is this line:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;if PulseCount &amp;lt; (&amp;quot;0001&amp;quot; &amp;amp; Position) then&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;then I don&amp;#39;t see any problem except that a comment might help others to understand it, and of course it imposes some restrictions on the timing of your waveforms which may well be an acceptable tradeoff for simplicity.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Do you simulate your FPGA code before running it ?&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;MK&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=21291&amp;AppID=293&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>