<?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: min and max frequency of eMIOS for MPC5674F in MPC5xxx</title>
    <link>https://community.nxp.com/t5/MPC5xxx/min-and-max-frequency-of-eMIOS-for-MPC5674F/m-p/544470#M3786</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;after power on reset, FMPLL is set to 60MHz. With 40MHz crystal, it is possible to decrease the frequency to 4MHz or increase up to 264MHz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Emios clock is half of the FMPLL clock and eMIOS itself enables prescaler 256. By simple calculation, you get:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Minimal frequency: 2MHz/256 = 0.0078125MHz = 7.8125KHz&lt;/P&gt;&lt;P&gt;Maximal frequency: 132MHz&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And also each channel has it's own prescaler, which can be set from 0 to 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Jul 2016 12:13:21 GMT</pubDate>
    <dc:creator>martin_kovar</dc:creator>
    <dc:date>2016-07-07T12:13:21Z</dc:date>
    <item>
      <title>min and max frequency of eMIOS for MPC5674F</title>
      <link>https://community.nxp.com/t5/MPC5xxx/min-and-max-frequency-of-eMIOS-for-MPC5674F/m-p/544469#M3785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Can anyone please help me with the min and max frequency/frequency range in which eMIOS can work for MPC5674F?&lt;/P&gt;&lt;P&gt;I have a 40 MHz crystal. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2016 05:35:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/min-and-max-frequency-of-eMIOS-for-MPC5674F/m-p/544469#M3785</guid>
      <dc:creator>snehakalkhair</dc:creator>
      <dc:date>2016-07-07T05:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: min and max frequency of eMIOS for MPC5674F</title>
      <link>https://community.nxp.com/t5/MPC5xxx/min-and-max-frequency-of-eMIOS-for-MPC5674F/m-p/544470#M3786</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;after power on reset, FMPLL is set to 60MHz. With 40MHz crystal, it is possible to decrease the frequency to 4MHz or increase up to 264MHz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Emios clock is half of the FMPLL clock and eMIOS itself enables prescaler 256. By simple calculation, you get:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Minimal frequency: 2MHz/256 = 0.0078125MHz = 7.8125KHz&lt;/P&gt;&lt;P&gt;Maximal frequency: 132MHz&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And also each channel has it's own prescaler, which can be set from 0 to 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2016 12:13:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/min-and-max-frequency-of-eMIOS-for-MPC5674F/m-p/544470#M3786</guid>
      <dc:creator>martin_kovar</dc:creator>
      <dc:date>2016-07-07T12:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: min and max frequency of eMIOS for MPC5674F</title>
      <link>https://community.nxp.com/t5/MPC5xxx/min-and-max-frequency-of-eMIOS-for-MPC5674F/m-p/544471#M3787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Martin,&lt;/P&gt;&lt;P&gt;Following is the code for IPWM which you had shared.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am unable to get the pulse width since the CSR flag for channel 0 is not being set.&lt;/P&gt;&lt;P&gt;while (!EMIOS.CH[0].CSR.B.FLAG)/* Wait for flag to be set */&lt;/P&gt;&lt;P&gt;pulse_width = EMIOS.CH[0].CBDR.R;/* read pulse width from register B */&lt;/P&gt;&lt;P&gt;Please correct me where ever i am wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#include "mpc5674f.h"&lt;/P&gt;&lt;P&gt;#include "fs_gpio.h"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;uint32_t pulse_width, count;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FMPLL_init(void);&lt;/P&gt;&lt;P&gt;void initEMIOSch0(void);&lt;/P&gt;&lt;P&gt;void initEMIOSch1(void);&lt;/P&gt;&lt;P&gt;void initEMIOSch23(void);&lt;/P&gt;&lt;P&gt;void initEMIOS(void);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static void FMPLL_init(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /**** Use for 40 MHz crystal reference ****/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // settings for 264 MHz&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; SIU.ECCR.B.EBDF = 3; /* Divide sysclk by 3+1 for CLKOUT */&lt;/P&gt;&lt;P&gt;&amp;nbsp; FMPLL.ESYNCR2.R = 0x00000002;&lt;/P&gt;&lt;P&gt;&amp;nbsp; FMPLL.ESYNCR1.R = 0x70040032; // EPREDIV=4, EMFD=0x32=50&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (FMPLL.SYNSR.B.LOCK != 1) {};&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FMPLL.ESYNCR2.R = 0x00000001; // ERFD=1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // fextal=40 =&amp;gt; fpll = 40*(50+16)/((4+1)*(1+1)) = 264MHz&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // fvco = 40*(50+16)/(4+1) = 528 &amp;lt; 600 and &amp;gt; 192 =&amp;gt; correct&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #if 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // settings for 200 MHz&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SIU.ECCR.B.EBDF = 3; /* Divide sysclk by 3+1 for CLKOUT */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FMPLL.ESYNCR2.R = 0x00000002;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FMPLL.ESYNCR1.R = 0x70040022; // EPREDIV=4, EMFD=0x22=34&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // fextal=40 =&amp;gt; fpll = 40*(34+16)/((4+1)*(1+1)) = 200MHz&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // fvco = 40*(34+16)/(4+1) = 400 &amp;lt; 600 and &amp;gt; 192 =&amp;gt; correct&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (FMPLL.SYNSR.B.LOCK != 1) {};&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FMPLL.ESYNCR2.R = 0x00000001;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #endif&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void main (void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;/* ------------------LED and Switch port init----------------------- */&lt;/P&gt;&lt;P&gt;SIU.PCR[65].R=0x0200;/* OBE on PE1 - LED connection */&lt;/P&gt;&lt;P&gt;SIU.GPDO[65].R = 0x01;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FMPLL_init();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;initEMIOS();&lt;/P&gt;&lt;P&gt;initEMIOSch0();&lt;/P&gt;&lt;P&gt;initEMIOSch1();&lt;/P&gt;&lt;P&gt;initEMIOSch23();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while (1)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;while (!EMIOS.CH[0].CSR.B.FLAG)/* Wait for flag to be set */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pulse_width = EMIOS.CH[0].CBDR.R;/* read pulse width from register B */&lt;/P&gt;&lt;P&gt;if (pulse_width == EMIOS.CH[1].CADR.R) /* Compare measured width at ch1 with original */&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;for (count=0; count&amp;lt;100000; count++)/* loops to toggle PE1, pulse width is correct */&lt;/P&gt;&lt;P&gt;SIU.GPDO[65].R = 0x01;&lt;/P&gt;&lt;P&gt;for (count=0; count&amp;lt;100000; count++)&lt;/P&gt;&lt;P&gt;SIU.GPDO[65].R = 0x00;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;/* Clear flags and overruns */&lt;/P&gt;&lt;P&gt;EMIOS.CH[0].CSR.B.FLAG = 1;&lt;/P&gt;&lt;P&gt;EMIOS.CH[1].CSR.B.FLAG = 1;&lt;/P&gt;&lt;P&gt;EMIOS.CH[0].CSR.B.OVR = 1;&lt;/P&gt;&lt;P&gt;EMIOS.CH[1].CSR.B.OVR = 1;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}/* end of main() */&lt;/P&gt;&lt;P&gt;/**************************** Functions*******************************************/&lt;/P&gt;&lt;P&gt;void initEMIOSch23(void) /* EMIOS CH 23: Modulus Up Counter */&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;EMIOS.CH[23].CADR.R = 999; /* Period will be 999+1 = 1000 clocks (1 msec) */&lt;/P&gt;&lt;P&gt;EMIOS.CH[23].CCR.B.MODE = 0x50; /* Modulus Counter Buffered (MCB) */&lt;/P&gt;&lt;P&gt;EMIOS.CH[23].CCR.B.BSL = 0x3; /* Use internal counter */&lt;/P&gt;&lt;P&gt;EMIOS.CH[23].CCR.B.UCPRE=0; /* Set channel prescaler to divide by 1 */&lt;/P&gt;&lt;P&gt;EMIOS.CH[23].CCR.B.FREN = 1; /* Freeze channel counting when in debug mode */&lt;/P&gt;&lt;P&gt;EMIOS.CH[23].CCR.B.UCPREN = 1; /* Enable prescaler; uses default divide by 1 */&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;void initEMIOSch0(void) /* EMIOS CH 0: Input Pulse Width Measurement (IPWM) */&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;EMIOS.CH[0].CCR.B.BSL = 0x0; /* Use counter bus A (default) */&lt;/P&gt;&lt;P&gt;EMIOS.CH[0].CCR.B.EDPOL = 1; /* Polarity-leading edge sets output/trailing clears */&lt;/P&gt;&lt;P&gt;EMIOS.CH[0].CCR.B.EDSEL = 1; /* internal counter trigger by both edges */&lt;/P&gt;&lt;P&gt;EMIOS.CH[0].CCR.B.MODE = 0x04; /* Input pulse width measurement */&lt;/P&gt;&lt;P&gt;SIU.PCR[179].R = 0x0500; /* Initialize pad for eMIOS chan. 0 input */&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;void initEMIOSch1(void) /* EMIOS CH 1: Output Pulse Width Modulation (OPWMB) */&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;EMIOS.CH[1].CADR.R = 500; /* Leading edge when channel counter bus=500 */&lt;/P&gt;&lt;P&gt;EMIOS.CH[1].CBDR.R = 999; /* Trailing edge when channel's counter bus=999 */&lt;/P&gt;&lt;P&gt;EMIOS.CH[1].CCR.B.BSL = 0x0; /* Use counter bus A (default) */&lt;/P&gt;&lt;P&gt;EMIOS.CH[1].CCR.B.EDPOL = 1; /* Polarity-leading edge sets output/trailing clears */&lt;/P&gt;&lt;P&gt;EMIOS.CH[1].CCR.B.MODE = 0x60; /* MPC551x, MPC563x: Mode is OPWM Buffered */&lt;/P&gt;&lt;P&gt;SIU.PCR[180].R = 0x0600; /* Initialize pad for eMIOS chan. 1 output */&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;void initEMIOS(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;EMIOS.MCR.B.GPRE= 131; /* Divide 40 MHz sysclk by 39+1 = 40 for 1MHz eMIOS clk */&lt;/P&gt;&lt;P&gt;EMIOS.MCR.B.GPREN = 1;/* Enable eMIOS clock */&lt;/P&gt;&lt;P&gt;EMIOS.MCR.B.GTBE = 1;/* Enable global time base */&lt;/P&gt;&lt;P&gt;EMIOS.MCR.B.FRZ = 1;/* Enable stopping channels when in debug mode */&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2016 09:18:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/min-and-max-frequency-of-eMIOS-for-MPC5674F/m-p/544471#M3787</guid>
      <dc:creator>snehakalkhair</dc:creator>
      <dc:date>2016-07-11T09:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: min and max frequency of eMIOS for MPC5674F</title>
      <link>https://community.nxp.com/t5/MPC5xxx/min-and-max-frequency-of-eMIOS-for-MPC5674F/m-p/544472#M3788</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;at first, please try the example I sent you and analyze the single steps. From the code you posted here I have no idea what you want to do. You are mixing two channels (OPWM and IPWM) together, so It cannot work correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to measure the frequency of the generated OPWM, connect physically&amp;nbsp; the output pin from OPWM channel to input pin from IPWM channel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jul 2016 11:32:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/min-and-max-frequency-of-eMIOS-for-MPC5674F/m-p/544472#M3788</guid>
      <dc:creator>martin_kovar</dc:creator>
      <dc:date>2016-07-18T11:32:55Z</dc:date>
    </item>
  </channel>
</rss>

