<?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: MPXY8300 example code doubts in CodeWarrior Development Tools</title>
    <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/MPXY8300-example-code-doubts/m-p/415480#M2747</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the fact is that I must use them and I have 10pcs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Jun 2015 11:16:07 GMT</pubDate>
    <dc:creator>nemanjasavic</dc:creator>
    <dc:date>2015-06-29T11:16:07Z</dc:date>
    <item>
      <title>MPXY8300 example code doubts</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/MPXY8300-example-code-doubts/m-p/415478#M2745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello guys,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;while waiting for my MPXY8300 chip to arrive, I am looking at the provided example code for dev KIT and reading datasheet. The example code is explained in reference manual while complete code was posted in this thread few years ago &lt;A _jive_internal="true" data-containerid="2020" data-containertype="14" data-objectid="324812" data-objecttype="1" href="https://community.nxp.com/thread/324812#408881" rel="nofollow noopener noreferrer" target="_blank"&gt;https://community.freescale.com/message/408881#408881&lt;/A&gt; . Unfortunatelly I couldn't find if any update of the code was released meanwhile.&lt;/P&gt;&lt;P&gt;However I would like to ask you a few questions about the code.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, first, at the begining of the main function, the autho of the code setup timers that will be used throughout the application:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="c++" name="code"&gt;&amp;nbsp; SRS=0x00;&amp;nbsp;&amp;nbsp; //The COP timer is reset by writing any value to the address of &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; //SRS. This write does not affect the data in the read-only SRS. Instead, the act of writing to &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; //this address is decoded and sends a reset signal to the COP timer. &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; __RESET_WATCHDOG();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; EnableInterrupts;&amp;nbsp;&amp;nbsp; SOPT1=0x33;&amp;nbsp; /*****************Main Time Base for the whole application************************/ &amp;nbsp;&amp;nbsp; PWUSC0_WUFACK=1;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; PWUDIV = 0x2F;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp; EVERY SECOND&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; PWUSC0 = 0x02;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp; PERIODIC WAKE-UP EVERY 2 sec.&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; PWUSC1 = 0x00;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp; NO PERIODIC RESET&amp;nbsp;&amp;nbsp; /********************************************************************************/&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;As can be seen the wake up interrupt will occure every 2 sec. The rest of the code is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="c++" name="code"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; InitLF(); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RF_Setup(); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPMSC1_BGBE=1;&amp;nbsp; //Enable Bandgap &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Measure_P_T_V(); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Acceleration Z byte &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; REIMS_READ_COMP_ACCEL_Z(&amp;amp;Acc_Z_Array,Pressure_Array[1],1,0); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delay(10); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PACCZ=Acc_Z_Array[1]&amp;gt;&amp;gt;2; &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; // Acceleration X byte &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; REIMS_READ_COMP_ACCEL_X(&amp;amp;Acc_X_Array,Pressure_Array[1],1,0); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delay(10); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PACCX=Acc_X_Array[1]&amp;gt;&amp;gt;2; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Send_RF_Datagram(); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SOPT2=0x70;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp; RESET VALUES &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPMSC1=0x10;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp; 0x10 :&amp;nbsp; STOP 1 MODE CONFIGURED LVDE &amp;amp; LVDSE = 0 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPMSC2=0x02;&amp;nbsp;&amp;nbsp;&amp;nbsp; // 02 ---&amp;gt; PDC = 1 ; PPDC = 0 STOP1 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __asm STOP;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, after the initialization, chip goes to power saving mode stop1. There it stay untill LF command was received or until wake up interrupt occures.&lt;/P&gt;&lt;P&gt;What I don't understand here is following: Where is 60 seconds period of transmission set? There is no counter, nothing.&lt;/P&gt;&lt;P&gt;ISR code for wake up timer looks like this:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="c++" name="code"&gt;void interrupt USER_4_INTERRUPT(void) {&amp;nbsp;&amp;nbsp; PWUSC0_WUFACK = SET;&amp;nbsp; PWUSC1_PRFACK = SET;&amp;nbsp;&amp;nbsp; Periodic_Wake_UP_Measures();&amp;nbsp;&amp;nbsp; //ok passe ici d'abord // _asm cli;&amp;nbsp; //_asm rti;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //supprimer avant // _asm cli; }&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It calls periodically function for measuring P, V and T. This function is:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="c++" name="code"&gt;void&amp;nbsp; Periodic_Wake_UP_Measures() { unsigned char i; EnableInterrupts;&amp;nbsp; _asm rti; }&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As can be seen function Periodic_Wake_Up_Measures does nothing (I supose it was left for the user to specify) except enabling interrupt and returning from interrupt (which I also don't unterstand why it was called explicitly, hope somebody could explain this also)&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the other hand, datasheet says that device recovering from stop1 mode will take reset vector, which means that the program will start at the begining of main function, which means that there is no ISR.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, having all previous in mind, it looks like this code will wake up every 2 seconds and transmit data over radio.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The ost turned out quite long, but if anybody has experience with MPXY8300 I am thankfull inadvance for your help.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Nemanja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jun 2015 11:44:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/MPXY8300-example-code-doubts/m-p/415478#M2745</guid>
      <dc:creator>nemanjasavic</dc:creator>
      <dc:date>2015-06-19T11:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: MPXY8300 example code doubts</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/MPXY8300-example-code-doubts/m-p/415479#M2746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nemanja&lt;/P&gt;&lt;P&gt;Please be aware that the mpxy8300 is not longer manufacturer as is shown on the following link:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MPXY8300&amp;amp;cof=0&amp;amp;am=0&amp;amp;tab=Buy_Parametric_Tab&amp;amp;fromSearch=false" title="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MPXY8300&amp;amp;cof=0&amp;amp;am=0&amp;amp;tab=Buy_Parametric_Tab&amp;amp;fromSearch=false"&gt;Microcontroller, Pressure Sensor, X-Z Acceler|Freescale&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Because of this I recommend you use the new family&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=FXTH87" title="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=FXTH87"&gt;FXTH87|Tire Pressure Monitor Sensor|Freescale&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Vicente&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2015 16:32:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/MPXY8300-example-code-doubts/m-p/415479#M2746</guid>
      <dc:creator>vicentegomez</dc:creator>
      <dc:date>2015-06-25T16:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: MPXY8300 example code doubts</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/MPXY8300-example-code-doubts/m-p/415480#M2747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the fact is that I must use them and I have 10pcs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2015 11:16:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/MPXY8300-example-code-doubts/m-p/415480#M2747</guid>
      <dc:creator>nemanjasavic</dc:creator>
      <dc:date>2015-06-29T11:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: MPXY8300 example code doubts</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/MPXY8300-example-code-doubts/m-p/415481#M2748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;meanwhile I designed a small evaluation board based on reference manual ...&lt;/P&gt;&lt;P&gt;And still I have following doubts:&lt;/P&gt;&lt;P&gt;1. Where can I find official datasheet for MPXY8300 (can't get it from freescale's website).&lt;/P&gt;&lt;P&gt;2. There are certain firmware functions provided as is. Some of those function returs status byte. It is written in a few places that status byte is explained in section 14 of the datasheet, but unfortunately nothing is explained. Could anybody, especially guys from freescale, explain what is status byte or at least provide usefull source of information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Nemanja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2015 14:25:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/MPXY8300-example-code-doubts/m-p/415481#M2748</guid>
      <dc:creator>nemanjasavic</dc:creator>
      <dc:date>2015-07-06T14:25:04Z</dc:date>
    </item>
  </channel>
</rss>

