<?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>topic Wierd wierd function behavior... - MCS08GT32A in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Wierd-wierd-function-behavior-MCS08GT32A/m-p/209372#M17860</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;P&gt;I really hope someone can tell me whats is going wrong, im fairly new to c/codewarrior and to the HCS08GT32A microcontroller.&amp;nbsp;The following doesn't make any sense me &lt;A href="http://freescale.i.lithium.com/i/smilies/16x16_smiley-sad.gif"&gt;&lt;IMG alt=":smileysad:" class="emoticon emoticon-smileysad" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-sad.gif" title="Smiley Sad" /&gt;&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my main looks like this:&lt;/P&gt;&lt;P&gt;void main(void)&lt;BR /&gt;{&amp;nbsp;&lt;BR /&gt;&amp;nbsp; char *test_str = "111222333";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; system_setup();&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; for(;&lt;A href="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif"&gt;&lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;&lt;/A&gt;&lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; display_string_still(test_str);&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;}&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;void display_string_still(incomming_str)&lt;BR /&gt;{&amp;nbsp;&lt;BR /&gt;&amp;nbsp; unsigned char disp_buffer[BUFFER_LENGTH][BUFFER_HEIGHT]; //BUFFER_LENGTH = 4&amp;nbsp; BUFFER_HEIGHT = 10&lt;BR /&gt;&amp;nbsp; unsigned char i;&lt;BR /&gt;&amp;nbsp; unsigned char j;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; display_string_rolling_left(incomming_str);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; for(i = 0; i &amp;lt; BUFFER_LENGTH; i++)&lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(j = 0;j &amp;lt; BUFFER_HEIGHT; j++)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; disp_buffer[i][j] = 0b00000000;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;The above code doesn't work... But if&amp;nbsp;I out comment the two for-loops it will run perfectly(display_string_rolling_left(incomming_str) is then working and making the text roll on my LEDS). But why?...&amp;nbsp;First of all the for-loops occurs after the display_string_rolling_left(incomming_str) function call. To my knowledge these things should be executed sequential? And since&amp;nbsp;the disp_buffer is a local variable, it shouldn't influence anything out of this void display_string_still() scope?..&amp;nbsp;Or&amp;nbsp;am&amp;nbsp;I missing something(which problerly is the case since im new in this microcontroller world &lt;A href="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif"&gt;&lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;&lt;/A&gt;) ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;Rubberduck&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Added p/n to subject.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Message Edited by NLFSJ on &lt;/SPAN&gt;&lt;SPAN class="date_text"&gt;2008-12-17&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;07:47 AM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Dec 2008 20:32:43 GMT</pubDate>
    <dc:creator>Rubberduck</dc:creator>
    <dc:date>2008-12-11T20:32:43Z</dc:date>
    <item>
      <title>Wierd wierd function behavior... - MCS08GT32A</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Wierd-wierd-function-behavior-MCS08GT32A/m-p/209372#M17860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;P&gt;I really hope someone can tell me whats is going wrong, im fairly new to c/codewarrior and to the HCS08GT32A microcontroller.&amp;nbsp;The following doesn't make any sense me &lt;A href="http://freescale.i.lithium.com/i/smilies/16x16_smiley-sad.gif"&gt;&lt;IMG alt=":smileysad:" class="emoticon emoticon-smileysad" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-sad.gif" title="Smiley Sad" /&gt;&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my main looks like this:&lt;/P&gt;&lt;P&gt;void main(void)&lt;BR /&gt;{&amp;nbsp;&lt;BR /&gt;&amp;nbsp; char *test_str = "111222333";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; system_setup();&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; for(;&lt;A href="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif"&gt;&lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;&lt;/A&gt;&lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; display_string_still(test_str);&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;}&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;void display_string_still(incomming_str)&lt;BR /&gt;{&amp;nbsp;&lt;BR /&gt;&amp;nbsp; unsigned char disp_buffer[BUFFER_LENGTH][BUFFER_HEIGHT]; //BUFFER_LENGTH = 4&amp;nbsp; BUFFER_HEIGHT = 10&lt;BR /&gt;&amp;nbsp; unsigned char i;&lt;BR /&gt;&amp;nbsp; unsigned char j;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; display_string_rolling_left(incomming_str);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; for(i = 0; i &amp;lt; BUFFER_LENGTH; i++)&lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(j = 0;j &amp;lt; BUFFER_HEIGHT; j++)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; disp_buffer[i][j] = 0b00000000;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;The above code doesn't work... But if&amp;nbsp;I out comment the two for-loops it will run perfectly(display_string_rolling_left(incomming_str) is then working and making the text roll on my LEDS). But why?...&amp;nbsp;First of all the for-loops occurs after the display_string_rolling_left(incomming_str) function call. To my knowledge these things should be executed sequential? And since&amp;nbsp;the disp_buffer is a local variable, it shouldn't influence anything out of this void display_string_still() scope?..&amp;nbsp;Or&amp;nbsp;am&amp;nbsp;I missing something(which problerly is the case since im new in this microcontroller world &lt;A href="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif"&gt;&lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;&lt;/A&gt;) ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;Rubberduck&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Added p/n to subject.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Message Edited by NLFSJ on &lt;/SPAN&gt;&lt;SPAN class="date_text"&gt;2008-12-17&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;07:47 AM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Dec 2008 20:32:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Wierd-wierd-function-behavior-MCS08GT32A/m-p/209372#M17860</guid>
      <dc:creator>Rubberduck</dc:creator>
      <dc:date>2008-12-11T20:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: Wierd wierd function behavior...</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Wierd-wierd-function-behavior-MCS08GT32A/m-p/209373#M17861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;First of all, 0b00000000 is not valid C and will not compile on any standard C compiler.&lt;BR /&gt;&lt;BR /&gt;Apart from that, I suspect that the problem is related to a stack overflow. You are allocating 40 bytes on the stack at each function call.&lt;BR /&gt;&lt;BR /&gt;What does "going wrong / doesn't work" mean, more specifically?&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Dec 2008 21:55:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Wierd-wierd-function-behavior-MCS08GT32A/m-p/209373#M17861</guid>
      <dc:creator>Lundin</dc:creator>
      <dc:date>2008-12-11T21:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: Wierd wierd function behavior...</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Wierd-wierd-function-behavior-MCS08GT32A/m-p/209374#M17862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;You were right, it was the stacksize that was too small, so it runs again now &lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt; Thanks alot for your answer!&lt;IMG alt=":smileyvery-happy:" class="emoticon emoticon-smileyvery-happy" id="smileyvery-happy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-very-happy.gif" title="Smiley Very Happy" /&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;What i meant with the going wrong thing, was that the display_string_rolling_left(incomming_str);&lt;BR /&gt;&amp;nbsp;was the place where the stack overflow&amp;nbsp;was occuring, so i was just confused, since a change in function A made function B go mad, but I learned something, and thanks again &lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Dec 2008 02:31:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Wierd-wierd-function-behavior-MCS08GT32A/m-p/209374#M17862</guid>
      <dc:creator>Rubberduck</dc:creator>
      <dc:date>2008-12-12T02:31:50Z</dc:date>
    </item>
  </channel>
</rss>

