<?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 sscanf problem in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/sscanf-problem/m-p/171556#M11583</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have a problem with using sscanf. I want to convert a hexdezimal ASCII Code to an integer. If i use it in main(), everything works, but if i put in in an event like AS1_OnRxChar() it does not work. Sometimes there are the wrong results, somtimes the program "hangs".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code is like:&lt;/P&gt;&lt;P&gt;void&amp;nbsp; AS2_OnRxChar(void)&lt;BR /&gt;{&lt;BR /&gt;...&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; char in[] = "CD";&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; int i;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sscanf(in, "%x", &amp;amp;i);&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;The variable i should be 205, but it does not work!!!&lt;/P&gt;&lt;P&gt;Can sombody help me? What is my mistake?&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;freddyka&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Jun 2012 15:18:58 GMT</pubDate>
    <dc:creator>freddyka</dc:creator>
    <dc:date>2012-06-12T15:18:58Z</dc:date>
    <item>
      <title>sscanf problem</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/sscanf-problem/m-p/171556#M11583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have a problem with using sscanf. I want to convert a hexdezimal ASCII Code to an integer. If i use it in main(), everything works, but if i put in in an event like AS1_OnRxChar() it does not work. Sometimes there are the wrong results, somtimes the program "hangs".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code is like:&lt;/P&gt;&lt;P&gt;void&amp;nbsp; AS2_OnRxChar(void)&lt;BR /&gt;{&lt;BR /&gt;...&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; char in[] = "CD";&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; int i;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sscanf(in, "%x", &amp;amp;i);&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;The variable i should be 205, but it does not work!!!&lt;/P&gt;&lt;P&gt;Can sombody help me? What is my mistake?&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;freddyka&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2012 15:18:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/sscanf-problem/m-p/171556#M11583</guid>
      <dc:creator>freddyka</dc:creator>
      <dc:date>2012-06-12T15:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: sscanf problem</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/sscanf-problem/m-p/171557#M11584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds like a stack overflow. Increase the STACK_SIZE in the prm file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2012 09:39:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/sscanf-problem/m-p/171557#M11584</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2012-06-13T09:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: sscanf problem</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/sscanf-problem/m-p/171558#M11585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if i change the Stack-size sometime it runs better, sometimes not. It seems, that is the problem. But what size is necessary for the Stack? Where can i see the used RAM? My microcontroller is the MC9S08DZ60.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for an answer,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;freddyka&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jun 2012 16:24:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/sscanf-problem/m-p/171558#M11585</guid>
      <dc:creator>freddyka</dc:creator>
      <dc:date>2012-06-15T16:24:17Z</dc:date>
    </item>
  </channel>
</rss>

