There are many peripheral chips connected to the main chip through the i2c bus. The main chip sends commands through i2c to initialize the peripheral chips.
I.MX5x At least three peripheral chips need to be connected to the i2c bus, and the main chip is configured with peripheral chips during initialization. They are audio codec sgtl5000, direction sensor mma7660, and pmic chip tps65180 of Eink screen. We all connected them to I2C1.
1. u-boot has an i2c driver, and the command line has an i2c command. However, the command line i2c command can only be used for one i2c bus. For different i2c buses, you need to modify the header file macro definition in u-boot-xx/include/configs/mx50_arm2.h
#define CONFIG_SYS_I2C_PORT I2C2_BASE_ADDR
2. Hardware connection. The I2C bus has only two connections, one clock line SCL and one data line DAT. All i2c peripherals must have a separate address. Note: The I2C bus hardware initialization state must be high for both SCL and DAT. If one or both of the two are not high, the hardware circuit has a problem. Eliminate hardware failures first.
3. I2c command
3.1 i2c bus search
U-boot> i2c probe
Search for all i2c devices connected to an i2c (eg i2c2) bus.
3.2 Reading i2c peripherals
For example: read the peripheral chip with i2c address 0x20, read from the 0th register, and read 16 registers in total.
U-boot> i2c md 0x20 0 16
Md ---- i2c read
0x20 ---- The address of the i2c peripheral. Each i2c peripheral has a separate address. Generally, the peripheral chip is already set at the factory.
0 ---- Read from the 0th register of the peripheral chip
16 ---- A total of 16 registers read
3.3 Write i2c Peripherals
For example: write the peripheral chip with i2c address 0x20, write its No. 01 register, and write the value of its No. 01 register as 0x12.
U-boot> i2c mw 0x20 01 0x12
Mw ---- i2c write
0x20 ---- The address of the i2c peripheral. Each i2c peripheral has a separate address. Generally, the peripheral chip is already set at the factory.
01 ---- Write the No. 01 register of the peripheral chip
0x12 ---- Write its value as 0x12
4. Inadequacies
Can only write a single I2C bus, read and write files on the same I2C bus, but also inconvenient, have time to change the program, change to read and write any I2C bus.
IO Cable Plug
Feyvan Electronics provides many different solutions of IO cable plug for CNC (computer numerical control) machine tool fittings of different systems.
Related connectors brand: AMP, HONDA, JAE, INC, HIR, DDK, 3M, HYPERTAC, Fujistu, etc.
We have designated agents for all the connectors brands.
Meanwhile, we also could produce copy connectors of the brands above which can obviously lower your costs.
All the connectors we used covers 100% of FANUC system, 100% of Mitsubishi system and 90% of SIEMENS system.
Io Cable Plug,Io Plug,Cable Wire Connector,Cable Plugs
Feyvan Electronics Technology Co., Ltd. , https://www.fv-cable-assembly.com