视频1 视频21 视频41 视频61 视频文章1 视频文章21 视频文章41 视频文章61 推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37 推荐39 推荐41 推荐43 推荐45 推荐47 推荐49 关键词1 关键词101 关键词201 关键词301 关键词401 关键词501 关键词601 关键词701 关键词801 关键词901 关键词1001 关键词1101 关键词1201 关键词1301 关键词1401 关键词1501 关键词1601 关键词1701 关键词1801 关键词1901 视频扩展1 视频扩展6 视频扩展11 视频扩展16 文章1 文章201 文章401 文章601 文章801 文章1001 资讯1 资讯501 资讯1001 资讯1501 标签1 标签501 标签1001 关键词1 关键词501 关键词1001 关键词1501 专题2001
英文翻译(电气工程及自动化)
2025-10-02 12:36:52 责编:小OO
文档
Tell the time a system design according to the auto of list slice machine

Abstract :Especially appear and live the change of bringing the root for mankind with the large scale integration along with the quick development of electronics technique. From it is list slice the machine is technical of applied the product has already walked into thousand 10000. The emergence of the electronics ten thousand calendars brings people's life of many conveniences. Automatically tell the time the system is used of the single slice of machine chip is AT C51 chipses, in addition still include: DS1302 chips, crystal flap electric circuit and reset the electric circuit composing list slice machine's least application system, there is also independent type key electric circuit, the dynamic state shows an electric circuit etc.. It not only can carry out various function of number electronics clock, if have to compare, adjust, in fixed time, alarm clock etc. function, and can also carry out the function that the fixed-point tells the time.

Key words :MCU,The single slice of machine makes bell clock, code, segment code, show

Foreword: Actually and always the clock can provide second, cent, , the day, week, month and year are small can automatically adjust, and have leap year repair function with 31 weathers for a month. This design is still additional the fixed-point tells the time of function, thus and further completed automatically a design of telling the time the system. In brief described the work principle of hardware system first in the text, and attached diagram with the design frame of the hardware system, discuss this graduation design connects the function and work process that a people's technique and each one connect a people mold piece various hardware applying, and concrete described to circumscribe electric circuit to connect of soft, the hardware adjust to try.

1.Single slice of machine total design way of thinking

(1) Design minimum hardware system of a single slice of machine of ability normal work, the outer circle electric circuit includes to establish a keyboard, the monitor of LCD or LED;

 (2) Carry on a software design, make use of single slice of machine system the clock design the internal clock system of high accuracy first, minimum and accurate time is period 1;

 (3) Design on second foundation that counts a machine for a 24 hours, clock, and design some in fixed time function;

   (4) Design a dozen of bells performance organization, complete an auto to beat bell function.

2.  The alternative of hardware

Automatically tell the time system, it needs to be walked accurately, compare, adjust, in fixed time, the fixed-point tell the time etc., therefore what I chose is one AT C51 list slice machine chip, then go together with with the DS12 C887, key electric circuit, crystal flap electric circuit and reset electric circuit and LED dynamic state of display, can carry out. The key connects, is completed by P1.0, P1.1, P1.2 and P1.3, four functions of keys respectively BE: One is the function key K1; One is a number to adjust the key K2; One is cancel to establish the key K3, use to establish time; One is K4 keyses, use to establish in fixed time time.

   Seven type figures tubes drive mold piece, buzzer to drive a mold piece and reset a mold piece, keyboard mold piece and crystal to flap to concuss an electric circuit mold a piece five parts to constitute. And all pass AT C51 to carry out.

2.1 seven type figures tubes drive a mold piece

   Adopt a dynamic state scanning method, through a set of single slice of machine port drive to merge together of LCD give out light a tube of on carrying(total Yin or total sun carry), LCD gives out light another feet of tube to connect to use an I/O and control it bright put out. The method can drive more LCD and control a way more vivid, and economical list the resources of the slice machine.

2.2 buzzers drive a mold piece

   The adoption presses electricity type buzzer and presses an electricity type buzzer to be mainly flapped by many Xies to concuss a machine and press to give or get an electric shock Feng to blare slice, resistance to match machine and sympathy box, and outer shell...etc. to constitute. Many Xies flap to concuss the machine constitutes to°from the transistor or the integrated circuit, when after connecting the power(1.5-15 V direct current work electric voltage), many Xies flap to concuss machine to flap and output the audio frequency signal with 1.5~2.5 khzs, the resistance matches a machine push to press to give or get an electric shock Feng to blare a slice of phonation.

 2.2  Reset a mold piece

