<?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 interrupt</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/18863/timer-interrupt</link><description> hello everyone, is there anybody know how to set timer interrupt with ST10 269 
 
The problem is that: the Tempo of sending data from the my ST10 269 to DAC is not the same everytime, it changes between 10us and 12us, because in my program there are</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Timer interrupt</title><link>https://community.arm.com/thread/130028?ContentTypeID=1</link><pubDate>Mon, 20 Feb 2006 10:31:38 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:39f21862-871d-4e54-848e-10460776923a</guid><dc:creator>Yaokui Xiong</dc:creator><description>&lt;p&gt;Thanks very much. I have tried ,it works already.&lt;br /&gt;
&lt;br /&gt;
Thanks again for your help&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer interrupt</title><link>https://community.arm.com/thread/123140?ContentTypeID=1</link><pubDate>Fri, 17 Feb 2006 12:13:21 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f2785b9f-a62f-498e-bf1e-16939e9fff17</guid><dc:creator>Chris Wunderlich</dc:creator><description>&lt;p&gt;Not sure where register.h comes from because you can use the Keil supplied header file &amp;quot;regst10f269.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Frequency of T3 = fCPU/(8x2^n) where I defined n = 0. So this gives you a T3 frequency of 2.5MHz (fCPU=20MHz). Which means each tick is 400nsec.&lt;br /&gt;
&lt;br /&gt;
To get a 20usec timeout perhaps you could take 20usec/400nsec -1 which is 49 decimal or 31 hexadecimal.&lt;br /&gt;
&lt;br /&gt;
Then in the example I can find this statement:&lt;br /&gt;
&lt;pre&gt;
#define Delay_20USEC 0x0031
&lt;/pre&gt;
T2 is used to automatically reload T3 after the underflow event.&lt;br /&gt;
&lt;pre&gt;
T2    =  Delay_20USEC;
&lt;/pre&gt;
So the T3 interrupt comes every 20 microseconds. In the T3 ISR you can add your code to update the DAC here or perhaps setup the PEC to move your data and then you don&amp;#39;t even need to vector to the interrupt.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer interrupt</title><link>https://community.arm.com/thread/111949?ContentTypeID=1</link><pubDate>Fri, 17 Feb 2006 11:14:15 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:fb4a2834-3cbf-449e-9df9-7570b621b1e0</guid><dc:creator>Yaokui Xiong</dc:creator><description>&lt;p&gt;Thank for your kind help.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I have actually already defined the address of T3,T3CON,T2,T2CON in register.h. The address in the datasheet is not the same as you gave to me, should I change it?&lt;br /&gt;
&lt;br /&gt;
In your programm how is the 20 us defined ?&lt;br /&gt;
because I have only seen several addresse,but no variable for the definition of 20us .&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer interrupt</title><link>https://community.arm.com/thread/97857?ContentTypeID=1</link><pubDate>Fri, 17 Feb 2006 09:02:43 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f459b330-5787-4f14-adad-2e0fcacbf82c</guid><dc:creator>Chris Wunderlich</dc:creator><description>&lt;p&gt;I am not sure how you are programming the rest of the device but here is a simple example (assumes 20MHz CPU clock).&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;
#define Delay_20USEC 0x0031

void InitGpt1(void)	{
  /* timer 3 works in timer mode, counts down */
  T3CON =  0x0080;
  T3    =  Delay_20USEC;

  /* - timer 2 works in reload mode */
  T2CON =  0x0027;
  T2    =  Delay_20USEC;

  T3IC =  0x007F; /* timer 3 interrupt (ILVL) = 15, (GLVL) = 3 */
  T3R =  1;       /* start timer 3 */
}


void GPT1Tmr3ISR(void) interrupt 0x23 {
  /* do what you want here! */
}

void main(void) {
  InitGpt1(); /* initialize GPT1 */
  IEN =  1;   /* globally enable interrupts */

	for(;;) {
	 ; /* loop forever */
	}
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer interrupt</title><link>https://community.arm.com/thread/73839?ContentTypeID=1</link><pubDate>Fri, 17 Feb 2006 02:20:24 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:e109c655-8d27-45c9-a93f-feeddfee4362</guid><dc:creator>Yaokui Xiong</dc:creator><description>&lt;p&gt;i dont know for 20us which timer should i choose, actually my main program interpolate the points between two points,it has used the line algorithm. Beim end of each ring it will send a signal to DAC. I just want tempo of the sending always be 20us.&lt;br /&gt;
Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer interrupt</title><link>https://community.arm.com/thread/73838?ContentTypeID=1</link><pubDate>Fri, 17 Feb 2006 02:16:39 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:1e87a210-b04b-4c10-b1c5-377b80b449eb</guid><dc:creator>Yaokui Xiong</dc:creator><description>&lt;p&gt;my processor is ST 10 269, it should be 16x family.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer interrupt</title><link>https://community.arm.com/thread/45563?ContentTypeID=1</link><pubDate>Thu, 16 Feb 2006 12:28:47 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d7db6e2e-b8d6-46dc-8124-54aec83b92eb</guid><dc:creator>Chris Wunderlich</dc:creator><description>&lt;p&gt;Yes, but you didn&amp;#39;t say which timer? Secondly, the repeatability would depend on what the core is doing at the time of the occurrence along with the interrupt level. You will ALWAYS have some amount of jitter when using software to make an update, it only a matter of how much you can minimize by your actions (control of the core).&lt;br /&gt;
&lt;br /&gt;
So you would have an interrupt that will calculate the new set point and another interrupt that is synchronized to an event (or periodic). The easiest way would be to use a PEC channel to make your move as this is simply a MOV instruction injected into the pipeline of the cpu.  If this not good enough then perhaps you need another interrupt to put the cpu into an idle state before the actual event will occur (also assuming that no other interrupts would also be allowed) so when the periodic interrupt does occur you should get the most repeatable update.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer interrupt</title><link>https://community.arm.com/thread/45560?ContentTypeID=1</link><pubDate>Thu, 16 Feb 2006 12:11:10 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:a8153565-f1e4-4547-aaa0-eec00b4e5774</guid><dc:creator>erik  malund</dc:creator><description>&lt;p&gt;I may be able to help you, but sice you did not see the need to enter Product: I can not since I have no idea whether your processor is a &amp;#39;51, 16x, &amp;#39;251 or ARM.&lt;br /&gt;
&lt;br /&gt;
Erik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>