<?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: I2C read problem ke02z</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-read-problem-ke02z/m-p/578947#M34348</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suraj,&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;I was wondering if you can tell me what the random values look like, and what the correctly values should be.&lt;BR /&gt;Have a great day,&lt;BR /&gt;Ping&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Jul 2016 06:26:18 GMT</pubDate>
    <dc:creator>jeremyzhou</dc:creator>
    <dc:date>2016-07-22T06:26:18Z</dc:date>
    <item>
      <title>I2C read problem ke02z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-read-problem-ke02z/m-p/578944#M34345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am using ke02z custom board. I have problem reading with DS1307 on board. I2C connected to I2C0, SDA PTA2, SCL PTA3. I had no problem with processor expert component DS1307. Now I am trying to move out of PE project because of the large library size after initializing all the peripherals. The problem is that I cannot read from I2C.&lt;/P&gt;&lt;P&gt;My code is as below.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE height="132" style="height: 99px; width: 337px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;sI2C_Config.u16Slt = 0;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;sI2C_Config.u16F = 0x1F;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;sI2C_Config.sSetting.bIntEn = 0;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;sI2C_Config.sSetting.bI2CEn = 1;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P&gt;I2C_Init(I2C0,&amp;amp;sI2C_Config );&lt;/P&gt;&lt;P&gt;I2C_MasterReadWait(I2C0, 0x68, &amp;amp;dsbuffer[0], 9);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting random values when reading. The reading also corrupts first 3 address locations in ds1307. (0x00, 0x01, 0x02).&lt;/P&gt;&lt;P&gt;I am running in FEE mode, external crystal 32khz, configured to run at 16.7MHz. I tried some other values of I2C Frequency Divider Register. Still getting random values and corrupting target. I have attached my project. DS1307 address is 0x68. I need to read values from address 0x00 to 0x09h. I also tried the interrupt mode . I have attached the project. I started the project from example file in driver_lib. Using KDS 3.2.&lt;/P&gt;&lt;P&gt;Please help. Thank you.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337300"&gt;ds1307_read_test.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Jul 2016 08:46:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-read-problem-ke02z/m-p/578944#M34345</guid>
      <dc:creator>surajka</dc:creator>
      <dc:date>2016-07-16T08:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: I2C read problem ke02z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-read-problem-ke02z/m-p/578945#M34346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suraj,&lt;/P&gt;&lt;P&gt;Regarding to the statement, the previous code which was generated by the PE had worked it out, however the current code failed.&lt;/P&gt;&lt;P&gt;So I'd highly recommend you to compare the initialization configuration of I2C in the previous and current code&lt;/P&gt;&lt;P&gt;Had you ever used the oscilloscope or logic analyzer to capture the wave when KE02 read the values from the DS1307?&lt;/P&gt;&lt;P&gt;If yes, I think you can figure out the root cause of the issue easily, as the wave can illustrates the I2C operations clearly.&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;BR /&gt;Have a great day,&lt;BR /&gt;Ping&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2016 03:20:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-read-problem-ke02z/m-p/578945#M34346</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2016-07-21T03:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: I2C read problem ke02z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-read-problem-ke02z/m-p/578946#M34347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jeremy,&lt;/P&gt;&lt;P&gt;Thank you for the replay.&lt;/P&gt;&lt;P&gt;The initialization seems OK. &lt;/P&gt;&lt;P&gt;I do not have an oscilloscope. But I tried the code from &lt;A href="https://jan.rychter.com/kinetis-i2c-driver" title="https://jan.rychter.com/kinetis-i2c-driver"&gt;Kinetis I2C Driver&lt;/A&gt; by Jan Richter. That code is working, except that it is based on interrupt. But occasionally I get wrong values using his library, probably because of other isr? Keeping the same initialization code, and disabling i2c0 isr, I tried i2c_masterreadwait function as mentioned in the original post. But I am still getting random values. I have spent a few days on this, but it's still not working. Is there something I am missing in my code?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jul 2016 04:59:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-read-problem-ke02z/m-p/578946#M34347</guid>
      <dc:creator>surajka</dc:creator>
      <dc:date>2016-07-22T04:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: I2C read problem ke02z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-read-problem-ke02z/m-p/578947#M34348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suraj,&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;I was wondering if you can tell me what the random values look like, and what the correctly values should be.&lt;BR /&gt;Have a great day,&lt;BR /&gt;Ping&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jul 2016 06:26:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-read-problem-ke02z/m-p/578947#M34348</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2016-07-22T06:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: I2C read problem ke02z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-read-problem-ke02z/m-p/578948#M34349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jeremy,&lt;/P&gt;&lt;P&gt;The seconds register reads like 40,27,248,178 etc where it should look like 1,2,3,….9,16,17..(it is BCD). I tried it with a wrong device address 0x50 and I get a constant 161. Again I tried with wrong address 0xD0, I get constant 161. So I guess the code is working upto the point where address is sent.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jul 2016 09:26:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-read-problem-ke02z/m-p/578948#M34349</guid>
      <dc:creator>surajka</dc:creator>
      <dc:date>2016-07-22T09:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: I2C read problem ke02z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-read-problem-ke02z/m-p/578949#M34350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess I should get value 255 if wrong slave address is sent.???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jul 2016 09:30:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-read-problem-ke02z/m-p/578949#M34350</guid>
      <dc:creator>surajka</dc:creator>
      <dc:date>2016-07-22T09:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: I2C read problem ke02z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-read-problem-ke02z/m-p/578950#M34351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I read the i2c_masterreadwait() function. &lt;/P&gt;&lt;P&gt;It is transmitting 0x68&amp;lt;&amp;lt;1. It the proceeds to read directly , without writing the slave register address (in my case 0x00) and 0x68 |0x01.&lt;/P&gt;&lt;P&gt;Similar is the case for i2c_mastersendwait() function.&lt;/P&gt;&lt;P&gt;Is there a problem me using the library or should I insert some code.?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jul 2016 09:48:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-read-problem-ke02z/m-p/578950#M34351</guid>
      <dc:creator>surajka</dc:creator>
      <dc:date>2016-07-22T09:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: I2C read problem ke02z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-read-problem-ke02z/m-p/578951#M34352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suraj,&lt;/P&gt;&lt;P&gt;It seems so weird, I don't think the root cause is from the library.&lt;/P&gt;&lt;P&gt;And according to the DS1307's datasheet, you can see that the slave address would be sent directly without plus send a 0x00.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="2016-07-25_16-07-07.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/37518i851C88C21E223C26/image-size/large?v=v2&amp;amp;px=999" role="button" title="2016-07-25_16-07-07.jpg" alt="2016-07-25_16-07-07.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And I'd highly recommend you to use the oscilloscope or logic analyzer to capture the wave, it can illustrate the root cause intuitively.&lt;BR /&gt;Have a great day,&lt;BR /&gt;Ping&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2016 08:15:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-read-problem-ke02z/m-p/578951#M34352</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2016-07-25T08:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: I2C read problem ke02z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-read-problem-ke02z/m-p/578952#M34353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But is there a way to send slave address using the library? I am tried a lot of things but I haven't got an oscilloscope. I am currently using a library which creates problem if ds1307 is damaged/not inserted. &lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jul 2016 08:24:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-read-problem-ke02z/m-p/578952#M34353</guid>
      <dc:creator>surajka</dc:creator>
      <dc:date>2016-07-28T08:24:06Z</dc:date>
    </item>
  </channel>
</rss>

