英语翻译3 软件部分的设计本设计是制作一个具有语音报时的时钟系统,它利用凌阳A61单片机的2Hz时基信号计时进行年历计算,用凌阳A61单片机的语音功能将当前时间报出来,并在LCD上显示.整个
来源:学生作业帮助网 编辑:六六作业网 时间:2024/07/19 19:12:14
英语翻译3 软件部分的设计本设计是制作一个具有语音报时的时钟系统,它利用凌阳A61单片机的2Hz时基信号计时进行年历计算,用凌阳A61单片机的语音功能将当前时间报出来,并在LCD上显示.整个
英语翻译
3 软件部分的设计
本设计是制作一个具有语音报时的时钟系统,它利用凌阳A61单片机的2Hz时基信号计时进行年历计算,用凌阳A61单片机的语音功能将当前时间报出来,并在LCD上显示.整个程序分为主程序、万年历计算子程序、校时子程序、键盘扫描子程序、播放语音子程序、LCD液晶显示子程序几部分.
3.1 主程序流程及其算法
语音时钟的主程序按照模块化设计,所有功能都可以通过调用子程序完成,主程序较简单,流程见图.凌阳A61单片机具有低功耗的睡眠模式,在睡眠模式下功耗电流可以降到2μA,这对于用电池供电的系统非常重要,睡眠模式可以通过按键中断唤醒.
3.2 万年历计算子程序设计
在万年历的计算中,我们是利用2Hz中断做时钟源进行计时的.由于周期是频率的倒数,因此每半秒中断一次.当每两次中断秒就加1,并进行年历计算.在进行年历计算时,有平闰年计算问题和月天数是30天还是31天的问题.闰年的条件是:能被400整除,或者能被4整除,但不能被100整除
3.3 键盘扫描子程序的设定
在键盘扫描过程中必须解决好按键消抖的问题.由于机械触点的弹性作用,通常按键在按下和释放时都存在一个抖动的暂态过程.这种抖动的暂态过程大约经过5~10ms的时间,人的肉眼是察觉不到的,但对高速的CPU是有反应的,可能产生误处理.为了保证键动作一次,仅进行一次处理,必须采取措施以消除抖动.我在设计中采用软件的方式来消除抖动.软件消除抖动是用延时来避开暂态抖动过程,即检测到按键闭合后执行一个延时程序,产生一个延时时间,让前沿抖动消失后再检测一次键的状态,如果仍然保持闭合状态,则确认真正有键按下.当检测到按键释放后,也要给出一个延时时间,待后沿抖动消失后才转入该键的处理程序
3.4 校时子程序的设计
系统扩展了四个按键,KEY1键用于报时,由于时间包括年、月、日和时、分、秒,按一次KEY1键,则报年、月、日,再按一次KEY2键则报时、分.当按住KEY3键时进入时间校正状态,语音播报当前是XXXX年,按KEY1键年份增加,按KEY2键年份减少;按KEY2键来切换月、日、时、分,调整完分后,按KEY3键确认,语音报出年、月、日、时、分.
3.5 语音播报部分的设计
报时用SACM-A2000播放.(见附录)
3.6 LCD液晶显示部分的设计
调用液晶显示子程序时,要设定好每行显示的起始位置.LCD12864字符型液晶模块是两行显示,第一行显示年、月、日,起始地址为0x0080.第二行显示时、分、秒,起始地址为0x00c0.(见附录)
英语翻译3 软件部分的设计本设计是制作一个具有语音报时的时钟系统,它利用凌阳A61单片机的2Hz时基信号计时进行年历计算,用凌阳A61单片机的语音功能将当前时间报出来,并在LCD上显示.整个
3 software design
This design is to produce a voice-time clock system,which uses Sunplus 2Hz SCM A61 signal time-base for calendar time,the A61 MCU with Sunplus voice out at the current time and the LCD显示.The whole process is divided into the main program,calendar calculation subroutine,school routines,keyboard scan subroutine,subroutines voice playback,LCD liquid crystal display parts subroutine.
3.1 The main program processes and algorithms
Voice of the main clock in accordance with the modular design,all functions can be completed by calling the subroutine,main program relatively simple,see the process.Sunplus has the A61 single-chip low-power sleep mode,power consumption in sleep mode current can be reduced to 2μA,which use battery-powered system is very important,sleep mode wake-up call can be interrupted through the keys.
3.2 Design of calendar calculation subroutine
Calculation of the calendar,we have to do is to use 2Hz interrupt timing source clock.As the cycle is the reciprocal of frequency,each time half a second interruption.When interrupted every two seconds plus 1,and the calendar calculation.In calculating the calendar,it is flat on a leap year and calculated the number of days is 30 days or 31 days of the issue.Leap year terms are:to be divisible by 400,or can be divisible by 4 but not divisible by 100
3.3 Subroutine keyboard scan settings
In the course of the keyboard scan buttons eliminate the need to solve the problem of shaking.Due to the flexibility of the role of mechanical contact,usually in the press and release button when there is a transient process of jitter.This jitter transient process after about 5 10ms of time,people are not aware that the naked eye,but the CPU for high-speed response is likely to produce the error handling.In order to ensure a key action,only a treatment,must take measures to eliminate jitter.I use the software in the design approach to the elimination of jitter.Software elimination of delay jitter is to avoid jitter transient process,that is,to detect a key closure delay after the implementation of procedures,resulting in a delay time,so that after the detection of the disappearance of leading-edge jitter of the state of a key,if the state remained closed ,then press the button to confirm genuine.When the release button is detected,it should give a delay time until after the disappearance of edge jitter into the key process
Subprogram 3.4 design school
Extension of the four keys,KEY1 button for time,because of the time,including year,month,day and hour,minute,second,according to a key KEY1,then at year,month,day,and then the time a key KEY2,sub - .When holding down the enter key KEY3 time correction,and voice broadcast is XXXX the current year by year increase in key KEY1,KEY2 by reducing the year button; KEY2 button to switch by months,days,hours,minutes,adjusting the end points,press KEY3 button to confirm,voice reported year,month,day,hour,minute.
3.5 Voice broadcast part of the design
SACM-A2000 Time to play with.(See appendix)
3.6 LCD liquid crystal display part of the design
Liquid crystal display subroutine call,it is necessary to set each line shows the initial position.Character LCD module is LCD12864 two lines show that the first line shows year,month,day,start address is 0x0080.The second line shows hours,minutes,seconds,the start address is 0x00c0.(See appendix)
哈哈。。楼主搞笑得很,像你这种翻译,给分就够了么?这篇翻译下来得花money的。。我可以给你介绍。。我老婆就是搞翻译的。。
这个东西没人会的啊