<?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: Clock tact between USB CDC and I2C in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Clock-tact-between-USB-CDC-and-I2C/m-p/1224911#M59495</link>
    <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/180637"&gt;@itr1718&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, your copying the Clock Configuratino code from the SDK?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could I recommend that you use the MCUXpresso Clock Wizard to set up your clocks?&amp;nbsp; I know it's basically user hostile and you will need to have a pretty good understanding of clocking, but if you can get things set up there, I think you're just about guaranteed to having everything working as expected.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm saying this because it looks like you're using the I2C API for your initialization and I'm not sure what is going to be happening for&amp;nbsp;&lt;SPAN&gt;I2C0_CLK_SRC.&amp;nbsp; It *should* be "BUS_CLK" but I don't know what it is nor do I know what speed BUS_CLK is running at.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can I suggest that you try to get the Clock Wizard working and then you can post a screen shot here for people to review?&amp;nbsp; It's a lot easier for people to review than to go through code.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;myke&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 02 Feb 2021 17:45:43 GMT</pubDate>
    <dc:creator>myke_predko</dc:creator>
    <dc:date>2021-02-02T17:45:43Z</dc:date>
    <item>
      <title>Clock tact between USB CDC and I2C</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Clock-tact-between-USB-CDC-and-I2C/m-p/1224142#M59480</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I already asked about a sensor probing and I tried also changed clock setting. I guess now, it depends on clock tact between USB and I2C.&lt;/P&gt;&lt;P&gt;My boot clock frequency is 48MHz and I2C baud rate is 400k. If the baud rate is lower, usb don't also run.&lt;/P&gt;&lt;P&gt;I red document about KL27 family. According to this, standard I2C rates are 100kbit/s in VLPR mode and my sensor with IIC runs in VLPR and also normal clock setting which frequency is 48MHz with Lirc mode.&lt;/P&gt;&lt;P&gt;But USB runs only in Hirc mode.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is, how can I set clock frequency or something others for two communication, USB and I2C?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2021 15:08:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Clock-tact-between-USB-CDC-and-I2C/m-p/1224142#M59480</guid>
      <dc:creator>itr1718</dc:creator>
      <dc:date>2021-02-01T15:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: Clock tact between USB CDC and I2C</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Clock-tact-between-USB-CDC-and-I2C/m-p/1224233#M59483</link>
      <description>&lt;P&gt;Hiya&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/180637"&gt;@itr1718&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Same response as previously - could you describe your set up a bit better?&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;For this question, you need to describe where you're getting your code (ie from the SDK or from?) and the second one is how are you setting up your clocks?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;myke&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2021 21:24:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Clock-tact-between-USB-CDC-and-I2C/m-p/1224233#M59483</guid>
      <dc:creator>myke_predko</dc:creator>
      <dc:date>2021-02-01T21:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: Clock tact between USB CDC and I2C</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Clock-tact-between-USB-CDC-and-I2C/m-p/1224251#M59485</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/58763"&gt;@myke_predko&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;First of all, I got the demo project from SDK for FRDM-K27L, because I am using MKL27Z256 microcontroller. the other codes for usb are also from the SDK. I just added some lines for printf using in terminal program.&lt;/P&gt;&lt;P&gt;Second, I applied clock setting same as the demo code, clock_config.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Core clock frequency is 48000000Hz for normal mode and&amp;nbsp;2000000Hz for&amp;nbsp;VLPR.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As my experience, HIRC source is enabled for normal mode. If it is changed LIRC mode, the sensor runs well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I add part of the detail code below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For clock_config,&lt;/P&gt;&lt;P&gt;const mcglite_config_t mcgliteConfig_BOARD_BootClockRUN =&lt;BR /&gt;{&lt;BR /&gt;.outsrc=kMCGLITE_ClkSrcHirc, /* MCGOUTCLK source is HIRC */&lt;BR /&gt;.irclkEnableMode = kMCGLITE_IrclkEnable, /* MCGIRCLK enabled, MCGIRCLK disabled in STOP mode */&lt;BR /&gt;.ircs = kMCGLITE_Lirc8M, /* Slow internal reference (LIRC) 8 MHz clock selected */&lt;BR /&gt;.fcrdiv = kMCGLITE_LircDivBy1, /* Low-frequency Internal Reference Clock Divider: divided by 1 */&lt;BR /&gt;.lircDiv2 = kMCGLITE_LircDivBy1, /* Second Low-frequency Internal Reference Clock Divider: divided by 1 */&lt;BR /&gt;.hircEnableInNotHircMode = true, /* HIRC source is enabled */&lt;BR /&gt;};&lt;BR /&gt;const sim_clock_config_t simConfig_BOARD_BootClockRUN =&lt;BR /&gt;{&lt;BR /&gt;.er32ksrc=SIM_OSC32KSEL_OSC32KCLK_CLK, /* OSC32KSEL select: OSC32KCLK clock */&lt;BR /&gt;.clkdiv1 = 0x10000U, /* SIM_CLKDIV1 - OUTDIV1: /1, OUTDIV4: /2 */&lt;BR /&gt;};&lt;BR /&gt;const osc_config_t oscConfig_BOARD_BootClockRUN =&lt;BR /&gt;{&lt;BR /&gt;.freq = 0U, /* Oscillator frequency: 0Hz */&lt;BR /&gt;.capLoad = (kOSC_Cap4P | kOSC_Cap8P), /* Oscillator capacity load: 12pF */&lt;BR /&gt;.workMode = kOSC_ModeOscLowPower, /* Oscillator low power */&lt;BR /&gt;.oscerConfig =&lt;BR /&gt;{&lt;BR /&gt;.enableMode = kOSC_ErClkEnable, /* Enable external reference clock, disable external reference clock in STOP mode */&lt;BR /&gt;}&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;void BOARD_BootClockRUN(void)&lt;BR /&gt;{&lt;BR /&gt;/* Set the system clock dividers in SIM to safe value. */&lt;BR /&gt;CLOCK_SetSimSafeDivs();&lt;BR /&gt;/* Set MCG to HIRC mode. */&lt;BR /&gt;CLOCK_SetMcgliteConfig(&amp;amp;mcgliteConfig_BOARD_BootClockRUN);&lt;BR /&gt;/* Set the clock configuration in SIM module. */&lt;BR /&gt;CLOCK_SetSimConfig(&amp;amp;simConfig_BOARD_BootClockRUN);&lt;BR /&gt;/* Set SystemCoreClock variable. */&lt;BR /&gt;SystemCoreClock = BOARD_BOOTCLOCKRUN_CORE_CLOCK;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For I2C Initialisation,&lt;/P&gt;&lt;P&gt;I2C_MasterGetDefaultConfig(&amp;amp;i2c_Mconfig);&lt;/P&gt;&lt;P&gt;i2c_Mconfig.baudRate_Bps = 400000U;&lt;BR /&gt;i2c_Mconfig.enableMaster = ON;&lt;BR /&gt;i2c_Mconfig.enableStopHold = OFF;&lt;BR /&gt;i2c_Mconfig.glitchFilterWidth = 0;&lt;/P&gt;&lt;P&gt;int16_t srcclock = CLOCK_GetFreq(I2C0_CLK_SRC);&lt;BR /&gt;I2C_MasterInit(I2C0, &amp;amp;i2c_Mconfig, srcclock);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;itr&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2021 22:40:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Clock-tact-between-USB-CDC-and-I2C/m-p/1224251#M59485</guid>
      <dc:creator>itr1718</dc:creator>
      <dc:date>2021-02-01T22:40:36Z</dc:date>
    </item>
    <item>
      <title>Re: Clock tact between USB CDC and I2C</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Clock-tact-between-USB-CDC-and-I2C/m-p/1224911#M59495</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/180637"&gt;@itr1718&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, your copying the Clock Configuratino code from the SDK?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could I recommend that you use the MCUXpresso Clock Wizard to set up your clocks?&amp;nbsp; I know it's basically user hostile and you will need to have a pretty good understanding of clocking, but if you can get things set up there, I think you're just about guaranteed to having everything working as expected.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm saying this because it looks like you're using the I2C API for your initialization and I'm not sure what is going to be happening for&amp;nbsp;&lt;SPAN&gt;I2C0_CLK_SRC.&amp;nbsp; It *should* be "BUS_CLK" but I don't know what it is nor do I know what speed BUS_CLK is running at.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can I suggest that you try to get the Clock Wizard working and then you can post a screen shot here for people to review?&amp;nbsp; It's a lot easier for people to review than to go through code.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;myke&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 17:45:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Clock-tact-between-USB-CDC-and-I2C/m-p/1224911#M59495</guid>
      <dc:creator>myke_predko</dc:creator>
      <dc:date>2021-02-02T17:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: Clock tact between USB CDC and I2C</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Clock-tact-between-USB-CDC-and-I2C/m-p/1224976#M59498</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/58763"&gt;@myke_predko&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;yes, I had usb connection problem before and copied clock_config from SDK.&lt;/P&gt;&lt;P&gt;I am using Kinetis design studio, but I try to use MCUXpresso Clock Wizard.&lt;/P&gt;&lt;P&gt;I2C0_CLK_SRC is defined SYS_CLOCK.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Should I check and set both clocks of USB and I2C?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 20:07:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Clock-tact-between-USB-CDC-and-I2C/m-p/1224976#M59498</guid>
      <dc:creator>itr1718</dc:creator>
      <dc:date>2021-02-02T20:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: Clock tact between USB CDC and I2C</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Clock-tact-between-USB-CDC-and-I2C/m-p/1224993#M59499</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/180637"&gt;@itr1718&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you see your clocks using the MCUXpresso Clock Wizard?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can we bring this down to one thread?&amp;nbsp; I think there are the same root causes to your problems.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let's move this into the "don't probe a sensor after applying usb driver" thread.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;myke&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 21:55:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Clock-tact-between-USB-CDC-and-I2C/m-p/1224993#M59499</guid>
      <dc:creator>myke_predko</dc:creator>
      <dc:date>2021-02-02T21:55:00Z</dc:date>
    </item>
  </channel>
</rss>

