<?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中的主题 Help needed for project</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Help-needed-for-project/m-p/258678#M9750</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am looking for someone to help get the S12XE hardware functions setup. I am willing to pay for this to be done. I would like to do it in three stages.&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;This will let me write other code and test before moving on.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Stage One:&lt;/P&gt;&lt;P&gt;&amp;nbsp; 1. Setup S12XE for 48 Mhz&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2. Setup XGate&lt;/P&gt;&lt;P&gt;&amp;nbsp; 3. Setup SPI&lt;/P&gt;&lt;P&gt;&amp;nbsp; 4. Setup SCI with interrupt on RX&lt;/P&gt;&lt;P&gt;&amp;nbsp; 5. Setup ADC&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Stage Two:&lt;/P&gt;&lt;P&gt;&amp;nbsp; 1. Setup ECT for input capture on two pins.&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2. Setup ECT for output compare on six pins.&lt;/P&gt;&lt;P&gt;&amp;nbsp; 3. Setup PIT for overflow interrupt&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Stage Three:&lt;/P&gt;&lt;P&gt;&amp;nbsp; 1. Setup PWM&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2. Setup CAN&amp;nbsp; &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are interested let me know.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ray,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Jul 2013 07:29:30 GMT</pubDate>
    <dc:creator>rayhall</dc:creator>
    <dc:date>2013-07-08T07:29:30Z</dc:date>
    <item>
      <title>Help needed for project</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Help-needed-for-project/m-p/258678#M9750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am looking for someone to help get the S12XE hardware functions setup. I am willing to pay for this to be done. I would like to do it in three stages.&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;This will let me write other code and test before moving on.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Stage One:&lt;/P&gt;&lt;P&gt;&amp;nbsp; 1. Setup S12XE for 48 Mhz&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2. Setup XGate&lt;/P&gt;&lt;P&gt;&amp;nbsp; 3. Setup SPI&lt;/P&gt;&lt;P&gt;&amp;nbsp; 4. Setup SCI with interrupt on RX&lt;/P&gt;&lt;P&gt;&amp;nbsp; 5. Setup ADC&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Stage Two:&lt;/P&gt;&lt;P&gt;&amp;nbsp; 1. Setup ECT for input capture on two pins.&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2. Setup ECT for output compare on six pins.&lt;/P&gt;&lt;P&gt;&amp;nbsp; 3. Setup PIT for overflow interrupt&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Stage Three:&lt;/P&gt;&lt;P&gt;&amp;nbsp; 1. Setup PWM&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2. Setup CAN&amp;nbsp; &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are interested let me know.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ray,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jul 2013 07:29:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Help-needed-for-project/m-p/258678#M9750</guid>
      <dc:creator>rayhall</dc:creator>
      <dc:date>2013-07-08T07:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed for project</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Help-needed-for-project/m-p/258679#M9751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We (Freescale technical support) can provide example codes for all your points - for free.&lt;/P&gt;&lt;P&gt;In some cases we can modify example codes directly according your demands.&lt;/P&gt;&lt;P&gt;Unfortunately we are not authorized to build your final application.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jul 2013 14:44:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Help-needed-for-project/m-p/258679#M9751</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2013-07-09T14:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed for project</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Help-needed-for-project/m-p/258680#M9752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Radek,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example code would help. What I need is for someone to tell me if how I have used the code from examples are correct. There are things I do not know, if are needed or correct. Example what is this... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;#pragma push&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;/* this variable definition is to demonstrate how to share data between XGATE and S12X */&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;#pragma DATA_SEG SHARED_DATA&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;volatile int shared_counter; /* volatile because both cores are accessing it. */&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;/* Two stacks in XGATE core3 */ &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;#pragma DATA_SEG XGATE_STK_L&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;word XGATE_STACK_L[1]; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;#pragma DATA_SEG XGATE_STK_H&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;word XGATE_STACK_H[1];&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;#pragma pop&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I also found a example with a different version of this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;#pragma push&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;#pragma DATA_SEG xstack13Seg&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;uint xgstack13[1];&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;#pragma DATA_SEG xstack47Seg&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;uint xgstack47[1];&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;#pragma pop&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So which one is correct and what does this code do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not want someone to build my project. What I want is some help to get the hardware setup.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also my post looks like it was removed from public view. Why was this done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ray.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jul 2013 04:44:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Help-needed-for-project/m-p/258680#M9752</guid>
      <dc:creator>rayhall</dc:creator>
      <dc:date>2013-07-10T04:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed for project</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Help-needed-for-project/m-p/258681#M9753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This code looks strange, however it is “simple”&lt;/P&gt;&lt;P&gt;&lt;EM&gt;#pragma push saves the current state of all the settings imposed via pragmas. Restore these settings by a subsequent #pragma pop. Any changes to the states that occur between a #pragma push and a #pragma pop will be discarded after the #pragma pop. &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;So, it is nothing special. In this case we can use #pragma DATA_SEG DEFAULT at end of this code. It will do the same (just restore variable placement back to default RAM).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;XGATE in version 3 has two hardware sets of basic registers and this way naturally support interrupt nesting. Interrupts with priority 4..7 could interrupts routines with priority 1..3. XGATE simply switch register sets.&lt;/P&gt;&lt;P&gt;For these two sets we should define also two stacks and this is done by this code.&lt;/P&gt;&lt;P&gt;This code just creates two variables at specific location (in default project at 0xF8107E and 0xF810FE addresses, see prm file), nothing else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;More important is this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;EM&gt;XGISPSEL= 1;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; XGISP31= (unsigned int)(void*__far)(XGATE_STACK_L + 1);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; XGISPSEL= 2;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; XGISP74= (unsigned int)(void*__far)(XGATE_STACK_H + 1);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; XGISPSEL= 0;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;This way we define initial address of stacks for routines with priority 1..3 and for routines with priority 4..7. Every time a thread of such priority is started, RISC core register R7 will be initialized with the content of XGISP74 or XGISP31.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I suppose that both codes in your post do the same work however second code uses non-default linker definition in prm file. That is all.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jul 2013 15:13:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Help-needed-for-project/m-p/258681#M9753</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2013-07-10T15:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed for project</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Help-needed-for-project/m-p/258682#M9754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I prepared for you compilation of example codes.&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-95116"&gt;https://community.freescale.com/docs/DOC-95116&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Not all example codes are directly for S12XE family however peripherals are typically the same.&lt;/P&gt;&lt;P&gt;I hope it helps you.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jul 2013 15:55:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Help-needed-for-project/m-p/258682#M9754</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2013-07-10T15:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed for project</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Help-needed-for-project/m-p/258683#M9755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Radek,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for this. I still have questions...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the XEP100 - SCI default - CW47 example the interrupt for the SCI has this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;#pragma CODE_SEG NON_BANKED&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;interrupt 20 void SCI0_Isr(void)&amp;nbsp; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;{ &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the 20. Is this a interrupt vector number ?&lt;/P&gt;&lt;P&gt;If it is, then where can I find a list of all the interrupt numbers ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ray.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jul 2013 21:45:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Help-needed-for-project/m-p/258683#M9755</guid>
      <dc:creator>rayhall</dc:creator>
      <dc:date>2013-07-10T21:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed for project</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Help-needed-for-project/m-p/258684#M9756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay I found them in the MC9S12XET256.h file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ray.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jul 2013 07:30:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Help-needed-for-project/m-p/258684#M9756</guid>
      <dc:creator>rayhall</dc:creator>
      <dc:date>2013-07-11T07:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed for project</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Help-needed-for-project/m-p/258685#M9757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="&amp;amp;quothighlight&amp;quot;"&gt;Interrupt&lt;/SPAN&gt; number 0 presents POR reset vector, 1 is CM reset, 2 is COP reset, … , 119 is Spurious Interrupt. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="&amp;amp;quothighlight&amp;quot;"&gt;Interrupt&lt;/SPAN&gt; number = (0xFE-Vector Address)/2.&lt;/P&gt;&lt;P&gt;See Table &lt;SPAN class="&amp;amp;quothighlight&amp;quot;"&gt;Interrupt&lt;/SPAN&gt; Vector Locations at RM (Table 1-14, page 81-84).&lt;/P&gt;&lt;P&gt;For Example: &lt;SPAN class="&amp;amp;quothighlight&amp;quot;"&gt;Interrupt&lt;/SPAN&gt; number of SCI0 = (0xFE-D6)/2 = 0x14 = 20.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jul 2013 12:51:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Help-needed-for-project/m-p/258685#M9757</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2013-07-11T12:51:48Z</dc:date>
    </item>
  </channel>
</rss>