List slice machine while switching on or make procedure lose control because of interference in the work, or the procedure in the work is placed in a certain dead circulating status and all needs to be reset in this case.  The function of resetting is the beginning that makes CPU CPU and other function partses all resume to an assurance to start status, and restart a work from this status. The  S51 list slice machine resets to depend an external electric circuit realization, the signal is led a feet importation by RESET(RST), Gao Dian Ping is effective, while flapping to concuss a machine work, as long as keeping RST to lead feet two machine periods of Gao Dian Ping, single slice of machine namely reset.  After resetting, the PC procedure counts the contents of machine as 0000 Hs, the contents is constant in RAM inside the slice.  Resetting electric circuit to generally have to up wire reply, move a switch to resetting and automatically reset electric circuit is 3 kinds of, this adoption hand moves to reset a way.

2.3  Keyboard mold piece

   Keyboard structure: The keyboard can is divided into 2 types: independent conjunction type and determinant(matrix type), each press it translate a code method and can is divided into code and don't  code two, here use an independent conjunction type don't  code a keyboard, the advantage of this kind of keyboard structure is that the electric circuit is simple; The weakness is to be key to count more, take up more I/O line.

2.4  The crystal flaps to concuss an electric circuit mold piece

   The crystal flaps the function quartz crystal of concussing the machine to flap to concuss a machine to also call quartz crystal the Xie flaps a machine, it uses to the stable frequency and the choice frequency, being 1 kind can replace the crystal Xie that the LC Xie flaps a back track to flap a component, this is crystal to flap the quartz that the electric circuit chooses crystal flap frequency to 6 Mhzs. The clock period is a single slice of machine to circumscribe crystal flap of reciprocal, for example 12 Ms of crystal flap, its time the period is a 1/12 us), is the most basic in the calculator, minimum of time unit.

3.  The design project of software

3.1  System workflow

   1. The clock shows: LCD from left arrive right show at a time, cent, second, adopt to account for 24 hours.

   2. The key controls function: Adopt 4 independent keyboards, an among those are function keys; One is a number adjustment key; One is cancel to establish key, use to establish time; One is an ALM key, use to establish in fixed time time.

 3. Time shows: After switching on electricity, the system automatically gets into a clock constitution, from 00: 00: When 00 beginnings account, can set current time at this time.

   4. The adjustment of time: Press function key, system suggested while stopping accounting, get into time to set status, system the contents that show a hour, rest other is placed in whole dark statuses and waits for a key constitution. At this time press to move a hour will add after the number adjustment's key 1, press move to cancel key behind again back again time show status afresh; If again press move function key to then use to adjust minute, other in hour and second indicate at this time whole dark, can increase to the minute after adjusting key according to the number 1 adjust, press move to cancel key behind again back again time show status afresh; Again press move function key to then use to adjust second, other in hour and minute indicate at this time whole dark, second shows current number, the dark number adjustment key can carry on increasing to second 1 adjust, press move to cancel key behind and then back again time shows status afresh, press move after the function key system will auto from set behind of time showed while starting accounting.

   5. Alarm clock constitution/the Qi make: Press K4 keyses, when the system continues to account but show to 00: 00:00, press again to move function key juniors to establish status into the alarm clock at this time, show after establishing process and time to adjust a homology, but finally pressing the function key assurance time in fixed time 30 Ss behind automatically start alarm clock function in fixed time, and resume time to show. In fixed time time arrives, the buzzer after blaring to call the 1 min automatically stops to make, can settle once and need to re- establish next time just while establishing each time.

