<?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>LPC Microcontrollers中的主题 Re: LPC1769 for I2C communication</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-for-I2C-communication/m-p/569981#M18046</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Hi Jingjing,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Thank you very much for your explanation and sorry for my late reply!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Thanks to your information, I could successfully build the sample project after all.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Although I did not yet complete the program of I2C communication, I can analyze the sample and will know how to use it!&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Hitotsu&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Sep 2016 15:58:43 GMT</pubDate>
    <dc:creator>hitotsuasahi</dc:creator>
    <dc:date>2016-09-02T15:58:43Z</dc:date>
    <item>
      <title>LPC1769 for I2C communication</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-for-I2C-communication/m-p/569976#M18041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I started learning to use the I2C function of LPC1769. &lt;/P&gt;&lt;P&gt;Could anyone provide me the sample program for the initialization and data transmission of I2C related registers?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to create my code based on the information from the user's manual of 1769, but it is too complicated for me to understand exactly what kind of setting is correct. I also tried the sample code of LPCOPEN (sample code for using EEPROM) but it is also complicated too, and I even could not compile it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I would like to do is just &lt;/P&gt;&lt;P&gt;(1) initialize the I2C setting, and&lt;/P&gt;&lt;P&gt;(2) send binary signal from SDA pin (P0_28) like LOW, HIGH, LOW, HIGH... in parallel with the clock from SCL pin (P0_27).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know the protocol of I2C and what kind of signal should be sent from the pins. I am not sure just how to adjust the register setting of LPC1769. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I understood from the manual is that following setting may be required, but it might be incorrect;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;Initialization&amp;gt;&lt;/P&gt;&lt;P&gt;LPC_SC-&amp;gt;PCONP |= (1 &amp;lt;&amp;lt; 7);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Power on PCI2C0&lt;/P&gt;&lt;P&gt;LPC_SC-&amp;gt;PCLKSEL0 |= (3 &amp;lt;&amp;lt; 14);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Input clock to I2C0 (φ/8)&lt;/P&gt;&lt;P&gt;LPC_PINCON-&amp;gt;PINSEL1 |= (1&amp;lt;&amp;lt;22);&amp;nbsp;&amp;nbsp; //P0_27&amp;nbsp; to SCL mode&lt;/P&gt;&lt;P&gt;LPC_PINCON-&amp;gt;PINSEL1 &amp;amp;= ~(1&amp;lt;&amp;lt;23);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //P0_27 to SCL mode&lt;/P&gt;&lt;P&gt;LPC_PINCON-&amp;gt;PINSEL1 |= (1&amp;lt;&amp;lt;24);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //P0_28 to SCL mode&lt;/P&gt;&lt;P&gt;LPC_PINCON-&amp;gt;PINSEL1 &amp;amp;= ~(1&amp;lt;&amp;lt;25);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //P0_28をSCL mode&lt;/P&gt;&lt;P&gt;LPC_I2C0-&amp;gt;I2CONSET = 0x40;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //enable I2C&lt;/P&gt;&lt;P&gt;LPC_I2C0-&amp;gt;I2SCLH = 0x06;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;LPC_I2C0-&amp;gt;I2SCLL = 0x06;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;...anything else?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;Data transmission&amp;gt;&lt;/P&gt;&lt;P&gt;I have no idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The support would be highly appreciated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2016 06:25:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-for-I2C-communication/m-p/569976#M18041</guid>
      <dc:creator>hitotsuasahi</dc:creator>
      <dc:date>2016-08-04T06:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1769 for I2C communication</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-for-I2C-communication/m-p/569977#M18042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hitotsu,&lt;/P&gt;&lt;P&gt;&amp;nbsp; If you want the sample code which is using the register mode, you can refer to the LPC17xx code bundle sample code, please find it from the attachment.&lt;/P&gt;&lt;P&gt;1. mdk project&lt;/P&gt;&lt;P&gt;mcb1700.code_.bundle.lpc17xx.keil_.zip&lt;/P&gt;&lt;P&gt;2. LPCxpresso IDE project&lt;/P&gt;&lt;P&gt;mcb1700.code_.bundle.lpc1769.lpcxpresso.zip&lt;/P&gt;&lt;P&gt;&amp;nbsp; Take keil project as an example, you can find the i2c sample code in folder: mcb1700.code_.bundle.lpc17xx.keil_\keil_examples\I2C&lt;/P&gt;&lt;P&gt;&amp;nbsp; Please refer to I2C0Init().&lt;/P&gt;&lt;P&gt;&amp;nbsp; Wish it helps you!&lt;/P&gt;&lt;P&gt;If you still have question, please contact me!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jingjing&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, 08 Aug 2016 03:21:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-for-I2C-communication/m-p/569977#M18042</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2016-08-08T03:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1769 for I2C communication</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-for-I2C-communication/m-p/569978#M18043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;Jingjing&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;Thank you for sharing that code. I want to use its I2C driver to work with a RTC chip (DS3231). &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;I saw the example and the driver in &lt;A _jive_internal="true" data-content-finding="Community" href="https://community.nxp.com/servlet/JiveServlet/download/11497-431883-820007-391187/mcb1700.code_.bundle.lpc17xx.keil_.zip" style="font-size: 12px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #017bba; background-color: #fdfdfd;" title="https://community.nxp.com/servlet/JiveServlet/download/820007-391187/mcb1700.code_.bundle.lpc17xx.keil_.zip"&gt;https://community.nxp.com/servlet/JiveServlet/download/820007-391187/mcb1700.code_.bundle.lpc17xx.keil_.zip&lt;/A&gt; but I'm kind of confused. How come the example didn't call the I2CStart() , I2CStop() functions? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;How can I use this driver for DS3231 ? Do I need to call those functions or it's just enough to set the buffers &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;I2CEngine() ? &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2016 07:37:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-for-I2C-communication/m-p/569978#M18043</guid>
      <dc:creator>mostafanfs</dc:creator>
      <dc:date>2016-08-10T07:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1769 for I2C communication</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-for-I2C-communication/m-p/569979#M18044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jingjing, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your kind advice. I imported all the files&amp;amp;projects from "&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;mcb1700.code_.bundle.lpc1769.lpcxpresso.zip" into the LPC Xpresso version 8.1.4. I tried to "build all" but an error message shows up and failed. The message says below; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;c:/nxp/lpcxpresso_8.1.4_606/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: cannot find -lCMSISv2_LPC17xx collect2.exe: error: ld returned 1 exit status&lt;/P&gt;&lt;P&gt;make: *** [I2C.axf] Error 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;Is any additional setting required or additional program has to be imported to build the project?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Though it might be useful just to see the sample source for initialization of I2C, I would like to see how it works&amp;nbsp; if possible. &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Aug 2016 05:02:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-for-I2C-communication/m-p/569979#M18044</guid>
      <dc:creator>hitotsuasahi</dc:creator>
      <dc:date>2016-08-12T05:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1769 for I2C communication</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-for-I2C-communication/m-p/569980#M18045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hitotsu,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Please follow these steps:&lt;/P&gt;&lt;P&gt;1. import CMSISv2_LPC17xx&lt;/P&gt;&lt;P&gt;2. modify Core_cm3.c&lt;/P&gt;&lt;P&gt;&amp;nbsp; Please replace all the "=r" to "=&amp;amp;r" in file core_cm3.c and save it, then build the CMSISv2_LPC17xx.&lt;/P&gt;&lt;P&gt;3. import I2C project, and build it.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/2220i7DFB29AC157F86D8/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will find the problem is sloved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jingjing&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, 12 Aug 2016 07:30:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-for-I2C-communication/m-p/569980#M18045</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2016-08-12T07:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1769 for I2C communication</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-for-I2C-communication/m-p/569981#M18046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Hi Jingjing,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Thank you very much for your explanation and sorry for my late reply!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Thanks to your information, I could successfully build the sample project after all.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Although I did not yet complete the program of I2C communication, I can analyze the sample and will know how to use it!&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Hitotsu&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Sep 2016 15:58:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-for-I2C-communication/m-p/569981#M18046</guid>
      <dc:creator>hitotsuasahi</dc:creator>
      <dc:date>2016-09-02T15:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1769 for I2C communication</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-for-I2C-communication/m-p/569982#M18047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hitotsu,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If you want make the I2C communication, you also need to add the I2C slave.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Then you can use the Logic Analyzer to check the I2C wave, what the problem caused the I2C communication failure, the master or the slave.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Any problem, you can let me know!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jingjing&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, 05 Sep 2016 08:44:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-for-I2C-communication/m-p/569982#M18047</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2016-09-05T08:44:35Z</dc:date>
    </item>
  </channel>
</rss>

