概述
The TCA9546A is a 4-channel, bidirectional translating switch for I 2 C buses that supports Standard-Mode (100
kHz) and Fast-Mode (400 kHz) operation
TCA9546A是一个4频道双向传输的i2c复用芯片,可以支持标准的100KHZ和高速传输的400KHZ.The TCA9546A features I 2 C control using a single 8-bit control register
in which the four least significant bits control the enabling and disabling of the 4 switch channels of I 2 C data flow
TCA9546A使用一个8位的控制寄存器,其中的低4位来控制开关这4路i2c数据流频道.The connections of the I 2 C data path are controlled by the same I 2 C master device that is switched to
communicate with multiple I 2 C slaves. After the successful acknowledgment of the slave address (hardware
selectable by A0 and A1 pins), a single 8-bit control register is written to or read from to determine the selected
channels
A0和A1是硬件连接,如果接地那么就全是0.
我的A2,A1,A0均接地,所以slave address = 0x70(去掉读写位)
下表是控制寄存器的情况.
0x01 channel0
0x02 channel1
0x04 channel2
0x08 channel3
使用方法
当需要使用channel 0时,首先需要:
发送 tca9546a 的slave address: 0xE1(写模式).
然后发送Control register : 0x1.
然后再使用正常的i2c写,比如这个时候你连接的是一个camera sensor, slave 地址是0x70, 这个时候使用你当前芯片的正常写i2c的步骤即可.只是需要在执行之前设置好tca9546a的channel,好让它知道当前是使用哪个channel.当你需要读设备的寄存器时,同样, 需要先发送:
tca9546a的slave address :0xE1(读模式),然后发送
0x1,选择channel.
然后调用当前芯片的i2c读函数.调试如下
1.配置I2C管脚
./load3559av100_multicore -i -sensor0 imx334 -sensor3 imx334
注: 因为两个tca9546分别挂在I2C0【对应sensor0】和I2C5【对应sensor3】上正常情况下挂载情况
i2cdetect -r -y 2
i2cdetect -r -y 5
切换tca9546方法0x01 channel0 0x02 channel1 0x04 channel2 0x08 channel3a. 连接tca9546 channel0
i2cset -f -y 5 0x70 0x01 则总线5上就直接出现了channel0的I2C地址了
然后就可以直接操作了
b. 其它通道方法类似
i2cset -f -y 5 0x70 0x02 ch1
i2cset -f -y 5 0x70 0x04 ch2
i2cset -f -y 5 0x70 0x08 ch3原文链接:https://blog.csdn.net/jzwjzw19900922/article/details/103769486?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522159705780219195188352231%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=159705780219195188352231&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_v1~rank_blog_v1-20-103769486.pc_v1_rank_blog_v1&utm_term=%E6%B5%B7%E6%80%9D3559&spm=1018.2118.3001.4187
免责声明:文章内容来自互联网,本站不对其真实性负责,也不承担任何法律责任,如有侵权等情况,请与本站联系删除。
转载请注明出处:海思3559平台调试TCA9546A https://www.yhzz.com.cn/a/15161.html