单片机电子钟设计代码 (singlechip electronic clock design code )

单片机电子钟设计代码 (singlechip electronic clock design code )

ID:15551804

大小:61.00 KB

页数:32页

时间:2018-08-04

单片机电子钟设计代码 (singlechip electronic clock design code )_第1页
单片机电子钟设计代码 (singlechip electronic clock design code )_第2页
单片机电子钟设计代码 (singlechip electronic clock design code )_第3页
单片机电子钟设计代码 (singlechip electronic clock design code )_第4页
单片机电子钟设计代码 (singlechip electronic clock design code )_第5页
资源描述:

《单片机电子钟设计代码 (singlechip electronic clock design code )》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、单片机电子钟设计代码(2)(Singlechipelectronicclockdesigncode(2))Giveyoua,Idotheelectronicclockprocedures,reference,timeisadjustable,thereisakeyscaninit*************************************;FileName:timer_controlableChiptype:ATMELMEGA8Programetype:ApplicationClockfrequency:8MHZMemorymodel:smallExternal,S

2、RAM,size:0Data,stack,size:256*************************************;.include"m8def.inc"".deftime_counter=r16;timecountunit.defkey_stime_counter=r17.defkey_input=r18;keyinputunit.defposit=r19;LEDdisplaycharactershiftpointer.deftemp=r20;temporaryregister.deftemp1=r21.defkey_press=r22.defkey_retu

3、rn=r23.defclock_state=r24;thestateofthestatemachine.defkey_state=r25.defkey_temp=r7.defcount=r8.deftemp2=r1.defset_on=r2;timeblinkmark.defreturn_time=r3.defpoint_on=r4;secondblinkingsign.deftime_1s_ok=r5;1stomark.defkey_stime_ok=r6;10mstomark.equkey_no=0;nobuttonsign.equkey_k1=1;buttonK1logo.

4、equkey_k2=2;buttonK2logo.equkey_mask=0b11000000;buttonidentificationmark.equkey_state_0=0;status0.equkey_state_1=1;status1.equkey_state_2=2;status2.org0x0000Rjmpmain.org0x0003;T2comparesmatchinginterruptvectoraddressesRjmptimer2_com_isr.org0x0020-----------------------------------------------

5、--------------------------------------------------------------------------------------------;Mainprogram-------------------------------------------------------------------------------------------------------------------------------------------;Main:Initializethestack;--**--;LDI,temp,0x5fOut,S

6、PL,tempLDI,temp,0x02Out,SPH,temp*--PB,PD--*initialization;LDI,temp,0x00Out,portb,temp;PBportoutputtodosectioncodecontrolLDI,temp,0xffOut,ddrb,tempOut,portd,tempLDI,temp,0x3f;PD0~5outputbitcontrolOut,ddrd,temp;PD6~7fortimeadjustmentinput*--T2initialization--*;LDI,temp,0x0DOut,tccr2,temp;intern

7、alclock,128frequencydivision(8M/128=62.5KHZ),CTCmodeLDI,temp,0x7cOut,OCR2,temp;ocr2=0x7c(124),(124+1)/62.5khz=2msidestemp,0x80outtimsk定时器2比较匹配中断使能,temp.;*--时钟初始化为:23:58:55--*.idesxl,low(time_buff)idesxi,high(time_buff)idestemp,55stx+s;秒:55ide

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。