📄 main.lis
字号:
.module main.c
.area text(rom, con, rel)
.even
0000 _FlashLoad::
0000 ; //*****************************************************************************
0000 ; //* BootLoader 3.1 for MegaLoad 3.0
0000 ; //*
0000 ; //* Devices supported at this time
0000 ; //* ATMega8
0000 ; //* ATMega16
0000 ; //* ATMega32
0000 ; //* ATMega64
0000 ; //* ATMega128
0000 ; //* ATMega162
0000 ; //* ATMega169
0000 ; //* ATMega8515
0000 ; //* ATMega8535
0000 ; //* ATMega2313 not tested, please give me feedback!
0000 ; //*
0000 ; //* Version 3.0 Dec 2003
0000 ; //* 1.0 : First Release
0000 ; //* 1.1 : Add auto baud rate, code smaller
0000 ; //* 1.2 : Correct a bug with file larger than 65280 bytes.
0000 ; //* 2.0 : All in one source file that fit in 512 Words
0000 ; //* 3.0 : Add EEprom programming
0000 ; //* Add RS485 half duplex support
0000 ; //* Add LockBit programming
0000 ; //* 3.1 : Correct a problem with interupt vector for M8/16/32/162/8515/8535
0000 ; //* Change some #define to be more clear
0000 ; //*
0000 ; //* Sylvain.Bissonnette@MicroSyl.com
0000 ; //*****************************************************************************
0000 ; //
0000 ; // To setup the bootloader for your project you must
0000 ; // remove the comment below to fit with your hardware
0000 ; // recompile it using ICCAVR setup for bootloader
0000 ; // of 512 word for ONLY flash programming
0000 ; // or 1024 word for flash and eeprom programming
0000 ; //
0000 ; //*****************************************************************************
0000 ; // MCU selection
0000 ; // -->Do the same thing in assembly.s<--
0000 ; //*****************************************************************************
0000 ;
0000 ; #define MEGATYPE 8
0000 ; //#define MEGATYPE 16
0000 ; //#define MEGATYPE 32
0000 ; //#define MEGATYPE 64
0000 ; //#define MEGATYPE 128
0000 ; //#define MEGATYPE 162
0000 ; //#define MEGATYPE 169
0000 ; //#define MEGATYPE 8515
0000 ; //#define MEGATYPE 8535
0000 ; //#define MEGATYPE 2313
0000 ;
0000 ;
0000 ; //*****************************************************************************
0000 ; // Bootload on UART x
0000 ; //*****************************************************************************
0000 ; //#define UART 0
0000 ; //#define UART 1
0000 ;
0000 ; //*****************************************************************************
0000 ; // BaudRate
0000 ; // If you don't specify the baudrate divisor the bootloader
0000 ; // will automaticaly be in AutoBaudRate mode
0000 ; //*****************************************************************************
0000 ; //#define BAUDRATE 87
0000 ; //#define BAUDSETTING (unsigned int)((unsigned long)(fosc)/(16*(unsigned long)(BAUDRATE)))-1
0000 ; //#define BAUD_H (unsigned char)(BAUDSETTING>>8)
0000 ; //#define BAUD_L (unsigned char) BAUDSETTING
0000 ; //*****************************************************************************
0000 ; // Crystal speed
0000 ; // frequancy of your MCU speed
0000 ; // LOW -> Xtal < 8Mhz
0000 ; // HIGH -> Xtal >= 8Mhz
0000 ; //*****************************************************************************
0000 ; //#define LOW
0000 ; #define HIGH
0000 ;
0000 ; //*****************************************************************************
0000 ; // EEprom programming
0000 ; // enable EEprom programing via bootloader
0000 ; // YOU MUST SET TO 1024 WORD THE BOOTLOADER SIZE IF EEPROM
0000 ; // PROGRAMMING IS USE
0000 ; //*****************************************************************************
0000 ; #define EEPROM
0000 ;
0000 ; //*****************************************************************************
0000 ; // LockBit programming
0000 ; // enable LOCKBIT programing via bootloader
0000 ; //*****************************************************************************
0000 ; //#define LOCKBIT
0000 ;
0000 ; //*****************************************************************************
0000 ; // RS485
0000 ; // if you use RS485 half duplex for bootloader
0000 ; // make the appropriate change for RX/TX transceiver switch
0000 ; //*****************************************************************************
0000 ; #define RS485DDR DDRD
0000 ; #define RS485PORT PORTD
0000 ; #define RS485TXE 0x10
0000 ;
0000 ; //*****************************************************************************
0000 ; // HomeNet
0000 ; // Only use for Sylvain Bissonnette personal projects
0000 ; // For normal use don't define HOMENET
0000 ; //*****************************************************************************
0000 ; //#define HOMENET
0000 ;
0000 ;
0000 ; //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
0000 ; //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
0000 ; //!!!!!!!!!!!!!! DO NOT CHANGE ANYTHING BELOW THIS LINE !!!!!!!!!!!!!!!!!!!!!!!
0000 ; //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
0000 ; //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
0000 ; #include <macros.h>
0000 ;
0000 ; #define Tiny2313 'O'
0000 ; #define Tiny13 'P'
0000 ; #define Mega8 'A'
0000 ; #define Mega16 'B'
0000 ; #define Mega32 'E'
0000 ; #define Mega48 'L'
0000 ; #define Mega64 'C'
0000 ; #define Mega88 'M'
0000 ; #define Mega128 'D'
0000 ; #define Mega162 'F'
0000 ; #define Mega163 'J'
0000 ; #define Mega168 'N'
0000 ; #define Mega169 'G'
0000 ; #define Mega323 'K'
0000 ; #define Mega8515 'H'
0000 ; #define Mega8535 'I'
0000 ;
0000 ;
0000 ; #define Flash1k 'g'
0000 ; #define Flash2k 'h'
0000 ; #define Flash4k 'i'
0000 ; #define Flash8k 'l'
0000 ; #define Flash16k 'm'
0000 ; #define Flash32k 'n'
0000 ; #define Flash64k 'o'
0000 ; #define Flash128k 'p'
0000 ; #define Flash256k 'q'
0000 ;
0000 ; #define EEprom64 '.'
0000 ; #define EEprom128 '/'
0000 ; #define EEprom256 '0'
0000 ; #define EEprom512 '1'
0000 ; #define EEprom1024 '2'
0000 ; #define EEprom2048 '3'
0000 ; #define EEprom4096 '4'
0000 ;
0000 ; #define Boot128 'a'
0000 ; #define Boot256 'b'
0000 ; #define Boot512 'c'
0000 ; #define Boot1024 'd'
0000 ; #define Boot2048 'e'
0000 ; #define Boot4096 'f'
0000 ;
0000 ; #define Page32 'Q'
0000 ; #define Page64 'R'
0000 ; #define Page128 'S'
0000 ; #define Page256 'T'
0000 ; #define Page512 'U'
0000 ;
0000 ; #if !(defined MEGATYPE)
0000 ; #error "Processor Type is Undefined"
0000 ; #endif
0000 ;
0000 ; #if (((MEGATYPE == 64) || (MEGATYPE == 128) || (MEGATYPE == 162)) && !(defined UART))
0000 ; #error "UART ch must be defined for this part"
0000 ; #endif
0000 ;
0000 ;
0000 ;
0000 ; #ifdef EEPROM
0000 ; #define BootSize Boot1024
0000 ; #endif
0000 ;
0000 ; #ifndef EEPROM
0000 ; #define BootSize Boot512
0000 ; #endif
0000 ;
0000 ; #if (MEGATYPE == 8)
0000 ; #include <iom8v.h>
0000 ; #define DeviceID Mega8
0000 ; #define FlashSize Flash8k
0000 ; #define PageSize Page64
0000 ; #define EEpromSize EEprom512
0000 ; #define PageByte 64
0000 ; #define NSHIFTPAGE 6
0000 ; #define INTVECREG GICR
0000 ; #define PULLUPPORT PORTD
0000 ; #define PULLUPPIN 0x01
0000 ; #endif
0000 ;
0000 ; #if (MEGATYPE == 16)
0000 ; #include "iom16v.h"
0000 ; #define DeviceID Mega16
0000 ; #define FlashSize Flash16k
0000 ; #define PageSize Page128
0000 ; #define EEpromSize EEprom512
0000 ; #define PageByte 128
0000 ; #define NSHIFTPAGE 7
0000 ; #define INTVECREG GICR
0000 ; #define PULLUPPORT PORTD
0000 ; #define PULLUPPIN 0x01
0000 ; #endif
0000 ;
0000 ; #if (MEGATYPE == 32)
0000 ; #include "iom32v.h"
0000 ; #define DeviceID Mega32
0000 ; #define FlashSize Flash32k
0000 ; #define PageSize Page128
0000 ; #define EEpromSize EEprom1024
0000 ; #define PageByte 128
0000 ; #define NSHIFTPAGE 7
0000 ; #define INTVECREG GICR
0000 ; #define PULLUPPORT PORTD
0000 ; #define PULLUPPIN 0x01
0000 ; #endif
0000 ;
0000 ; #if (MEGATYPE == 64)
0000 ; #include "iom64v.h"
0000 ; #define DeviceID Mega64
0000 ; #define FlashSize Flash64k
0000 ; #define PageSize Page256
0000 ; #define EEpromSize EEprom2048
0000 ; #define PageByte 256
0000 ; #define NSHIFTPAGE 8
0000 ; #define INTVECREG MCUCR
0000 ; #if (UART == 0)
0000 ; #define PULLUPPORT PORTE
0000 ; #define PULLUPPIN 0x01
0000 ; #endif
0000 ;
0000 ; #if (UART == 1)
0000 ; #define PULLUPPORT PORTD
0000 ; #define PULLUPPIN 0x04
0000 ; #endif
0000 ; #endif
0000 ;
0000 ; #if (MEGATYPE == 128)
0000 ; #include "iom128v.h"
0000 ; #define DeviceID Mega128
0000 ; #define FlashSize Flash128k
0000 ; #define PageSize Page256
0000 ; #define EEpromSize EEprom4096
0000 ; #define PageByte 256
0000 ; #define NSHIFTPAGE 8
0000 ; #define INTVECREG MCUCR
0000 ; #define RAMPZ_FLAG
0000 ; #if (UART == 0)
0000 ; #define PULLUPPORT PORTE
0000 ; #define PULLUPPIN 0x01
0000 ; #endif
0000 ;
0000 ; #if (UART == 1)
0000 ; #define PULLUPPORT PORTD
0000 ; #define PULLUPPIN 0x04
0000 ; #endif
0000 ; #endif
0000 ;
0000 ; #if (MEGATYPE == 162)
0000 ; #include "iom162v.h"
0000 ; #define DeviceID Mega162
0000 ; #define FlashSize Flash16k
0000 ; #define PageSize Page128
0000 ; #define EEpromSize EEprom512
0000 ; #define PageByte 128
0000 ; #define NSHIFTPAGE 7
0000 ; #define INTVECREG GICR
0000 ; #if (UART == 0)
0000 ; #define PULLUPPORT PORTD
0000 ; #define PULLUPPIN 0x01
0000 ; #endif
0000 ;
0000 ; #if (UART == 1)
0000 ; #define PULLUPPORT PORTB
0000 ; #define PULLUPPIN 0x04
0000 ; #endif
0000 ; #endif
0000 ;
0000 ; #if (MEGATYPE == 169)
0000 ; #include "iom169v.h"
0000 ; #define DeviceID Mega169
0000 ; #define FlashSize Flash16k
0000 ; #define PageSize Page128
0000 ; #define EEpromSize EEprom512
0000 ; #define PageByte 128
0000 ; #define NSHIFTPAGE 7
0000 ; #define INTVECREG MCUCR
0000 ; #define PULLUPPORT PORTE
0000 ; #define PULLUPPIN 0x01
0000 ; #endif
0000 ;
0000 ; #if (MEGATYPE == 8515)
0000 ; #include "iom8515v.h"
0000 ; #define DeviceID Mega8515
0000 ; #define FlashSize Flash8k
0000 ; #define PageSize Page64
0000 ; #define EEpromSize EEprom512
0000 ; #define PageByte 64
0000 ; #define NSHIFTPAGE 6
0000 ; #define INTVECREG GICR
0000 ; #define PULLUPPORT PORTD
0000 ; #define PULLUPPIN 0x01
0000 ; #endif
0000 ;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -