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

📄 initial.lis

📁 AVR单片机 C语言程序设计经典实用
💻 LIS
字号:
                        .module initial.c
                        .area text(rom, con, rel)
 0000                   .dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\LCD菜单系统设计\initial.c
 0000                   .dbfunc e Hardware_Init _Hardware_Init fV
                        .even
 0000           _Hardware_Init::
 0000                   .dbline -1
 0000                   .dbline 23
 0000           ; //***************************************************************
 0000           ; // File Name : initial.c
 0000           ; // Author    : Steaven
 0000           ; // Created   : 2008-06-09
 0000           ; // Modified  : 
 0000           ; // Revision  : V0.0
 0000           ; //***************************************************************
 0000           ; 
 0000           ; #include "app.h"
 0000           ; 
 0000           ; //local function(s) declaration
 0000           ; void Gpio_Init(void);
 0000           ; void Timer2_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 24
 0000           ;     Gpio_Init();
 0000 02D0              xcall _Gpio_Init
 0002                   .dbline 25
 0002           ;     Timer2_Init();
 0002 0FD0              xcall _Timer2_Init
 0004                   .dbline 26
 0004           ;     Interrupt_Init();
 0004                   .dbline -2
 0004                   .dbline 27
 0004           ; }
 0004           L1:
 0004                   .dbline 0 ; func end
 0004 1CC0              xjmp _Interrupt_Init
 0006                   .dbend
 0006                   .dbfunc e Gpio_Init _Gpio_Init fV
                        .even
 0006           _Gpio_Init::
 0006                   .dbline -1
 0006                   .dbline 36
 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 37
 0006           ;       DDRA  = 0xFF;
 0006 8FEF              ldi R24,255
 0008 8ABB              out 0x1a,R24
 000A                   .dbline 38
 000A           ;       PORTA = 0x00; 
 000A 2224              clr R2
 000C 2BBA              out 0x1b,R2
 000E                   .dbline 39
 000E           ;       DDRB  = 0x0F;
 000E 8FE0              ldi R24,15
 0010 87BB              out 0x17,R24
 0012                   .dbline 40
 0012           ;       PORTB = 0xF0;
 0012 80EF              ldi R24,240
 0014 88BB              out 0x18,R24
 0016                   .dbline 41
 0016           ;       DDRC  = 0xFF;
 0016 8FEF              ldi R24,255
 0018 84BB              out 0x14,R24
 001A                   .dbline 42
 001A           ;       PORTC = 0x00;
 001A 25BA              out 0x15,R2
 001C                   .dbline 43
 001C           ;       DDRD  = 0xFF;
 001C 81BB              out 0x11,R24
 001E                   .dbline 44
 001E           ;       PORTD = 0x00;
 001E 22BA              out 0x12,R2
 0020                   .dbline -2
 0020                   .dbline 45
 0020           ; }
 0020           L2:
 0020                   .dbline 0 ; func end
 0020 0895              ret
 0022                   .dbend
 0022                   .dbfunc e Timer2_Init _Timer2_Init fV
                        .even
 0022           _Timer2_Init::
 0022                   .dbline -1
 0022                   .dbline 54
 0022           ; 
 0022           ; //***************************************************************
 0022           ; // Function    : Timer_Init
 0022           ; // Input       : none
 0022           ; // Output      : none
 0022           ; // Description : ATmega16 Timer Initialization
 0022           ; //***************************************************************
 0022           ; void Timer2_Init(void)
 0022           ; {
 0022                   .dbline 55
 0022           ;       ASSR  = 0x00;   //Timer2 clocked by sys clk
 0022 2224              clr R2
 0024 22BC              out 0x22,R2
 0026                   .dbline 56
 0026           ;       TCCR2 = 0x47;   //1024 division,8M/1024,CTC Mode
 0026 87E4              ldi R24,71
 0028 85BD              out 0x25,R24
 002A                   .dbline 57
 002A           ;       TCNT2 = 0x00;   //Clear Counter
 002A 24BC              out 0x24,R2
 002C                   .dbline 58
 002C           ;       OCR2  = 78;     //78 * 1024/8M = 10ms 
 002C 8EE4              ldi R24,78
 002E 83BD              out 0x23,R24
 0030                   .dbline 59
 0030           ;       TIMSK |= 0x80;  //Enable OCIE2
 0030 89B7              in R24,0x39
 0032 8068              ori R24,128
 0034 89BF              out 0x39,R24
 0036                   .dbline 60
 0036           ;       TIFR  |= 0x80;  //Clear OCIF2
 0036 88B7              in R24,0x38
 0038 8068              ori R24,128
 003A 88BF              out 0x38,R24
 003C                   .dbline -2
 003C                   .dbline 61
 003C           ; }
 003C           L3:
 003C                   .dbline 0 ; func end
 003C 0895              ret
 003E                   .dbend
 003E                   .dbfunc e Interrupt_Init _Interrupt_Init fV
                        .even
 003E           _Interrupt_Init::
 003E                   .dbline -1
 003E                   .dbline 70
 003E           ; 
 003E           ; //***************************************************************
 003E           ; // Function    : Interrupt_Init
 003E           ; // Input       : none
 003E           ; // Output      : none
 003E           ; // Description : ATmega16 Interrupt Initialization
 003E           ; //***************************************************************
 003E           ; void Interrupt_Init(void)
 003E           ; {
 003E                   .dbline 71
 003E           ;       SREG |= 0x80;   //Enable Global Interrupt
 003E 7894              bset 7
 0040                   .dbline -2
 0040                   .dbline 72
 0040           ; }
 0040           L4:
 0040                   .dbline 0 ; func end
 0040 0895              ret
 0042                   .dbend

⌨️ 快捷键说明

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