<?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 Constant NACK</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553799#M12937</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jherrera8 on Fri Oct 14 11:03:19 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hahaha whoops, I think I might have been up too late working on this. As for the scope, I let a friend borrow it for a few hours. What I am seeing is the data signals look good, but the clock duty cycle seems way too small. The time that the signal is high seems way way too short. On the example scope, it shows that clock and data lines are somewhat the same size. My clock triggers regularly, but seems like it spikes more than a square wave. I hope this is enough to help until I get my scope back.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks so much,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The system clock seems to be at 72Mhz, I think that would put the PClk around 18Mhz, so the values I chose for SCLL and SCHL are 0x5a&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;void I2C2Init( void )
{
&amp;nbsp; LPC_SC-&amp;gt;PCONP |= (1 &amp;lt;&amp;lt; 26);

&amp;nbsp; /* set PIO0.10 and PIO0.11 to I2C2 SDA and SCL */
&amp;nbsp; /* function to 10 on both SDA and SCL. */
&amp;nbsp; LPC_PINCON-&amp;gt;PINSEL0 &amp;amp;= ~((0x03&amp;lt;&amp;lt;20)|(0x03&amp;lt;&amp;lt;22));
&amp;nbsp; LPC_PINCON-&amp;gt;PINSEL0 |= ((0x02&amp;lt;&amp;lt;20)|(0x02&amp;lt;&amp;lt;22));
&amp;nbsp; LPC_PINCON-&amp;gt;PINMODE0 &amp;amp;= ~((0x03&amp;lt;&amp;lt;20)|(0x03&amp;lt;&amp;lt;22));
&amp;nbsp; LPC_PINCON-&amp;gt;PINMODE0 |= ((0x02&amp;lt;&amp;lt;20)|(0x2&amp;lt;&amp;lt;22));/* No pull-up no pull-down */
&amp;nbsp; LPC_PINCON-&amp;gt;PINMODE_OD0 |= ((0x01&amp;lt;&amp;lt;10)|(0x1&amp;lt;&amp;lt;11));

&amp;nbsp; /*--- Clear flags ---*/
&amp;nbsp; LPC_I2C2-&amp;gt;CONCLR = I2CONCLR_AAC | I2CONCLR_SIC | I2CONCLR_STAC | I2CONCLR_I2ENC;

&amp;nbsp; LPC_I2C2-&amp;gt;SCLL&amp;nbsp;&amp;nbsp; = I2SCLL_SCLL;
&amp;nbsp; LPC_I2C2-&amp;gt;SCLH&amp;nbsp;&amp;nbsp; = I2SCLH_SCLH;





 /* Enable the I2C Interrupt */
 NVIC_EnableIRQ(I2C2_IRQn);

 LPC_I2C2-&amp;gt;CONSET = I2CONSET_I2EN ;
 return;
}&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 23:30:50 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T23:30:50Z</dc:date>
    <item>
      <title>I2C Constant NACK</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553790#M12928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jherrera8 on Fri Oct 14 02:28:25 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a LPC1769 that I am using I2C on. I have been working on the code to set up my accelerometer and gyro. I can get the code to send a start signal, but all I receive are NACK signals. I think I have the clock right, anybody have any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;J&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:30:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553790#M12928</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: I2C Constant NACK</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553791#M12929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by RA1981 on Fri Oct 14 03:03:00 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: jherrera8&lt;/STRONG&gt;&lt;BR /&gt;... anybody have any ideas?&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes... my idea is... post your code... :)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ralf&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:30:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553791#M12929</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: I2C Constant NACK</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553792#M12930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by NXP_Europe on Fri Oct 14 03:21:33 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello jherrera8&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sometimes it works better to connect a simple known part first. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Also when you do not know whether the data is o.k., search in you component data that is fixed e.g. some address.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When you recognize the data, then the connection is established.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:30:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553792#M12930</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: I2C Constant NACK</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553793#M12931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jherrera8 on Fri Oct 14 06:10:03 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Well, the problem is that when I send the device address, the device should ack, and then I can go along my merry way. I cannot even get to that point because the device just sends a NACK. I am just checking a known value inside the device so I know that the data is valid, but I cannot even get to that point. Please help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;I2C1Init( );/* initialize I2c2 */
