简体   繁体   English

Contiki OS中是否有适合Atmega128平台的双线接口/ I2C阅读写作库?

[英]Is there a suitable Two wire interface / I2C reading writing library in Contiki OS for Atmega128 platform?

I wish to read the EUI64 address from an AT24MAC602 memory chip interfaced to an Atmega128rfa1 MCU over the Two wire interface. 我希望从通过两线接口连接到Atmega128rfa1 MCU的AT24MAC602存储芯片中读取EUI64地址。 I tried to modify the I2C master drivers which are available for other platforms to suit my need. 我试图修改I2C主驱动程序,该驱动程序可用于其他平台以满足我的需要。 However, I wasn't able to carry out these modifications successfully as the program stopped responding as soon as the slave address was written to the twi bus with Write flag set. 但是,一旦从地址被写入Write设置为twi总线,程序就停止了响应,所以我无法成功进行这些修改。 I failed to uncover the underlying reasons for the same. 我未能发现造成这种情况的根本原因。 As Contiki OS is quite popular, i thought someone might have already come up with contiki specific libraries for reading writing over TWI interface for Atmega128rfa1 MCU. 由于Contiki OS非常流行,我认为有人可能已经提出了针对contiki的特定库,用于通过Atmega128rfa1 MCU的TWI接口进行读写。 If so, please provide pointers to the twi drivers or documentation for the same, or suggest factors that should be considered for developing such drivers. 如果是这样,请提供指向twi驱动程序或相同文件的指针,或提出开发此类驱动程序时应考虑的因素。 Thank you. 谢谢。

If you don't have any luck finding/creating a driver for the TWI peripheral, you might consider emulating it by configuring the SDA/SCL pins as general I/O and then implementing the TWI protocol yourself. 如果没有运气找到/创建TWI外设的驱动程序,则可以考虑通过将SDA / SCL引脚配置为通用I / O,然后自己实现TWI协议来进行仿真。 If you're just doing a one-time read of a chip ID then speed probably isn't a big concern, so this could work if you get desperate. 如果您只是一次性读取芯片ID,那么速度可能不是大问题,因此,如果您不顾一切,这可能会起作用。 Google should throw up a few examples of emulated TWI. Google应该举一些模拟TWI的例子。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM