Toto odstráni stránku "I2C_Speed"
. Buďte si prosím istí.
optional
The data rates on the two I2C busses seems to be a bit off. Using the current shipping build, the i2c-1 bus runs at 266kb/s, and the i2c-2 bus runs at 160k
b/s. Neither of these are frequencies called out in the I2C standard, although they will work properly with '400kB/s' I2C devices.
There may be cases where you want better control over the bus speeds, and the current Linux I2C driver does not implement hooks to allow a speed change. Use the devmem2
progam to write these words.
Bus (linux name) | Pins (40 pin connector) | Register | Write |
---|---|---|---|
i2c-1 | 15 (scl), 17 (sda) | 0x2096.0000 | 0xnnn.0000 then 0xnnn.0001 |
i2c-2 | 19 (scl), 21 (sda) | 0x2097.0000 | 0xnnn.0000 then 0xnnn.0001 |
where 'nnn' = one of these:
The i2cdetect
program does not seem to work well on this microprocessor. If you write your own i2c scanner, it will work ok. Try this:
#!/usr/bin/env python3
import smbus
bus = smbus.SMBus(1) # 1 indicates /dev/i2c-1
for device in range(128):
try:
bus.read_byte(device)
print(hex(device))
except: # exception if read_byte fails
pass
The 2G-IOT board operates the same way.
Toto odstráni stránku "I2C_Speed"
. Buďte si prosím istí.