zoukankan      html  css  js  c++  java
  • TCA9546A

    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 = 0xE0.

    下表是控制寄存器的情况.

    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读api函数.

  • 相关阅读:
    第 9 章 用户自己建立数据类型
    第 10 章 对文件的输入输出
    第 7 章 用函数实现模块化程序设计
    第 4 章 选择结构程序设计
    第 5 章 循环结构程序设计
    第 6 章 利用数组处理批量数据
    第 3 章 最简单的 C 程序设计——顺序程序设计
    第 1 章 程序设计和 C 语言
    第 2 章 算法——程序的灵魂
    SQL(SQL Server) 批量替换两列的数据
  • 原文地址:https://www.cnblogs.com/biglucky/p/4711097.html
Copyright © 2011-2022 走看看