目 录
1 绪 论 .............................................................................................................................1
1.1 研究目的与意义 ..................................................................................................1
1.2 研究现状 ..............................................................................................................1
1.3 设计的总体工作结构 ..........................................................................................2
1.4 本次设计的任务 ..................................................................................................2
2 硬件电路设计 ................................................................................................................3
2.1 单片机型号的选择 ...............................................................................................3
2.2 最小系统的选择 ...................................................................................................4
2.3 显示器件的选择 ...................................................................................................5
2.3.1 数码管显示 .................................................................................................5
2.3.2 LCD 屏显示 ................................................................................................5
2.3.3 LED 点阵显示 ............................................................................................6
2.4 DS1302 时钟芯片.................................................................................................7
2.5 红外遥控模块 .......................................................................................................8
2.5.1 红外光应用原理 .........................................................................................8
2.5.2 红外遥控通信原理 .....................................................................................9
2.6 蜂鸣器模块 .........................................................................................................10
2.7 DS18B20 温度传感器与 HS1011 湿度传感器 .................................................11
2.7.1 温度传感器 DS18B20 ..............................................................................11
2.7.2 湿度传感器 HS1011.................................................................................12
3 系统的软件设计 ..........................................................................................................13
3.1 软件设计的规划 ................................................................................................13
3.1.1 模块的划分 ...............................................................................................13
3.1.2 软件程序流程 ...........................................................................................13
3.2 1602 液晶显示模块 ...........................................................................................14
3.2.1 液晶的接口时序 .......................................................................................14
3.2.2 液晶驱动模块操作部分代码 ...................................................................16
3.2.3 1602 液晶 RAM 状态字的说明...............................................................16
3.2.4 1602 液晶 RAM 映射区...........................................................................17
3.2.5 1602 液晶初始化 ......................................................................................18
3.3 时钟芯片 DS1302 的操作................................................................................19