<?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>Output compare interrupt</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/37125/output-compare-interrupt</link><description> 
i would like to use the output compare 1 Interrupt. What do I have
to add (or remove) to following code, so that it works? 

 
 TIM_InitStructure.TIM_Mode = TIM_OCM_CHANNEL_1;
 TIM_InitStructure.TIM_OC1_Modes = TIM_TIMING;
 TIM_InitStructure.TIM_Clock_Source</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Output compare interrupt</title><link>https://community.arm.com/thread/130109?ContentTypeID=1</link><pubDate>Wed, 10 Jan 2007 14:48:56 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:9f183f0d-e142-4029-90c1-42ebe78a3df2</guid><dc:creator>Peter Row</dc:creator><description>&lt;p&gt;&lt;p&gt;
I&amp;#39;m trying to set up the timer so that it compares the freerunning
counter with the compare register and when those registers match,
then it should jump into the Interrupt Handler subroutine, or at
least set the interrupt flag, for which I can poll.&lt;/p&gt;

&lt;p&gt;
Actually I do this, like discribed in the ref-manual, but
obviously the interrupt Flag is never set!&lt;/p&gt;

&lt;p&gt;
To use the output compare function, select the following in the
TIM_CR1 and TIM_CR2 registers:&lt;/p&gt;

&lt;p&gt;
&lt;b&gt;1)&lt;/b&gt; Set the OCiE bit if an output is needed then the OCMPi
pin is dedicated to the output compare i function.&lt;br /&gt;
&lt;b&gt;2)&lt;/b&gt; Select the timer clock ECKEN and program the prescaler
(CC[7:0]).&lt;br /&gt;
&lt;b&gt;3)&lt;/b&gt; Select the OLVLi bit to applied to the OCMPi pins after the
match occurs. &lt;i&gt;(I don&amp;#39;t need this)&lt;/i&gt;&lt;br /&gt;
&lt;b&gt;4)&lt;/b&gt; Set the OCiIE bit to generate an interrupt if required.&lt;/p&gt;

&lt;p&gt;
I do this with following code:&lt;/p&gt;

&lt;pre&gt;
   TIM1-&amp;gt;CR1 &amp;amp;= 0xFFBF;          //OCMP1 = 0
   TIM1-&amp;gt;CR1 != 0x0001;              //ECKEN = 1
   TIM1-&amp;gt;CR1 &amp;amp;= 0xFDFF;          //OLVL1 = 0
   TIM1-&amp;gt;CR2 != 0x4000;              //OC1IE = 1
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Output compare interrupt</title><link>https://community.arm.com/thread/123598?ContentTypeID=1</link><pubDate>Wed, 10 Jan 2007 14:18:34 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f2e16171-035c-4e09-a6c4-6d22f4013224</guid><dc:creator>Dan Henry</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&amp;quot;What else do you need to know?&amp;quot;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
What you are trying to achieve and what doesn&amp;#39;t work.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Output compare interrupt</title><link>https://community.arm.com/thread/112580?ContentTypeID=1</link><pubDate>Wed, 10 Jan 2007 13:13:50 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:7e78e455-c766-4f65-904b-4e9104751a71</guid><dc:creator>Peter Row</dc:creator><description>&lt;p&gt;&lt;p&gt;
I&amp;#39;m using the STR912F on the MCBSTR9U Board.&lt;/p&gt;

&lt;p&gt;
What else do you need to know?&lt;/p&gt;

&lt;p&gt;
don&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Output compare interrupt</title><link>https://community.arm.com/thread/98801?ContentTypeID=1</link><pubDate>Wed, 10 Jan 2007 11:14:04 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:916f8732-975f-431e-8b61-c58fb10331dd</guid><dc:creator>Dan Henry</dc:creator><description>&lt;p&gt;&lt;p&gt;
Well, as I just got done saying to another poster here:&lt;/p&gt;

&lt;p&gt;
The ARM is merely the processor core around which manufacturers
connect their own memory and peripheral subsystems.&lt;/p&gt;

&lt;p&gt;
In other words timer subsystems by Atmel, NXP, ADI, Freescale,
STM, etc. are not created equal.&lt;/p&gt;

&lt;p&gt;
What are you using? We&amp;#39;re not mind readers!&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Output compare interrupt</title><link>https://community.arm.com/thread/88124?ContentTypeID=1</link><pubDate>Wed, 10 Jan 2007 11:02:16 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:48129623-9252-4f78-9683-3127f68128d6</guid><dc:creator>Peter Row</dc:creator><description>&lt;p&gt;&lt;p&gt;
alright, and beside that?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Output compare interrupt</title><link>https://community.arm.com/thread/88125?ContentTypeID=1</link><pubDate>Wed, 10 Jan 2007 10:59:47 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f8b03463-be7a-42b3-a3a4-110d858afd48</guid><dc:creator>Peter Row</dc:creator><description>&lt;p&gt;&lt;p&gt;
lol&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Output compare interrupt</title><link>https://community.arm.com/thread/47550?ContentTypeID=1</link><pubDate>Wed, 10 Jan 2007 10:25:36 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:a17a9c90-3539-46ca-9a5c-32ad5a943ae7</guid><dc:creator>Dan Henry</dc:creator><description>&lt;p&gt;&lt;p&gt;
No MCU specified.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>