<?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: 1769 -I2C doesn't work</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577471#M23232</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Polux rsv on Fri Jun 29 02:32:27 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Is everything initialized in I2C1Init();&amp;nbsp; ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-I2C1 peripheral activated ? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-Clock source, dividers, speed correctly setup for your device ? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-IO pins configured as I2C1 port ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Angelo&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[SIZE=2][/SIZE]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Jun 2016 02:37:01 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-16T02:37:01Z</dc:date>
    <item>
      <title>1769 -I2C doesn't work</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577464#M23225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by bruno on Thu Jun 28 06:44:03 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying make work the i2c of 1769.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I carry the example . But he doesn`t work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using the i2c1. Pines PIO0.0 and&amp;nbsp; PIO0.1 of micro.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The resistor of pull-up are OK.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What can are wrong?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:36:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577464#M23225</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: 1769 -I2C doesn't work</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577465#M23226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by bruno on Thu Jun 28 06:47:23 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Code&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[SIZE=2]I2C1Init( ); [/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* initialize I2c1 */[/COLOR][/SIZE][/COLOR][/SIZE]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[SIZE=2][COLOR=#3f7f5f]The port &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[SIZE=2][COLOR=#3f7f5f][B][SIZE=2][COLOR=#3f7f5f]#define[/COLOR][/SIZE][/B][/COLOR][/SIZE][SIZE=2][COLOR=#000000] PORT_USED 1[/COLOR][/SIZE]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[SIZE=2][COLOR=#000000]whenever will "1" ??[/COLOR][/SIZE]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/COLOR][/SIZE]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[LEFT][SIZE=2]I2CWriteLength[PORT_USED] = 3;[/SIZE]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[SIZE=2]I2CReadLength[PORT_USED] = 0;[/SIZE]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[SIZE=2]I2CMasterBuffer[PORT_USED][0] = CI_ADDR; //A0 for Si570 VCXO of 10 MHz[/SIZE]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[SIZE=2]I2CMasterBuffer[PORT_USED][1] = 0x07; [/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* address */[/COLOR][/SIZE][/COLOR][/SIZE][/LEFT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[SIZE=2]I2CMasterBuffer[PORT_USED][2] = 0x55; [/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* Data0 */[/COLOR][/SIZE][/COLOR][/SIZE]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[SIZE=2]I2CEngine( PORT_USED );[/SIZE]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Bruno Braga&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:36:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577465#M23226</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: 1769 -I2C doesn't work</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577466#M23227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by bruno on Thu Jun 28 09:32:26 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Someone for help me??&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:36:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577466#M23227</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: 1769 -I2C doesn't work</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577467#M23228</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 Thu Jun 28 12:41:14 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;What doesn't work?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you used the debugger to try and find the problem?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:36:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577467#M23228</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: 1769 -I2C doesn't work</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577468#M23229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by creafyumi on Thu Jun 28 18:03:51 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;No useful information provided. It will be very hard for other forum members to help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:37:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577468#M23229</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: 1769 -I2C doesn't work</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577469#M23230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by serge on Thu Jun 28 23:59:46 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Bruno,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[LIST=1]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[*]Export your project and post your code here.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[*]Are you using the lpcxpresso 1769 board or a custom board. In case of a custom board we want to see at least the I2C part of the schematic.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[*]What is the hardware you are trying to get working, the chip-number would be great.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[*]Which version of the IDE do you use?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/LIST]Without knowing the above we won't be able to help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:37:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577469#M23230</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: 1769 -I2C doesn't work</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577470#M23231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by researchinnovation on Fri Jun 29 00:20:19 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: bruno&lt;/STRONG&gt;&lt;BR /&gt;I am trying make work the i2c of 1769.&lt;BR /&gt; &lt;BR /&gt;I carry the example . But he doesn`t work.&lt;BR /&gt; &lt;BR /&gt;I am using the i2c1. Pines PIO0.0 and&amp;nbsp; PIO0.1 of micro.&lt;BR /&gt;The resistor of pull-up are OK.&lt;BR /&gt; &lt;BR /&gt;What can are wrong?&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi..!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What is the exact error, you are getting on console. Can you share it with us.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks &amp;amp; Regards......:)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:37:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577470#M23231</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: 1769 -I2C doesn't work</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577471#M23232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Polux rsv on Fri Jun 29 02:32:27 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Is everything initialized in I2C1Init();&amp;nbsp; ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-I2C1 peripheral activated ? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-Clock source, dividers, speed correctly setup for your device ? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-IO pins configured as I2C1 port ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Angelo&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[SIZE=2][/SIZE]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:37:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577471#M23232</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: 1769 -I2C doesn't work</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577472#M23233</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 Fri Jun 29 02:51:41 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Guys,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;please ....&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Bruno lives in Brazil so he is still asleep right now.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Could we at least give him a chance to react before flooding the forum with a lot if these (obvious) questions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rob&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:37:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577472#M23233</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: 1769 -I2C doesn't work</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577473#M23234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by bruno on Fri Jun 29 04:53:07 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: atomicdog&lt;/STRONG&gt;&lt;BR /&gt;What doesn't work?&lt;BR /&gt;Have you used the debugger to try and find the problem?&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;He just doesn't work. The code is sure. When I make debugger no errors.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:37:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577473#M23234</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: 1769 -I2C doesn't work</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577474#M23235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by bruno on Fri Jun 29 05:03:28 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: Serge&lt;/STRONG&gt;&lt;BR /&gt;Bruno,&lt;BR /&gt;&lt;BR /&gt;[LIST=1]&lt;BR /&gt;[*]Export your project and post your code here.&lt;BR /&gt;[*]Are you using the lpcxpresso 1769 board or a custom board. In case of a custom board we want to see at least the I2C part of the schematic.&lt;BR /&gt;[*]What is the hardware you are trying to get working, the chip-number would be great.&lt;BR /&gt;[*]Which version of the IDE do you use?&lt;BR /&gt;[/LIST]Without knowing the above we won't be able to help.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; The code complete is the example, I just change the address of slave. Because I am using the PCF2129 ( address of slave him is A2). Of couse, the data with will record at PCF2129.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using LPCXpresso v4.1.5_219 version.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Too, I am using 1769 board&amp;nbsp; called LCXpresso LPC1769 REV B. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The I2C ative is I2C 1, of the&amp;nbsp; Pines PIO0.0 and PIO0.1 .&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:37:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577474#M23235</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: 1769 -I2C doesn't work</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577475#M23236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by bruno on Fri Jun 29 07:25:23 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;For there are not doubts here my code complete:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
