<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>LPCXpresso IDE中的主题 Re: Timer and interrupts</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-and-interrupts/m-p/552043#M12136</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ferix on Thu Jul 28 13:09:15 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Bit Angle Modulation is a software PWM, hardware PWM is working like a charm already &lt;SPAN class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;&lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Its more, how can i do stuff in my main void and once every time, when a timer triggers, go out of the main void to a new void.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;when i make something like this and put it all at the bottom of my code and call it in my main void it works:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;Int test123 (void)
{
GPIOSetValue(0, 7, 1);
}&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt;i want the same but then when a timer "Interrupts" that it then executes a void.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;almost at the bottom of this PDF is some info about Bit Angle Modulation:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.artisticlicence.com/WebSiteMaster/App%20Notes/appnote011.pdf&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 22:08:45 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T22:08:45Z</dc:date>
    <item>
      <title>Timer and interrupts</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-and-interrupts/m-p/552041#M12134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ferix on Thu Jul 28 10:54:38 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to dim a lot of LED's using Bit Angle Modulation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In the blinky example, the uC goes into sleep mode after executing its code and once every 10mS the timer "Interrupts" and the uC wakes up, executes the blinkaled code and goes back to sleep.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to do other stuff to while PWMing LED's so i don't want to have my uC sleeping all the time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;How do i modify my code to do this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
&amp;nbsp; [FONT=Courier New, monospace][SIZE=2][COLOR=#7f0055][B]#include[/B][/COLOR][COLOR=#2a00ff]"driver_config.h"[/COLOR][/SIZE][/FONT]
 [FONT=Courier New, monospace][SIZE=2][COLOR=#7f0055][B]#include[/B][/COLOR][COLOR=#2a00ff]"target_config.h"[/COLOR][/SIZE][/FONT]
 [FONT=Courier New, monospace][SIZE=2][COLOR=#7f0055][B]#include[/B][/COLOR][COLOR=#2a00ff]"timer32.h"[/COLOR][/SIZE][/FONT]
 [FONT=Courier New, monospace][SIZE=2][COLOR=#7f0055][B]#include[/B][/COLOR][COLOR=#2a00ff]"gpio.h"[/COLOR][/SIZE][/FONT]
 

 [FONT=Courier New, monospace][SIZE=2][COLOR=#7f0055][B]int [/B][/COLOR][COLOR=#000000][B]main[/B][/COLOR][COLOR=#000000] ([/COLOR][COLOR=#7f0055][B]void[/B][/COLOR][COLOR=#000000])[/COLOR][/SIZE][/FONT]
 [COLOR=#000000][FONT=Courier New, monospace][SIZE=2]{[/SIZE][/FONT][/COLOR]
 [COLOR=#000000][FONT=Courier New, monospace][SIZE=2]init_timer32(1, TIME_INTERVAL);[/SIZE][/FONT][/COLOR]
 [COLOR=#000000][FONT=Courier New, monospace][SIZE=2]enable_timer32(1);[/SIZE][/FONT][/COLOR]
 [COLOR=#000000][FONT=Courier New, monospace][SIZE=2]GPIOInit();[/SIZE][/FONT][/COLOR]
 

 [FONT=Courier New, monospace][SIZE=2][COLOR=#7f0055][B]while[/B][/COLOR][COLOR=#000000](1)[/COLOR][/SIZE][/FONT]
&amp;nbsp;&amp;nbsp; [COLOR=#000000][FONT=Courier New, monospace][SIZE=2]{[/SIZE][/FONT][/COLOR]
 [COLOR=#000000][FONT=Courier New, monospace][SIZE=2]&amp;nbsp;&amp;nbsp;&amp;nbsp; dostuffhere[/SIZE][/FONT][/COLOR]
&amp;nbsp;&amp;nbsp; [COLOR=#000000][FONT=Courier New, monospace][SIZE=2]}[/SIZE][/FONT][/COLOR]
 [COLOR=#000000][FONT=Courier New, monospace][SIZE=2]}[/SIZE][/FONT][/COLOR]
 

 [COLOR=#000000][FONT=Courier New, monospace][SIZE=2]Timerinterrupt()[/SIZE][/FONT][/COLOR]
 [COLOR=#000000][FONT=Courier New, monospace][SIZE=2]{[/SIZE][/FONT][/COLOR]
 [COLOR=#000000][FONT=Courier New, monospace][SIZE=2]&amp;nbsp;&amp;nbsp;&amp;nbsp; Code for PWMing LED's with Bit Angle Modulation[/SIZE][/FONT][/COLOR]
 [COLOR=#000000][FONT=Courier New, monospace][SIZE=2]}[/SIZE][/FONT][/COLOR]
 &lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt;Its a bit of a beginners question but i hope you don't mind to help me out.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:08:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-and-interrupts/m-p/552041#M12134</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: Timer and interrupts</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-and-interrupts/m-p/552042#M12135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ex-Zero on Thu Jul 28 11:58:32 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Forum Search ? Google ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://"&gt;http://www.microbuilder.eu/projects/LPC1343ReferenceDesign/LPC1343_LPC1114_PWM.aspx&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:08:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-and-interrupts/m-p/552042#M12135</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: Timer and interrupts</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-and-interrupts/m-p/552043#M12136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ferix on Thu Jul 28 13:09:15 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Bit Angle Modulation is a software PWM, hardware PWM is working like a charm already &lt;SPAN class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;&lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Its more, how can i do stuff in my main void and once every time, when a timer triggers, go out of the main void to a new void.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;when i make something like this and put it all at the bottom of my code and call it in my main void it works:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;Int test123 (void)
{
GPIOSetValue(0, 7, 1);
}&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt;i want the same but then when a timer "Interrupts" that it then executes a void.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;almost at the bottom of this PDF is some info about Bit Angle Modulation:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.artisticlicence.com/WebSiteMaster/App%20Notes/appnote011.pdf&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:08:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-and-interrupts/m-p/552043#M12136</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: Timer and interrupts</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-and-interrupts/m-p/552044#M12137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by qili on Thu Jul 28 13:24:13 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;it probably isn't that difficult to write two routines:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) initialize the timer: this will set the timer to trip after a user-specified period of time;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2) hook in a user code to be run by the timer isr: you can use a function pointer for that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this allows the user code to be run periodically, at a user-specified interval.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:08:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-and-interrupts/m-p/552044#M12137</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: Timer and interrupts</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-and-interrupts/m-p/552045#M12138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ferix on Thu Jul 28 14:43:45 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;hmm, i got something working &lt;SPAN class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;&lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i still have this part of code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;Int test123 (void)
{
GPIOSetValue(0, 7, 1);
}&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt;in the timer32.C library i found that every time the timer "interrupts" this part of code triggers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;void TIMER32_0_IRQHandler(void)
{&amp;nbsp; 
&amp;nbsp; if ( LPC_TMR32B0-&amp;gt;IR &amp;amp; 0x01 )
&amp;nbsp; {&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_TMR32B0-&amp;gt;IR = 1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* clear interrupt flag */
&amp;nbsp;&amp;nbsp;&amp;nbsp; timer32_0_counter++;
&amp;nbsp; }
&amp;nbsp; if ( LPC_TMR32B0-&amp;gt;IR &amp;amp; (0x1&amp;lt;&amp;lt;4) )
&amp;nbsp; {&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_TMR32B0-&amp;gt;IR = 0x1&amp;lt;&amp;lt;4;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* clear interrupt flag */
&amp;nbsp;&amp;nbsp;&amp;nbsp; timer32_0_capture++;
&amp;nbsp; }
&amp;nbsp; return;
}&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt;so i added test123(); to that part and now its working &lt;SPAN class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;&lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Bit ugly but hey&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:08:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-and-interrupts/m-p/552045#M12138</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:08:46Z</dc:date>
    </item>
  </channel>
</rss>

