希望使用 ATtiny13A 对 MCP23017 的 I2C 接口进行位操作,很多地方都提到 HI2COUT 作为在 I2C 总线上发送数据的方法,但我不知道这是否是语言或库的一部分,甚至是描述的一部分被调用时会发生什么。所以问题是:
1) 我在哪里可以获得 HI2COUT 的信息?
2) 如果有人曾经与 MCP23017 连接,您能否发布正确的序列以将 1 个(或所有)引脚设置为输出并设置为高电平? (这包括开始、写地址、写寄存器IOCON、...、停止等...)
3)这可能是“硬件”,比如 stackoverflow,如果有人知道更适合这个问题的网站(或者可能有答案),请告诉我。
looking to bit-bang the I2C interface of a MCP23017 with an ATtiny13A, a lot of places mention HI2COUT as a method to send data on the I2C bus but i have no clue if this is part of a language or a Library or even a description of what happens when called. so the questions:
1) where can i get info on HI2COUT?
2) if any one has ever interfaces with an MCP23017 can you post the proper sequence to set 1 (or all) pins as output and set HIGH? (this includes start, write address, write register IOCON, ..., stop, etc...)
3) this may be to "Hardware" like for stackoverflow if anyone knows of a site better suited for this question (or may have the answer) please let me know.
发布评论
评论(1)
您的意思是您有兴趣对 ATtiny13A 进行编程(以便它可以与目标设备通信,该目标设备恰好是 MCP23017,但这不是一个重要的细节)?
只是猜测,HI2COUT 可能是内存映射寄存器的名称,用于将数据输出到微处理器的 I2C 外设。但是,查看 ATtiny13A 数据表 和 MCP23017数据表,我看不到这样的寄存器命名。也许这是不同类型微处理器的 I2C 外设的寄存器名称?
MCP23017 内置 I2C 硬件——请参见 MCP23017 数据表。它会告诉您如何在该设备上执行 I2C。但假设你要编程的是 ATtiny13A,它看起来好像没有 I2C 硬件,所以正如你所说,需要位碰撞。
我建议互联网搜索“ ATtiny13A i2c",您应该能够找到几个示例。
Do you mean you're interested in programming the ATtiny13A (so that it can talk to a target device, which happens to be a MCP23017 but that's not an important detail)?
Just guessing, HI2COUT might be the name of a memory-mapped register to output data to the I2C peripheral of a microprocessor. However, looking at the ATtiny13A data sheet and the MCP23017 data sheet, I can't see such a register named. Perhaps that is the name of a register for an I2C peripheral of a different type of microprocessor?
The MCP23017 has I2C hardware built-in--see section 1.3.2 "I2C Interface" starting on page 5 of the MCP23017 data sheet. It will tell you how to do I2C on that device. But assuming it's the ATtiny13A you want to program, it looks as though it has no I2C hardware, so as you say, bit-banging is needed.
I suggest doing an Internet search for "ATtiny13A i2c" and you should be able to find several examples.