3.2  The lord procedure process designs

   The lord procedure beginning starts to turn, and open interruption, then carry out interruption service procedure. Carry out 24 hours system electric clock, 8 figures tubes suggest, cent second shows a format while showing: 23-59-59(the hour is ten if for 0 don't show) to schedule to time start buzzer emulation to beat bell, buzzer BEEP:    Use 4 keys, 3 keys are been used to adjust time, another adjust to choose key SET_KEY for compulsive dozen bell button: P1.0; Passing chooses that the key chooses an adjustment and picks out a flicker increment key ADD_KEY: P1.1; Press to make to pick out to add at a time 1 reduce key DEC_KEY; P1.2; Press to make to pick out to reduce at a time 1, if is long to press ADD_KEY or DEC_KEY, while being then carry on adjusting after identifying enter quickly, stop flicker at this time.

3.3  Key procedure

 Get into key procedure, does the judgment include key to press? Have no, re- judge while then adjusting to use to postpone, if arrive, tremble procedure while adjusting to use to postpone, again the judgment has key to press to deny, didn't then return to postpone a schedule preface, if have a key, then judge key, heap inn, judgment whether key releases, have no, continue to judge, release, then input key to send into tired add a machine, then return lord procedure.

3.4  Show procedure

   Show a procedure adoption dynamic state suggests, is controled that figures tube by the code to suggest, from segment code control the figures tube show what number, according to break off the procedure show time to checks form to show number, from the first arrive the fourth pursue point bright, at the same time each time show 1 to judge four at a time finish showing have no, have never finished showing to carry on showing next, show that finishing is from the first again circularly.

End language:

   This design is used of the single slice of machine chip is AT C51 chipses, in addition still include: DS1302 chips, crystal flap electric circuit and reset the electric circuit composing list slice machine's least application system, there is also independent type key electric circuit, the dynamic state shows an electric circuit etc.. It not only can carry out various function of number electronics clock, if have to compare, adjust, in fixed time, alarm clock etc. function, and can also carry out the function that the fixed-point tells the time. Secondly elaborated the process of procedure and carry out process. This design is to edit collected materials language by the basic language of list slice machine to carry on a software design, the design adoption mold piece of software turns structure and make the logic of program design relate to more simple and direct clear. Make the hardware moderate under the control of software to operate.

基于单片机的自动报时系统设计

摘要:随着电子技术的迅速发展,特别是随大规模集成电路出现,给人类生活带来了根本性的改变。由其是单片机技术的应用产品已经走进了千家万户。电子万年历的出现给人们的生活带来的诸多方便。自动报时系统用到的单片机芯片是ATC51芯片,除此之外还包括:DS1302芯片、晶振电路和复位电路构成单片机最小应用系统,还有式按键电路,动态显示电路等等。它不仅能实现数字电子时钟的各种功能,如具有较时、调时、定时、闹钟等功能,而且还能实现定点报时的功能。

关键词:单片机,闹铃时钟,位码,段码,显示

前言:实时时钟可提供秒、分、时、日、星期、月和年,一个月小与31天时可以自动调整,且具有闰年补偿功能。本设计还附加了定点报时的功能,从而进一步完成了自动报时系统的设计。正文中首先简单描述了硬件系统的工作原理,且附以硬件系统的设计框图,论述了本次毕业设计所应用的各种硬件接口技术和各个接口模块的功能及工作过程, 并具体描述了外接电路接口的软、硬件调试。

1.单片机总体设计思路

(1)设计能正常工作的一个单片机最小硬件系统,外围电路包括设置键盘,LCD或LED的显示屏;

    (2)进行软件设计,利用单片机系统时钟先设计一个高精度的内部时钟系统,最小精确时间为期1秒;

    (3)在秒计数器的基础上设计一个24小时时钟,并设计若干定时功能;

(4)设计打铃执行机构,完成自动打铃功能。

2. 硬件的选择方案

自动报时系统,它需要准确的走时、较时、调时、定时、定点报时等,因此我选用的是ATC51单片机芯片,再配以DS12C887、按键电路、晶振电路、复位电路以及LCD动态显示器,就可以实现。按键接口,由P1.0、P1.1、P1.2、P1.3来完成,四个按键的作用分别是:一个为功能键K1;一个为数字调整键K2;一个为取消设置键K3,用来设置时间;一个为K4键,用来设置定时时间。

由七段式数码管驱动模块、蜂鸣器驱动模块、复位模块、键盘模块和晶体振荡电路模块五部分组成。且都通过ATC51来实现。

2.1七段式数码管驱动模块

采用动态扫描方式,通过一组单片机端口驱动并联在一起的LCD发光管的一端(共阴或共阳端),LCD发光管的另一脚接通用I/O口,控制其亮灭。该方法能驱动较多的LCD,控制方式较灵活,而且节省单片机的资源。

2.2蜂鸣器驱动模块

采用压电式蜂鸣器,压电式蜂鸣器主要由多谐振荡器、压电蜂鸣片、阻抗匹配器及共鸣箱、外壳等组成。多谐振荡器由晶体管或集成电路构成,当接通电源后(1.5-15V直流工作电压),多谐振荡器起振,输出1.5~2.5kHZ的音频信号,阻抗匹配器推动压电蜂鸣片发声。

2.2 复位模块

单片机在开机时或在工作中因干扰而使程序失控,或工作中程序处于某种死循环状态,在这种情况下都需要复位。 复位的作用是使处理器CPU以及其他功能部件都恢复到一个确定的初始状态,并从这个状态重新开始工作。S51单片机的复位靠外部电路实现,信号由RESET(RST)引脚输入,高电平有效,在振荡器工作时,只要保持RST引脚高电平两个机器周期,单片机即复位。 复位后,PC程序计数器的内容为0000H,片内RAM中内容不变。 复位电路一般有上电复位、手动开关复位和自动复位电路3种,本次采用手动复位方式。

2.3 键盘模块

键盘结构:键盘可分为连接式和行列式(矩阵式)两类,每一类按其译码方法又都可分为编码及非编码两种类型,这里使用连接式非编码键盘,这种键盘结构的优点是电路简单;缺点是当键数较多时,要占用较多的I/O线。

2.4 晶体振荡电路模块

石英晶体振荡器也称石英晶体谐振器,它用来稳定频率和选择频率,是一种可以取代LC谐振回路的晶体谐振元件,此晶振电路所选用的石英晶振频率为6MHZ。时钟周期就是单片机外接晶振的倒数,例如12M的晶振,它的时间周期就是1/12 us),是计算机中最基本的、最小的时间单位。

