<?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>Kinetis Software Development KitのトピックI CANNOT WRITE I2Cx[D] REGISTER</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/I-CANNOT-WRITE-I2Cx-D-REGISTER/m-p/1539366#M8142</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I tryed to Write a driver in C++, to command a EEPROM connected to I2C1 port on my K22 microcontroller.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a problema when a tried to write a command using&amp;nbsp;&lt;STRONG&gt;I2C_MasterTransferBlocking,&lt;/STRONG&gt; I'm not able to write register D (DATA) of I2C1 port, The function&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;I2C_MasterTransferBlocking,&lt;/STRONG&gt;&amp;nbsp;calls&lt;STRONG&gt;&amp;nbsp;I2C_MasterStart.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;When I debug&amp;nbsp;I2C_MasterStart , after the following line:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;base-&amp;gt;D = (((uint32_t)address) &amp;lt;&amp;lt; 1U | ((direction == kI2C_Read) ? 1U : 0U));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;the register base-&amp;gt;D is allways 0, even if the address is not 0.&lt;/P&gt;&lt;P&gt;I cannot understand Why?&lt;/P&gt;&lt;P&gt;I folowed this example:&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;sourceClock = I2C_MASTER_CLK_FREQ;&lt;/P&gt;&lt;P&gt;I2C_MasterInit(EXAMPLE_I2C_MASTER_BASEADDR, &amp;amp;masterConfig, sourceClock);&lt;/P&gt;&lt;P&gt;memset(&amp;amp;masterXfer, 0, sizeof(masterXfer));&lt;/P&gt;&lt;P&gt;/* subAddress = 0x01, data = g_master_txBuff - write to slave.&lt;BR /&gt;start + slaveaddress(w) + subAddress + length of data buffer + data buffer + stop*/&lt;BR /&gt;uint8_t deviceAddress = 0x01U;&lt;BR /&gt;masterXfer.slaveAddress = I2C_MASTER_SLAVE_ADDR_7BIT;&lt;BR /&gt;masterXfer.direction = kI2C_Write;&lt;BR /&gt;masterXfer.subaddress = (uint32_t)deviceAddress;&lt;BR /&gt;masterXfer.subaddressSize = 1;&lt;BR /&gt;masterXfer.data = g_master_txBuff;&lt;BR /&gt;masterXfer.dataSize = I2C_DATA_LENGTH;&lt;BR /&gt;masterXfer.flags = kI2C_TransferDefaultFlag;&lt;/P&gt;&lt;P&gt;I2C_MasterTransferBlocking(EXAMPLE_I2C_MASTER_BASEADDR, &amp;amp;masterXfer);&lt;/P&gt;&lt;P&gt;PRINTF("Receive sent data from slave :");&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Oct 2022 13:51:40 GMT</pubDate>
    <dc:creator>vdavi81_cefla</dc:creator>
    <dc:date>2022-10-18T13:51:40Z</dc:date>
    <item>
      <title>I CANNOT WRITE I2Cx[D] REGISTER</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/I-CANNOT-WRITE-I2Cx-D-REGISTER/m-p/1539366#M8142</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I tryed to Write a driver in C++, to command a EEPROM connected to I2C1 port on my K22 microcontroller.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a problema when a tried to write a command using&amp;nbsp;&lt;STRONG&gt;I2C_MasterTransferBlocking,&lt;/STRONG&gt; I'm not able to write register D (DATA) of I2C1 port, The function&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;I2C_MasterTransferBlocking,&lt;/STRONG&gt;&amp;nbsp;calls&lt;STRONG&gt;&amp;nbsp;I2C_MasterStart.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;When I debug&amp;nbsp;I2C_MasterStart , after the following line:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;base-&amp;gt;D = (((uint32_t)address) &amp;lt;&amp;lt; 1U | ((direction == kI2C_Read) ? 1U : 0U));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;the register base-&amp;gt;D is allways 0, even if the address is not 0.&lt;/P&gt;&lt;P&gt;I cannot understand Why?&lt;/P&gt;&lt;P&gt;I folowed this example:&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;sourceClock = I2C_MASTER_CLK_FREQ;&lt;/P&gt;&lt;P&gt;I2C_MasterInit(EXAMPLE_I2C_MASTER_BASEADDR, &amp;amp;masterConfig, sourceClock);&lt;/P&gt;&lt;P&gt;memset(&amp;amp;masterXfer, 0, sizeof(masterXfer));&lt;/P&gt;&lt;P&gt;/* subAddress = 0x01, data = g_master_txBuff - write to slave.&lt;BR /&gt;start + slaveaddress(w) + subAddress + length of data buffer + data buffer + stop*/&lt;BR /&gt;uint8_t deviceAddress = 0x01U;&lt;BR /&gt;masterXfer.slaveAddress = I2C_MASTER_SLAVE_ADDR_7BIT;&lt;BR /&gt;masterXfer.direction = kI2C_Write;&lt;BR /&gt;masterXfer.subaddress = (uint32_t)deviceAddress;&lt;BR /&gt;masterXfer.subaddressSize = 1;&lt;BR /&gt;masterXfer.data = g_master_txBuff;&lt;BR /&gt;masterXfer.dataSize = I2C_DATA_LENGTH;&lt;BR /&gt;masterXfer.flags = kI2C_TransferDefaultFlag;&lt;/P&gt;&lt;P&gt;I2C_MasterTransferBlocking(EXAMPLE_I2C_MASTER_BASEADDR, &amp;amp;masterXfer);&lt;/P&gt;&lt;P&gt;PRINTF("Receive sent data from slave :");&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 13:51:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/I-CANNOT-WRITE-I2Cx-D-REGISTER/m-p/1539366#M8142</guid>
      <dc:creator>vdavi81_cefla</dc:creator>
      <dc:date>2022-10-18T13:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: I CANNOT WRITE I2Cx[D] REGISTER</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/I-CANNOT-WRITE-I2Cx-D-REGISTER/m-p/1539579#M8143</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest review the example in the SDK using the MCUXpresso IDE. If you have doubt, please let me know.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Pavel&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 20:37:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/I-CANNOT-WRITE-I2Cx-D-REGISTER/m-p/1539579#M8143</guid>
      <dc:creator>Pavel_Hernandez</dc:creator>
      <dc:date>2022-10-18T20:37:33Z</dc:date>
    </item>
    <item>
      <title>Re: I CANNOT WRITE I2Cx[D] REGISTER</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/I-CANNOT-WRITE-I2Cx-D-REGISTER/m-p/1539903#M8144</link>
      <description>&lt;P&gt;To write my code I used the example but I when tryed if it works I saw that base-&amp;gt;D I always 0.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 08:10:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/I-CANNOT-WRITE-I2Cx-D-REGISTER/m-p/1539903#M8144</guid>
      <dc:creator>vdavi81_cefla</dc:creator>
      <dc:date>2022-10-19T08:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: I CANNOT WRITE I2Cx[D] REGISTER</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/I-CANNOT-WRITE-I2Cx-D-REGISTER/m-p/1540494#M8146</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Could you give me the main.c of your project to see something please?&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Pavel&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 22:07:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/I-CANNOT-WRITE-I2Cx-D-REGISTER/m-p/1540494#M8146</guid>
      <dc:creator>Pavel_Hernandez</dc:creator>
      <dc:date>2022-10-19T22:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: I CANNOT WRITE I2Cx[D] REGISTER</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/I-CANNOT-WRITE-I2Cx-D-REGISTER/m-p/1542174#M8148</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I don't think you should be accessing the D register in your application code, if you're using the SDK driver for I2C.&lt;/P&gt;&lt;P&gt;If you're asking why the D register shows 0 when you read it in the debugger, it's because it's showing the last received byte from the I2C peripheral. It won't show what was written to the output side.&lt;/P&gt;&lt;P&gt;Have you checked that the&amp;nbsp;EXAMPLE_I2C_MASTER_BASEADDR macro evaluates to a valid I2C base address?&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2022 22:11:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/I-CANNOT-WRITE-I2Cx-D-REGISTER/m-p/1542174#M8148</guid>
      <dc:creator>scottm</dc:creator>
      <dc:date>2022-10-21T22:11:04Z</dc:date>
    </item>
  </channel>
</rss>

