V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Explorare
V2EX  ›  硬件

TXS0108E 与 RS1307 与 HTU21D 的兼容问题

  •  
  •   Explorare · 2017-05-15 22:34:42 +08:00 · 2055 次点击
    这是一个创建于 2537 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我尝试在 I2C 线路上同时连接 RS1307 ( 5V )和 HTU21D ( 3.3V ),用 TXS0108E 进行逻辑电平转换,然后发现个问题,当 TXS0108E 的 OE 为 HIGH 时 HTU21D 工作正常,但 RS1307 输出时间是错的,如下:

    2165/165/165 (Saturday) 165:165:85 since midnight 1/1/1970 = 1552693585s = 17970d now + 7d + 30s: 2019/3/23 12:16:31 24935

    当 TXS0108E 的 OE 为 LOW 时,RS1307 工作正常,但 HTU21D 工作不正常,输出错误。但并不是这两个设备不能同时在线,就算只留下一个设备,TXS0108E 的 HIGH 和 LOW 都会产生同上结果。求助,如何让这两个设备同时工作?

    第 1 条附言  ·  2017-05-16 08:25:27 +08:00
    2 条回复    2017-05-16 08:13:47 +08:00
    ryd994
        1
    ryd994  
       2017-05-16 05:04:46 +08:00 via Android
    不可能同时工作的啊
    i2c 共享数据线,oe 就是用来分开工作的
    oe 为低时是高阻态,等于断开
    同一时间只能有一个 oe
    另外,注意看文档,有些芯片的 oe 是取反的
    Explorare
        2
    Explorare  
    OP
       2017-05-16 08:13:47 +08:00
    谢谢回复。根据 TXS0108E 的 datasheet

    "When the output-enable (OE) input is low, all outputs
    are placed in the high-impedance (Hi-Z) state.
    To ensure the Hi-Z state during power-up or powerdown
    periods, tie OE to GND through a pull-down
    resistor. The minimum value of the resistor is
    determined by the current-sourcing capability of the
    driver."

    也就是说当 OE 为 LOW 时 3.3V 这一侧就等于是断开,为 HIGH 时 3.3V 这一侧可以和 5V 一侧正常通信。但经过我测试,我把 RS1307 和 Arduino 的 I2C 都接在了 5V 这边,另一侧就算什么也不接,只要 OE 为 HIGH RS1307 的输出就不正常了,但同一条线的 GY-30 是正常的,同为 5V 逻辑电压,也接在同一侧。

    是我哪里理解错了么?求教。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1853 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 78ms · UTC 16:29 · PVG 00:29 · LAX 09:29 · JFK 12:29
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.