<?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のトピックAccessing multiple slave devices</title>
    <link>https://community.nxp.com/t5/S32K/Accessing-multiple-slave-devices/m-p/2013645#M44237</link>
    <description>&lt;P&gt;I am confused on how to add multiple slaves devices to one master. I thought it was to add another channel but that doesn't seem to be it as you can't have duplicate hardware channels.&lt;/P&gt;&lt;P&gt;How do you add another slave address? I currently have one device at 0x39 and wish to add one at 0x38, accessed through the same scl/sda line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pb632146_0-1734097549706.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/315818iB883A57718789759/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pb632146_0-1734097549706.png" alt="pb632146_0-1734097549706.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Dec 2024 13:45:57 GMT</pubDate>
    <dc:creator>pb632146</dc:creator>
    <dc:date>2024-12-13T13:45:57Z</dc:date>
    <item>
      <title>Accessing multiple slave devices</title>
      <link>https://community.nxp.com/t5/S32K/Accessing-multiple-slave-devices/m-p/2013645#M44237</link>
      <description>&lt;P&gt;I am confused on how to add multiple slaves devices to one master. I thought it was to add another channel but that doesn't seem to be it as you can't have duplicate hardware channels.&lt;/P&gt;&lt;P&gt;How do you add another slave address? I currently have one device at 0x39 and wish to add one at 0x38, accessed through the same scl/sda line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pb632146_0-1734097549706.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/315818iB883A57718789759/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pb632146_0-1734097549706.png" alt="pb632146_0-1734097549706.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2024 13:45:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Accessing-multiple-slave-devices/m-p/2013645#M44237</guid>
      <dc:creator>pb632146</dc:creator>
      <dc:date>2024-12-13T13:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing multiple slave devices</title>
      <link>https://community.nxp.com/t5/S32K/Accessing-multiple-slave-devices/m-p/2013651#M44238</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Dear, &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/230291"&gt;@pb632146&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You don't need to make extra channels in order to connect several slave devices to a single I2C master on the same SDA/SCL line. Rather, you use the I2C driver to programmatically control the slave addresses. This is a solution breakdown that is developer-friendly:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;Single I2C Channel: Keep using the same hardware channel (LPI2C_1) in your configuration.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Manage Slave Addresses in Code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The configuration tool is for initializing one channel with one default slave address (e.g., 0x39).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In your application code, switch between slave addresses dynamically using API calls provided by your I2C driver.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dynamic Address Switching:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Use your I2C library or HAL to set the target slave address before sending or receiving data. For example, in an NXP SDK environment:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;c&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I2C_MasterStart(LPI2C_1, 0x38, kI2C_Write);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// Perform operations with slave at 0x38&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I2C_MasterStop(LPI2C_1);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I2C_MasterStart(LPI2C_1, 0x39, kI2C_Write);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// Perform operations with slave at 0x39&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I2C_MasterStop(LPI2C_1);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Shared Bus Handling:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ensure that only one device communicates at a time, as all slaves are connected to the same bus. This is managed automatically if the protocol is followed correctly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In short, you don't need multiple channels—just handle the slave address selection in your application code!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2024 13:59:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Accessing-multiple-slave-devices/m-p/2013651#M44238</guid>
      <dc:creator>AshutoshNama</dc:creator>
      <dc:date>2024-12-13T13:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing multiple slave devices</title>
      <link>https://community.nxp.com/t5/S32K/Accessing-multiple-slave-devices/m-p/2013850#M44253</link>
      <description>&lt;P&gt;Thank you for the advice, I tried to implement this but what is ki2c_Write&amp;nbsp; and masterstart/stop supposed to be for s32k344? Do i need to write those things myself? Are those functions in documentation?&lt;/P&gt;</description>
      <pubDate>Sat, 14 Dec 2024 04:17:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Accessing-multiple-slave-devices/m-p/2013850#M44253</guid>
      <dc:creator>pb632146</dc:creator>
      <dc:date>2024-12-14T04:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing multiple slave devices</title>
      <link>https://community.nxp.com/t5/S32K/Accessing-multiple-slave-devices/m-p/2013852#M44254</link>
      <description>Found its Lpi2c_Ip_MasterSetSlaveAddr i dont need to toggle it on and off just change the slave address</description>
      <pubDate>Sat, 14 Dec 2024 04:41:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Accessing-multiple-slave-devices/m-p/2013852#M44254</guid>
      <dc:creator>pb632146</dc:creator>
      <dc:date>2024-12-14T04:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing multiple slave devices</title>
      <link>https://community.nxp.com/t5/S32K/Accessing-multiple-slave-devices/m-p/2014108#M44267</link>
      <description>&lt;P&gt;&amp;nbsp;Got it!&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 05:11:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Accessing-multiple-slave-devices/m-p/2014108#M44267</guid>
      <dc:creator>AshutoshNama</dc:creator>
      <dc:date>2024-12-16T05:11:55Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing multiple slave devices</title>
      <link>https://community.nxp.com/t5/S32K/Accessing-multiple-slave-devices/m-p/2014154#M44272</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;yes you're right.&lt;BR /&gt;Slave address is provided at initialization time through the master configuration structure, but it can be changed at runtime by using LPI2C_Ip_MasterSetSlaveAddr(), which sets the slave address which will be used for any future transfers initiated by the LPI2C master..&lt;/P&gt;
&lt;DIV&gt;So to access other slave, call LPI2C_Ip_MasterSetSlaveAddr() with slave address as parameter before new Lpi2c_Ip_MasterSendData and Lpi2c_Ip_MasterReceiveData functions call.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;BR, Petr&lt;/DIV&gt;</description>
      <pubDate>Mon, 16 Dec 2024 06:32:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Accessing-multiple-slave-devices/m-p/2014154#M44272</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2024-12-16T06:32:12Z</dc:date>
    </item>
  </channel>
</rss>

