4463|4

7

帖子

0

TA的资源

一粒金砂(中级)

楼主
 

请问USI的I2C怎么用? [复制链接]

芯片资料上的USI寄存器有点看不明白, 硬件上是不是集成了SPI,I2C的收发器还是要软件模拟? 从TI官网上下了个USI_I2CMaster的函数库,初始化的时候端口上看不到波形,USI_I2CSelect E2PROM的就死在里面了,应该是等不到响应信号.

不知道哪里有更详细的资料说明? 谢谢!

最新回复

我也想问一问群号是多少啊?  详情 回复 发表于 2012-4-10 23:50
 
点赞 关注

回复
举报

42

帖子

0

TA的资源

一粒金砂(中级)

沙发
 

群共享上有例程的
硬件上集成了I2C,设置相应寄存器就成了,有啥不明白的?

 

14.2.4.1 I2C Master Mode
To configure the USI module as an I2C master the USIMST bit must be set. In master mode, clocks are
generated by the USI module and output to the SCL line while USIIFG = 0. When USIIFG = 1, the SCL
will stop at the idle, or high, level. Multi-master operation is supported as described in the Arbitration
section.
The master supports slaves that are holding the SCL line low only when USIDIVx > 0. When USIDIVx is
set to /1 clock division (USIDIVx = 0), connected slaves must not hold the SCL line low during data
transmission. Otherwise the communication may fail.
14.2.4.2 I2C Slave Mode
To configure the USI module as an I2C slave the USIMST bit must be cleared. In slave mode, SCL is held
low if USIIFG = 1, USISTTIFG = 1 or if USICNTx = 0. USISTTIFG must be cleared by software after the
slave is setup and ready to receive the slave address from a master.
14.2.4.3 I2C Transmitter
In transmitter mode, data is first loaded into USISRL. The output is enabled by setting USIOE and the
transmission is started by writing 8 into USICNTx. This clears USIIFG and SCL is generated in master
mode or released from being held low in slave mode. After the transmission of all 8 bits, USIIFG is set,
and the clock signal on SCL is stopped in master mode or held low at the next low phase in slave mode.
To receive the I2C acknowledgment bit, the USIOE bit is cleared with software and USICNTx is loaded
with 1. This clears USIIFG and one bit is received into USISRL. When USIIFG becomes set again, the
LSB of USISRL is the received acknowledge bit and can be tested in software.

[ 本帖最后由 wl1336412 于 2011-10-16 17:53 编辑 ]

USI.JPG (45.55 KB, 下载次数: 1)

USI.JPG
 
 

回复

7

帖子

0

TA的资源

一粒金砂(中级)

板凳
 

多谢楼上!

原先只看datasheet,没看到user guide,后来看了就清晰多了.

刚开始没看到波形主要是由于lauchpad上P1.6引脚上接了LED,跳线没拿开驱动能力不够所致.

 
 
 

回复

16

帖子

0

TA的资源

一粒金砂(中级)

4
 

回复 沙发 wl1336412 的帖子

群号是什么啊?
 
 
 

回复

63

帖子

0

TA的资源

一粒金砂(中级)

5
 

回复 楼主 toor 的帖子

我也想问一问群号是多少啊?
 
 
 

回复
您需要登录后才可以回帖 登录 | 注册

查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/10 下一条
福禄克有奖直播:高精度测温赋能电子制造 报名中!
直播时间:2025年2月28日(周五)上午10:00
直播主题:高精度测温赋能电子制造
小伙伴们儿快来报名直播吧~好礼等你拿!

查看 »

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表