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

📄 app.lis

📁 AVR单片机C语言程序设计实例精粹
💻 LIS
字号:
                        .module app.c
                        .area text(rom, con, rel)
 0000                   .dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\I2C总线应用设计\app.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 "includes.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 24
 0000           ;       Gpio_Init();
 0000 02D0              xcall _Gpio_Init
 0002                   .dbline 25
 0002           ;     Timer0_Init();
 0002 0CD0              xcall _Timer0_Init
 0004                   .dbline 26
 0004           ;       Interrupt_Init();
 0004                   .dbline -2
 0004                   .dbline 27
 0004           ; }
 0004           L1:
 0004                   .dbline 0 ; func end
 0004 18C0              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  = 0x00; //PortA - Input with internal pull-up
 0006 2224              clr R2
 0008 2ABA              out 0x1a,R2
 000A                   .dbline 38
 000A           ;     PORTA = 0x00; 
 000A 2BBA              out 0x1b,R2
 000C                   .dbline 39
 000C           ;     DDRB  = 0x00; //PortB - Input with internal pull-up
 000C 27BA              out 0x17,R2
 000E                   .dbline 40
 000E           ;     PORTB = 0x00; 
 000E 28BA              out 0x18,R2
 0010                   .dbline 41
 0010           ;     DDRC  = 0x03; //PortC - PC[0:1] Output,others inpupt
 0010 83E0              ldi R24,3
 0012 84BB              out 0x14,R24
 0014                   .dbline 42
 0014           ;     PORTC = 0x00; 
 0014 25BA              out 0x15,R2
 0016                   .dbline 43
 0016           ;     DDRD  = 0x00; //PortD - Input without Output
 0016 21BA              out 0x11,R2
 0018                   .dbline 44
 0018           ;     PORTD = 0x00; 
 0018 22BA              out 0x12,R2
 001A                   .dbline -2
 001A                   .dbline 45
 001A           ; }
 001A           L2:
 001A                   .dbline 0 ; func end
 001A 0895              ret
 001C                   .dbend
 001C                   .dbfunc e Timer0_Init _Timer0_Init fV
                        .even
 001C           _Timer0_Init::
 001C                   .dbline -1
 001C                   .dbline 54
 001C           ; 
 001C           ; //***************************************************************
 001C           ; // Function    : Timer0_Init
 001C           ; // Input       : none
 001C           ; // Output      : none
 001C           ; // Description : ATmega16 Timer0 Initialization,10ms Interval
 001C           ; //***************************************************************
 001C           ; void Timer0_Init(void)
 001C           ; {
 001C                   .dbline 55
 001C           ;       TCCR0 = 0x0D;   //1024 division,8M/1024,CTC Mode
 001C 8DE0              ldi R24,13
 001E 83BF              out 0x33,R24
 0020                   .dbline 56
 0020           ;       TCNT0 = 0x00;   //Clear Counter
 0020 2224              clr R2
 0022 22BE              out 0x32,R2
 0024                   .dbline 57
 0024           ;       OCR0  = 78;     //78 * 1024/8M = 10ms 
 0024 8EE4              ldi R24,78
 0026 8CBF              out 0x3c,R24
 0028                   .dbline 58
 0028           ;       TIMSK |= 0x02;  //Enable OCIE0
 0028 89B7              in R24,0x39
 002A 8260              ori R24,2
 002C 89BF              out 0x39,R24
 002E                   .dbline 59
 002E           ;       TIFR  |= 0x02;  //Clear OCIF0
 002E 88B7              in R24,0x38
 0030 8260              ori R24,2
 0032 88BF              out 0x38,R24
 0034                   .dbline -2
 0034                   .dbline 60
 0034           ; }
 0034           L3:
 0034                   .dbline 0 ; func end
 0034 0895              ret
 0036                   .dbend
 0036                   .dbfunc e Interrupt_Init _Interrupt_Init fV
                        .even
 0036           _Interrupt_Init::
 0036                   .dbline -1
 0036                   .dbline 69
 0036           ; 
 0036           ; //***************************************************************
 0036           ; // Function    : Interrupt_Init
 0036           ; // Input       : none
 0036           ; // Output      : none
 0036           ; // Description : ATmega16 Interrupt Initialization
 0036           ; //***************************************************************
 0036           ; void Interrupt_Init(void)
 0036           ; {
 0036                   .dbline 70
 0036           ;       SREG |= 0x80;   //Enable Global Interrupt
 0036 7894              bset 7
 0038                   .dbline -2
 0038                   .dbline 71
 0038           ; }
 0038           L4:
 0038                   .dbline 0 ; func end
 0038 0895              ret
 003A                   .dbend

⌨️ 快捷键说明

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