电子工程世界电子工程世界电子工程世界

关键词

搜索

型号

搜索

AN-686

产品描述application note
文件大小39KB,共2页
制造商ADI(亚德诺半导体)
官网地址https://www.analog.com
下载文档 全文预览

AN-686概述

application note

文档预览

下载PDF文档
AN-686
APPLICATION NOTE
One Technology Way • P.O. Box 9106 • Norwood, MA 02062-9106 • Tel: 781/329-4700 • Fax: 781/326-8703 •
www.analog.com
Implementing an I
2
C
®
Reset
By Jim Greene
The I
2
C bus is a high integrity, robust serial bus used for
control purposes in many systems. The primary compo-
nents that make up a system are at least one master and
one slave. Under normal conditions, everything works
fine; however, it is the abnormal conditions that gener-
ate problems. Two questions present themselves when a
problem arises: Is the problem device or system related,
or some combination of both? What, if anything, can be
done about it?
Hard device failures are relatively easy to isolate. Perhaps
a function does not work, proper power cycling does not
resolve the issue, pins are stuck high or low, and so on.
System related problems sometimes disguise themselves
as device failures, or worse, are intermittent. It is the latter
area that this application note examines because it repre-
sents the majority of bus fault conditions.
Perhaps a brief description of the I
2
C bus is in order. The
I
2
C (inter integrated circuit) bus was developed and pat-
ented by Philips. It allows devices to communicate over
an open-drain (or open-collector) 2-wire serial bus. Inter-
facing is simple; serial data (SDA) and serial clock (SCL)
are the only signals that traverse the circuit board. Due to
the low speed (literally dc to 400 kB/s) problems associ-
ated with routing, transmission line effects and matching
are nonexistent. The limiting factor is bus capacitance,
which is limited to 400 pF
.
The following terms are used to describe the I
2
C bus:
Master—the
device that initiates a message, and defines
the direction of the I
2
C bus. The master is also responsible
for the generation of the clock (SCL). (9 clocks per byte: 8
for data and 1 for the acknowledge.)
Slave—a
device with an address that is addressed by a
master.
Start—a
bus condition in which the SCL line is high and
the SDA line transitions from a high to a low. It is the
first operation on the bus and is always followed by an
address. The least significant bit determines the direc-
tion of the bus. A high tells the slave that the bus will
read, while an LSB = 0 identifies a write to the specified
address.
Stop—the
condition opposite Start, under which the SCL
line is high while the SDA line goes from a low to a high
state. It is the only method of ending a transmission after
the reception of a byte.
Byte Width—all
bytes are 8 bits wide, with no exceptions.
Message Length—technically
there is no maximum length
for a message; a minimum message consists of 2 bytes
(an address and a data byte).
Wait State—this
condition is rarely used, but is worth
understanding. Once the SCL line is low, a device may
continue to hold it low to identify a wait state. The wait
state permits slow devices to not lose synchronization
with the transmitting device. An example is writing many
bytes to an E
2
PROM; another is a processor holding off
data from a slave to handle an interrupt.
Acknowledge—The
“ACK” is the condition under which
the master generates a 9
th
clock pulse on the SCL line
(for each byte) while the receiving device pulls the SDA
line low in order to signify that the last byte was received.
A “NAK” is only generated by the master; it signals the
slave that no additional data need be sent. A NAK is used
prior to a STOP to prevent the slave from driving the bus
with additional data when the master is about to termi-
nate the communication.
Frequently the master, which is usually a microcontroller
or a gate array, will be interrupted in the middle of its
communication with an I
2
C slave and, upon return, find
a stuck bus. Initially this looks like a device problem, but
it is not. The slave is still waiting to send the remainder
of the data requested by the master. The problem is that
the master has forgotten where it was when it was inter-
rupted or reset. An extraneous reset on the processor will
generally create this condition, especially if the processor
cannot save its status. At this point, the slave will have
put the next bit out on the SDA line (because the SCL line
may have dropped to a low on reset) and awaits the next
clock on SCL. Of course the processor does not send it,
and as a result this slave just waits and waits. If the bit
the slave puts on the SDA line is a 0, the newly awakened
processor sees what appears to be a hung bus. The bus
is in a nonoperational mode; however, it is not due to the
slave. It is the processor’s fault for not finishing the mes-
sage it started. Generating graceful resets is not within
the scope of this application note.
REV. 0
Cirrus Logic携LED创新调光技术参加大比特LED研讨会
来源:半导体器件应用网作者:方优仪 摘要:在这春暖花开、乍暖还寒的时节,LED照明市场迎来新的发展机遇和挑战。于今年5月25日在浙江宁波豪生大酒店举行的由大比特主办、宁波市照明电器行业协 ......
dabite2012 嵌入式系统
幸运之星在哪里?——“是德科技双11仪器秒杀活动”
双十一之前看到下面这个活动 万元仪器8元秒 | 第三届是德科技双11仪器秒杀活动如约而至 https://bbs.eeworld.com.cn/forum.php?mod=viewthread&tid=1056341&fromuid=373534 宣传海报还 ......
tianshuihu 聊聊、笑笑、闹闹
ARM扩展的问题
我想用ARM的外部总线RDATA和RADDR扩展FPGA,在有操作系统的情况下,应该如何操作呢?是否还要写一个针对FPGA的驱动?请高手指点。 我看了芯片手册,ARM共有6个SROM扩展区域,片选为nRCS,这些 ......
lordice ARM技术
我这个设计相当于一个原有手动控制更改为自动控制。整提设计思路如下,但现阶段仍...
本帖最后由 garfield_lixi 于 2019-7-15 16:10 编辑 我这个设计相当于一个原有手动控制更改为自动控制。整提设计思路如下,但现阶段仍有问题,需要各路大神帮提供思路进行解决,谢谢~ 原 ......
garfield_lixi 模拟电子
[我的电子技术入门之路]-从茫然到循序渐进
在写这段话时,我依旧是一个菜鸟;从毕业到现在快2年,想想刚出学校时的自信,现在变成老感觉自己的知识面不够宽广;从51单片机到MSP430单片机再到ARM,为了满足研发的需求一次又一次的重新学习 ......
alex09huang 工作这点儿事
大家这么喜欢看美女,那就看看吧
http://img.bbs.csdn.net/upload/201305/13/1368435788_31300.jpg 本帖最后由 wangfuchong 于 2013-5-16 15:05 编辑 ]...
wangfuchong 聊聊、笑笑、闹闹

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

 
机器人开发圈

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

站点相关: 大学堂 TI培训 Datasheet 电子工程 索引文件: 1178  2417  2613  2888  666  30  13  43  2  57 

器件索引   0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

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

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