&amp;nbsp; while (1)
&amp;nbsp; {
&amp;nbsp; I2CWriteLength[PORT_USED] = 3;
&amp;nbsp; I2CReadLength[PORT_USED] = 5;
&amp;nbsp; I2CMasterBuffer[PORT_USED][0] = 0xA7;
&amp;nbsp; I2CMasterBuffer[PORT_USED][1] = 0x00;

&amp;nbsp; I2CMasterBuffer[PORT_USED][2] = 0xd1;/* Data0 */
&amp;nbsp; I2CEngine( PORT_USED );

&amp;nbsp; }
}&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is what I use as my main loop, then I have my Engine and IRQ_Handler&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;uint32_t I2CEngine( uint32_t portNum ) 
{
&amp;nbsp; /*--- Issue a start condition ---*/

LPC_I2C[portNum]-&amp;gt;CONSET = I2CONSET_STA;/* Set Start flag */

&amp;nbsp; I2CMasterState[portNum] = I2C_BUSY;

&amp;nbsp; while ( I2CMasterState[portNum] == I2C_BUSY )
&amp;nbsp; {
if ( timeout[portNum] &amp;gt;= MAX_TIMEOUT )
{
&amp;nbsp; I2CMasterState[portNum] = I2C_TIME_OUT;
&amp;nbsp; break;
}
timeout[portNum]++;
&amp;nbsp; }
&amp;nbsp; LPC_I2C[portNum]-&amp;gt;CONCLR = I2CONCLR_STAC;

&amp;nbsp; return ( I2CMasterState[portNum] );
}&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;void I2C1_IRQHandler(void)
{
&amp;nbsp; uint8_t StatValue;

&amp;nbsp; timeout[1] = 0;
&amp;nbsp; /* this handler deals with master read and master write only */
&amp;nbsp; StatValue = LPC_I2C1-&amp;gt;STAT;
&amp;nbsp; switch ( StatValue )
&amp;nbsp; {
case 0x08:/* A Start condition is issued. */
WrIndex1 = 0;
LPC_I2C1-&amp;gt;DAT = I2CMasterBuffer[1][WrIndex1++];
LPC_I2C1-&amp;gt;CONCLR = (I2CONCLR_SIC | I2CONCLR_STAC);
break;

case 0x10:
RdIndex1 = 0;

LPC_I2C1-&amp;gt;DAT = I2CMasterBuffer[1][WrIndex1++];
LPC_I2C1-&amp;gt;CONCLR = (I2CONCLR_SIC | I2CONCLR_STAC);
break;

case 0x18:/* Regardless, it's a ACK */
if ( I2CWriteLength[1] == 1 )
{
&amp;nbsp; LPC_I2C1-&amp;gt;CONSET = I2CONSET_STO;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Set Stop flag */
&amp;nbsp; I2CMasterState[1] = I2C_NO_DATA;
}
else
{
&amp;nbsp; LPC_I2C1-&amp;gt;DAT = I2CMasterBuffer[1][WrIndex2++];
}
LPC_I2C1-&amp;gt;CONCLR = I2CONCLR_SIC;
break;

case 0x28:/* Data byte has been transmitted, regardless ACK or NACK */
if ( WrIndex2 &amp;lt; I2CWriteLength[1] )
{&amp;nbsp;&amp;nbsp; 
&amp;nbsp; LPC_I2C1-&amp;gt;DAT = I2CMasterBuffer[1][WrIndex2++]; /* this should be the last one */
}
else
{
&amp;nbsp; if ( I2CReadLength[1] != 0 )
&amp;nbsp; {
LPC_I2C1-&amp;gt;CONSET = I2CONSET_STA;/* Set Repeated-start flag */
&amp;nbsp; }
&amp;nbsp; else
&amp;nbsp; {
LPC_I2C1-&amp;gt;CONSET = I2CONSET_STO;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Set Stop flag */
I2CMasterState[1] = I2C_OK;
&amp;nbsp; }
}
LPC_I2C1-&amp;gt;CONCLR = I2CONCLR_SIC;
break;

case 0x30:
LPC_I2C1-&amp;gt;CONSET = I2CONSET_STO;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Set Stop flag */
I2CMasterState[1] = I2C_NACK_ON_DATA;
LPC_I2C1-&amp;gt;CONCLR = I2CONCLR_SIC;
break;

case 0x40:/* Master Receive, SLA_R has been sent */
if ( (RdIndex2 + 1) &amp;lt; I2CReadLength[1] )
{
&amp;nbsp; /* Will go to State 0x50 */
&amp;nbsp; LPC_I2C1-&amp;gt;CONSET = I2CONSET_AA;/* assert ACK after data is received */
}
else
{
&amp;nbsp; /* Will go to State 0x58 */
&amp;nbsp; LPC_I2C1-&amp;gt;CONCLR = I2CONCLR_AAC;/* assert NACK after data is received */
}
LPC_I2C1-&amp;gt;CONCLR = I2CONCLR_SIC;
break;

case 0x50:/* Data byte has been received, regardless following ACK or NACK */
I2CSlaveBuffer[1][RdIndex2++] = LPC_I2C1-&amp;gt;DAT;
if ( (RdIndex2 + 1) &amp;lt; I2CReadLength[1] )
{&amp;nbsp;&amp;nbsp; 
&amp;nbsp; LPC_I2C1-&amp;gt;CONSET = I2CONSET_AA;/* assert ACK after data is received */
}
else
{
&amp;nbsp; LPC_I2C1-&amp;gt;CONCLR = I2CONCLR_AAC;/* assert NACK on last byte */
}
LPC_I2C1-&amp;gt;CONCLR = I2CONCLR_SIC;
break;

case 0x58:
I2CSlaveBuffer[1][RdIndex2++] = LPC_I2C1-&amp;gt;DAT;
I2CMasterState[1] = I2C_OK;
LPC_I2C1-&amp;gt;CONSET = I2CONSET_STO;/* Set Stop flag */
LPC_I2C1-&amp;gt;CONCLR = I2CONCLR_SIC;/* Clear SI flag */
break;

case 0x20:/* regardless, it's a NACK */
case 0x48:
LPC_I2C1-&amp;gt;CONSET = I2CONSET_STO;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Set Stop flag */
I2CMasterState[1] = I2C_NACK_ON_ADDRESS;
LPC_I2C1-&amp;gt;CONCLR = I2CONCLR_SIC;
break;

case 0x38:/* Arbitration lost, in this example, we don't
deal with multiple master situation */
default:
I2CMasterState[1] = I2C_ARBITRATION_LOST;
LPC_I2C1-&amp;gt;CONCLR = I2CONCLR_SIC;
break;
&amp;nbsp; }
&amp;nbsp; return;
}&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:30:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553793#M12931</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: I2C Constant NACK</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553794#M12932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ex-Zero on Fri Oct 14 09:11:46 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: jherrera8&lt;/STRONG&gt;&lt;BR /&gt;....to set up my accelerometer and gyro...&lt;BR /&gt;...anybody have any ideas?&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Don't know how 'your' device is working, but a lot of commercial devices have a datasheet :eek:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So posting a link to that datasheet could help to understand what's necessary to address this device and what you are doing wrong :)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;And perhaps someone has worked with this device before :rolleyes:&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:30:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553794#M12932</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: I2C Constant NACK</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553795#M12933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jherrera8 on Fri Oct 14 09:22:19 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Ok, so the chip is an IMU from sparkfun.com, and it has an accelerometer and a gyro. They both should work independently. I have tried fooling around with the code , and now I am not getting anything after I load the device address on the bus. Below are the links to the documents. Please help, slowly going insane....:confused:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://http://www.sparkfun.com/datasheets/Sensors/Gyro/PS-ITG-3200-00-01.4.pdf"&gt;http://http://www.sparkfun.com/datasheets/Sensors/Gyro/PS-ITG-3200-00-01.4.pdf&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://http://www.sparkfun.com/datasheets/Sensors/Accelerometer/ADXL345.pdf"&gt;http://www.sparkfun.com/datasheets/Sensors/Accelerometer/ADXL345.pdf&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://http://www.sparkfun.com/datasheets/Sensors/IMU/6DOF-Digital-v10.pdf"&gt;http://www.sparkfun.com/datasheets/Sensors/IMU/6DOF-Digital-v10.pdf&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:30:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553795#M12933</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: I2C Constant NACK</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553796#M12934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ex-Zero on Fri Oct 14 09:56:37 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;An alternate I2C address of 0x53 (followed by the R/W bit) can be chosen by grounding the SDO/ALT ADDRESS pin (Pin 12). This translates to 0xA6 for a write and 0xA7 for a read.&lt;/SPAN&gt;&lt;HR /&gt;&lt;SPAN&gt;Is Pin 12 grounded?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Figure 9 shows correct address usage and starts always with writing :eek::eek:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Why don't you start with this code :confused::confused:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://"&gt;http://knowledgebase.nxp.com/showthread.php?p=970&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:30:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553796#M12934</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: I2C Constant NACK</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553797#M12935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jherrera8 on Fri Oct 14 10:25:03 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I think my issue is with the clock, because when I scope mine, it doesn't look like that. I know that the address should be 0xA6, when I copied the code I was trying everything I could. That code is very helpful , but like I said, I think I'm having trouble with the clock.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit: Could you help me setup a proper clock&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;J&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:30:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553797#M12935</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: I2C Constant NACK</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553798#M12936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ex-Zero on Fri Oct 14 10:51:00 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: jherrera8&lt;/STRONG&gt;&lt;BR /&gt;...when I scope mine, it doesn't look like that...:confused:&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You didn't&amp;nbsp; post your i2c config and you don't describe what you've scoped, so only a clairvoyant could help you :rolleyes:&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:30:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553798#M12936</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: I2C Constant NACK</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553799#M12937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jherrera8 on Fri Oct 14 11:03:19 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hahaha whoops, I think I might have been up too late working on this. As for the scope, I let a friend borrow it for a few hours. What I am seeing is the data signals look good, but the clock duty cycle seems way too small. The time that the signal is high seems way way too short. On the example scope, it shows that clock and data lines are somewhat the same size. My clock triggers regularly, but seems like it spikes more than a square wave. I hope this is enough to help until I get my scope back.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks so much,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The system clock seems to be at 72Mhz, I think that would put the PClk around 18Mhz, so the values I chose for SCLL and SCHL are 0x5a&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;void I2C2Init( void )
{
&amp;nbsp; LPC_SC-&amp;gt;PCONP |= (1 &amp;lt;&amp;lt; 26);

&amp;nbsp; /* set PIO0.10 and PIO0.11 to I2C2 SDA and SCL */
&amp;nbsp; /* function to 10 on both SDA and SCL. */
&amp;nbsp; LPC_PINCON-&amp;gt;PINSEL0 &amp;amp;= ~((0x03&amp;lt;&amp;lt;20)|(0x03&amp;lt;&amp;lt;22));
&amp;nbsp; LPC_PINCON-&amp;gt;PINSEL0 |= ((0x02&amp;lt;&amp;lt;20)|(0x02&amp;lt;&amp;lt;22));
&amp;nbsp; LPC_PINCON-&amp;gt;PINMODE0 &amp;amp;= ~((0x03&amp;lt;&amp;lt;20)|(0x03&amp;lt;&amp;lt;22));
&amp;nbsp; LPC_PINCON-&amp;gt;PINMODE0 |= ((0x02&amp;lt;&amp;lt;20)|(0x2&amp;lt;&amp;lt;22));/* No pull-up no pull-down */
&amp;nbsp; LPC_PINCON-&amp;gt;PINMODE_OD0 |= ((0x01&amp;lt;&amp;lt;10)|(0x1&amp;lt;&amp;lt;11));

&amp;nbsp; /*--- Clear flags ---*/
&amp;nbsp; LPC_I2C2-&amp;gt;CONCLR = I2CONCLR_AAC | I2CONCLR_SIC | I2CONCLR_STAC | I2CONCLR_I2ENC;

&amp;nbsp; LPC_I2C2-&amp;gt;SCLL&amp;nbsp;&amp;nbsp; = I2SCLL_SCLL;
&amp;nbsp; LPC_I2C2-&amp;gt;SCLH&amp;nbsp;&amp;nbsp; = I2SCLH_SCLH;





 /* Enable the I2C Interrupt */
 NVIC_EnableIRQ(I2C2_IRQn);

 LPC_I2C2-&amp;gt;CONSET = I2CONSET_I2EN ;
 return;
}&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:30:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553799#M12937</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: I2C Constant NACK</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553800#M12938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ex-Zero on Fri Oct 14 11:31:01 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;The system clock seems to be at 72Mhz, I think that would put the PClk around 18Mhz, so the values I chose for SCLL and SCHL are 0x5a&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;SPAN&gt;Is this a game show? Guess frequency and resulting SCL and win a brand new washing machine?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could be a good idea to measure SCL, would increase the chance to win the prize :rolleyes:&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:30:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553800#M12938</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: I2C Constant NACK</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553801#M12939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jherrera8 on Fri Oct 14 11:48:24 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;HAHAHA, so when in debug, I can see the value of the system clock is 72MHz. Am I correct in saying the Pclk is 72Mhz/4? I used the equation in the the documents to calculate the SCLL value. Does this seem right? What other settings are there for the clock besides the SCLL and SCLH values? I don't think my logic analyzer clocks the frequency accurately, it tells me about 60Hz.When I change the SCLL and SCLH values the clock doesn't seem to change much.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for all the help,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;J&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:30:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553801#M12939</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: I2C Constant NACK</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553802#M12940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by atomicdog on Fri Oct 14 14:19:24 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you have the 1769 LPCXpresso board? If you do you should start out trying to read/write to the I2C eeprom on it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:30:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553802#M12940</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: I2C Constant NACK</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553803#M12941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jherrera8 on Fri Oct 14 14:47:06 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I did, and it does the same thing. That is why I am starting to think there is something wrong with the clock. Like I said, I don't think the clock signal is right. If it is the clock, it would be a good reason why nothing is happening. The status register says 0x08, then 0xf8, then finally 0x38. Is there a way to see if the clock is correct. I am getting my logic analyzer back shortly, and I will post a pic. Until then is there something else I can check....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:30:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553803#M12941</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: I2C Constant NACK</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553804#M12942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jherrera8 on Fri Oct 14 16:16:45 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;OK, here is the screen shot of the signals, like I said, I don' think the clock is right, so no matter what I put on the bus, it wont work. Any ideas?&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;&lt;SPAN&gt;[IMG]&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fi.imgur.com%2F4VdI8.png%5B%2FIMG%5D" rel="nofollow" target="_blank"&gt;http://i.imgur.com/4VdI8.png[/IMG]&lt;/A&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:30:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553804#M12942</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:30:53Z</dc:date>
    </item>
    <item>
      <title>Re: I2C Constant NACK</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553805#M12943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by atomicdog on Fri Oct 14 19:44:00 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;The system clock seems to be at 72Mhz, I think that would put the PClk&amp;nbsp; around 18Mhz, so the values I chose for SCLL and SCHL are 0x5a&lt;/SPAN&gt;&lt;HR /&gt;&lt;SPAN&gt;Are you [U]sure[/U] that I2SCLL_SCLL and I2SCLL_SCLH are both [B]really[/B] 0x5A?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What did you set [I]I2CPADCFG[/I] to?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:30:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553805#M12943</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: I2C Constant NACK</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553806#M12944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jherrera8 on Fri Oct 14 20:18:34 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I am very sure that it is set to 0x5a, and I don't believe I have I2CPADCFG set. Where would that be set? I don't think I have that so how and where should I set it?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit: After looking, is I2cPADCFG only used for I2C0 ? I am using SDA2 and SCL2. &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;J&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:30:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553806#M12944</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: I2C Constant NACK</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553807#M12945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ex-Zero on Sat Oct 15 08:39:49 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: jherrera8&lt;/STRONG&gt;&lt;BR /&gt;Edit: After looking, is I2cPADCFG only used for I2C0 ?&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Of course, that's the confusing the confused part of this game show :mad:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And your confusing the confused part is your posted picture :eek: Did you meanwhile measure your SCL frequency? If this picture is showing the right time scale you have a serious timing problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Otherwise it looks like an output problem and it could be a good idea to disconnect your I2C device and scope the signals again (of course with selected pullup and disabled open drain) :eek:&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:30:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553807#M12945</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: I2C Constant NACK</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553808#M12946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jherrera8 on Sat Oct 15 08:51:54 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Im sorry, I dont understand what you mean. So I will remove the sensor, but how do I disable open drain , and what do you mean about the resistors? Sorry but I am just new to all of this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;J&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:30:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553808#M12946</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: I2C Constant NACK</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553809#M12947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ex-Zero on Sat Oct 15 09:14:59 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;And even worse, you don't do what you've been asked for :eek:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Step #1: What is your measured SCL frequency :confused: And don't answer with words like 'think', 'believe' or 'should' :)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note: Could be a good idea to read the user manual and google a little bit. This is a forum and not a school :rolleyes:&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:30:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/I2C-Constant-NACK/m-p/553809#M12947</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:30:56Z</dc:date>
    </item>
  </channel>
</rss>

