外文翻译基于基于单片机进行实时日历和时钟显示设计.doc

上传人:仙人指路1688 文档编号:2325125 上传时间:2023-02-11 格式:DOC 页数:12 大小:158KB
返回 下载 相关 举报
外文翻译基于基于单片机进行实时日历和时钟显示设计.doc_第1页
第1页 / 共12页
外文翻译基于基于单片机进行实时日历和时钟显示设计.doc_第2页
第2页 / 共12页
外文翻译基于基于单片机进行实时日历和时钟显示设计.doc_第3页
第3页 / 共12页
外文翻译基于基于单片机进行实时日历和时钟显示设计.doc_第4页
第4页 / 共12页
外文翻译基于基于单片机进行实时日历和时钟显示设计.doc_第5页
第5页 / 共12页
点击查看更多>>
资源描述

《外文翻译基于基于单片机进行实时日历和时钟显示设计.doc》由会员分享,可在线阅读,更多相关《外文翻译基于基于单片机进行实时日历和时钟显示设计.doc(12页珍藏版)》请在三一办公上搜索。

1、毕业论文(设计)外文翻译学 生 姓 名: 指导教师: 合作指导教师: 专业名称: 自动化 所在学院: 2012年 6月Design of single chip real time clock and calendar based onAbstract: This clock and calendar uses the AT89S52 microcontroller as the core for the control. Time Circuit which is constituted by Dallass DS1302 real-time clock chip achieved a ti

2、me and date display, it increased functionality for the temperature display and the whole point timekeeping. This paper discusses the hardware circuit of the system, principle in detail , and gives the flow chart of the software design and the major source code. Keywords: microcontroller; real-time

3、clock; Temperature measurement1 Introduction Clock and calendar-bedroom at home, schools, stations and more and more extensive use of plaza for peoples lives, study, work great convenience. clock and calendar for the past need to re-adjust after power-off time and date, and time is a big error. Desi

4、gned the system using real-time clock chip (DS1302) as a timer parts, the chip comes with an internal crystal oscillator, so that effectively guarantee the accuracy of the time and hang own internal battery power makes the situation will continue to update the time information . This design uses AT8

5、9S52 as the main controller, in order to improve the practicality of the circuit add temperature measurement circuit, timekeeping and alarm functions. 2 System hardware design Schematic circuit shown in Figure 2:System architecture diagram2.1 Power Supply Circuit In order to reduce circuit costs, th

