<?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: Switching to I2C0 module for FRDM-KL26Z in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Switching-to-I2C0-module-for-FRDM-KL26Z/m-p/693847#M7451</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am referring to FRDM-KL26Z SDK driver example code for I2C polling transfer: &lt;EM&gt;i2c_polling_transfer.c&amp;nbsp;&lt;/EM&gt;(located at boards\frdmkl26z\driver_examples\i2c\polling_transfer). I thought this was the example you were referring to. But I didn't see&lt;EM&gt; hardware_init.c&amp;nbsp;&lt;/EM&gt;in the example. Which example are you working with?&lt;/P&gt;&lt;P&gt;In the example, I have mentioned above, they are using I2C1 as slave &amp;amp; I2C0 as master. Since you want to use I2C0 as slave &amp;amp; master, modifying the definition is necessary.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 May 2017 13:07:49 GMT</pubDate>
    <dc:creator>visakhanc</dc:creator>
    <dc:date>2017-05-30T13:07:49Z</dc:date>
    <item>
      <title>Switching to I2C0 module for FRDM-KL26Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Switching-to-I2C0-module-for-FRDM-KL26Z/m-p/693844#M7448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using the driver example for I2C blocking, communicating using 2 FRDM-KL26Z boards (1 master, 1 slave). Currently the examples work, but on the board I am developing, I need I2C communication to happen over PTB2 and PTB3. When the hardware is initialized in the file 'hardware_init.c', you can call the function 'configure_i2c_pins' where you select I2C0 or I2C1 module. Looking into that function, if the arguments you pass in can either be 0U or 1U, where 1U corresponds to setting Port C pin1 and Port C pin 2 as your I2C pins. Sending in 0U should then set Port&amp;nbsp;B pin2 and Port&amp;nbsp;B pin&amp;nbsp;3 as your I2C pins. I also enabled the port clocks using the command 'CLOCK_SYS_EnablePortClock (PORTB_IDX);' .When changing the file on both the master and slave side to configure_i2c_pins(0U), I am not getting any communication through those pins. Am I misunderstanding the code?&amp;nbsp; Or is&amp;nbsp;there additional places&amp;nbsp;that I have to change the code to set those pins as I2C? If anyone could provide any insight on this, it would be much appreciated.&lt;/P&gt;&lt;P&gt;For reference, my hardware_init.c file now looks like this:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7f0055; font-size: small;"&gt;&lt;STRONG&gt;#include&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #2a00ff; font-size: small;"&gt;"board.h"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7f0055; font-size: small;"&gt;&lt;STRONG&gt;#include&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #2a00ff; font-size: small;"&gt;"pin_mux.h"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7f0055; font-size: small;"&gt;&lt;STRONG&gt;#include&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #2a00ff; font-size: small;"&gt;"fsl_clock_manager.h"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7f0055; font-size: small;"&gt;&lt;STRONG&gt;#include&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #2a00ff; font-size: small;"&gt;"fsl_debug_console.h"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7f0055; font-size: small;"&gt;&lt;STRONG&gt;void&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; &lt;STRONG&gt;hardware_init&lt;/STRONG&gt;(&lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small;"&gt;void&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt;) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;/* enable clock for PORTs */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;CLOCK_SYS_EnablePortClock(PORTA_IDX);&lt;/P&gt;&lt;P&gt;CLOCK_SYS_EnablePortClock(PORTB_IDX);&lt;/P&gt;&lt;P&gt;CLOCK_SYS_EnablePortClock(PORTE_IDX);&lt;/P&gt;&lt;P&gt;configure_i2c_pins(0U);&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;/* &lt;SPAN style="text-decoration: underline;"&gt;Init&lt;/SPAN&gt; board clock */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;BOARD_ClockInit();&lt;/P&gt;&lt;P&gt;dbg_uart_init();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 May 2017 20:33:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Switching-to-I2C0-module-for-FRDM-KL26Z/m-p/693844#M7448</guid>
      <dc:creator>danyonchu</dc:creator>
      <dc:date>2017-05-25T20:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: Switching to I2C0 module for FRDM-KL26Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Switching-to-I2C0-module-for-FRDM-KL26Z/m-p/693845#M7449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The modifications to change I2C pins to from I2C1 (PortE 0&amp;amp;1) to I2C0 (PortB 2&amp;amp;3) seems correct.&lt;/P&gt;&lt;P&gt;But as per your need, both master and slave should use I2C0 to communicate. So, you also need to initialize the I2C driver to use I2C0 as slave (Master already uses I2C0 in the example).&lt;/P&gt;&lt;P&gt;The following modification can be done:&lt;/P&gt;&lt;P&gt;#define&amp;nbsp;EXAMPLE_I2C_SLAVE_BASEADDR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;I2C0&lt;/P&gt;&lt;P&gt;Have you done this already?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 May 2017 07:41:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Switching-to-I2C0-module-for-FRDM-KL26Z/m-p/693845#M7449</guid>
      <dc:creator>visakhanc</dc:creator>
      <dc:date>2017-05-29T07:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: Switching to I2C0 module for FRDM-KL26Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Switching-to-I2C0-module-for-FRDM-KL26Z/m-p/693846#M7450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/visakhanc"&gt;visakhanc&lt;/A&gt;‌ what file(s)&amp;nbsp;are this declaration needed? I have not done this yet, but I am not sure of where this needs to go since I don't see a use of that variable in the example code. The only modifications I have made were to hardware_init.c on both the master side and the slave side.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 12:32:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Switching-to-I2C0-module-for-FRDM-KL26Z/m-p/693846#M7450</guid>
      <dc:creator>danyonchu</dc:creator>
      <dc:date>2017-05-30T12:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: Switching to I2C0 module for FRDM-KL26Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Switching-to-I2C0-module-for-FRDM-KL26Z/m-p/693847#M7451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am referring to FRDM-KL26Z SDK driver example code for I2C polling transfer: &lt;EM&gt;i2c_polling_transfer.c&amp;nbsp;&lt;/EM&gt;(located at boards\frdmkl26z\driver_examples\i2c\polling_transfer). I thought this was the example you were referring to. But I didn't see&lt;EM&gt; hardware_init.c&amp;nbsp;&lt;/EM&gt;in the example. Which example are you working with?&lt;/P&gt;&lt;P&gt;In the example, I have mentioned above, they are using I2C1 as slave &amp;amp; I2C0 as master. Since you want to use I2C0 as slave &amp;amp; master, modifying the definition is necessary.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 13:07:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Switching-to-I2C0-module-for-FRDM-KL26Z/m-p/693847#M7451</guid>
      <dc:creator>visakhanc</dc:creator>
      <dc:date>2017-05-30T13:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: Switching to I2C0 module for FRDM-KL26Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Switching-to-I2C0-module-for-FRDM-KL26Z/m-p/693848#M7452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The example I was referring to was the i2c blocking example (located at boards\frdmkl26z\driver_examples\i2c\i2c_blocking).&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 14:11:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Switching-to-I2C0-module-for-FRDM-KL26Z/m-p/693848#M7452</guid>
      <dc:creator>danyonchu</dc:creator>
      <dc:date>2017-05-30T14:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: Switching to I2C0 module for FRDM-KL26Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Switching-to-I2C0-module-for-FRDM-KL26Z/m-p/693849#M7453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I could not find the example in&amp;nbsp;&lt;EM&gt;i2c/i2c_blocking.&amp;nbsp;&lt;/EM&gt;The SDK V2.2 for FRDM-KL26Z don't have that example. Which version of SDK is used?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 14:29:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Switching-to-I2C0-module-for-FRDM-KL26Z/m-p/693849#M7453</guid>
      <dc:creator>visakhanc</dc:creator>
      <dc:date>2017-05-30T14:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: Switching to I2C0 module for FRDM-KL26Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Switching-to-I2C0-module-for-FRDM-KL26Z/m-p/693850#M7454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess you are using SDK v1.x. I have found the example you mentioned. Here they are using I2C1 for master and slave. To change this to I2C0, you need to modify the file:&amp;nbsp;&lt;EM&gt;examples\frdmkl46z\board.h.&lt;/EM&gt; Make &lt;EM&gt;&amp;nbsp;&lt;/EM&gt;the following modification:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;/* The i2c instance used for i2c connection by default */&lt;BR /&gt;#define BOARD_I2C_INSTANCE &amp;nbsp;&amp;nbsp;&amp;nbsp;0&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will make the driver to use I2C0 for communication. The modifications you have done already are correct.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 15:18:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Switching-to-I2C0-module-for-FRDM-KL26Z/m-p/693850#M7454</guid>
      <dc:creator>visakhanc</dc:creator>
      <dc:date>2017-05-30T15:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: Switching to I2C0 module for FRDM-KL26Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Switching-to-I2C0-module-for-FRDM-KL26Z/m-p/693851#M7455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have found the part in the code that you have mentioned. Unfortunately I still do not have any communication between PTB2(board1)--&amp;gt;PTB2(board2)&amp;nbsp;and PTB3(board1)--&amp;gt;PTB3(board2) on both boards. These are the follwoing changes I have made thus far:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&amp;nbsp;In board.h&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* The i2c instance used for i2c DAC demo */&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7f0055; font-size: small;"&gt;&lt;STRONG&gt;#define&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; BOARD_DAC_I2C_INSTANCE 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;/* The i2c instance used for i2c connection by default */&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7f0055; font-size: small;"&gt;&lt;STRONG&gt;#define&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; BOARD_I2C_INSTANCE 0 &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;//&amp;lt;-- changed here&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;/* The &lt;SPAN style="text-decoration: underline;"&gt;spi&lt;/SPAN&gt; instance used for &lt;SPAN style="text-decoration: underline;"&gt;spi&lt;/SPAN&gt; example */&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7f0055; font-size: small;"&gt;&lt;STRONG&gt;#define&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; BOARD_SPI_INSTANCE 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline; font-size: small;"&gt;In hardware_init.h&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;/* enable clock for PORTs */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;CLOCK_SYS_EnablePortClock(PORTA_IDX);&lt;/P&gt;&lt;P&gt;CLOCK_SYS_EnablePortClock(PORTB_IDX); &lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;//&amp;lt;-- added this&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;CLOCK_SYS_EnablePortClock(PORTC_IDX);&lt;/P&gt;&lt;P&gt;CLOCK_SYS_EnablePortClock(PORTD_IDX);&lt;/P&gt;&lt;P&gt;CLOCK_SYS_EnablePortClock(PORTE_IDX);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;configure_i2c_pins(0U);&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;//&amp;lt;-- changed from 1U to 0U&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 16:52:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Switching-to-I2C0-module-for-FRDM-KL26Z/m-p/693851#M7455</guid>
      <dc:creator>danyonchu</dc:creator>
      <dc:date>2017-05-30T16:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Switching to I2C0 module for FRDM-KL26Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Switching-to-I2C0-module-for-FRDM-KL26Z/m-p/693852#M7456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I figured out that I was overwriting my I2C pins later by accident and the suggestion you made earlier was correct. Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 17:00:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Switching-to-I2C0-module-for-FRDM-KL26Z/m-p/693852#M7456</guid>
      <dc:creator>danyonchu</dc:creator>
      <dc:date>2017-05-30T17:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Switching to I2C0 module for FRDM-KL26Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Switching-to-I2C0-module-for-FRDM-KL26Z/m-p/693853#M7457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nice to know it is working for you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 17:06:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Switching-to-I2C0-module-for-FRDM-KL26Z/m-p/693853#M7457</guid>
      <dc:creator>visakhanc</dc:creator>
      <dc:date>2017-05-30T17:06:10Z</dc:date>
    </item>
  </channel>
</rss>

