⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ds1302.lis

📁 DS1302
💻 LIS
📖 第 1 页 / 共 5 页
字号:
                        .module DS1302.c
                        .area data(ram, con, rel)
 0000           _WriteAddress::
 0000                   .blkb 2
                        .area idata
 0000 8C88              .byte 140,136
                        .area data(ram, con, rel)
 0002                   .blkb 2
                        .area idata
 0002 8684              .byte 134,132
                        .area data(ram, con, rel)
 0004                   .blkb 2
                        .area idata
 0004 8280              .byte 130,128
                        .area data(ram, con, rel)
 0006                   .blkb 1
                        .area idata
 0006 8A                .byte 138
                        .area data(ram, con, rel)
 0007                   .dbfile E:\biyesheji\SUCCES~1\SENDSE~1\SETPFI~2\程序/ds1302.h
 0007                   .dbsym e WriteAddress _WriteAddress A[7:7]c
 0007           _WriteTime::
 0007                   .blkb 2
                        .area idata
 0007 0705              .byte 7,5
                        .area data(ram, con, rel)
 0009                   .dbfile E:\biyesheji\SUCCES~1\SENDSE~1\SETPFI~2\程序/ds1302.h
 0009                   .blkb 2
                        .area idata
 0009 0213              .byte 2,19
                        .area data(ram, con, rel)
 000B                   .dbfile E:\biyesheji\SUCCES~1\SENDSE~1\SETPFI~2\程序/ds1302.h
 000B                   .blkb 2
                        .area idata
 000B 5030              .byte 'P,48
                        .area data(ram, con, rel)
 000D                   .dbfile E:\biyesheji\SUCCES~1\SENDSE~1\SETPFI~2\程序/ds1302.h
 000D                   .blkb 1
                        .area idata
 000D 00                .byte 0
                        .area data(ram, con, rel)
 000E                   .dbfile E:\biyesheji\SUCCES~1\SENDSE~1\SETPFI~2\程序/ds1302.h
 000E                   .dbsym e WriteTime _WriteTime A[7:7]c
                        .area text(rom, con, rel)
 0000                   .dbfile E:\biyesheji\SUCCES~1\SENDSE~1\SETPFI~2\程序/ds1302.h
 0000                   .dbfunc e DS1302_set _DS1302_set fV
 0000           ;              i -> R16
                        .even
 0000           _DS1302_set::
 0000                   .dbline -1
 0000                   .dbline 49
 0000           ; //ICC-AVR 修改日期: 2007-05-01 15:38:44
 0000           ; //PC3:功能按键
 0000           ; //PC4:移位按键
 0000           ; //PC5:加一按键
 0000           ; //PB0:减一按键
 0000           ; //  CenWenJiao
 0000           ; // Target : M8
 0000           ; // Crystal: 1.0000Mhz
 0000           ; //2007.05.01 21:08:CC 完成时间调整程序
 0000           ; #include <iom8v.h>
 0000           ; #include <macros.h>
 0000           ; #include "ds1302.h"
 0000           ; #include "DELAY.C"
 0000           ; #include "LCD.h"    //eureka
 0000           ; 
 0000           ; /*cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
 0000           ;                              单片机初始化程序
 0000           ; ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc*/
 0000           ; void port_init(void) //设置portb和portc端口
 0000           ; {
 0000           ;  PORTB = 0x01;//PB0 作为减一按键
 0000           ;  DDRB  = 0x00;
 0000           ;  PORTC = 0x38; //m103 output only//PC3; PC4; PC5; 功能,移位,加一
 0000           ;  DDRC  = 0xC7;  
 0000           ;  PORTD = 0x00;
 0000           ;  DDRD  = 0xFF;
 0000           ; }
 0000           ; /*ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
 0000           ;      1302初始化驱动
 0000           ; cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc*/
 0000           ; void init_devices(void)
 0000           ; {
 0000           ;  //CLI(); //disable all interrupts
 0000           ;  port_init();
 0000           ;  DS1302_set();
 0000           ;  //timer1_init();
 0000           ;  MCUCR = 0x00;
 0000           ;  GICR  = 0x00;
 0000           ;  TIMSK = 0x04; 
 0000           ;  //SEI(); //re-enable interrupts
 0000           ; }
 0000           ; /*ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
 0000           ;      LCD1602初始化驱动
 0000           ; cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc*/
 0000           ; void init_devicesl(void)
 0000           ; {
 0000           ;   //CLI(); //disable all interrupts
 0000           ;   LCD_init();
 0000           ;  // DS1302_set();
 0000                   .dbline 50
 0000           ;   MCUCR = 0x00;
 0000 A998              cbi 0x15,1
 0002                   .dbline 51
 0002           ;   GICR  = 0x00;
 0002 A898              cbi 0x15,0
 0004                   .dbline 52
 0004           ;   TIMSK = 0x00; //timer interrupt sources
 0004 0027              clr R16
 0006 02C0              rjmp L5
 0008           L2:
 0008                   .dbline 53
 0008                   .dbline 54
 0008 0000              nop
 000A                   .dbline 55
 000A           L3:
 000A                   .dbline 52
 000A 0395              inc R16
 000C           L5:
 000C                   .dbline 52
 000C 0830              cpi R16,8
 000E E0F3              brlo L2
 0010                   .dbline 56
 0010           ;  // SEI(); //re-enable interrupts
 0010           ; }
 0010           ; /*ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
 0010           ;      基本的显示程序
 0010 A89A              sbi 0x15,0
 0012                   .dbline -2
 0012           L1:
 0012                   .dbline 0 ; func end
 0012 0895              ret
 0014                   .dbsym r i 16 c
 0014                   .dbend
 0014                   .dbfunc e DS1302_Write _DS1302_Write fV
 0014           ;              i -> R20,R21
 0014           ;              x -> R22
                        .even
 0014           _DS1302_Write::
 0014 00D0              rcall push_gset2
 0016 602F              mov R22,R16
 0018                   .dbline -1
 0018                   .dbline 62
 0018           ; cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc*/
 0018           ; void SendDataForDisplay(void)
 0018           ; {
 0018           ;     //DS1302_ReadTime();
 0018           ;     //DataFenli();
 0018           ;   
 0018                   .dbline 65
 0018           ;     LCD_write_string(0,0,"time:");  
 0018           ;     LCD_write_char(6,0,hourth+48);  //时
 0018           ;       LCD_write_char(7,0,hourtl+48);
 0018 A998              cbi 0x15,1
 001A                   .dbline 66
 001A           ;       LCD_write_char(8,0,45);
 001A A29A              sbi 0x14,2
 001C                   .dbline 67
 001C           ;       LCD_write_char(9,0,minuteth+48);  //分
 001C 4427              clr R20
 001E 5527              clr R21
 0020           L7:
 0020                   .dbline 68
 0020           ;       LCD_write_char(10,0,minutetl+48);
 0020                   .dbline 68
 0020 A998              cbi 0x15,1
 0022                   .dbline 69
 0022           ;       LCD_write_char(11,0,45);
 0022 01E0              ldi R16,1
 0024 10E0              ldi R17,0
 0026 9A01              movw R18,R20
 0028 00D0              rcall lsl16
 002A 262E              mov R2,R22
 002C 3324              clr R3
 002E 2022              and R2,R16
 0030 3122              and R3,R17
 0032 2220              tst R2
 0034 11F4              brne X0
 0036 3320              tst R3
 0038 11F0              breq L11
 003A           X0:
 003A                   .dbline 70
 003A           ;       LCD_write_char(12,0,secondth+48);
 003A AA9A              sbi 0x15,2
 003C 01C0              rjmp L12
 003E           L11:
 003E                   .dbline 72
 003E           ;     LCD_write_char(13,0,secondtl+48); //秒
 003E           ;     
 003E AA98              cbi 0x15,2
 0040           L12:
 0040                   .dbline 73
 0040 0000              nop
 0042                   .dbline 74
 0042 A99A              sbi 0x15,1
 0044                   .dbline 75
 0044 0000              nop
 0046                   .dbline 76
 0046           L8:
 0046                   .dbline 67
 0046 4F5F              subi R20,255  ; offset = 1
 0048 5F4F              sbci R21,255
 004A                   .dbline 67
 004A 4830              cpi R20,8
 004C E0E0              ldi R30,0
 004E 5E07              cpc R21,R30
 0050 3CF3              brlt L7
 0052                   .dbline 77
 0052           ;     LCD_write_string(0,1,"data:");
 0052           ;     LCD_write_char(6,1,yearth+48);
 0052           ;       LCD_write_char(7,1,yeartl+48);  //年
 0052           ;       LCD_write_char(8,1,45);
 0052           ;       LCD_write_char(9,1,monthth+48);  //月
 0052 A998              cbi 0x15,1
 0054                   .dbline -2
 0054           L6:
 0054 00D0              rcall pop_gset2
 0056                   .dbline 0 ; func end
 0056 0895              ret
 0058                   .dbsym r i 20 I
 0058                   .dbsym r x 22 c
 0058                   .dbend
 0058                   .dbfunc e DS1302_WriteT _DS1302_WriteT fV
 0058           ;           time -> R20
 0058           ;            ddr -> R22
                        .even
 0058           _DS1302_WriteT::
 0058 00D0              rcall push_gset2
 005A 422F              mov R20,R18
 005C 602F              mov R22,R16
 005E                   .dbline -1
 005E                   .dbline 81
 005E           ;       LCD_write_char(10,1,monthtl+48);
 005E           ;       LCD_write_char(11,1,45);
 005E           ;       LCD_write_char(12,1,dateth+48);  //日
 005E           ;     LCD_write_char(13,1,datetl+48); 
 005E                   .dbline 82
 005E           ;    
 005E D0DF              rcall _DS1302_set
 0060                   .dbline 83
 0060           ;    delay_nus(200);
 0060 062F              mov R16,R22
 0062 D8DF              rcall _DS1302_Write
 0064                   .dbline 84
 0064           ; 
 0064 042F              mov R16,R20
 0066 D6DF              rcall _DS1302_Write
 0068                   .dbline -2
 0068           L13:
 0068 00D0              rcall pop_gset2
 006A                   .dbline 0 ; func end
 006A 0895              ret
 006C                   .dbsym r time 20 c
 006C                   .dbsym r ddr 22 c
 006C                   .dbend
 006C                   .dbfunc e DS1302_Read _DS1302_Read fc
 006C           ;              k -> R20
 006C           ;           temp -> R22
 006C           ;              i -> R10
 006C           ;           addr -> R20
                        .even
 006C           _DS1302_Read::
 006C 00D0              rcall push_gset3
 006E 402F              mov R20,R16
 0070                   .dbline -1
 0070                   .dbline 90
 0070           ; }
 0070           ; /*ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
 0070           ;  显示中调用的闪烁调用程序
 0070           ; cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc*/
 0070           ;  void black(int m,int n)//闪烁
 0070           ;  {
 0070                   .dbline 92
 0070           ;  LCD_write_char(m,n,95);//95为闪烁时"下滑线"的代码
 0070           ;   delay_nus(1000);
 0070 6627              clr R22
 0072                   .dbline 93
 0072           ;  }
 0072 A29A              sbi 0x14,2
 0074                   .dbline 94
 0074           ; /*cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc*/
 0074 A898              cbi 0x15,0
 0076                   .dbline 95
 0076           ;   /*设置分钟,秒,加法子程序*/
 0076 A998              cbi 0x15,1
 0078                   .dbline 96
 0078           ; /*cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc*/
 0078 0000              nop
 007A                   .dbline 97
 007A           ; void PlusForSET(int i)           
 007A 0000              nop
 007C                   .dbline 98
 007C           ;              {    
 007C 0000              nop
 007E                   .dbline 99
 007E           ;               if(WriteTime[i]==0x09)  //writetime[i] 是定义存储写地址的数组
 007E 0000              nop
 0080                   .dbline 100
 0080           ;                       { WriteTime[i]=0x0f;
 0080 A89A              sbi 0x15,0
 0082                   .dbline 101
 0082           ;                         }
 0082 642F              mov R22,R20
 0084                   .dbline 102
 0084           ;                       if(WriteTime[i]==0x19)
 0084 AA24              clr R10
 0086 0EC0              rjmp L18
 0088           L15:
 0088                   .dbline 103
 0088           ;                   {WriteTime[i]=0x1f;
 0088                   .dbline 104
 0088           ;                       } 
 0088 01E0              ldi R16,1
 008A 1A2D              mov R17,R10
 008C 00D0              rcall lsl8
 008E 262E              mov R2,R22
 0090 2022              and R2,R16
 0092 11F0              breq L19
 0094                   .dbline 105
 0094           ;                       if(WriteTime[i]==0x29)
 0094 AA9A              sbi 0x15,2
 0096 01C0              rjmp L20
 0098           L19:
 0098                   .dbline 107
 0098           ;                        {WriteTime[i]=0x2f;
 0098           ;                       } 
 0098 AA98              cbi 0x15,2
 009A           L20:
 009A                   .dbline 108
 009A 0000              nop
 009C                   .dbline 109
 009C 0000              nop

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -