<?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>S12 / MagniV Microcontrollers中的主题 Eficiency</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Eficiency/m-p/140340#M3092</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;I was wondering why my code cycle repeated itselft so slowly and decided to see what part of it took so long. In the end i got the down to;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;FONT color="#000000" face="Courier New" size="2"&gt;&lt;SPAN class="msg_source_code"&gt;&lt;SPAN class="text_smallest"&gt;Code:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;PRE&gt;void main(void) {  EnableInterrupts;  TSCR1 = 0x80;               //ENABLE TIMER  TSCR2 = 0x04;        //PRESCALER SET TO 16  for(;;)   {    Marker9 = Marker8;    Marker8 = Marker7;    Marker7 = Marker6;    Marker6 = Marker5;    Marker5 = Marker4;    Marker4 = Marker3;    Marker3 = Marker2;    Marker2 = Marker1;    Marker1 = TCNT;                       }}&lt;/PRE&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;FONT color="#000000" face="Courier New" size="2"&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;FONT color="#333333" face="Arial"&gt;I then looked at the marker values and was amazed to see that&amp;nbsp;each differed by 3-4 increments of the timer. with a timer prescaler of 16 thats 45-60 bus cycles is it not? Why is such a simple operation taking so long?&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Oct 2020 08:40:38 GMT</pubDate>
    <dc:creator>ernestsnaith</dc:creator>
    <dc:date>2020-10-29T08:40:38Z</dc:date>
    <item>
      <title>Eficiency</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Eficiency/m-p/140340#M3092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;I was wondering why my code cycle repeated itselft so slowly and decided to see what part of it took so long. In the end i got the down to;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;FONT color="#000000" face="Courier New" size="2"&gt;&lt;SPAN class="msg_source_code"&gt;&lt;SPAN class="text_smallest"&gt;Code:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;PRE&gt;void main(void) {  EnableInterrupts;  TSCR1 = 0x80;               //ENABLE TIMER  TSCR2 = 0x04;        //PRESCALER SET TO 16  for(;;)   {    Marker9 = Marker8;    Marker8 = Marker7;    Marker7 = Marker6;    Marker6 = Marker5;    Marker5 = Marker4;    Marker4 = Marker3;    Marker3 = Marker2;    Marker2 = Marker1;    Marker1 = TCNT;                       }}&lt;/PRE&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;FONT color="#000000" face="Courier New" size="2"&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;FONT color="#333333" face="Arial"&gt;I then looked at the marker values and was amazed to see that&amp;nbsp;each differed by 3-4 increments of the timer. with a timer prescaler of 16 thats 45-60 bus cycles is it not? Why is such a simple operation taking so long?&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:40:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Eficiency/m-p/140340#M3092</guid>
      <dc:creator>ernestsnaith</dc:creator>
      <dc:date>2020-10-29T08:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: Eficiency</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Eficiency/m-p/140341#M3093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi, Ernest:&lt;BR /&gt;&lt;BR /&gt;Not much information to go on, but here are a few things to look at.&lt;BR /&gt;&lt;BR /&gt;What type are Marker1 through Marker9? If they were floats, 60 cycles sound reasonable, but certainly to long if they were 16-bit integers.&lt;BR /&gt;&lt;BR /&gt;Where are they allocated? In page-zero? On the stack?&lt;BR /&gt;&lt;BR /&gt;Could there be interrupts enabled that may be sapping all of your CPU bandwidth?&lt;BR /&gt;&lt;BR /&gt;Have you looked at the assembly code that was generated?&lt;BR /&gt;&lt;BR /&gt;I don't know what timer you are using, so are you sure it's running on the same clock as the CPU?&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Dec 2006 05:09:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Eficiency/m-p/140341#M3093</guid>
      <dc:creator>rocco</dc:creator>
      <dc:date>2006-12-17T05:09:14Z</dc:date>
    </item>
  </channel>
</rss>

