<?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: Need help interfacing MPU6050 with LPC1769</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Need-help-interfacing-MPU6050-with-LPC1769/m-p/663442#M26479</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tabouri Fouzi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Please don't worry about it, when we meet the problem, we need more patient to find the root problem!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I don't have the MPU6050 on my side, but as a I2C slave, the test method is the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If you want to read the data from the MPU6050, you must send the data which is the MPC6050 needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 1. Check the MPU6050, what the command, I2C clock , slave address the MPU6050 needed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 2. In LPC, configure the I2C module, yes, you can refer to lpcopen or cmsis driver, configure the I2C baudrate, the send data which your slave need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 3. Use the oscilloscope to check the I2C wave which is send from the LPC.This is very important, check byte by byte.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Clock baud rate, slave address, the command, is it the slave needed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;Please follow my step to check it, check wave and the data in the I2C bus is very important.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any updated question, just let me know!&lt;/P&gt;&lt;P&gt;&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;Kerry&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>Wed, 22 Mar 2017 07:05:02 GMT</pubDate>
    <dc:creator>kerryzhou</dc:creator>
    <dc:date>2017-03-22T07:05:02Z</dc:date>
    <item>
      <title>Need help interfacing MPU6050 with LPC1769</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Need-help-interfacing-MPU6050-with-LPC1769/m-p/663441#M26478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone !&lt;/P&gt;&lt;P&gt;well to start, I'm a beginner in programming LPC1769, and i need some help regarding how to use the i2c protocole to read data from the MPU6050. been trying for almost a month now and i tried different libraries (lpcopen and cmsis) aswell as trying to modify the examples present in those libraries but in vain. couldnt even get to read the WHO_AM_I register data of the MPU6050 and I'm stuck :/&lt;/P&gt;&lt;P&gt;If someone can explain in detail what do i need to do to be able to read and write to the mpu6050 using i2c it would be perfect.&lt;/P&gt;&lt;P&gt;here's the final version of the code i've tried to make work but it didnt :smileycry:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#include &amp;lt;cr_section_macros.h&amp;gt;&lt;BR /&gt;#include &amp;lt;NXP/crp.h&amp;gt;&lt;/P&gt;&lt;P&gt;__CRP const unsigned int CRP_WORD = CRP_NO_CRP ;&lt;/P&gt;&lt;P&gt;#include "lpc17xx.h"&lt;BR /&gt;#include "type.h"&lt;BR /&gt;#include "i2c.h"&lt;BR /&gt;#include &amp;lt;stdio.h&amp;gt;&lt;BR /&gt;extern volatile uint8_t I2CMasterBuffer[I2C_PORT_NUM][BUFSIZE];&lt;BR /&gt;extern volatile uint8_t I2CSlaveBuffer[I2C_PORT_NUM][BUFSIZE];&lt;BR /&gt;extern volatile uint32_t I2CReadLength[I2C_PORT_NUM];&lt;BR /&gt;extern volatile uint32_t I2CWriteLength[I2C_PORT_NUM];&lt;/P&gt;&lt;P&gt;#define PORT_USED 2&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;int main (void)&lt;BR /&gt;{&lt;BR /&gt; uint32_t i;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; SystemClockUpdate();&lt;/P&gt;&lt;P&gt;I2C2Init( ); /* initialize I2c2 */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for ( i = 0; i &amp;lt; BUFSIZE; i++ )&lt;BR /&gt; {&lt;BR /&gt; I2CSlaveBuffer[PORT_USED][i] = 0x00;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;I2CWriteLength[PORT_USED] = 2;&lt;BR /&gt; I2CReadLength[PORT_USED] = 1;&lt;BR /&gt; I2CMasterBuffer[PORT_USED][0] = 0x68; /* MPU6050 adress */&lt;BR /&gt; I2CMasterBuffer[PORT_USED][1] = 0x75; /* who am i reg adress _ it should contain the 0x68 */&lt;BR /&gt; I2CEngine( PORT_USED );&lt;/P&gt;&lt;P&gt;printf("%X \n",I2CSlaveBuffer[PORT_USED][0]);&lt;BR /&gt; while ( 1 );&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Mar 2017 17:23:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Need-help-interfacing-MPU6050-with-LPC1769/m-p/663441#M26478</guid>
      <dc:creator>tabourifouzi</dc:creator>
      <dc:date>2017-03-18T17:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: Need help interfacing MPU6050 with LPC1769</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Need-help-interfacing-MPU6050-with-LPC1769/m-p/663442#M26479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tabouri Fouzi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Please don't worry about it, when we meet the problem, we need more patient to find the root problem!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I don't have the MPU6050 on my side, but as a I2C slave, the test method is the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If you want to read the data from the MPU6050, you must send the data which is the MPC6050 needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 1. Check the MPU6050, what the command, I2C clock , slave address the MPU6050 needed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 2. In LPC, configure the I2C module, yes, you can refer to lpcopen or cmsis driver, configure the I2C baudrate, the send data which your slave need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 3. Use the oscilloscope to check the I2C wave which is send from the LPC.This is very important, check byte by byte.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Clock baud rate, slave address, the command, is it the slave needed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;Please follow my step to check it, check wave and the data in the I2C bus is very important.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any updated question, just let me know!&lt;/P&gt;&lt;P&gt;&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;Kerry&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>Wed, 22 Mar 2017 07:05:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Need-help-interfacing-MPU6050-with-LPC1769/m-p/663442#M26479</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2017-03-22T07:05:02Z</dc:date>
    </item>
  </channel>
</rss>

