<?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>timer counting in AT89s8252</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/25050/timer-counting-in-at89s8252</link><description> 
i&amp;#39;m currently doing a code on counting timer but there are error
while my port3^2 and port^2(START==0&amp;amp;&amp;amp;STOP==0)and port3^2 and
port^2(START==0&amp;amp;&amp;amp;STOP==1) and then it goes into the
disassembly then cant debug 
anyone can help me to correct my error please</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: timer counting in AT89s8252</title><link>https://community.arm.com/thread/125916?ContentTypeID=1</link><pubDate>Thu, 17 Dec 2009 02:50:38 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:6f47077d-0253-40c9-a7be-1d1e62be11bf</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
Did you actually look at the instructions?&lt;/p&gt;

&lt;p&gt;
They are immediately above the box where you enter your
message!&lt;/p&gt;

&lt;p&gt;
One thing they don&amp;#39;t mention: do &lt;i&gt;&lt;b&gt;not&lt;/b&gt;&lt;/i&gt; use TABs - use
only spaces!&lt;/p&gt;

&lt;p&gt;
(any decent editor - even uVision - can be set to insert spaces
when you press the TAB button)&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: timer counting in AT89s8252</title><link>https://community.arm.com/thread/115447?ContentTypeID=1</link><pubDate>Thu, 17 Dec 2009 02:41:51 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:9756617d-8f51-4e64-b811-e09e1d66a144</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
But copy the code from the editor, and not from one of the already
broken posts!&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: timer counting in AT89s8252</title><link>https://community.arm.com/thread/103678?ContentTypeID=1</link><pubDate>Thu, 17 Dec 2009 01:30:33 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:1f28365d-c819-4609-a78b-3f37b4128e7e</guid><dc:creator>Tamir Michael</dc:creator><description>&lt;p&gt;&lt;p&gt;
use the pre and /pre markers!&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: timer counting in AT89s8252</title><link>https://community.arm.com/thread/77999?ContentTypeID=1</link><pubDate>Thu, 17 Dec 2009 01:16:45 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:2f419559-b6d8-493d-9770-7029cd6e38bd</guid><dc:creator>Seng Hong Wong</dc:creator><description>&lt;p&gt;&lt;p&gt;
the code is like this&lt;/p&gt;

&lt;p&gt;
#include &amp;lt;AT898252.H&amp;gt;&lt;br /&gt;
unsigned char pulse_low=0,pulse_high=0;&lt;br /&gt;
unsigned int overflow_count=0,int_count=1,pulse=0;&lt;br /&gt;
long int pulse_width=0;&lt;br /&gt;
sbit STOP=P3^2;&lt;br /&gt;
sbit START=P3^3;&lt;br /&gt;
void main(){&lt;/p&gt;

&lt;p&gt;
TMOD=0x90;&lt;br /&gt;
TF1=0;&lt;br /&gt;
IT1=1;&lt;br /&gt;
IE=0x8c;&lt;/p&gt;

&lt;p&gt;
while(1){&lt;/p&gt;

&lt;p&gt;
unsigned int a;&lt;/p&gt;

&lt;p&gt;
if(START&amp;amp;~STOP)&lt;/p&gt;

&lt;p&gt;
{&lt;/p&gt;

&lt;p&gt;
a=0;&lt;/p&gt;

&lt;p&gt;
}&lt;/p&gt;

&lt;p&gt;
else if(~START&amp;amp;STOP)&lt;/p&gt;

&lt;p&gt;
{&lt;/p&gt;

&lt;p&gt;
a=1;&lt;/p&gt;

&lt;p&gt;
}&lt;/p&gt;

&lt;p&gt;
else if(~START&amp;amp;~STOP)&lt;/p&gt;

&lt;p&gt;
{&lt;/p&gt;

&lt;p&gt;
a=2;&lt;/p&gt;

&lt;p&gt;
}&lt;/p&gt;

&lt;p&gt;
else if (START&amp;amp;STOP)&lt;/p&gt;

&lt;p&gt;
{&lt;/p&gt;

&lt;p&gt;
a=3;&lt;/p&gt;

&lt;p&gt;
}&lt;/p&gt;

&lt;p&gt;
switch(a){&lt;br /&gt;
case 0:&lt;/p&gt;

&lt;p&gt;
{&lt;/p&gt;

&lt;p&gt;
TR1=1;&lt;br /&gt;
break;&lt;/p&gt;

&lt;p&gt;
}&lt;/p&gt;

&lt;p&gt;
case 1:&lt;/p&gt;

&lt;p&gt;
{&lt;/p&gt;

&lt;p&gt;
pulse_low=TL1;&lt;br /&gt;
pulse_high=TH1;&lt;br /&gt;
pulse=(TH1&amp;lt;&amp;lt;8)+TL1;&lt;br /&gt;
pulse_width=(overflow_count)*65536+pulse;&lt;br /&gt;
TH1=0x00;&lt;br /&gt;
TL1=0x00;&lt;br /&gt;
overflow_count=0;&lt;br /&gt;
break;&lt;/p&gt;

&lt;p&gt;
}&lt;/p&gt;

&lt;p&gt;
default:&lt;/p&gt;

&lt;p&gt;
{&lt;/p&gt;

&lt;p&gt;
break;&lt;/p&gt;

&lt;p&gt;
}&lt;br /&gt;
} }&lt;br /&gt;
} void timer1_int()interrupt 3&lt;br /&gt;
{&lt;/p&gt;

&lt;p&gt;
overflow_count++;&lt;/p&gt;

&lt;p&gt;
}&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: timer counting in AT89s8252</title><link>https://community.arm.com/thread/57457?ContentTypeID=1</link><pubDate>Thu, 17 Dec 2009 00:46:20 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:1446d9bc-78c2-410f-9812-f8d1f119cbd6</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
How about posting your code as code, instead posting it as
free-flow text? How? As described in the instructions directly above
the message input box.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>