<?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>LPCXpresso IDEのトピックRe: I2C sample code not generating INTR after start</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-sample-code-not-generating-INTR-after-start/m-p/597020#M32096</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by avass on Mon Feb 04 12:01:08 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Rob, I found why there was no INTR, it was totally my fault ( as is most of the time ), my 3.3V power line had bad connection. Fixed that, now INTRs are coming in... Live and Learn...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I still have the Q though on finding the right values for the SCLL and SCLH. The 331DL spec says that it has to be at least 4.7 and 4.0 microsec accordingly. Assuming I am running at 12MHz on the 1115...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I know the formula of I2CFreq = PCLK / (SCLH + SCLL).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SCLH + SCLL = 12000kHz / 100 kHz = 120&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This gives me about SCLL=65 and SCHH=56&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are these kinda OK?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thx.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 21:40:02 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T21:40:02Z</dc:date>
    <item>
      <title>I2C sample code not generating INTR after start</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-sample-code-not-generating-INTR-after-start/m-p/597017#M32093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by avass on Sat Feb 02 10:03:25 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I wonder if any of you came across the same problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I hooked up my LIS331DL to my board in I2C mode.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am running the I2C sample ( after changing the target address ).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SCL-SCL (pull-up), SDA-SDA (pull-up), SDO-GND, CS-GND&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The I2CInit(comes back), but the I2CEngine hangs in waiting. I checked and there is no INTR at all.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using the i2c sample. Your help is appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-A&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:40:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-sample-code-not-generating-INTR-after-start/m-p/597017#M32093</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: I2C sample code not generating INTR after start</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-sample-code-not-generating-INTR-after-start/m-p/597018#M32094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Rob65 on Sun Feb 03 07:24:59 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you have some means of measuring the I2C lines?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Minimum is a voltmeter (or a logic probe) but a digital scope or logic analyzer is even better.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let's start with the configuration of your chip: SDO-GND, CS-GND is according to the datasheet placing the chip in I2C mode with A0 = 0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Pull ups on SCL and SDA should indeed be there. I'm just wondering which board you are using and what the values of the pullups are (and are these connected to 3V3 ?)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I2CInit() always comes back.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I2CEngine() will always wait until the transaction has completed, the examples does not do proper error handling - I have no idea what happens when you try to send/read from a non-existing device.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Still ... the interrupt should be triggered as soon as the start condition has been transmitted. But do take note that this only happens when the I2C peripheral can send a start condition. Meaning that both SCL and SDA need to be high first.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you placed a breakpoint in the I2Cx_IRQHandler ? This is the interrupt routine that contains the real I2C engine to transmit data.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Consider taking the improved I2C driver. The newest version is in my repository (&lt;/SPAN&gt;&lt;A href="http://http://hg.bikealive.nl/Platform1754/file/ae0834ece8c9/Drivers/lpc17xx/i2c.c"&gt;i2c.c&lt;/A&gt;&lt;SPAN&gt; and &lt;/SPAN&gt;&lt;A href="http://http://hg.bikealive.nl/Platform1754/file/ae0834ece8c9/Drivers/inc/i2c.h"&gt;i2c.h&lt;/A&gt;&lt;SPAN&gt;), an older version with a small piece of example code can be found &lt;/SPAN&gt;&lt;A href="http://http://myvoice.nl/software/#XpressoDrivers"&gt;here&lt;/A&gt;&lt;SPAN&gt;. (please consider using the first (newer) version, that contains some improvements and is the one I currently use).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rob&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;P.s: what kind of LPC1xxx processor are you using?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;P.p.s: feel free to use other code from my repository.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:40:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-sample-code-not-generating-INTR-after-start/m-p/597018#M32094</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: I2C sample code not generating INTR after start</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-sample-code-not-generating-INTR-after-start/m-p/597019#M32095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by avass on Sun Feb 03 23:48:49 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: Rob65&lt;/STRONG&gt;&lt;BR /&gt;Do you have some means of measuring the I2C lines?&lt;BR /&gt;Minimum is a voltmeter (or a logic probe) but a digital scope or logic analyzer is even better.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, I have a 40MHz USB scope.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: Rob65&lt;/STRONG&gt;&lt;BR /&gt;Let's start with the configuration of your chip: SDO-GND, CS-GND is according to the datasheet placing the chip in I2C mode with A0 = 0.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry, I think CS should be on Vdd, right? It is there now, my mistake in my original posting.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: Rob65&lt;/STRONG&gt;&lt;BR /&gt;Pull ups on SCL and SDA should indeed be there. I'm just wondering which board you are using and what the values of the pullups are (and are these connected to 3V3 ?)&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using the LPCXpresso LPC1115 board connected to a STEVAL-MKI089V1 board with an LIS331DLH on it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My current pull-ups were 2.4K. I have just lowered them to 1K but haven't tried it yet... I will eventually plan on running the system at 2.28V. What would be the proper values for both that and the 3.3V?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: Rob65&lt;/STRONG&gt;&lt;BR /&gt;I2CInit() always comes back.&lt;BR /&gt;I2CEngine() will always wait until the transaction has completed, the examples does not do proper error handling - I have no idea what happens when you try to send/read from a non-existing device.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It has an insanely long timeout.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: Rob65&lt;/STRONG&gt;&lt;BR /&gt;Still ... the interrupt should be triggered as soon as the start condition has been transmitted. But do take note that this only happens when the I2C peripheral can send a start condition. Meaning that both SCL and SDA need to be high first.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yeah, I understand, but it's not happening. I'll check on the scope. If they don't go high, what could be the problem?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: Rob65&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;Have you placed a breakpoint in the I2Cx_IRQHandler ? This is the interrupt routine that contains the real I2C engine to transmit data.&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, I also added global variables to all the status cases in the handler. There is absolutely no INTR coming in.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: Rob65&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;Consider taking the improved I2C driver. The newest version is in my repository (&lt;A href="http://http://hg.bikealive.nl/Platform1754/file/ae0834ece8c9/Drivers/lpc17xx/i2c.c"&gt;i2c.c&lt;/A&gt; and &lt;A href="http://http://hg.bikealive.nl/Platform1754/file/ae0834ece8c9/Drivers/inc/i2c.h"&gt;i2c.h&lt;/A&gt;), an older version with a small piece of example code can be found &lt;A href="http://http://myvoice.nl/software/#XpressoDrivers"&gt;here&lt;/A&gt;. (please consider using the first (newer) version, that contains some improvements and is the one I currently use).&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Will give it a try fresh in the morning.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, what should be the numbers for I2SCLL_SCLL and I2SCLH_SCLH if I plan on going down to 12MHz on the 1115 and 400Hz updates from the 331?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Attila&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;PS: I like how the header of your i2c.c code says "pwm.c: Driver for PWM peripheral"&amp;nbsp; :-)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:40:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-sample-code-not-generating-INTR-after-start/m-p/597019#M32095</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: I2C sample code not generating INTR after start</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-sample-code-not-generating-INTR-after-start/m-p/597020#M32096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by avass on Mon Feb 04 12:01:08 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Rob, I found why there was no INTR, it was totally my fault ( as is most of the time ), my 3.3V power line had bad connection. Fixed that, now INTRs are coming in... Live and Learn...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I still have the Q though on finding the right values for the SCLL and SCLH. The 331DL spec says that it has to be at least 4.7 and 4.0 microsec accordingly. Assuming I am running at 12MHz on the 1115...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I know the formula of I2CFreq = PCLK / (SCLH + SCLL).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SCLH + SCLL = 12000kHz / 100 kHz = 120&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This gives me about SCLL=65 and SCHH=56&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are these kinda OK?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thx.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:40:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-sample-code-not-generating-INTR-after-start/m-p/597020#M32096</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:40:02Z</dc:date>
    </item>
  </channel>
</rss>

