|
|||||||||||
| 技術(shù)交流 | 電路欣賞 | 工控天地 | 數(shù)字廣電 | 通信技術(shù) | 電源技術(shù) | 測控之家 | EMC技術(shù) | ARM技術(shù) | EDA技術(shù) | PCB技術(shù) | 嵌入式系統(tǒng) 驅(qū)動編程 | 集成電路 | 器件替換 | 模擬技術(shù) | 新手園地 | 單 片 機 | DSP技術(shù) | MCU技術(shù) | IC 設(shè)計 | IC 產(chǎn)業(yè) | CAN-bus/DeviceNe |
哪位大蝦幫我看看這段程序 |
| 作者:qioujw 欄目:ARM技術(shù) |
#include "..\inc\lcd320.h" #include "..\inc\44b.h" #include"..\inc\44blib.h" #include "..\inc\option.h" #include"..\inc\def.h" extern int LCDCurrentPrnTxt; extern int LCD_start_AddressX; extern int LCD_txt_Start_Address; extern int LCD_start_AddressY; void Set_Rtc(U8 yea, U8 mon, U8 dat, U8 hou, U8 min, U8 sec); void Display_Rtc(void); int Main(int argc, CHAR **argv) { rPCONG=0x5fff; rPUPG=0xc0; rPDATG=0xc0; Led_Display(0x0); Delay(2000); Led_Display(0x3); LCD_Init(); Set_Rtc(05, 04, 04, 18, 03, 00); while(1) { Display_Rtc(); } return 0; } void Set_Rtc(U8 yea, U8 mon, U8 dat, U8 hou, U8 min, U8 sec) { U8 a,b,c,d,e,f; rRTCCON=0x01; rBCDYEAR=yea;//( ((yea/10)<<4) + (yea%10) ); a=rBCDYEAR; rBCDMON=mon;//( ((mon/10)<<4) + (mon%10) ); b=rBCDMON; rBCDDATE=dat;//( ((dat/10)<<4) + (dat%10) ); c=rBCDDATE; rBCDHOUR=hou;//( ((hou/10)<<4) + (hou%10) ); d=rBCDHOUR; rBCDMIN=min;//( ((min/10)<<4) + (min%10) ); e=rBCDMIN; rBCDSEC=sec;//( ((sec/10)<<4) + (sec%10) ); f= rBCDSEC; rRTCCON=0x00; } void Display_Rtc(void) { U8 year,month,day,weekday,hour,minute,second; rRTCCON =0x01; // R/W, 1/32768, Normal(merge), No reset while(1) {year =rBCDYEAR; month=rBCDMON; day=rBCDDAY; weekday=rBCDDATE; hour=rBCDHOUR; minute=rBCDMIN; second=rBCDSEC; if(second!=0)break; // Èç¹û®”ǰÃëÖ&MICRO;ÊÇ0Ã룬„tÒªÇóÖØÐÂ×xÒ»´ÎRTC } LCD_Printfnum(1,1,year); LCD_Printfnum(1,5,month); LCD_Printfnum(1,9,day); LCD_Printfnum(2,1,hour); LCD_Printfnum(2,5,minute); LCD_Printfnum(2,9,second); rRTCCON =0x00; // êPé]R/W } 怎么讀不出實踐時鐘;顯示函數(shù)是對的! 如果知道請發(fā)qioujw@163.com |
|
|
| 免費注冊為維庫電子開發(fā)網(wǎng)會員,參與電子工程師社區(qū)討論,點此進(jìn)入 |
Copyright © 1998-2006 m.58mhw.cn 浙ICP證030469號 |