This project is based on the linux platform on Raspberry Pi and is still under development. Project address:
Take a photo
.
Video Monitoring
Self-built hotspot
First, let's talk about the communication between the MPU6050 device. The typical communication process is as follows. The first part is the data content, followed by the Register address:
1. 0x41 => 0x6B: set the clock and x axis clock
2. 0x00 => 0x1B gyroscope range, 250 °/s
3. 0x00 => 0x1C accelerometer range, 2g
4. 0x01 => 0x6B wake-up
5. 0x3B ~ 0x48 observe the data output, where each data is 2 bytes long. 0x3B acceleration X, 0x3D acceleration Y, 0x3F acceleration Z, 0x41 temperature, 0x43 gyroscope X, 0x45 gyroscope Y, 0x47 gyroscope Z
Because the HMC5883L data line in the GY86 module is connected to the MPU6050 slave I2C interface, you must first enable the MPU6050 bypass mode when accessing the HMC5883L. The typical communication process of HMC5883L, in the same format as above:
1. MPU6050 0x00 => 0x6A disable I2C Master mode
2. MPU6050 0x02 => 0x37 enable bypass Mode
3. HMC5883 0x70 => 0x00 Config
4. HMC5883 0x20 => 0x01 Config B
5. HMC5883 0x00 => 0x02 continuous output
6. HMC5883 0x03 ~ 0x08 observe the data output, where each data is 2 bytes long. Note that 0x03 is the X axis data, 0x05 is the Z axis data, and 0x07 is the Y axis data
The above communication process is basically enough, but I still don't meet it. Since MPU6050 can get HMC5883L data on behalf of me, why don't I need it? This makes data retrieval easier and code implementation more elegant. The typical setting process is as follows:
1. 0x20 => 0x6A enable I2C Master mode
2. 0x00 => 0x37 disable bypass Mode
3. 0x0D => 0x24: Set the operation clock and other
4. 0x9e => 0x25: Set the operating mode and address of the slave device.
5. 0x03 => 0x26 set the start Register address for reading from the device
6. 0x86 => 0x27 set the length and switch of the read from device register.
7. HMC5883L register 0x03 ~ 0x08 data is stored in MPU6050 register 0x49 ~ 0x54, and updated periodically
If the value of HMC5883 cannot be obtained after the above steps, reset I2C SLV0. I couldn't try it at the beginning. After I reset it, I 've been Okay.
The driver of the pressure gauge MS561101BA has not been completed yet. He does not use the standard I2C. You can refer to the driver provided in FreeIMU.
The difficulty of nRF communication is only in the SPI communication protocol, and the SPI and nRF are almost done. Previously, I used the LM4F software of TI to simulate SPI and did not solve the nRF problem. I checked the code repeatedly. I did not even see it when I came to my classmates. When I got stuck with the same problem in the electric competition, I realized the problem. The initialization operation was not delayed enough, and the MCU startup delay was not enough. Now, I just installed the code and haven't tested it yet, so I will not talk about it here.