<?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 Re: sscanf and sprintf on mc9s12dj128b in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/sscanf-and-sprintf-on-mc9s12dj128b/m-p/141226#M3237</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Bobby ; I wouldnt attack the problem this way. &lt;BR /&gt;The GPS might have a different output on a day to day basis.&lt;BR /&gt;&lt;BR /&gt;Someone might change the GPS setup.&lt;BR /&gt;It depends of course how robust you need your code to be,and how &lt;BR /&gt;"serious" the application is. If its a serious commercial &lt;BR /&gt;application ,you shold go another route.&lt;BR /&gt;&lt;BR /&gt;Then you should take the received string and pass it to a &lt;BR /&gt;function that splits the string in an array of strings. &lt;BR /&gt;&lt;BR /&gt;The comma would need to be the separator.Luckily such a function&lt;BR /&gt;is testable in an XP environment....&lt;BR /&gt;&lt;BR /&gt;In e.g CSharp (C#) this is called Split(.....) ,which returns an array&lt;BR /&gt;to you. Here Im afraid you must make the split() routine yourselves.&lt;BR /&gt;&lt;BR /&gt;Unless you are lucky,and finds it on the Net.&lt;BR /&gt;&lt;BR /&gt;Then ,you must check the beginning of each little string ,and check &lt;BR /&gt;what it begins with .If its an 'N' its the North ,if its an 'E' its&lt;BR /&gt;the East ,and so on.&lt;BR /&gt;&lt;BR /&gt;Regards ,&lt;BR /&gt;kwik&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 09 Sep 2006 03:00:53 GMT</pubDate>
    <dc:creator>kwik</dc:creator>
    <dc:date>2006-09-09T03:00:53Z</dc:date>
    <item>
      <title>sscanf and sprintf on mc9s12dj128b</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/sscanf-and-sprintf-on-mc9s12dj128b/m-p/141224#M3235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to extract some informations from a string.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This string has not always the same lengh, but all values are separated by a ",".&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The string on wich I work is an NMEA GPS string for people who now their structure.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So what I want to do is a sscanf. The fonction work properly on a PC with visual studio 2005. But the same code don't want to work on my mc9s12. The compilator doesn(t return any error but no values has extracted.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using sscanf like below : &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;nbValuesReturned = sscanf(dataReceived,"$GPRMC,%2d%2d%2d.00,%c,%2d%f,N,%2d%f,E,%*f,%f,%2d%2d%2d",time.hour,time.minute,time.seconde,validity.positionOk,latitudeDegree,position.latitude,longitudeDegree,position.longitude,position.course,time.day,time.month,time.year);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I know the line is very long but I've test on shorter strings but it is the same thing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is someone has an idea ? Maybe sscanf can't work on mc9s12 ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have the same problem with sprintf wich is the opposite of sscanf.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm sorry for my english. If someone has an idea it will be really usefull for me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Bobby&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jun 2006 06:49:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/sscanf-and-sprintf-on-mc9s12dj128b/m-p/141224#M3235</guid>
      <dc:creator>Bobby</dc:creator>
      <dc:date>2006-06-28T06:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: sscanf and sprintf on mc9s12dj128b</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/sscanf-and-sprintf-on-mc9s12dj128b/m-p/141225#M3236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;sscanf should work with HCS12 CPU.&lt;/P&gt;&lt;P&gt;Basically if you want to use sscanf or sprintf in your application:&lt;/P&gt;&lt;P&gt;&amp;nbsp; - Make sure to include stdio.h in each source file, where you are using one of these function&lt;BR /&gt;&amp;nbsp; - Make sure to define a big enough stack. (try to define at least 1.5 K of stack)&lt;/P&gt;&lt;P&gt;If this does not help please submit a service request through our web site. Make sure to attach a project&lt;BR /&gt;reproducing the issue to the request.&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jun 2006 15:05:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/sscanf-and-sprintf-on-mc9s12dj128b/m-p/141225#M3236</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2006-06-28T15:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: sscanf and sprintf on mc9s12dj128b</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/sscanf-and-sprintf-on-mc9s12dj128b/m-p/141226#M3237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Bobby ; I wouldnt attack the problem this way. &lt;BR /&gt;The GPS might have a different output on a day to day basis.&lt;BR /&gt;&lt;BR /&gt;Someone might change the GPS setup.&lt;BR /&gt;It depends of course how robust you need your code to be,and how &lt;BR /&gt;"serious" the application is. If its a serious commercial &lt;BR /&gt;application ,you shold go another route.&lt;BR /&gt;&lt;BR /&gt;Then you should take the received string and pass it to a &lt;BR /&gt;function that splits the string in an array of strings. &lt;BR /&gt;&lt;BR /&gt;The comma would need to be the separator.Luckily such a function&lt;BR /&gt;is testable in an XP environment....&lt;BR /&gt;&lt;BR /&gt;In e.g CSharp (C#) this is called Split(.....) ,which returns an array&lt;BR /&gt;to you. Here Im afraid you must make the split() routine yourselves.&lt;BR /&gt;&lt;BR /&gt;Unless you are lucky,and finds it on the Net.&lt;BR /&gt;&lt;BR /&gt;Then ,you must check the beginning of each little string ,and check &lt;BR /&gt;what it begins with .If its an 'N' its the North ,if its an 'E' its&lt;BR /&gt;the East ,and so on.&lt;BR /&gt;&lt;BR /&gt;Regards ,&lt;BR /&gt;kwik&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Sep 2006 03:00:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/sscanf-and-sprintf-on-mc9s12dj128b/m-p/141226#M3237</guid>
      <dc:creator>kwik</dc:creator>
      <dc:date>2006-09-09T03:00:53Z</dc:date>
    </item>
  </channel>
</rss>

