<?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>Stepper Motor Control with Hercules High-End Timer - Part 7: HET Assembly Language Test</title><link>/technologies/industrial-automation-space/b/blog/posts/stepper-motor-control-with-hercules-high-end-timer---part-7-het-assembly-language-test</link><description>I&amp;#39;m trying to control an unknown stepper motor with the high-end timer (NHET) module of a Texas Instruments Hercules microcontroller I got a freebie from TI almost a year ago. An unknown stepper motor, a driver board and a Hercules RM57 LaunchPad. The</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Stepper Motor Control with Hercules High-End Timer - Part 7: HET Assembly Language Test</title><link>https://community.element14.com/technologies/industrial-automation-space/b/blog/posts/stepper-motor-control-with-hercules-high-end-timer---part-7-het-assembly-language-test</link><pubDate>Sun, 05 Jan 2020 17:24:40 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:5fd0d1b0-d612-4e9c-8e4c-a24673f8dbf5</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I&amp;#39;m checking some more advanced timer functions (not related to the stepper motor exercise, more for my own learning)&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;TI has an example to &lt;a class="jive-link-external-small" href="http://www.ti.com/lit/an/spna178/spna178.pdf" rel="nofollow ugc noopener" target="_blank"&gt;generate dynamic PWM signals and measure timing errors&lt;/a&gt;, all done within the timers.&lt;/p&gt;&lt;p&gt;This example is interesting because it tests generating somewhat complex signals (a triangle waveform).&lt;/p&gt;&lt;p&gt;The signal is made by changing the duty cycle od a PWM dynamically. A discrete low pass filter (a resistor and capacitor) turns those pulses into the analog waveform.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/617x370/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-5fd0d1b0-d612-4e9c-8e4c-a24673f8dbf5/8712.contentimage_5F00_188533.png:617:370]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Because the PWM signal has different duty cycles during a single wave cycle, this signal is interesting to test if the timer can detect precision of a signal&amp;#39;s attributes.&lt;/p&gt;&lt;p&gt;The second part of the timer logic uses this capability. It puts an output pin high (and raises a software trigger too that you can use for counting failures) whe the duty cycle is outside a given range.&lt;/p&gt;&lt;p&gt;You see that in the blue trace.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Everything, except the optional trigger, consumes 0 CPU cycles. Really 0 cycles on the Hercules. I can stop the controller in the debugger and both timer functions will happily continue working.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/620x827/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-5fd0d1b0-d612-4e9c-8e4c-a24673f8dbf5/1768.contentimage_5F00_188534.png:620:827]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I&amp;#39;ll write a post on this, because TI&amp;#39;s example needs some changes to make it work on a LaunchPad that aren&amp;#39;t documented ...&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=3166&amp;AppID=141&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Stepper Motor Control with Hercules High-End Timer - Part 7: HET Assembly Language Test</title><link>https://community.element14.com/technologies/industrial-automation-space/b/blog/posts/stepper-motor-control-with-hercules-high-end-timer---part-7-het-assembly-language-test</link><pubDate>Mon, 12 Jun 2017 10:17:09 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:5fd0d1b0-d612-4e9c-8e4c-a24673f8dbf5</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Capture of both the SPI and PWM part:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/663x427/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-5fd0d1b0-d612-4e9c-8e4c-a24673f8dbf5/6712.contentimage_5F00_188532.png:663:427]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Signals on all lines, but the motor doesn&amp;#39;t move yet.&lt;/p&gt;&lt;p&gt;Although I thought I was sending the identical SPI commands from Hercules as those from the official&amp;#39; MSP example, something may be missing. &lt;/p&gt;&lt;p&gt;When I pull the DRV out of sleep, it consumes 13 ma instead of the 600 mA it draws with the MSP430 app...&lt;/p&gt;&lt;p&gt;Reset and nSLeep aren&amp;#39;t shown here. I&amp;#39;ve measured those with a multimeter.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;But this is good news by itself: there&amp;#39;s no GAP in capabilities - the Hercules can provide the required signals.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=3166&amp;AppID=141&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Stepper Motor Control with Hercules High-End Timer - Part 7: HET Assembly Language Test</title><link>https://community.element14.com/technologies/industrial-automation-space/b/blog/posts/stepper-motor-control-with-hercules-high-end-timer---part-7-het-assembly-language-test</link><pubDate>Sun, 11 Jun 2017 14:50:03 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:5fd0d1b0-d612-4e9c-8e4c-a24673f8dbf5</guid><dc:creator>michaelkellett</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Useful blog Jan, I see that the HET has been around since 2010 (at least) and this is the first time I&amp;#39;ve noticed it !!&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Motorola (in the days before On and Freescale) offered a complex programmable timer but they never supported it with decent tools so it wasn&amp;#39;t used much.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;It looks as if TI support this a lot better - I wonder if it might appear on non Hercules ARMs at some time.&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=3166&amp;AppID=141&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Stepper Motor Control with Hercules High-End Timer - Part 7: HET Assembly Language Test</title><link>https://community.element14.com/technologies/industrial-automation-space/b/blog/posts/stepper-motor-control-with-hercules-high-end-timer---part-7-het-assembly-language-test</link><pubDate>Sat, 10 Jun 2017 19:37:20 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:5fd0d1b0-d612-4e9c-8e4c-a24673f8dbf5</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Here&amp;#39;s a capture of a TI NHET example with dynamic period.&lt;/p&gt;&lt;p&gt;I&amp;#39;ve compiled it from source and it&amp;#39;s running on my controller now, an excellent opportunity to start from working code.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;The scope shows how the frequency of the signal dynamically and gradually slows down and speeds up.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/620x372/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-5fd0d1b0-d612-4e9c-8e4c-a24673f8dbf5/5633.contentimage_5F00_188529.png:620:372]&lt;/span&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=3166&amp;AppID=141&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Stepper Motor Control with Hercules High-End Timer - Part 7: HET Assembly Language Test</title><link>https://community.element14.com/technologies/industrial-automation-space/b/blog/posts/stepper-motor-control-with-hercules-high-end-timer---part-7-het-assembly-language-test</link><pubDate>Sat, 10 Jun 2017 17:49:48 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:5fd0d1b0-d612-4e9c-8e4c-a24673f8dbf5</guid><dc:creator>DAB</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Another excellent post Jan.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Good detail and screen captures so that the reader can easily follow along.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Well done.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;DAB&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=3166&amp;AppID=141&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>