<?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 MicrocontrollersのトピックRe: Using IOCTL set the I2C master, but the I2C0_C1 register value still 0x80</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Using-IOCTL-set-the-I2C-master-but-the-I2C0-C1-register-value/m-p/270794#M9174</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes.&amp;nbsp; So the address field in register A1 is the upper 7 bits.&amp;nbsp; The last bit is always read as zero.&amp;nbsp; The MQX driver accounts for this.&amp;nbsp; So when you pass param to the driver, it will shift it left by one bit (shifting in a zero).&amp;nbsp; So if you pass in 0x60 (0b0110_0000), the driver will shift it left and store it in A1 as 0xC0 (0b1100_0000).&amp;nbsp; The reason for this is to account for the R/W bit that it will receive from the master.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Aug 2013 15:52:41 GMT</pubDate>
    <dc:creator>chris_brown</dc:creator>
    <dc:date>2013-08-23T15:52:41Z</dc:date>
    <item>
      <title>Using IOCTL set the I2C master, but the I2C0_C1 register value still 0x80</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Using-IOCTL-set-the-I2C-master-but-the-I2C0-C1-register-value/m-p/270791#M9171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using CW10.4, MQX4.0.1 and MK60F120.&lt;/P&gt;&lt;P&gt;I open a I2C channel and use ioctl(current_dev, IO_IOCTL_I2C_SET_MASTER_MODE, NULL) set it to master.&lt;/P&gt;&lt;P&gt;But when I debug and monitor the register, the value of register I2C0_C1 is always 0x80.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions about this??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Aug 2013 22:24:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Using-IOCTL-set-the-I2C-master-but-the-I2C0-C1-register-value/m-p/270791#M9171</guid>
      <dc:creator>danielchai</dc:creator>
      <dc:date>2013-08-22T22:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using IOCTL set the I2C master, but the I2C0_C1 register value still 0x80</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Using-IOCTL-set-the-I2C-master-but-the-I2C0-C1-register-value/m-p/270792#M9172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe this is normal operation.&amp;nbsp; You have set the I2C instance to master mode, but the master mode bit in the register will not set until you send a message out this port.&amp;nbsp; The reason for this is that once the master mode bit is set in the I2C module register, the module immediately puts a start condition on the bus.&amp;nbsp; Please see the I2C C1 register description (chapter 54.3.3) in your device specific reference manual.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 13:29:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Using-IOCTL-set-the-I2C-master-but-the-I2C0-C1-register-value/m-p/270792#M9172</guid>
      <dc:creator>chris_brown</dc:creator>
      <dc:date>2013-08-23T13:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: Using IOCTL set the I2C master, but the I2C0_C1 register value still 0x80</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Using-IOCTL-set-the-I2C-master-but-the-I2C0-C1-register-value/m-p/270793#M9173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chris,&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;One more question is that I use command&lt;/P&gt;&lt;P&gt;param = 0x60;&lt;/P&gt;&lt;P&gt;ioctl (fd, IO_IOCTL_I2C_SET_STATION_ADDRESS, &amp;amp;param))&lt;/P&gt;&lt;P&gt;set the station address which will effect the register I2C0_A1. It changes to 0xC0.&lt;/P&gt;&lt;P&gt;Does it make sense to you?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 14:13:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Using-IOCTL-set-the-I2C-master-but-the-I2C0-C1-register-value/m-p/270793#M9173</guid>
      <dc:creator>danielchai</dc:creator>
      <dc:date>2013-08-23T14:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using IOCTL set the I2C master, but the I2C0_C1 register value still 0x80</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Using-IOCTL-set-the-I2C-master-but-the-I2C0-C1-register-value/m-p/270794#M9174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes.&amp;nbsp; So the address field in register A1 is the upper 7 bits.&amp;nbsp; The last bit is always read as zero.&amp;nbsp; The MQX driver accounts for this.&amp;nbsp; So when you pass param to the driver, it will shift it left by one bit (shifting in a zero).&amp;nbsp; So if you pass in 0x60 (0b0110_0000), the driver will shift it left and store it in A1 as 0xC0 (0b1100_0000).&amp;nbsp; The reason for this is to account for the R/W bit that it will receive from the master.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 15:52:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Using-IOCTL-set-the-I2C-master-but-the-I2C0-C1-register-value/m-p/270794#M9174</guid>
      <dc:creator>chris_brown</dc:creator>
      <dc:date>2013-08-23T15:52:41Z</dc:date>
    </item>
  </channel>
</rss>

