<?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>BeagleBone Control Stepper Motors with PRU - Part 2: Test Driving Outputs</title><link>/products/devtools/single-board-computers/next-genbeaglebone/b/blog/posts/beaglebone-control-stepper-motors-with-pru---part-2-test-driving-outputs</link><description>I&amp;#39;m trying here is to let the real-time units of the BeagleBone generate the signals for a stepper motor .In this post: control two output pins from PRU and Linux The PRU will have to drive two pins when driving the stepper motor.One for the dire...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: BeagleBone Control Stepper Motors with PRU - Part 2: Test Driving Outputs</title><link>https://community.element14.com/products/devtools/single-board-computers/next-genbeaglebone/b/blog/posts/beaglebone-control-stepper-motors-with-pru---part-2-test-driving-outputs</link><pubDate>Mon, 19 Aug 2019 11:39:51 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:dd8a6df0-c408-4d6d-8503-837415c0f495</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Example C program that sends data to the PRU: &lt;a class="jive-link-external-small" href="https://git.ti.com/pru-software-support-package/pru-software-support-package/blobs/master/examples/am335x/PRU_ADC_onChip/pru_adc_userspace/pru_adc_userspace.c" rel="nofollow ugc noopener" target="_blank" title="https://git.ti.com/pru-software-support-package/pru-software-support-package/blobs/master/examples/am335x/PRU_ADC_onChip/pru_adc_userspace/pru_adc_userspace.c"&gt;https://git.ti.com/pru-software-support-package/pru-software-support-package/blobs/master/examples/am335x/PRU_ADC_onChip…&lt;/a&gt; &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;It uses the same mechanism as Linux command line, using the character device &lt;span&gt;/dev/rpmsg_pru30&lt;/span&gt;.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=7506&amp;AppID=80&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: BeagleBone Control Stepper Motors with PRU - Part 2: Test Driving Outputs</title><link>https://community.element14.com/products/devtools/single-board-computers/next-genbeaglebone/b/blog/posts/beaglebone-control-stepper-motors-with-pru---part-2-test-driving-outputs</link><pubDate>Thu, 25 Jul 2019 08:15:04 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:dd8a6df0-c408-4d6d-8503-837415c0f495</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Here&amp;#39;s a first capture.&lt;/p&gt;&lt;p&gt;Command executed:&lt;/p&gt;&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef06e6b-9b7d-4651-b12d-db8be7f5e991:type=text&amp;amp;text=echo+%221150%22+%3E+%2Fdev%2Frpmsg_pru30]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;First char is &amp;#39;1&amp;#39;. It tells the PRU to dive the DIR pin high.&lt;/p&gt;&lt;p&gt;The remainder is &amp;#39;150&amp;#39;, telling the PRU to create a train of 150 pulses&lt;/p&gt;&lt;p&gt;The main ARM controller only spends time when submitting the command, almost nothing.&lt;/p&gt;&lt;p&gt;Even if you tell the PRU to generate a few thousand pulses, the time spent in Linux is a few miliseconds.&lt;/p&gt;&lt;p&gt;You can keep on submitting commands from Linux while the previous command is still executing. They are queued and the PRU picks them up 1 by 1.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/634x380/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-dd8a6df0-c408-4d6d-8503-837415c0f495/2475.contentimage_5F00_204091.png:634:380]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I removed the wait time, so this is close to the maximum frequency I can achieve.&lt;/p&gt;&lt;p&gt;The code isn&amp;#39;t optimised. I could eek out some clock ticks by easy optimisations - but at the cost of readability.&lt;/p&gt;&lt;p&gt;It&amp;#39;s frequency is 6.7 MHz. I don&amp;#39;t think optimisation is needed for a stepper motor.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Below capture is when I execute the command:&lt;/p&gt;&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef06e6b-9b7d-4651-b12d-db8be7f5e991:type=text&amp;amp;text=echo+%2204%22+%3E+%2Fdev%2Frpmsg_pru30]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;It drives DIR low and generates 4 pulses. Ideal to get a few pulses on the screen in good resolution.&lt;/p&gt;&lt;p&gt;I&amp;#39;ve added the frequency at the bottom of the screen.&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-dd8a6df0-c408-4d6d-8503-837415c0f495/1070.contentimage_5F00_204092.png:620:372]&lt;/span&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=7506&amp;AppID=80&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: BeagleBone Control Stepper Motors with PRU - Part 2: Test Driving Outputs</title><link>https://community.element14.com/products/devtools/single-board-computers/next-genbeaglebone/b/blog/posts/beaglebone-control-stepper-motors-with-pru---part-2-test-driving-outputs</link><pubDate>Wed, 24 Jul 2019 21:49:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:dd8a6df0-c408-4d6d-8503-837415c0f495</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Code Composer Studio project and build instructions attached.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=7506&amp;AppID=80&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: BeagleBone Control Stepper Motors with PRU - Part 2: Test Driving Outputs</title><link>https://community.element14.com/products/devtools/single-board-computers/next-genbeaglebone/b/blog/posts/beaglebone-control-stepper-motors-with-pru---part-2-test-driving-outputs</link><pubDate>Wed, 24 Jul 2019 21:03:06 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:dd8a6df0-c408-4d6d-8503-837415c0f495</guid><dc:creator>DAB</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Nice walk through of the Linux driver software.&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=7506&amp;AppID=80&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>