3. 软件的设计方案

3.1 系统工作流程

1.时钟显示:LCD从左到右一次显示时、分、秒,采用24小时计时。

2.按键控制功能:采用4个键盘,其中一个为功能键;一个为数字调整键;一个为取消设置键,用来设置时间;一个为ALM键,用来设置定时时间。

3.时间显示:通电后,系统自动进入时钟设置,从00:00:00开始计时,此时可以设定当前时间。

4.时间调整:按下功能键,系统停止计时显示,进入时间设定状态,系统只显示小时的内容,其余处于全暗状态,等待按键设置。此时按动数字调整键后小时将会加1,按动取消键后又重新回到原来的时间显示状态;若再按动功能键则用来调整分钟,此时小时和秒指示全暗,按数字调整键后可以对分钟增1调整,按动取消键后又重新回到原来的时间显示状态;再按动功能键则用来调整秒,此时小时和分钟指示全暗,秒显示当前的秒数,按数字调整键可以对秒进行增1调整,按动取消键后又重新回到原来的时间显示状态,按动功能键后系统将自动由设定后的时间开始计时显示。

5.闹钟设置/启闹:按下K4键,系统继续计时,但显示为00:00:00,此时再按动功能键后进入闹钟设置状态,设置过程和时间调整相同,但是最后按功能键确定后显示定时时间后自动启动定时闹钟功能,并恢复时间显示。定时时间到,蜂鸣器鸣叫1min后自动停闹,每次设置时只能定一次,下次需重新设置。

3.2 主程序流程设计

主程序初始化,并打开中断,然后执行中断服务程序。实现24小时制电子钟,8位数码管显示,显示时分秒显示格式:23-59-59(小时十位如果为0则不显示) 到预定时间启动蜂鸣器模拟打铃,蜂鸣器BEEP:P3.7打铃方式分起床、熄灯铃和上、下课铃两种系统使用4只按键,3只按键用来调整时间,另一只为强制打铃按钮 调整选择键SET_KEY:P1.0;通过选择键选择调整位,选中位闪烁增加键ADD_KEY:P1.1;按一次使选中位加1减少键DEC_KEY;P1.2;按一次使选中位减1,如果长按ADD_KEY或DEC_KEY,识别后则进行调时快进,此时停止闪烁。

3.3 按键程序

 ,然后返回主程序。

3.4 显示程序

显示程序采用动态显示,由位码控制那一个数码管显示,由段码控制数码管显示什么数值,根据中断程序显示时间来查表显示数值,从第一位到第四位逐个点亮,同时每显示一位判断一次四位显示完了没有,没有显示完进行显示下一位,显示完了从头开始再循环。

结束语:

本次设计用到的单片机芯片是ATC51芯片,除此之外还包括:DS1302芯片、晶振电路和复位电路构成单片机最小应用系统,还有式按键电路,动态显示电路等等。它不仅能实现数字电子时钟的各种功能,如具有较时、调时、定时、闹钟等功能,而且还能实现定点报时的功能。其次阐述了程序的流程和实现过程。本设计就是以单片机的基本语言汇编语言来进行软件设计,软件的设计采用模块化结构,使程序设计的逻辑关系更加简洁明了。使硬件在软件的控制下协调运作。下载本文

显示全文
专题