<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/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>To drive a DC  motor.</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/30985/to-drive-a-dc-motor</link><description> 
Hi, 
Can anyone please give a C program for 8051 that can drive two DC
motors with time delay?? That is two motors have to run for 5secs and
stop for 5 secs. I have a program to interface the motors using l293d
but cannot understand how to implement</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: To drive a DC  motor.</title><link>https://community.arm.com/thread/128528?ContentTypeID=1</link><pubDate>Mon, 07 Apr 2014 04:57:30 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:dc20852d-f25c-4e79-8017-1788d0196dc9</guid><dc:creator>&amp;#178;erik malund</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;CPU clock frequency = crystal oscillator frequency/12&lt;/i&gt;&lt;br /&gt;
here you go again,&lt;/p&gt;

&lt;p&gt;
for the old steam driven &amp;#39;51 that is true, but for most modern
derivatives it is BLATANTLY FALSE&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To drive a DC  motor.</title><link>https://community.arm.com/thread/117523?ContentTypeID=1</link><pubDate>Sun, 06 Apr 2014 23:20:29 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:004a99e8-f1f5-4401-a38e-044a8b2c6859</guid><dc:creator>Ash J</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;...are based on...&lt;/i&gt;&lt;br /&gt;
are based on the crystal oscillator used.&lt;br /&gt;
Important note:&lt;br /&gt;
CPU clock frequency = crystal oscillator frequency/12&lt;br /&gt;
and&lt;br /&gt;
CPU clock time period = 1/CPU clock frequency&lt;/p&gt;

&lt;p&gt;
Also, i would prefer using a timer to generate a delay as compared
to generating a delay by using a software code.&lt;/p&gt;

&lt;p&gt;
@Rajat Saha refer to any text book. Mazidi is good for
starters.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To drive a DC  motor.</title><link>https://community.arm.com/thread/107600?ContentTypeID=1</link><pubDate>Sun, 06 Apr 2014 21:55:04 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:129db880-e28b-4414-868c-8d7c5296ce9d</guid><dc:creator>Deepakraj Srinivas</dc:creator><description>&lt;p&gt;&lt;p&gt;
Most of the basic 8051 family controllers are based on 11.0592MHz
clock, so i calculated machine cycles according to that frequency and
given the example.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To drive a DC  motor.</title><link>https://community.arm.com/thread/93158?ContentTypeID=1</link><pubDate>Sun, 06 Apr 2014 14:35:14 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:eef99ae4-238d-4b41-b2e8-206a1d27ae3e</guid><dc:creator>&amp;#178;erik malund</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;Ex: MOV R0,#01h - &amp;gt; 1 X &lt;b&gt;1.085uSec&lt;/b&gt; (1 Machine
cycle)&lt;/i&gt;&lt;br /&gt;
how do you know, there is no info re clock speed or processor&lt;br /&gt;
for a 8051f120 it coud be 30ns&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To drive a DC  motor.</title><link>https://community.arm.com/thread/62716?ContentTypeID=1</link><pubDate>Sun, 06 Apr 2014 07:23:22 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:6876eefe-6eab-4472-aa96-c7f37299cfcd</guid><dc:creator>Deepakraj Srinivas</dc:creator><description>&lt;p&gt;&lt;p&gt;
People can give the code, Its simple just try yourself, people are
there to help you.&lt;/p&gt;

&lt;p&gt;
Write a delay instead of timer(for your application),&lt;/p&gt;

&lt;p&gt;
Use simple instructions to build delay, how??&lt;/p&gt;

&lt;p&gt;
Ex: MOV R0,#01h - &amp;gt; 1 X 1.085uSec (1 Machine cycle)&lt;/p&gt;

&lt;p&gt;
MUL AB - &amp;gt; 4 X 1.085uSec (4 Machine cycle)&lt;/p&gt;

&lt;p&gt;
Since the above code will take 5.425uSec, Just calculate how many
times do you need to execute the above code to get 5Sec delay&lt;/p&gt;

&lt;p&gt;
All the best&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>