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

📄 app.lis

📁 AVR单片机 C语言程序设计经典实用
💻 LIS
📖 第 1 页 / 共 2 页
字号:
                        .module app.c
                        .area text(rom, con, rel)
 0000                   .dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\字符型LCD显示应用设计\app.c
 0000                   .dbfunc e Hardware_Init _Hardware_Init fV
                        .even
 0000           _Hardware_Init::
 0000                   .dbline -1
 0000                   .dbline 25
 0000           ; //***************************************************************
 0000           ; // File Name : Gpio.c
 0000           ; // Author    : Steaven
 0000           ; // Created   : 2008-06-09
 0000           ; // Modified  : 
 0000           ; // Revision  : V0.0
 0000           ; //***************************************************************
 0000           ; 
 0000           ; #include "iom16v.h" 
 0000           ; #include "DataType.h"
 0000           ; #include "app.h"
 0000           ; 
 0000           ; //local function declaration
 0000           ; void Gpio_Init(void);
 0000           ; void Timer0_Init(void);
 0000           ; void Interrupt_Init(void);
 0000           ; 
 0000           ; //***************************************************************
 0000           ; // Function    : Hardware_Init
 0000           ; // Input       : none
 0000           ; // Output      : none
 0000           ; // Description : ATmega16 Hardware Initialization
 0000           ; //***************************************************************
 0000           ; void Hardware_Init(void)
 0000           ; {
 0000                   .dbline 26
 0000           ;     Gpio_Init();
 0000 02D0              xcall _Gpio_Init
 0002                   .dbline 27
 0002           ;     Timer0_Init();
 0002 0FD0              xcall _Timer0_Init
 0004                   .dbline 28
 0004           ;       Interrupt_Init();
 0004                   .dbline -2
 0004                   .dbline 29
 0004           ; }
 0004           L1:
 0004                   .dbline 0 ; func end
 0004 1BC0              xjmp _Interrupt_Init
 0006                   .dbend
 0006                   .dbfunc e Gpio_Init _Gpio_Init fV
                        .even
 0006           _Gpio_Init::
 0006                   .dbline -1
 0006                   .dbline 38
 0006           ; 
 0006           ; //***************************************************************
 0006           ; // Function    : Gpio_Init
 0006           ; // Input       : none
 0006           ; // Output      : none
 0006           ; // Description : ATmega16 GPIO Initialization
 0006           ; //***************************************************************
 0006           ; void Gpio_Init(void)
 0006           ; {
 0006                   .dbline 39
 0006           ;     DDRA  = 0xFF; //端口A设置为输出
 0006 8FEF              ldi R24,255
 0008 8ABB              out 0x1a,R24
 000A                   .dbline 40
 000A           ;     PORTA = 0x00; //初始化输出0
 000A 2224              clr R2
 000C 2BBA              out 0x1b,R2
 000E                   .dbline 41
 000E           ;     DDRB  = 0x0F; //端口B设置为输出
 000E 8FE0              ldi R24,15
 0010 87BB              out 0x17,R24
 0012                   .dbline 42
 0012           ;     PORTB = 0xF0; //初始化输出0
 0012 80EF              ldi R24,240
 0014 88BB              out 0x18,R24
 0016                   .dbline 43
 0016           ;     DDRC  = 0xFF; //端口C设置为输出
 0016 8FEF              ldi R24,255
 0018 84BB              out 0x14,R24
 001A                   .dbline 44
 001A           ;     PORTC = 0x00; //初始化输出0
 001A 25BA              out 0x15,R2
 001C                   .dbline 45
 001C           ;     DDRD  = 0xFF; //端口D设置为输出
 001C 81BB              out 0x11,R24
 001E                   .dbline 46
 001E           ;     PORTD = 0x00; //初始化输出0
 001E 22BA              out 0x12,R2
 0020                   .dbline -2
 0020                   .dbline 47
 0020           ; }
 0020           L2:
 0020                   .dbline 0 ; func end
 0020 0895              ret
 0022                   .dbend
 0022                   .dbfunc e Timer0_Init _Timer0_Init fV
                        .even
 0022           _Timer0_Init::
 0022                   .dbline -1
 0022                   .dbline 56
 0022           ; 
 0022           ; //***************************************************************
 0022           ; // Function    : Timer0_Init
 0022           ; // Input       : none
 0022           ; // Output      : none
 0022           ; // Description : ATmega16 Timer0 Initialization,10ms Interval
 0022           ; //***************************************************************
 0022           ; void Timer0_Init(void)
 0022           ; {
 0022                   .dbline 57
 0022           ;       TCCR0 = 0x0D;   //1024 division,8M/1024,CTC Mode
 0022 8DE0              ldi R24,13
 0024 83BF              out 0x33,R24
 0026                   .dbline 58
 0026           ;       TCNT0 = 0x00;   //Clear Counter
 0026 2224              clr R2
 0028 22BE              out 0x32,R2
 002A                   .dbline 59
 002A           ;       OCR0  = 78;     //78 * 1024/8M = 10ms 
 002A 8EE4              ldi R24,78
 002C 8CBF              out 0x3c,R24
 002E                   .dbline 60
 002E           ;       TIMSK |= 0x02;  //Enable OCIE0
 002E 89B7              in R24,0x39
 0030 8260              ori R24,2
 0032 89BF              out 0x39,R24
 0034                   .dbline 61
 0034           ;       TIFR  |= 0x02;  //Clear OCIF0
 0034 88B7              in R24,0x38
 0036 8260              ori R24,2
 0038 88BF              out 0x38,R24
 003A                   .dbline -2
 003A                   .dbline 62
 003A           ; }
 003A           L3:
 003A                   .dbline 0 ; func end
 003A 0895              ret
 003C                   .dbend
 003C                   .dbfunc e Interrupt_Init _Interrupt_Init fV
                        .even
 003C           _Interrupt_Init::
 003C                   .dbline -1
 003C                   .dbline 71
 003C           ; 
 003C           ; //***************************************************************
 003C           ; // Function    : Interrupt_Init
 003C           ; // Input       : none
 003C           ; // Output      : none
 003C           ; // Description : ATmega16 Interrupt Initialization
 003C           ; //***************************************************************
 003C           ; void Interrupt_Init(void)
 003C           ; {
 003C                   .dbline 72
 003C           ;       SREG |= 0x80;   //Enable Global Interrupt
 003C 7894              bset 7
 003E                   .dbline -2
 003E                   .dbline 73
 003E           ; }
 003E           L4:
 003E                   .dbline 0 ; func end
 003E 0895              ret
 0040                   .dbend
                        .area data(ram, con, rel)
 0000                   .dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\字符型LCD显示应用设计\app.c
 0000           L6:
 0000                   .blkb 1
                        .area idata
 0000 00                .byte 0
                        .area data(ram, con, rel)
 0001                   .dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\字符型LCD显示应用设计\app.c
                        .area text(rom, con, rel)
 0040                   .dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\字符型LCD显示应用设计\app.c
 0040                   .dbfunc e Get_Key0 _Get_Key0 fc
 0040                   .dbsym s Key_Flag L6 c
                        .even
 0040           _Get_Key0::
 0040                   .dbline -1
 0040                   .dbline 82
 0040           ; 
 0040           ; //***************************************************************
 0040           ; // Function    : Get_Key0/1/2/3
 0040           ; // Input       : none
 0040           ; // Output      : Key Press Status
 0040           ; // Description : Key Press Status Check
 0040           ; //***************************************************************
 0040           ; INT8U Get_Key0(void)
 0040           ; {
 0040                   .dbline 84
 0040           ;       static INT8U Key_Flag = 0;
 0040           ;       if(Key_Flag == 0)
 0040 20900000          lds R2,L6
 0044 2220              tst R2
 0046 31F4              brne L7
 0048                   .dbline 85
 0048           ;       {
 0048                   .dbline 86
 0048           ;               if((PINB & 0x10) == 0x00)
 0048 B499              sbic 0x16,4
 004A 11C0              rjmp L8
 004C                   .dbline 87
 004C           ;               {
 004C                   .dbline 88
 004C           ;                       Key_Flag = 1;
 004C 81E0              ldi R24,1
 004E 80930000          sts L6,R24
 0052                   .dbline 89
 0052           ;               }
 0052                   .dbline 90
 0052           ;       }
 0052 0DC0              xjmp L8
 0054           L7:
 0054                   .dbline 91
 0054           ;       else if(Key_Flag == 1)
 0054 80910000          lds R24,L6
 0058 8130              cpi R24,1
 005A 49F4              brne L11
 005C                   .dbline 92
 005C           ;       {
 005C                   .dbline 93
 005C           ;               if((PINB & 0x10) == 0x10)
 005C 86B3              in R24,0x16
 005E 8071              andi R24,16
 0060 8031              cpi R24,16
 0062 29F4              brne L13
 0064                   .dbline 94
 0064           ;               {
 0064                   .dbline 95
 0064           ;                       Key_Flag = 0;
 0064 2224              clr R2
 0066 20920000          sts L6,R2
 006A                   .dbline 96
 006A           ;                       return(true);
 006A 01E0              ldi R16,1
 006C 01C0              xjmp L5
 006E           L13:
 006E                   .dbline 98
 006E           ;               }
 006E           ;       }
 006E           L11:
 006E           L8:
 006E                   .dbline 99
 006E           ;       return(false);
 006E 0027              clr R16
 0070                   .dbline -2
 0070           L5:
 0070                   .dbline 0 ; func end
 0070 0895              ret
 0072                   .dbend
                        .area data(ram, con, rel)
 0001                   .dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\字符型LCD显示应用设计\app.c
 0001           L16:
 0001                   .blkb 1
                        .area idata
 0001 00                .byte 0
                        .area data(ram, con, rel)
 0002                   .dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\字符型LCD显示应用设计\app.c
                        .area text(rom, con, rel)
 0072                   .dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\字符型LCD显示应用设计\app.c
 0072                   .dbfunc e Get_Key1 _Get_Key1 fc
 0072                   .dbsym s Key_Flag L16 c
                        .even
 0072           _Get_Key1::
 0072                   .dbline -1
 0072                   .dbline 103
 0072           ; }
 0072           ; 

⌨️ 快捷键说明

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