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

📄 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\多任务模拟系统设计\initial.c
 0000                   .dbfunc e Hardware_Init _Hardware_Init fV
                        .even
 0000           _Hardware_Init::
 0000                   .dbline -1
 0000                   .dbline 23
 0000           ; //***************************************************************
 0000           ; // File Name : Gpio.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 0ED0              xcall _Timer2_Init
 0004                   .dbline 26
 0004           ;     Interrupt_Init();
 0004                   .dbline -2
 0004                   .dbline 27
 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 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           ;       DDRB  &= 0xF0;  //Key1~Key4,GPIO input
 0006 87B3              in R24,0x17
 0008 807F              andi R24,240
 000A 87BB              out 0x17,R24
 000C                   .dbline 38
 000C           ;       PORTB &= 0xF0;  //Key1~Key4,GPIO no pull-up
 000C 88B3              in R24,0x18
 000E 807F              andi R24,240
 0010 88BB              out 0x18,R24
 0012                   .dbline 39
 0012           ;       DDRD  |= 0xF0;  //LED1~LED4,GPIO output
 0012 81B3              in R24,0x11
 0014 806F              ori R24,240
 0016 81BB              out 0x11,R24
 0018                   .dbline 40
 0018           ;       PORTB &= 0x0F;  //LED1~LED4,Gpio output 'L'
 0018 88B3              in R24,0x18
 001A 8F70              andi R24,15
 001C 88BB              out 0x18,R24
 001E                   .dbline -2
 001E                   .dbline 41
 001E           ; }
 001E           L2:
 001E                   .dbline 0 ; func end
 001E 0895              ret
 0020                   .dbend
 0020                   .dbfunc e Timer2_Init _Timer2_Init fV
                        .even
 0020           _Timer2_Init::
 0020                   .dbline -1
 0020                   .dbline 50
 0020           ; 
 0020           ; //***************************************************************
 0020           ; // Function    : Timer_Init
 0020           ; // Input       : none
 0020           ; // Output      : none
 0020           ; // Description : ATmega16 Timer Initialization
 0020           ; //***************************************************************
 0020           ; void Timer2_Init(void)
 0020           ; {
 0020                   .dbline 51
 0020           ;       ASSR  = 0x00;   //Timer2 clocked by sys clk
 0020 2224              clr R2
 0022 22BC              out 0x22,R2
 0024                   .dbline 52
 0024           ;       TCCR2 = 0x47;   //1024 division,8M/1024,CTC Mode
 0024 87E4              ldi R24,71
 0026 85BD              out 0x25,R24
 0028                   .dbline 53
 0028           ;       TCNT2 = 0x00;   //Clear Counter
 0028 24BC              out 0x24,R2
 002A                   .dbline 54
 002A           ;       OCR2  = 78;     //78 * 1024/8M = 10ms 
 002A 8EE4              ldi R24,78
 002C 83BD              out 0x23,R24
 002E                   .dbline 55
 002E           ;       TIMSK |= 0x80;  //Enable OCIE2
 002E 89B7              in R24,0x39
 0030 8068              ori R24,128
 0032 89BF              out 0x39,R24
 0034                   .dbline 56
 0034           ;       TIFR  |= 0x80;  //Clear OCIF2
 0034 88B7              in R24,0x38
 0036 8068              ori R24,128
 0038 88BF              out 0x38,R24
 003A                   .dbline -2
 003A                   .dbline 57
 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 66
 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 67
 003C           ;       SREG |= 0x80;   //Enable Global Interrupt
 003C 7894              bset 7
 003E                   .dbline -2
 003E                   .dbline 68
 003E           ; }
 003E           L4:
 003E                   .dbline 0 ; func end
 003E 0895              ret
 0040                   .dbend

⌨️ 快捷键说明

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