[LEFT]#include[SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]&amp;lt;cr_section_macros.h&amp;gt;[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#2a00ff][/LEFT]

[/COLOR][/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]#include
[/COLOR][/SIZE][/COLOR][/SIZE][/B][LEFT][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]&amp;lt;NXP/crp.h&amp;gt;[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#2a00ff]
[/COLOR][/SIZE]
[LEFT][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// Variable to store CRP value in. Will be placed automatically[/COLOR][/SIZE]
[SIZE=2][COLOR=#3f7f5f]// by the linker when "Enable Code Read Protect" selected.[/COLOR][/SIZE]
[SIZE=2][COLOR=#3f7f5f]// See crp.h header for more information[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]__CRP [/LEFT]
[/LEFT]
[/SIZE][LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]const[/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]unsigned[/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] CRP_WORD = CRP_NO_CRP ;[/SIZE]
 
[LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]#include[/LEFT]
[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][/B][LEFT][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"lpc17xx.h"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#2a00ff]
[LEFT][/COLOR][/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]#include[/LEFT]
[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][/B][LEFT][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"type.h"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#2a00ff]
[LEFT][/COLOR][/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]#include[/LEFT]
[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][/B][LEFT][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"i2c.h"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#2a00ff]
[/COLOR][/SIZE]
[LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]extern[/LEFT]
[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][/B][LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]volatile[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#005032][SIZE=2][COLOR=#005032]uint8_t[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] I2CMasterBuffer[I2C_PORT_NUM][BUFSIZE];[/SIZE]
[LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]extern[/LEFT]
[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][/B][LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]volatile[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#005032][SIZE=2][COLOR=#005032]uint8_t[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] I2CSlaveBuffer[I2C_PORT_NUM][BUFSIZE];[/SIZE]
[LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]extern[/LEFT]
[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][/B][LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]volatile[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#005032][SIZE=2][COLOR=#005032]uint32_t[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] I2CReadLength[I2C_PORT_NUM];[/SIZE]
[LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]extern[/LEFT]
[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][/B][LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]volatile[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#005032][SIZE=2][COLOR=#005032]uint32_t[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] I2CWriteLength[I2C_PORT_NUM];[/SIZE]
 
[LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]#define[/LEFT]
[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][/B][LEFT][SIZE=2]PORT_USED 1[/SIZE]
 
[LEFT][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/*******************************************************************************[/COLOR][/SIZE]
[SIZE=2][COLOR=#3f7f5f]** Main Function main()[/COLOR][/SIZE]
[SIZE=2][COLOR=#3f7f5f]*******************************************************************************/[/COLOR][/SIZE]
[/COLOR][/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int[/LEFT]
[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][/B][LEFT][SIZE=2][B]main[/B] ([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]void[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2])[/SIZE]
[LEFT][SIZE=2]{[/SIZE][/LEFT]
 
[LEFT][SIZE=2]ã€€[/SIZE]
[SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* SystemClockUpdate() updates the SystemFrequency variable */[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f]
[/COLOR][/SIZE][SIZE=2]SystemClockUpdate();[/SIZE][/LEFT]
 
[LEFT][SIZE=2]ã€€[/SIZE]
[SIZE=2]I2C1Init( ); [/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* initialize I2c1 */[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f][/LEFT]
[/COLOR][/SIZE]
[LEFT][SIZE=2]ã€€[/SIZE]
[SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* In order to start the I2CEngine, the all the parameters [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f]
[SIZE=2][COLOR=#3f7f5f]must be set in advance, including I2CWriteLength, I2CReadLength,[/COLOR][/SIZE]
[SIZE=2][COLOR=#3f7f5f]I2CCmd, and the I2cMasterBuffer which contains the stream[/COLOR][/SIZE]
[SIZE=2][COLOR=#3f7f5f]command/data to the I2c slave device. [/COLOR][/SIZE]
[SIZE=2][COLOR=#3f7f5f](1) If it's a I2C write only, the number of bytes to be written is [/COLOR][/SIZE]
[SIZE=2][COLOR=#3f7f5f]I2CWriteLength, I2CReadLength is zero, the content will be filled [/COLOR][/SIZE]
[SIZE=2][COLOR=#3f7f5f]in the I2CMasterBuffer. [/COLOR][/SIZE]
[SIZE=2][COLOR=#3f7f5f](2) If it's a I2C read only, the number of bytes to be read is [/COLOR][/SIZE]
[SIZE=2][COLOR=#3f7f5f]I2CReadLength, I2CWriteLength is 0, the read value will be filled [/COLOR][/SIZE]
[SIZE=2][COLOR=#3f7f5f]in the I2CMasterBuffer. [/COLOR][/SIZE]
[SIZE=2][COLOR=#3f7f5f](3) If it's a I2C Write/Read with repeated start, specify the [/COLOR][/SIZE]
[SIZE=2][COLOR=#3f7f5f]I2CWriteLength, fill the content of bytes to be written in [/COLOR][/SIZE]
[SIZE=2][COLOR=#3f7f5f]I2CMasterBuffer, specify the I2CReadLength, after the repeated [/COLOR][/SIZE]
[SIZE=2][COLOR=#3f7f5f]start and the device address with RD bit set, the content of the [/COLOR][/SIZE]
[SIZE=2][COLOR=#3f7f5f]reading will be filled in I2CMasterBuffer index at [/COLOR][/SIZE]
[SIZE=2][COLOR=#3f7f5f]I2CMasterBuffer[I2CWriteLength+2]. [/COLOR][/SIZE][/LEFT]
 
[LEFT][SIZE=2][COLOR=#3f7f5f]e.g. Start, DevAddr(W), WRByte1...WRByteN, Repeated-Start, DevAddr(R), [/COLOR][/SIZE]
[SIZE=2][COLOR=#3f7f5f]RDByte1...RDByteN Stop. The content of the reading will be filled [/COLOR][/SIZE]
[SIZE=2][COLOR=#3f7f5f]after (I2CWriteLength + two [U]devaddr[/U]) bytes. */[/COLOR][/SIZE][/LEFT]
[/COLOR][/SIZE]
[LEFT][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* Write SLA(W), address and one data byte */[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f]
[/COLOR][/SIZE][SIZE=2]I2CWriteLength[PORT_USED] = 3;[/SIZE]
[SIZE=2]I2CReadLength[PORT_USED] = 0;[/SIZE]
[SIZE=2]I2CMasterBuffer[PORT_USED][0] = PCF8594_ADDR;[/SIZE]
[SIZE=2]I2CMasterBuffer[PORT_USED][1] = 0x00; [/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* address */[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f]
[/COLOR][/SIZE][SIZE=2]I2CMasterBuffer[PORT_USED][2] = 0x55; [/LEFT]
[/LEFT]
[/SIZE][LEFT][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* Data0 */[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f]
[LEFT][/COLOR][/SIZE][SIZE=2]I2CEngine( PORT_USED );[/SIZE][/LEFT]
 
[LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]return[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] 0;[/SIZE][/LEFT]
[SIZE=2]}[/SIZE]
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;All this is stranger, because the code is very simple.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/LEFT]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:37:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577475#M23236</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: 1769 -I2C doesn't work</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577476#M23237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by bruno on Fri Jun 29 07:31:45 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: Polux rsv&lt;/STRONG&gt;&lt;BR /&gt;Is everything initialized in I2C1Init(); ?&lt;BR /&gt;-I2C1 peripheral activated ? &lt;BR /&gt;-Clock source, dividers, speed correctly setup for your device ? &lt;BR /&gt;-IO pins configured as I2C1 port ?&lt;BR /&gt; &lt;BR /&gt;Angelo&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Hello&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Yes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Too, doesn't wrong.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Yes..&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Bruno Braga&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:37:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577476#M23237</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: 1769 -I2C doesn't work</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577477#M23238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by serge on Sun Jul 01 23:51:22 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;[SIZE=2]I would like to see the define for "PCF8594_ADDR". Just to be sure.[/SIZE]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:37:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577477#M23238</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: 1769 -I2C doesn't work</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577478#M23239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by bruno on Mon Jul 02 04:51:07 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;It is OK.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Bruno Braga&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:37:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577478#M23239</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: 1769 -I2C doesn't work</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577479#M23240</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 Mon Jul 02 12:41:42 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: bruno&lt;/STRONG&gt;&lt;BR /&gt;It is OK.&lt;BR /&gt; &lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does this mean that it is working now or that you think the define is OK?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please just provide the source for the define and let us decide weather it's OK or not.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rob&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:37:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577479#M23240</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: 1769 -I2C doesn't work</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577480#M23241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by bruno on Tue Jul 03 05:15:11 MST 2012&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;Does this mean that it is working now or that you think the define is OK?&lt;BR /&gt; &lt;BR /&gt;Please just provide the source for the define and let us decide weather it's OK or not.&lt;BR /&gt; &lt;BR /&gt;Rob&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, is working one parte of my program. I found errors in&amp;nbsp; the file i2c.c &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The program just send the first datium, the address of slave.. After, he doesn't worked..&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In fuction&amp;nbsp; [SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]I2C1Init&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/COLOR][/SIZE][/COLOR][/SIZE] &lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;[SIZE=2]
[LEFT]LPC_SC-&amp;gt;[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]PCONP[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] |= (1 &amp;lt;&amp;lt; 19);
[/LEFT]
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][LEFT]#if[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] 0
[/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* set PIO0.19 and PIO0.20 to I2C1 SDA and SCL */[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT][/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* function to 11 on both SDA and SCL. */[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT]LPC_PINCON-&amp;gt;PINSEL1 &amp;amp;= ~((0x3&amp;lt;&amp;lt;6)|(0x3&amp;lt;&amp;lt;8));
LPC_PINCON-&amp;gt;PINSEL1 |= ((0x3&amp;lt;&amp;lt;6)|(0x3&amp;lt;&amp;lt;8));
LPC_PINCON-&amp;gt;PINMODE1 &amp;amp;= ~((0x3&amp;lt;&amp;lt;6)|(0x3&amp;lt;&amp;lt;8));
LPC_PINCON-&amp;gt;PINMODE1 |= ((0x2&amp;lt;&amp;lt;6)|(0x2&amp;lt;&amp;lt;8)); [/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* No pull-up no pull-down */[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT]LPC_PINCON-&amp;gt;PINMODE_OD0 |= ((0x1&amp;lt;&amp;lt;19)|(0x1&amp;lt;&amp;lt;20));[/LEFT]
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][LEFT]#endif[/LEFT]
[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT][/LEFT]
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][LEFT]#if[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] 1
[/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* set PIO0.0 and PIO0.1 to I2C1 SDA and SCL */[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT][/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* function to 11 on both SDA and SCL. */[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT]LPC_PINCON-&amp;gt;[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]PINSEL0[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] &amp;amp;= ~((0x3&amp;lt;&amp;lt;0)|(0x3&amp;lt;&amp;lt;2));
LPC_PINCON-&amp;gt;[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]PINSEL0[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] |= ((0x3&amp;lt;&amp;lt;0)|(0x3&amp;lt;&amp;lt;2));
LPC_PINCON-&amp;gt;[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]PINMODE0[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] &amp;amp;= ~((0x3&amp;lt;&amp;lt;0)|(0x3&amp;lt;&amp;lt;2));
LPC_PINCON-&amp;gt;[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]PINMODE0[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] |= ((0x2&amp;lt;&amp;lt;0)|(0x2&amp;lt;&amp;lt;2)); [/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* No pull-up no pull-down */[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT]LPC_PINCON-&amp;gt;[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]PINMODE_OD0[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] |= ((0x01&amp;lt;&amp;lt;0)|(0x1&amp;lt;&amp;lt;1)); [/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* Open drain */[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][LEFT]#endif[/LEFT]
[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT]
[/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/*--- Clear flags ---*/[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT]LPC_I2C1-&amp;gt;[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]CONCLR[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = I2CONCLR_AAC | I2CONCLR_SIC | I2CONCLR_STAC | I2CONCLR_I2ENC; 

[/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/*--- Reset registers ---*/[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT]LPC_I2C1-&amp;gt;[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]SCLL[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = I2SCLL_SCLL;
LPC_I2C1-&amp;gt;[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]SCLH[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = I2SCLH_SCLH;

[/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* Install interrupt handler */[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT]NVIC_EnableIRQ([/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]I2C1_IRQn[/I][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]);
[/LEFT]
LPC_I2C1-&amp;gt;[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]CONSET[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = I2CONSET_I2EN;
[/SIZE][SIZE=2][LEFT]LPC_SC-&amp;gt;[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]PCONP[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] |= (1 &amp;lt;&amp;lt; 19);
[/LEFT]
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][LEFT]#if[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] 0
[/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* set PIO0.19 and PIO0.20 to I2C1 SDA and SCL */[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT][/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* function to 11 on both SDA and SCL. */[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT]LPC_PINCON-&amp;gt;PINSEL1 &amp;amp;= ~((0x3&amp;lt;&amp;lt;6)|(0x3&amp;lt;&amp;lt;8));
LPC_PINCON-&amp;gt;PINSEL1 |= ((0x3&amp;lt;&amp;lt;6)|(0x3&amp;lt;&amp;lt;8));
LPC_PINCON-&amp;gt;PINMODE1 &amp;amp;= ~((0x3&amp;lt;&amp;lt;6)|(0x3&amp;lt;&amp;lt;8));
LPC_PINCON-&amp;gt;PINMODE1 |= ((0x2&amp;lt;&amp;lt;6)|(0x2&amp;lt;&amp;lt;8)); [/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* No pull-up no pull-down */[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT]LPC_PINCON-&amp;gt;PINMODE_OD0 |= ((0x1&amp;lt;&amp;lt;19)|(0x1&amp;lt;&amp;lt;20));[/LEFT]
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][LEFT]#endif[/LEFT]
[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT][/LEFT]
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][LEFT]#if[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] 1
[/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* set PIO0.0 and PIO0.1 to I2C1 SDA and SCL */[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT][/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* function to 11 on both SDA and SCL. */[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT]LPC_PINCON-&amp;gt;[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]PINSEL0[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] &amp;amp;= ~((0x3&amp;lt;&amp;lt;0)|(0x3&amp;lt;&amp;lt;2));
LPC_PINCON-&amp;gt;[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]PINSEL0[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] |= ((0x3&amp;lt;&amp;lt;0)|(0x3&amp;lt;&amp;lt;2));
LPC_PINCON-&amp;gt;[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]PINMODE0[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] &amp;amp;= ~((0x3&amp;lt;&amp;lt;0)|(0x3&amp;lt;&amp;lt;2));
LPC_PINCON-&amp;gt;[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]PINMODE0[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] |= ((0x2&amp;lt;&amp;lt;0)|(0x2&amp;lt;&amp;lt;2)); [/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* No pull-up no pull-down */[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT]LPC_PINCON-&amp;gt;[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]PINMODE_OD0[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] |= ((0x01&amp;lt;&amp;lt;0)|(0x1&amp;lt;&amp;lt;1)); [/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* Open drain */[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][LEFT]#endif[/LEFT]
[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT]
[/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/*--- Clear flags ---*/[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT]LPC_I2C1-&amp;gt;[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]CONCLR[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = I2CONCLR_AAC | I2CONCLR_SIC | I2CONCLR_STAC | I2CONCLR_I2ENC; 

[/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/*--- Reset registers ---*/[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT]LPC_I2C1-&amp;gt;[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]SCLL[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = I2SCLL_SCLL;
LPC_I2C1-&amp;gt;[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]SCLH[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = I2SCLH_SCLH;

[/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* Install interrupt handler */[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT]NVIC_EnableIRQ([/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]I2C1_IRQn[/I][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]);
[/LEFT]
LPC_I2C1-&amp;gt;[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]CONSET[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = I2CONSET_I2EN;
[/SIZE]&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The if0 and if1 was inverted. Now, I think there are more errors.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:37:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577480#M23241</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: 1769 -I2C doesn't work</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577481#M23242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by yakin on Sat Jul 06 07:42:38 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;This is my first contribution and I hope it will not be the last, at the beginning I had dificulties to read data from a PCF8574, data are collected on I2CSlaveBuffer [PORT_USED] [0] be transmitted on UART0, This is how I do it:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;int main (void)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; uint32_t i;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SystemClockUpdate () / * updates the SystemFrequency variable * /&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;UART0Count = 1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;UARTInit (0, 38400) / * baud rate setting * /&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I2C2Init () / * initialize I2c2 * /&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I2CReadLength [PORT_USED] = 1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I2CWriteLength [PORT_USED] = 2;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I2CMasterBuffer [PORT_USED] [0] = PCF8574_ADDR;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I2CMasterBuffer [PORT_USED] [1] = 0xFF;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I2CMasterBuffer [PORT_USED] [2] = PCF8574_ADDR | RD_BIT;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;while (1) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I2CEngine (PORT_USED);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;UART0Buffer [0] = I2CSlaveBuffer [PORT_USED] [0];&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_UART0-&amp;gt; IER = IER_THRE | IER_RLS / * Disable RBR * /&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;UARTSend (0, (uint8_t *) UART0Buffer, UART0Count);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_UART0-&amp;gt; IER = IER_THRE | IER_RLS | IER_RBR / * Re-enable RBR &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:37:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/1769-I2C-doesn-t-work/m-p/577481#M23242</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:37:07Z</dc:date>
    </item>
  </channel>
</rss>