6、e system power supply circuit by the transformer transformer, three-terminal integrated regulator (L7805 circuit 5V, has a simple, reliable, inexpensive and so on. 2.2 Host Controller Host controller using ATMELs latest MCU Products AT89S52. Apart from the single-chip microcomputer has a MCS-51 seri

7、es single-chip all the benefits of things,also has 8KB of internal in-system programmable FLASH memory,free and low-power brown-out mode, greatly reducing the power circuit . In addition,also has a watchdog circuit,a reliable job for the circuit provides greater assurance. 2.3 digital tube display c

8、ircuit Show circuit with a high brightness,long life,low cost features such as the LED digital tube. Throughout the show circuit by the digital control and display LED drive circuit and decoding circuit. Because of the system to display the contents of more,a total of 16 digital tube, respectively,w

9、ith eight shows year,month,day,four show time,show that 22 weeks,2 show the temperature. Controller in order to save resources,between the controller and displays add a decoding circuit 16 so that would have required the line of control into the circuit only 4 control lines,a great save system resou

10、rces. The decoder by the decoder constitute both 3-8. 2.4 Real-time clock chip This design uses the United States Dallas company DS1302, the chip can automatically generate century,year,month,day,hour,minute,second,such as time information. Century the use of internal registers with the software wil

11、l be able to resolve the Millennium, the problem. The chip has its own internal battery-keng,external brown-out,the internal time information also be able to maintain for 10 years. Time for a single day record of 12 hours and there is a 24-hour mode. Time Table Ways that also has two kinds of binary

12、 numbers,and the other with BCD code express. The chip with 128 bytes of internal RAM,one of 11 bytes used to store time information,4 bytes of memory chips used to control information,known as the control register,113-byte general-purpose RAM for users to store temporary information. In addition,us

13、ers can also program the chip to control a variety of square-wave output,and its internal three-way through the software interrupt shielding. 2.5 Buttons and temperature measurements and circuit The system in order to make the circuit more easy,button circuit design only three keys, which are set,+,

14、-, three keys to adjust the calendar and clock. The system in order to improve the practicality of the circuit,an increase of a temperature display. The system temperature measurement circuit using Dallass DS18B20. The device because of its low price,easy circuits,measurement precision,etc. 2.6 audi

15、o signal generator and driver circuit The circuits function is to receive control circuit to send to the entire point of time and timing signal,according to system settings produce different frequencies of audio signals,amplification by the drive circuit to drive speakers to voice their opinions in

16、order to realize the whole point timekeeping and alarm functions. DescriptionThe AT89S52 is a low-power, high-performance CMOS 8-bit microcomputer with 4K bytes of Flash programmable and erasable read only memory (PEROM). The device is manufactured using Atmels high-density nonvolatile memory techno

17、logy and is compatible with the industry-standard MCS-52 instruction set and pinout. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89S52 is a

18、 powerful microcomputer which provides a highly-flexible and cost-effective solution to many embedded control applications.Function characteristicThe AT89S52 provides the following standard features: 4K bytes of Flash, 128 bytes of RAM, 32 I/O lines, two 16-bit timer/counters, a five vector two-leve

19、l interrupt architecture, a full duplex serial port, on-chip oscillator and clock circuitry. In addition, the AT89S52 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/

20、counters, serial port and interrupt system to continue functioning. The Power-down Mode saves the RAM contents but freezes the oscillator disabling all other chip functions until the next hardware reset.Pin DescriptionVCC:Supply voltage.GND:Ground.Port 0:Port 0 is an 8-bit open-drain bi-directional

21、I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as highimpedance inputs.Port 0 may also be configured to be the multiplexed loworder address/data bus during accesses to external program and data memory. In this mode P0 has int

22、ernal pullups.Port 0 also receives the code bytes during Flash programming,and outputs the code bytes during programverification. External pullups are required during programverification.Port 1Port 1 is an 8-bit bi-directional I/O port with internal pullups.The Port 1 output buffers can sink/source

23、four TTL inputs.When 1s are written to Port 1 pins they are pulled high by the internal pullups and can be used as inputs. As inputs,Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pullups.Port 1 also receives the low-order address bytes during Flas

24、h programming and verification.Port 2Port 2 is an 8-bit bi-directional I/O port with internal pullups.The Port 2 output buffers can sink/source four TTL inputs.When 1s are written to Port 2 pins they are pulled high by the internal pullups and can be used as inputs. As inputs,Port 2 pins that are ex

25、ternally being pulled low will source current, because of the internal pullups.Port 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memory that use 16-bit addresses. In this application, it uses strong internal pullupswhen emitting

26、 1s. During accesses to external data memory that use 8-bit addresses, Port 2 emits the contents of the P2 Special Function Register.Port 2 also receives the high-order address bits and some control signals during Flash programming and verification.Port 3Port 3 is an 8-bit bi-directional I/O port wi

27、th internal pullups.The Port 3 output buffers can sink/source four TTL inputs.When 1s are written to Port 3 pins they are pulled high by the internal pullups and can be used as inputs. As inputs,Port 3 pins that are externally being pulled low will source current (IIL) because of the pullups.Port 3

28、also serves the functions of various special features of the AT89C51 as listed below:Port 3 also receives some control signals for Flash programming and verification.RSTReset input. A high on this pin for two machine cycles while the oscillator is running resets the device.ALE/PROGAddress Latch Enab

29、le output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming.In normal operation ALE is emitted at a constant rate of 1/6 the oscillator frequency, and may be used for external timing or clocking

30、 purposes. Note, however, that one ALE pulse is skipped during each access to external Data Memory.If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting

31、 the ALE-disable bit has no effect if the microcontroller is in external execution mode.PSENProgram Store Enable is the read strobe to external program memory.When the AT89S52 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations

32、 are skipped during each access to external data memory.EA/VPPExternal Access Enable. EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally la

33、tched on reset.EA should be strapped to VCC for internal program executions.This pin also receives the 12-volt programming enable voltage(VPP) during Flash programming, for parts that require12-volt VPP.XTAL1Input to the inverting oscillator amplifier and input to the internal clock operating circui

34、t.XTAL2Output from the inverting oscillator amplifier.Oscillator CharacteristicsXTAL1 and XTAL2 are the input and output, respectively,of an inverting amplifier which can be configured for use as an on-chip oscillator, as shown in Figure 1.Either a quartz crystal or ceramic resonator may be used. To

35、 drive the device from an external clock source, XTAL2 should be left unconnected while XTAL1 is driven as shown in Figure 2.There are no requirements on the duty cycle of the external clock signal, since the input to the internal clocking circuitry is through a divide-by-two flip-flop, but minimum

36、and maximum voltage high and low time specifications must be observed. Figure 1. Oscillator Connections Figure 2. External Clock Drive ConfigurationIdle ModeIn idle mode, the CPU puts itself to sleep while all the onchip peripherals remain active. The mode is invoked by software. The content of the

37、on-chip RAM and all the special functions registers remain unchanged during this mode. The idle mode can be terminated by any enabled interrupt or by a hardware reset.It should be noted that when idle is terminated by a hard ware reset, the device normally resumes program execution,from where it lef

38、t off, up to two machine cycles before the internal reset algorithm takes control. On-chip hardware inhibits access to internal RAM in this event, but access to the port pins is not inhibited. To eliminate the possibility of an unexpected write to a port pin when Idle is terminated by reset, the ins

39、truction following the one that invokes Idle should not be one that writes to a port pin or to external memory.Power-down ModeIn the power-down mode, the oscillator is stopped, and the instruction that invokes power-down is the last instruction executed. The on-chip RAM and Special Function Register

40、s retain their values until the power-down mode is terminated. The only exit from power-down is a hardware reset. Reset redefines the SFRs but does not change the on-chip RAM. The reset should not be activated before VCC is restored to its normal operating level and must be held active long enough t

41、o allow the oscillator to restart and stabilize.Program Memory Lock BitsOn the chip are three lock bits which can be left unprogrammed (U) or can be programmed (P) to obtain the additional features listed in the table below.When lock bit 1 is programmed, the logic level at the EA pin is sampled and

42、latched during reset. If the device is powered up without a reset, the latch initializes to a random value, and holds that value until reset is activated. It is necessary that the latched value of EA be in agreement with the current logic level at that pin in order for the device to function properl

43、y.基于基于单片机进行实时日历和时钟显示设计摘要:日历及时钟显示以AT89S52单片机为控制核心,采用Dallas公司的DS1302实时钟芯片构成计时电路,实现了时间和日期的显示,还增加了温度显示和整点报时的功能。文章对该系统的硬件电路、工作原理做了详细介绍,同时给出了软件设计的流程图及主要程序源代码。关键词:单片机,实时钟.温度测量1引言日历及时钟显示在家庭居室、学校、车站和广场使用越来越广泛,给人们的生活、学习、工作带来极大的方便。针对以往的电子万年历断电后需重新调整时间与日期,且计时误差大的现象。本系统设计采用实时钟芯片(DS1302)作为计时器件,该芯片内部自带晶体振荡器,这样就有效的

44、保证了计时的精确性,并且内部自带铿电池使得在断电情况能继续更新时间信息。本设计采用AT89S52作为主控制器,为了提高电路的实用性加入温度测量电路、报时和闹钟功能。2系统硬件的设计电路原理图如图所示: 该系统的结构框图系统的工作原理是:主控制器每隔一段时间(小于一秒钟)读一次时钟芯片的内部寄存器的值,将读出的日历、时间信息实时的显示在LED数码显示器一上。同时,主控制器不断的扫描按键电路和温度测量电路,当有键按下时,识别出按键的值并调整相应的时间或日历的值再写入时钟芯片内部。温度数据由测量电路(DS18B20)获得的温度值送入显示电路显示。2. 1电源电路为了减少电路成本,本系统电源电路由变压

45、器变压、三端集成稳压(L7805电路产生5V,具有简单、可靠、价格低廉等特点。2. 2主控制器主控制器采用ATMEL公司的最新系列单片机产品AT89S52。该单片机除了拥有MCS-51系列单片机的所有优点外,内部还具有8KB的在系统可编程FLASH存储器,低功耗的空闲和掉电模式,极大的降低了电路的功耗。另外,还具有一个看门狗电路,为电路的可靠工作提供了更大的保证。2. 3数码管显示电路显示电路采用具有高亮度、使用寿命长、价格低廉等特点的LED数码管。整个显示电路由LED数码管和显示驱动电路和译码电路构成。由于本系统中显示的内容较多,共需要16个数码管,分别用八位显示年、月、日,四位显示时间,二

46、二位显示星期,二位显示温度。为了节省控制器的资源,在控制器和显示器之间加入一个译码电路使本来需要16根控制线的电路变成只需四根控制线,极大的节省了系统资源。该译码器由两个3-8译码器构成。2. 4实时钟芯片本设计采用美国Dallas公司的DS12C887A,该芯片能够自动产生世纪、年、月、日、时、分、秒等时间信息。利用内部的世纪寄存器,配合软件就能解决千年,的问题。该芯片内部自带有铿电池,外部掉电时,其内部的时间信息还能够保持10年之久。对于一天内的时间记录有 12小时制和24小时制两种模式。时间的表示方法也有两种,一种用二进制数表示,另一种用BCD码表示。该芯片内部带有128字节的RAM,其

47、中11字节用来存储时间信息,4字节用来存储芯片的控制信息,称为控制寄存器,113字节通用RAM可供用户存储临时信息。此外,用户还可以对芯片进行编程控制输出各种方波,并可对其内部的三路中断通过软件进行屏蔽。2. 5按键与温度测且电路本系统为了使电路更简单,按键电路只设计了三个按键,分别是设置、+、-,三个键用来调整日历以及时钟。本系统为了提高电路的实用性,增加了一个温度显示功能。该系统的温度测量电路采用Dallas公司的DS1280。该器件由于其具有价格低廉、电路简单、测量精确等优点。2. 6音频信号产生及驱动电路本电路的功能是接收控制电路发送来的整点报时及定时信号,根据系统设定产生不同频率的音

48、频信号,由驱动电路加以放大驱动扬声器发出声音,从而实现整点报时及闹钟的功能。 描述AT89S52是一个低电压,高性能CMOS8位单片机带有4K字节的可反复擦写的程序存储器(PENROM)。和128字节的存取数据存储器(RAM),这种器件采用ATMEL公司的高密度、不容易丢失存储技术生产,并且能够与MCS-52系列的单片机兼容。片内含有8位中央处理器和闪烁存储单元,有较强的功能的AT89S52单片机能够被应用到控制领域中。功能特性AT89S52提供以下的功能标准:4K字节闪烁存储器,128字节随机存取数据存储器,32个I/O口,2个16位定时/计数器,1个5向量两级中断结构,1个串行通信口,片内震荡器和时钟电路。另外,AT89S52还可以进行0HZ的静态逻辑操作,并支持两种软件的节电模式。闲散方式停止中央处理器的工作,能够允许随机存取数据存储器、定时/计数器、串行通信口及中断系统继续工作。掉电方式保存随机存取数据存储器中的内容,但震荡器停止工作并禁止其它所

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 建筑/施工/环境 > 项目建议


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号