The electric energy is a guarantee to national economy and daily life in modern society.With the fast development of the society, contradiction between the demand and production of electrical energy occurs. Time-scheduled tariff system, that changes user's behavior in energy consuming and rationalizes the electrical energy utilisation, is an effective and valuable measure to solve this problem. For the energy measurement the traditional mechanical electricity meter no longer can meet the requirements of this new tariff system, and microcontroller-based digital E-meter becomes the prerequisite and backbone of this tariff system.
This paper design of an PIC microcontroller-based E-meter with cost-effectiveness and unique voltage and current input channels; Design methods that integrates the PIC16F877A's limited hardware and software resources to implement real-time clock, I2C and serial EEPROM communication interfaces;
Keywords:Electric energy meter ,ATT7022A, microcontrolle, Integration of hardware and sofmare
目 录
摘 要 I
Abstract II
目 录 III
1 前 言 1
1.1 课题背景 1
1.2 电能表技术的发展与动向 1
1.2.1 电能计量技术的发展 1
1.2.2 电能计量技术的研究动向 2
1.3 本课题的意义 3
2 电能测量原理 4
2.1 三相电路电能参数的测量 4
2.2 ATT7022A电能参数的计算 6
2.2.1 ATT7022A计量模块 6
2.2.2 计量原理简介 6
2.3 多时段的划分和控制 7
2.3.1 多时段的划分 7
2.3.2多时段控制 8
本系统采用的测量方法 8
3 系统总体方案设计 9
3.1电能表的功能和技术指标 9
3.2系统硬件方案 10
3.3主程序软件流程 10
3.4 本系统设计方案的特点 11
4 系统的硬件模块选择与设计 12
4.1 PIC 系列单片机简介 12
4.1.1 PIC16F877 的性能简介 13
4.1.2 PIC16F877 的内部结构 14
4.2 电能计量芯片 ATT7022A 简介 16
4.2.1 ATT7022A 的功能特性、引脚和内部框图 16
4.3 实时时钟芯片 DS1302 20
4.3.1 DS1302 功能及特点 20
4.3.2 DS1302结构和工作原理 20
4.4 LCD 显示器 21
4.4.1 LCD 液晶显示简介[20] 21
4.4.2 液晶模块引脚定义 22
4.5 系统硬件电路设计 22
4.5.1 系统前向输入通道设计[14] 22
4.5.2 电能表与单片机的接口 23
4.5.3 实时时钟电路 25
4.5.4 电源电路 26
4.5.5 PCB布线 26
5 系统的软件分析与设计 27
5.1 系统控制接口 27
5.1.1 SPI 接口简介 27
5.2.1 SPI 接口通信程序设计 28
5.2 EEPROM 模块 30
5.2.1 EEPROM 模块介绍 30
5.2.2 EEPROM 的操作原理 31
5.3 ATT7022A数据处理 33
5.3.1 ATT7022A计量参数处理 33
5.3.2 ATT7022A 软件校表程序设计 34
6 系统总体性能评估 36
6.1 系统硬件总体设计评估 36
6.2 系统软件总体设计评估 37
6.3 系统调试及运行状况 37
6.3.1 系统调试过程中出现的问题及其解决方法 37
6.3.2 系统运行状况 38
7 总结与展望 39
7.1工作总结 39
7.2课题展望 39
致 谢 40
参考文献 41
附录 42
附录1 原理图 42
附录2 : 系统PCB图 44