<?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>S32KのトピックUsing I2C with LPTMR</title>
    <link>https://community.nxp.com/t5/S32K/Using-I2C-with-LPTMR/m-p/1335781#M11997</link>
    <description>&lt;P&gt;hello everybody&lt;/P&gt;&lt;P&gt;finally, I success i2c communication using LPI2C.&lt;/P&gt;&lt;P&gt;but another problem has occured.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I using LPTMR example.&amp;nbsp;lptmr_periodic_interrupt_s32k116&lt;/P&gt;&lt;P&gt;and, add components i2c. set master mode 50kHz&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and than,&amp;nbsp;&lt;/P&gt;&lt;P&gt;void LPTMR_ISR(void)&lt;BR /&gt;{&lt;BR /&gt;/* Clear compare flag */&lt;BR /&gt;LPTMR_DRV_ClearCompareFlag(INST_LPTMR1);&lt;BR /&gt;/* Toggle LED_GREEN */&lt;BR /&gt;PINS_DRV_TogglePins(LED_GPIO_PORT, (1 &amp;lt;&amp;lt; LED_GREEN));&lt;/P&gt;&lt;P&gt;I2C_MasterSendDataBlocking(&amp;amp;i2c1_instance, masterTxBuffer, TRANSFER_SIZE, false, 10);&lt;BR /&gt;masterTxBuffer[0] = 0x01;&lt;BR /&gt;I2C_MasterReceiveDataBlocking(&amp;amp;i2c1_instance, masterTxBuffer, TRANSFER_SIZE, false, 10);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;in LPTMR ISR loop.&lt;/P&gt;&lt;P&gt;but, when start program, It going to&amp;nbsp;OSIF_SemaWait(&amp;amp;(master-&amp;gt;idleSemaphore), 0); function in&amp;nbsp;LPI2C_DRV_MasterSendDataBlocking.&lt;/P&gt;&lt;P&gt;why this? how to escape OSIF_SemaWait?&lt;/P&gt;&lt;P&gt;it is hard to using LPTMR with LPI2C?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 07 Sep 2021 04:24:05 GMT</pubDate>
    <dc:creator>skb</dc:creator>
    <dc:date>2021-09-07T04:24:05Z</dc:date>
    <item>
      <title>Using I2C with LPTMR</title>
      <link>https://community.nxp.com/t5/S32K/Using-I2C-with-LPTMR/m-p/1335781#M11997</link>
      <description>&lt;P&gt;hello everybody&lt;/P&gt;&lt;P&gt;finally, I success i2c communication using LPI2C.&lt;/P&gt;&lt;P&gt;but another problem has occured.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I using LPTMR example.&amp;nbsp;lptmr_periodic_interrupt_s32k116&lt;/P&gt;&lt;P&gt;and, add components i2c. set master mode 50kHz&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and than,&amp;nbsp;&lt;/P&gt;&lt;P&gt;void LPTMR_ISR(void)&lt;BR /&gt;{&lt;BR /&gt;/* Clear compare flag */&lt;BR /&gt;LPTMR_DRV_ClearCompareFlag(INST_LPTMR1);&lt;BR /&gt;/* Toggle LED_GREEN */&lt;BR /&gt;PINS_DRV_TogglePins(LED_GPIO_PORT, (1 &amp;lt;&amp;lt; LED_GREEN));&lt;/P&gt;&lt;P&gt;I2C_MasterSendDataBlocking(&amp;amp;i2c1_instance, masterTxBuffer, TRANSFER_SIZE, false, 10);&lt;BR /&gt;masterTxBuffer[0] = 0x01;&lt;BR /&gt;I2C_MasterReceiveDataBlocking(&amp;amp;i2c1_instance, masterTxBuffer, TRANSFER_SIZE, false, 10);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;in LPTMR ISR loop.&lt;/P&gt;&lt;P&gt;but, when start program, It going to&amp;nbsp;OSIF_SemaWait(&amp;amp;(master-&amp;gt;idleSemaphore), 0); function in&amp;nbsp;LPI2C_DRV_MasterSendDataBlocking.&lt;/P&gt;&lt;P&gt;why this? how to escape OSIF_SemaWait?&lt;/P&gt;&lt;P&gt;it is hard to using LPTMR with LPI2C?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 04:24:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Using-I2C-with-LPTMR/m-p/1335781#M11997</guid>
      <dc:creator>skb</dc:creator>
      <dc:date>2021-09-07T04:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using I2C with LPTMR</title>
      <link>https://community.nxp.com/t5/S32K/Using-I2C-with-LPTMR/m-p/1335884#M11998</link>
      <description>&lt;P&gt;Hi@&lt;A id="link_12" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://community.nxp.com/t5/user/viewprofilepage/user-id/184307" target="_self" aria-label="View Profile of skb"&gt;&lt;SPAN class=""&gt;skb&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; try to use this function.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Senlent_0-1630999033761.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/155283i8E54F0472868CC54/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Senlent_0-1630999033761.png" alt="Senlent_0-1630999033761.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Tips: &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Because in the blocking API function, the API function of the OSIF component-OSIF_SemaWait() is called to check the data transmission and reception semaphore in the peripheral driver global state structure, if RTOS is used in the application project, such as FreeRTOS , The task that calls the blocking API function will be blocked, and the CPU resources are released to run other ready high-priority thinking, until the receipt and delivery is completed (semaphore release) or timeout, so the CPU execution efficiency will be greatly improved; and if the application If RTOS is not used in the project, the blocking API function will always occupy the CPU, resulting in a waste of CPU resources;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;In summary, if the application project uses RTOS, it is recommended to use the blocking API function; if the application project does not use the RTOS, it is recommended to use the non-blocking API function, and cooperate with the interrupt callback function to determine the data receiving and sending status and do corresponding processing.&lt;/P&gt;
&lt;P&gt;BR!&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Jim,&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 07:22:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Using-I2C-with-LPTMR/m-p/1335884#M11998</guid>
      <dc:creator>Senlent</dc:creator>
      <dc:date>2021-09-07T07:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using I2C with LPTMR</title>
      <link>https://community.nxp.com/t5/S32K/Using-I2C-with-LPTMR/m-p/1335961#M11999</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/188029"&gt;@Senlent&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you, It operated. but not well.&lt;/P&gt;&lt;P&gt;void LPTMR_ISR(void)&lt;BR /&gt;{&lt;BR /&gt;/* Clear compare flag */&lt;BR /&gt;LPTMR_DRV_ClearCompareFlag(INST_LPTMR1);&lt;BR /&gt;/* Toggle LED_GREEN */&lt;BR /&gt;PINS_DRV_TogglePins(LED_GPIO_PORT, (1 &amp;lt;&amp;lt; LED_GREEN));&lt;BR /&gt;LPI2C_DRV_MasterSendData(INST_LPI2C1, buffer, TRANSFER_SIZE, false);&lt;BR /&gt;&lt;BR /&gt;LPI2C_DRV_MasterReceiveData(INST_LPI2C1, buffer, TRANSFER_SIZE, false);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when I insert non-blocking i2c code in LPTMR, SDA pulse is not changed.&lt;/P&gt;&lt;P&gt;I search some solution like that.&lt;/P&gt;&lt;P&gt;while ((retCode = LPI2C_DRV_MasterGetTransferStatus(INST_LPI2C1, NULL))&lt;BR /&gt;== STATUS_BUSY) {&lt;/P&gt;&lt;P&gt;};&lt;/P&gt;&lt;P&gt;but this code do like blocking i2c function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how can i?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 08:38:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Using-I2C-with-LPTMR/m-p/1335961#M11999</guid>
      <dc:creator>skb</dc:creator>
      <dc:date>2021-09-07T08:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: Using I2C with LPTMR</title>
      <link>https://community.nxp.com/t5/S32K/Using-I2C-with-LPTMR/m-p/1335997#M12002</link>
      <description>&lt;P&gt;Hi@&lt;A id="link_12" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://community.nxp.com/t5/user/viewprofilepage/user-id/184307" target="_self" aria-label="View Profile of skb"&gt;&lt;SPAN class=""&gt;skb&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;Is there any problem with this usage? I2C is not parallel communication, it always needs some waiting time。&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; You can try to use FlexIO to simulate I2C, which is also a way to realize I2C communication. You can even use the GPIO port to simulate I2C communication, but this requires you to write your own software code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; These ways of implementing I2C communication all depend on the user.&lt;/P&gt;
&lt;P&gt;BR!&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; Jim,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 09:12:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Using-I2C-with-LPTMR/m-p/1335997#M12002</guid>
      <dc:creator>Senlent</dc:creator>
      <dc:date>2021-09-07T09:12:53Z</dc:date>
    </item>
  </channel>
</rss>

