毕业设计---基于TFT-LCD的指针式时钟设计 下载本文

内容发布更新时间 : 2024/11/17 14:18:58星期一 下面是文章的全部内容请认真阅读。

基于TFT-LCD的指针式时钟设计

摘 要

自时钟发明的那天起,它就注定了与人们有着密不可分的关系,但科学技术在不断发展,人们随着时间的推移对时间计量的精度要求越来越高,机械式时钟也越来越满足不了人们日益增高的要求了。取而代之的事具有高度准确性和直观性且无机械装置,使用寿命更长更长等优点的电子时钟。电子时钟更具人性化,更能提高人们的生活质量,更受人们欢迎,机械时代已经远去,电子时代已经到来。因此本设计是基于ATMEL公司的ATmega128单片机开发平台实现一种高精度,智能化的指针式时钟系统,采用单片机与时钟芯片DS1302设计电子时钟时,通常是数字显示,这是由于选用数码管和1602等器件的显示能力有限。而12864是基于点阵式的液晶屏,其像素点为128×64,但12864自身像素较低,使其显示指针式时钟效果远低于1.8寸TFT-LCD液晶,但两者所基于的原理相同。因此本设计采用ATmega128单片机为控制核心,辅以DS1302时钟采集系统,1.8寸TFT-LCD液晶作为显示芯片,构成了一个指针式电子时钟。

关键词:ATmega128单片机;DS1302;TFT-LCD

The design based on TFT-LCD ClockTop

Abstract

Since the invention of the clock, it is destined to have a close relationship with people, but science and technology in development, higher and higher over time the accuracy of time measurement requirements, the mechanical clock increasingly meet not the increasing requirements. Instead, things have a high degree of accuracy and intuitive and no mechanical device, service life longer longer, and the advantages of the electronic clock. The electronic clock is more humane, more to improve people's quality of life, but also welcomed by the people, has passed the Mechanical Age, the electronic age has arrived. This design is based on the ATMEL ATmega128 MCU development platform to achieve a high precision, intelligent analog clock systems. Using a single-chip clock chip DS1302 design electronic clock, digital display, which is due to the limited capacity of the display of the selected digital tube and 1602 devices. 12864 is based on a dot matrix LCD screen, the pixels of 128 × 64, but 12 864 pixel itself low to display analog clock effect is much lower than the 1.8 inch TFT-LCD LCD, but both are based on the principle of the same. This design uses the ATmega128 MCU for the control of the core, supplemented by the DS1302 clock acquisition system, 1.8-inch TFT-LCD liquid crystal display chips to form a pointer electronic clock.

Key words: ATmega128microcontroller;DS1302;TFT-LCD

I

苏州科技学院本科毕业生设计(论文)

目 录

第1章 绪论...................................................................................................................................... 1 1.1 引言 ............................................................................................................................................... 1 1.2 本设计的目的和意义 ................................................................................................................... 1 1.2.1 设计目的 .............................................................................................................................. 1 1.2.2设计意义 ............................................................................................................................... 1 1.3本设计的主要研究内容 ............................................................................................................... 2 第2章 方案设计及方案论证 ........................................................................................................... 3 2.1时钟系统的总体设计思路 ........................................................................................................... 3 2.2 时钟系统方案论证 ....................................................................................................................... 3 2.2.1 单片机的选择 ....................................................................................................................... 3 2.2.2时钟系统方案选择 ................................................................................................................ 3 2.2.3显示系统的方案比较 ............................................................................................................ 4 第3章 硬件系统设计 ...................................................................................................................... 5 3.1 系统框图与说明 ........................................................................................................................... 5 3.2 硬件设计部分 ............................................................................................................................... 5 3.2.1 单片机芯片选择 ................................................................................................................... 5 3.2.2 单片机管脚说明 ................................................................................................................... 7 3.2.3 单片机最小系统 ................................................................................................................... 9 3.2.4 时钟系统电路设计 ............................................................................................................. 12 3.2.5 TFT-LCD显示电路设计 ..................................................................................................... 16 3.2.6 硬件电路总图 ..................................................................................................................... 22 第4章 软件系统设计 .................................................................................................................... 23 4.1 主程序设计 ................................................................................................................................. 23 4.1.1 主程序设计框图 ................................................................................................................. 23 4.1.2 主程序设计框图源程序 ..................................................................................................... 24 4.2 DS1302芯片的实时时钟日历子程序 ........................................................................................ 27 4.2.1 DS1302时钟程序设计框图 ................................................................................................ 27 4.2.2 DS1302时钟主要源程序 .................................................................................................... 28 4.3 TFT-LCD显示子程序 ................................................................................................................ 31 4.3.1 LCD液晶显示程序设计框图 ............................................................................................. 31 4.3.2 LCD液晶显示程序 ............................................................................................................. 32 4.4 时钟的绘制及走时 ..................................................................................................................... 40 4.4.1 时钟表针的绘制 ................................................................................................................. 40 4.4.2 时钟表盘的绘制 ................................................................................................................. 44 4.4.3 时钟走时部分 ..................................................................................................................... 47 第5章 系统的安装与调试 ............................................................................................................. 49

II