<?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>MPC5xxxのトピックRe: MPC5566 EMIOS SAOC mode</title>
    <link>https://community.nxp.com/t5/MPC5xxx/MPC5566-EMIOS-SAOC-mode/m-p/1927871#M26437</link>
    <description>Thanks a lot!&lt;BR /&gt;</description>
    <pubDate>Thu, 08 Aug 2024 02:53:54 GMT</pubDate>
    <dc:creator>EmilyZhou8</dc:creator>
    <dc:date>2024-08-08T02:53:54Z</dc:date>
    <item>
      <title>MPC5566 EMIOS SAOC mode</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5566-EMIOS-SAOC-mode/m-p/1924060#M26363</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am setting EMIOS 17 to work as SAOC mode channel which uses bus C driven by EMIOS 8. However, SAOC mode is not working. Could you please help to check my code?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Emily&lt;/P&gt;&lt;P&gt;#include "MPC5566.h"&lt;/P&gt;&lt;P&gt;/************ PWM_Period and PWM_Frequence should be changed together ************/&lt;BR /&gt;/* Define PWM period Counter value */&lt;BR /&gt;#define PWM_Period 16&lt;BR /&gt;#define FS_GPIO_EMIOS17 196&lt;BR /&gt;#define Commutation_Time_Channel FS_GPIO_EMIOS17&lt;/P&gt;&lt;P&gt;void initSysclk (void) {&lt;BR /&gt;&lt;BR /&gt;FMPLL.SYNCR.B.LOLRE = 0; /* 0: ignore loss of lock - reset not asserted. */&lt;BR /&gt;FMPLL.SYNCR.B.LOLIRQ = 0; /* 0: ignore loss of lock - interrupt not requested */&lt;BR /&gt;FMPLL.SYNCR.B.PREDIV = 1; /* 1: use incoming OSC 8MHz / 2 = 4 MHz */&lt;BR /&gt;FMPLL.SYNCR.B.MFD = 28; /* 28: VCO = 4 * (28+4) = 128 MHz */&lt;BR /&gt;FMPLL.SYNCR.B.RFD = 1; /* 1: divide by 2, Fsys = VCO / (2^1=2) = 64MHz */&lt;BR /&gt;while(FMPLL.SYNSR.B.LOCK != 1){} /* Wait for FMPLL to Lock */&lt;BR /&gt;FMPLL.SYNCR.B.RFD = 0; /* 0: divide by 1, Fsys = VCO / (2^0=1) = 128MHz */&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void initEMIOS(void) {&lt;BR /&gt;EMIOS.MCR.B.GPRE= 7; /* Divide 128 MHz sysclk by 7+1 = 8 for 16MHz eMIOS clk*/ //EMIOS.MCR.B.GPRE= 63; /* Divide 64 MHz sysclk by 63+1 = 64 for 1MHz eMIOS clk*/&lt;BR /&gt;EMIOS.MCR.B.ETB = 0; /* External time base is disabled; Ch 23 drives ctr bus A */&lt;BR /&gt;EMIOS.MCR.B.GPREN = 1; /* Enable eMIOS clock */&lt;BR /&gt;EMIOS.MCR.B.GTBE = 1; /* Enable global time base */&lt;BR /&gt;EMIOS.MCR.B.FRZ = 1; /* Enable stopping channels when in debug mode */&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void initEMIOSch8(void) { /* EMIOS CH 8: Modulus Up Counter */&lt;BR /&gt;EMIOS.CH[8].CADR.R = PWM_Period - 1; /* Period will be 15+1 = 16 clocks (1 MHz) */&lt;BR /&gt;EMIOS.CH[8].CCR.B.MODE = 0x10; /* MPC555x: Modulus Counter (MC), internal clock */&lt;BR /&gt;EMIOS.CH[8].CCR.B.BSL = 0x3; /* Use internal counter */&lt;BR /&gt;EMIOS.CH[8].CCR.B.UCPRE=0; /* Set channel prescaler to divide by 1 */&lt;BR /&gt;EMIOS.CH[8].CCR.B.FREN = 1; /* Freeze channel counting when in debug mode */&lt;BR /&gt;EMIOS.CH[8].CCR.B.UCPREN = 1; /* Enable prescaler; uses default divide by 1 */&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void initEMIOSch17(void) {&lt;BR /&gt;uint8_t EMIOS_Channel_Output;&lt;BR /&gt;&lt;BR /&gt;EMIOS_Channel_Output = Commutation_Time_Channel-179; /* Convert to EMIOS channel number compatible with EMIOS struct in MPC5566.h */&lt;BR /&gt;&lt;BR /&gt;EMIOS.CH[EMIOS_Channel_Output].CCR.B.MODE = 0x3; /* MPC555x: Mode is Single action output compare */&lt;BR /&gt;EMIOS.CH[EMIOS_Channel_Output].CCR.B.BSL = 0x1; /* Use bus C */&lt;BR /&gt;EMIOS.CH[EMIOS_Channel_Output].CCR.B.UCPRE = 0; /* Set channel prescaler to divide by 1 */&lt;BR /&gt;EMIOS.CH[EMIOS_Channel_Output].CCR.B.FREN = 1; /* Stop (freeze) channel registers when in debug mode */&lt;BR /&gt;EMIOS.CH[EMIOS_Channel_Output].CCR.B.UCPREN = 1; /* Enable prescaler; uses default divide by 1 */&lt;BR /&gt;EMIOS.CH[EMIOS_Channel_Output].CCR.B.DMA = 0; /* FLAG assigned to Interrupt request */&lt;BR /&gt;EMIOS.CH[EMIOS_Channel_Output].CCR.B.EDSEL = 1; /* Both edges triggering */&lt;BR /&gt;EMIOS.CH[EMIOS_Channel_Output].CCR.B.FCK = 0; /* Filter clock select: EMIOS clock */&lt;BR /&gt;EMIOS.CH[EMIOS_Channel_Output].CCR.B.IF = 0x1; /* Input filter: 8 filter clock periods */&lt;BR /&gt;EMIOS.CH[EMIOS_Channel_Output].CCR.B.FEN = 1; /* Flag enables interrupt */&lt;BR /&gt;&lt;BR /&gt;SIU.PCR[Commutation_Time_Channel].R = 0x0E00; /* MPC555x: Initialize pad for eMIOS output */&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void main (void) {&lt;BR /&gt;volatile uint32_t i = 0; /* Dummy idle counter */&lt;BR /&gt;uint32_t NextCmtPeriod=1000;&lt;BR /&gt;initSysclk(); /* Set sysclk = 128MHz running from PLL */&lt;BR /&gt;initEMIOS(); /* Initialize eMIOS to provide 16 MHz clock to channels */&lt;BR /&gt;initEMIOSch8(); /* Initialize eMIOS channel 8 as modulus counter*/&lt;BR /&gt;initEMIOSch17(); /* Initialize eMIOS channel 17 as SAOC, using ch 8 as time base */&lt;BR /&gt;&lt;BR /&gt;while (1)&lt;BR /&gt;{i++;&lt;BR /&gt;&lt;BR /&gt;EMIOS.CH[17].CADR.R = EMIOS.CH[8].CCNTR.R + NextCmtPeriod;&lt;BR /&gt;while(EMIOS.CH[17].CSR.B.FLAG != 1)&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;NextCmtPeriod=NextCmtPeriod+2000;&lt;BR /&gt;EMIOS.CH[17].CSR.B.FLAG = 1;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2024 13:45:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5566-EMIOS-SAOC-mode/m-p/1924060#M26363</guid>
      <dc:creator>EmilyZhou8</dc:creator>
      <dc:date>2024-08-02T13:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5566 EMIOS SAOC mode</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5566-EMIOS-SAOC-mode/m-p/1924931#M26385</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;if you want to use local counter bus for ch17, then ch16 (counter us D) have to be configured, not ch8 you have&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PetrS_0-1722834624619.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/291845iD193C42DE29F6BB6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PetrS_0-1722834624619.png" alt="PetrS_0-1722834624619.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR, Petr&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 05:10:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5566-EMIOS-SAOC-mode/m-p/1924931#M26385</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2024-08-05T05:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5566 EMIOS SAOC mode</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5566-EMIOS-SAOC-mode/m-p/1924953#M26386</link>
      <description>Hi Peter,&lt;BR /&gt;Thanks for your reply. I am wondering if I use EMIOS Chanel 16 to set bus D, SAOC of EMIOS Channel 17 can work only if EMIOS.CH[16].CADR.R&amp;gt;=EMIOS.CH[17].CADR.R?&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Emily</description>
      <pubDate>Mon, 05 Aug 2024 05:41:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5566-EMIOS-SAOC-mode/m-p/1924953#M26386</guid>
      <dc:creator>EmilyZhou8</dc:creator>
      <dc:date>2024-08-05T05:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5566 EMIOS SAOC mode</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5566-EMIOS-SAOC-mode/m-p/1925098#M26390</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;yes, correct.&lt;/P&gt;
&lt;P&gt;BR, Petr&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 08:10:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5566-EMIOS-SAOC-mode/m-p/1925098#M26390</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2024-08-05T08:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5566 EMIOS SAOC mode</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5566-EMIOS-SAOC-mode/m-p/1927871#M26437</link>
      <description>Thanks a lot!&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Aug 2024 02:53:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5566-EMIOS-SAOC-mode/m-p/1927871#M26437</guid>
      <dc:creator>EmilyZhou8</dc:creator>
      <dc:date>2024-08-08T02:53:54Z</dc:date>
    </item>
  </channel>
</rss>

