i n
t h
e i r
b e
i n g
图5 DS1302与MCU 接口电路
图5为DS1302的接口电路,其中Vcc1为后备电源,在单电源与电池供电的系统中提供低电源并提供低功率的电池备份。电源系统中提供主电源,在这种运用方式中VCC1连接到备份电源,以便在没有
d
A
l l t h i n
g s
i n
t h
e i r
b e
i n 图6 DS1302读/写时序图
4、DS1302的寄存器AM
DS1302有12个寄存器,其中有7个寄存器与日历、时钟相关,存放的数据位为BCD 码形式,其日历、时间寄存器及其控制字见表3。
表3 DS1302的日历、时间寄存器
写寄存器读寄存器Bit7Bit6
Bit5Bit7
Bit3Bit2
Bit1Bit0
g
n
i
h
t
l
l
A
d
图8温度传感器DS18B20接口电路
n d
A
l l t h i n g s h
e i r b e i n g
a r
e g
o o
、读时序图
a
t i m
e a
n d
A
l l t h i n g s i n b e i n g
a r
e g
o o
d 图12 总线时序
t i m
e a
n d
A
l l t h i s i n
t h e i r b e g a r
e g
o o
d )应答时序图15 应答时序
)立即地址读时序
d
A
l l t h i n
g s
i n
t h
e i r
b e
i n 图17 按键电路
个按键作简要说明:S4——SET 键,S3——UP 键,S2——DOWN 键。