/* Chen 24c01 (1 k) memory I2C bus Experiment C language example single-byte and unsigned long integer read/write program sda scl can be any common I/O */// # Include # Define trytime 250// Number of attempts to perform the operation again when the operation fails// # Define SDA p42// Data line// # Define SCL p43// Clock line# Define i2cwrite 0xa0 // A2 A1 A0 is 0# Define i2cread 0xa1Unsigned char trytime;// Function declarationVoid i2c_write4byte (un
After the frequency of the DDR and arm changes, the I2C problem occurs again:
The previous processing logic is that when the sending buffer is empty, I will read the data in the receiving buffer, the result is determined based on the value of the data counter that reads the receiving buffer first after the interruption. The number of times the receiving FIFO is read is determined based on this value. The previous logic has always been good. This is b
I²C transmits data between devices connected to the bus using only two lines (SDA and SCL). Each device is identified by a unique address (whether it is a microprocessor, LCD driver, memory, or keyboard interface) and can be used as a transmitter or
2. Use JNI to add service access interfaces at the application framework layer
The application cannot directly access the Hal layer. The JNI layer needs to access the Hal module and provide APIs. You can directly provide interfaces, but it is
Write Process
When the MCU performs write operations, it first sends the 7-bit address code of the device and the Write direction "0" (a total of 8 bits, that is, one byte ), after sending the message, the SDA line is released and 9th clock signals
IICVsSPIToday, in low-end digital communications applications, we are seen in IIC (inter-integrated circuit) and SPI (Serial peripheral Interface). The reason is that these two communication protocols are ideal for near- low-speed inter-chip
Data transfer format
(1) byte Transfer and response
Each byte must be an 8-bit length. During data transmission, the highest bit (MSB) is first transmitted. Each transmitted byte must follow one response bit (that is, a frame has nine digits ).
The following is a simple example:Only one host is set on the bus, and the host uses query read/writeMultiple slave machines are allowed on the bus, and the slave machine uses the hardware interruption function.*****************I started to use the
Clock stretching (stretching)Clock stretching pauses a transmission by pulling the SCL line down. The transfer continues until the SCL line is released high. Clock stretching is optional, in fact most slave devices do not include the SCL driver, so
I. About I2C
The I2C (Inter-Integrated Circuit) bus is a two-line serial bus developed by Philips to connect the microcontroller and its peripheral devices. The main advantage of I2C bus is its simplicity and effectiveness. The simplicity is embodied in the simple wiring. There are only two lines of data cable (SCL) and clock line (SDA), and the control is simpl
compatibility with ov2685 + ov8865 on Qualcomm msm8926!
The debugging experience is as follows:
1 Camera driver loading failure is mostly caused by incorrect i2c and voltage. Make sure these are configured properly.
2. carefully analyze the kernel debugging log, add debugging information in key areas, and use the oscilloscope, voltmeter, and other auxiliary debugging devices to analyze the root cause of th
This article turns from: http://blog.csdn.net/qianjin0703/article/details/5894869
1. Overview
2. Data Structure
3. Adapter
4. I2c-core
5. Slave Device
1. Overview
1.1 Definition I2C inter-integrated circuit SMBUS System Management Bus, the I2C subset
1.2 Characteristics The amount of data exchanged is small. The required data transfer rate is low.
1.3 Speed Fas
. A Microcomputer acts as a device to exchange information and data with other devices, it is used for device-level interconnection. ---- In a broad sense, computer communication methods can be divided into parallel communication and serial communication. The corresponding communication bus is called parallel bus and serial bus. Parallel Communication is fast and real-time, but it is not suitable for small-sized products due to the large number of ports used. Although the serial communication sp
difference. The potential difference is the voltage. Voltage is the reason for current formation. In the circuit, the voltage is commonly displayed as a u table. The unit of voltage is V, which is also commonly used as unit of MV or UV. 1 V = 1000mV, 1mV = 1000uv.Voltage can be measured with a voltmeter. During measurement, the voltmeter is connected in parallel to the circuit, and the
consists of two parts: platform_device and platfrom_driver.
The general process for developing the underlying driver through the platform mechanism is: Define platform_device-> Register platform_device-> define platform_driver-> Register platform_driver.
The first thing to confirm is the device resource information, such as the device address and interrupt number.
In the 2.6 kernel, the platform device is described by the structure platform_device, which is defined in kernel \ include \ Li
relationships:, R ^ 2 = RX ^ 2 + RY ^ 2 + RZ ^ 2 (Equation 1)This formula is equivalent to the three-dimensional space Pythagorean theorem.Remember the 1/2 square root 0.71 I just said is not a random value. If you put them back up and look back on the gravitational acceleration of 1g, then we can verify that:1 ^ 2 = (SQRT) ^ 2 + 0 ^ 2 + (SQRT (1/2)) ^ 2InEquation 1Simple substitution: r=1, Rx =-sqrt, Ry = 0, Rz =-sqrt (1/2)After a long period of theoretical preface, we are very close to the ac
. Register platform_device. Define platform_driver. Register platform_driver.The first thing to confirm is the device resource information, such as the device address and interrupt number.In the 2.6 kernel, the platform device is described by the structure platform_device, which is defined in kernel/include/Linux/platform_device.h,Struct platform_device {Const char * Name;U32 ID;Struct device dev;U32 num_resources;Struct resource * resource;};An important element of this structure is resource, w
Brief
The next content will be the basic functions of MPU9250 detailed introduction, mainly divided into modules for elaboration. Clock
MPU9250 has two internal clock sources, as well as a PLL.Internal clock Source:
Clock Source
Description
Internal oscillator
Low power consumption, but slightly worse clock accuracy
X,y or Z-direction gyro
MEMS clock, high power consumption, but clock accuracy (as long as the gyro is enabled, it will use the
information by I2C,SPI or Usart, and the output of the analog accelerometers is a voltage value within a predetermined range, and you need to convert it to a numeric value using the ADC (Analog to digital) module. I won't go into the details of how ADC works, in part because it's a very broad topic, and another reason is that there are differences between ADCs on different platforms. Some MCUs have built-in ADC modules, while others require an extern
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.