<?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>serial and timer problem</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/33207/serial-and-timer-problem</link><description> hi, 
The soft is composed with 
 
•	One interrupt timer 
•	One serial interrupt 
 
If we use at the same time the serial interrupt and the timer interrupt, the string transfert is not regular, she was composed by random wrong value like &amp;#39;;&amp;#39; &amp;#39;&amp;amp;&amp;#39; or another</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: serial and timer problem</title><link>https://community.arm.com/thread/39703?ContentTypeID=1</link><pubDate>Thu, 22 May 2003 07:39:17 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ebcb075f-de65-478c-9f4f-29a0f13c1fdd</guid><dc:creator>terrance peiris</dc:creator><description>&lt;p&gt;Hi Jeromi, I beleived u should solve this problem if not let me know&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: serial and timer problem</title><link>https://community.arm.com/thread/39704?ContentTypeID=1</link><pubDate>Tue, 18 Feb 2003 18:28:02 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:4d4724ab-4665-42a5-8823-419608c33ae3</guid><dc:creator>Ronald Hartley</dc:creator><description>&lt;p&gt;Jerome,&lt;br /&gt;
I&amp;#39;m using serial ISR (Mode 2) and timer0 (Mode 2) ISR, too, and if I go below -40 (215) for TL0 reload of TH0, my Serial ISR stops working. Under that it&amp;#39;s fine.&lt;br /&gt;
I can&amp;#39;t figure it out, can you?&lt;br /&gt;
&lt;br /&gt;
I&amp;#39;ve tried many things, and here are my ISR codes:&lt;br /&gt;
serial () interrupt 4 using 2&lt;br /&gt;
{&lt;br /&gt;
if (RI)&lt;br /&gt;
  {&lt;br /&gt;
  Targets_Status = SBUF; 	RI=0;&lt;br /&gt;
  else RCV1=1;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void timer0 (void) interrupt 1 using 1&lt;br /&gt;
{ int i=0;&lt;br /&gt;
  Frequency_Out = 0;&lt;br /&gt;
  Frequency_Out = 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: serial and timer problem</title><link>https://community.arm.com/thread/141212?ContentTypeID=1</link><pubDate>Sun, 02 Feb 2003 19:24:53 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d7525158-0697-4a65-a493-f83a4247d662</guid><dc:creator>Mark H</dc:creator><description>&lt;p&gt;Hi Alberic,&lt;br /&gt;
&lt;br /&gt;
I have just realised (hopefully) what you problem is, it is like you say the timer interrupt but it is because you have specified the WRONG interrupt number for Timer_0(void), interrupt 3 is for timer 1, so if you change it to be as follows:-&lt;br /&gt;
&lt;br /&gt;
Timer_0(void) interrupt 1&lt;br /&gt;
&lt;br /&gt;
then i think everything should now be ok.&lt;br /&gt;
&lt;br /&gt;
Mark.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: serial and timer problem</title><link>https://community.arm.com/thread/137646?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2003 06:22:50 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:410ce15b-de70-495e-9525-b12e17048cf6</guid><dc:creator>albaric jerome</dc:creator><description>&lt;p&gt;Chiane is declared in UCHAR and Poids in long&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: serial and timer problem</title><link>https://community.arm.com/thread/137647?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2003 06:18:12 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:6a49845b-a639-48fd-93cf-a24d3db7df01</guid><dc:creator>albaric jerome</dc:creator><description>&lt;p&gt;Chiane is declared in UCHAR and Poids in long&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: serial and timer problem</title><link>https://community.arm.com/thread/137645?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2003 06:14:26 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:dfa715d2-1ce6-4889-b1f0-b053fe5cdcb4</guid><dc:creator>albaric jerome</dc:creator><description>&lt;p&gt;Chiane is declared in UCHAR and Poids in long&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: serial and timer problem</title><link>https://community.arm.com/thread/137644?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2003 06:13:49 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:7a8d0cde-1617-4cbe-9fda-24fbd3f0c015</guid><dc:creator>albaric jerome</dc:creator><description>&lt;p&gt;Chiane is declared in UCHAR and Poids in long&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: serial and timer problem</title><link>https://community.arm.com/thread/134134?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2003 04:34:05 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d9205242-ee74-4403-9482-0c8cbf7d26ec</guid><dc:creator>John Donaldson</dc:creator><description>&lt;p&gt;Or &amp;#39;poids&amp;#39; for that matter - is it declared as a long?&lt;br /&gt;
&lt;br /&gt;
Stefan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: serial and timer problem</title><link>https://community.arm.com/thread/121891?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2003 04:30:58 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:af5c8246-5075-4e0b-802e-9de25b1a3aa0</guid><dc:creator>John Donaldson</dc:creator><description>&lt;p&gt;I don&amp;#39;t see the declarations of &amp;#39;chaine&amp;#39; and &amp;#39;pdsaff&amp;#39; - can you post the complete source?&lt;br /&gt;
&lt;br /&gt;
Stefan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: serial and timer problem</title><link>https://community.arm.com/thread/110226?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2003 01:44:56 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:0d6b8ed4-d556-4b46-b0ab-29698aaddf21</guid><dc:creator>albaric jerome</dc:creator><description>&lt;p&gt;i try but i have the same problem&lt;br /&gt;
&lt;br /&gt;
thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: serial and timer problem</title><link>https://community.arm.com/thread/95333?ContentTypeID=1</link><pubDate>Wed, 29 Jan 2003 08:58:36 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d85a8e17-264d-4636-9fda-8926857d5d0d</guid><dc:creator>Mark Hickman</dc:creator><description>&lt;p&gt;If you are using Timer 2 as the baud rate generator, dont you need to set the correct bits in T2CON?&lt;br /&gt;
&lt;br /&gt;
Include in void config_Rs232(void)&lt;br /&gt;
&lt;br /&gt;
T2CON = 0x34;   // RCLK, TCLK enabled, TR2 start timer&lt;br /&gt;
&lt;br /&gt;
Mark&lt;br /&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: serial and timer problem</title><link>https://community.arm.com/thread/54978?ContentTypeID=1</link><pubDate>Wed, 29 Jan 2003 04:07:34 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:af25fb45-8365-4423-9146-be26a9d011ca</guid><dc:creator>albaric jerome</dc:creator><description>&lt;p&gt;i think it&amp;#39;s that but i don&amp;#39;t know how can i change... sorry i am a new user&lt;br /&gt;
&lt;br /&gt;
thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: serial and timer problem</title><link>https://community.arm.com/thread/39700?ContentTypeID=1</link><pubDate>Wed, 29 Jan 2003 04:01:09 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:96e3dccd-b19e-452e-90ed-65d93639490e</guid><dc:creator>John Donaldson</dc:creator><description>&lt;p&gt;I suggest you take a look at the interrupt driven serial i/o examples in the download area on this site. The way you are handling serial rx/tx is a bit weird - maybe the timer being enabled/disabled is just changing the timing a bit and messing up the transmission?&lt;br /&gt;
&lt;br /&gt;
Stefan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>