Sven Stöcker
User
; set follow equ to 0/1 to de/activate....
.equ UseBootMode = 0 ; 0 = start bootloader always
.equ UseWDR = 0 ; Watchdog support (2 sec timeout, remember to deactivate WDT in your application if not needed)
.equ UseSaveMCUSR = 0 ; save MCUSR on stack (RAMEND) for access by application (on UseWDR=1 MCUSR must be cleared)
.equ UseE2Write = 1 ; EEPROM write command (have implicit verify)
.equ UseE2Read = 1 ; EEPROM read command
.equ UseCrypt = 0 ; cryptography (crypt.inc)
.equ UseCryptFLASH = 0 ; explicit use of cryptography for writing to FLASH
.equ UseCryptE2 = 0 ; explicit use of cryptography for writing to EEPROM
.equ UseVerify = 1 ; Verify FLASH command (FLASH write/erase have implicit verify, can be deactivated)
.equ UseVersioning = 0 ; Versioning for application software (stored 4/6 bytes before BootStart)
.equ UseSRAM = 0 ; SRAM read/write commands (attention! can be a security risk)
.equ UseSpecialBootVect = 0 ; use a rjmp BootStart at end of FLASH to start bootloader from application code
.equ UseSpecialWrite = 0 ; special function "write_flash" to reprogram FLASH
.equ UseSpecialWriteBoot = 0 ; "write_flash" can write to bootloader section with magic code, only usefull if SPM is allowed by lockbit fuses in BLS
.equ UseSpecialRead = 0 ; special function "read_flash" to read from FLASH
.equ UseSpecialMsg = 0 ; special function to return address and size of BootMsg
; look into AVRootloader.h and M162 test project in folder \test\ for use of special funcs
.equ UseAutobaud = 1 ; Baudrate detection
.equ UseResetDelay = 1 ; Reset the boot delay everytime if any activity is detected on RX pin.
.equ UseUartInvert = 1 ; invert UART levels (for RS232 drivers such as MAX232)
.equ UseRS485 = 0 ; activate RS-485 Data Enable pin
.equ UseRS485Invert = 0 ; inverted logic of RS-485 DE pin (HIHGH for receive, LOW for transmit)
.equ RX_PORT = PORTD ; Receive port and pin
.equ RX = PD0
.equ TX_PORT = PORTD ; Transmit port and pin
.equ TX = PD0
.if UseRS485
.equ DE_PORT = PORTB ; DE enable pin of RS-485
.equ DE = PB2 ; must be only set if RS485 DE is used
.endif
.set XTAL = 16000000 ;
.set BootDelay = XTAL/4 ; about 250ms (don't set to fast to avoid connection problems)
.set BootBaudrate = 115200 ; only used if no Baudrate detection activated, XTAL is than important
.set BootVersion = 6 ; Version 6 (must be not changed)
.set BootCodeSize = 484 ; set to 0, compile and set to value in [.cseg] Used, compile again
; after this step cseg used is +2 bytes greater, ignore it (AVRStudio 4.16 bugfix)
.equ UseBootMode = 0 ; 0 = start bootloader always
.equ UseWDR = 0 ; Watchdog support (2 sec timeout, remember to deactivate WDT in your application if not needed)
.equ UseSaveMCUSR = 0 ; save MCUSR on stack (RAMEND) for access by application (on UseWDR=1 MCUSR must be cleared)
.equ UseE2Write = 1 ; EEPROM write command (have implicit verify)
.equ UseE2Read = 1 ; EEPROM read command
.equ UseCrypt = 0 ; cryptography (crypt.inc)
.equ UseCryptFLASH = 0 ; explicit use of cryptography for writing to FLASH
.equ UseCryptE2 = 0 ; explicit use of cryptography for writing to EEPROM
.equ UseVerify = 1 ; Verify FLASH command (FLASH write/erase have implicit verify, can be deactivated)
.equ UseVersioning = 0 ; Versioning for application software (stored 4/6 bytes before BootStart)
.equ UseSRAM = 0 ; SRAM read/write commands (attention! can be a security risk)
.equ UseSpecialBootVect = 0 ; use a rjmp BootStart at end of FLASH to start bootloader from application code
.equ UseSpecialWrite = 0 ; special function "write_flash" to reprogram FLASH
.equ UseSpecialWriteBoot = 0 ; "write_flash" can write to bootloader section with magic code, only usefull if SPM is allowed by lockbit fuses in BLS
.equ UseSpecialRead = 0 ; special function "read_flash" to read from FLASH
.equ UseSpecialMsg = 0 ; special function to return address and size of BootMsg
; look into AVRootloader.h and M162 test project in folder \test\ for use of special funcs
.equ UseAutobaud = 1 ; Baudrate detection
.equ UseResetDelay = 1 ; Reset the boot delay everytime if any activity is detected on RX pin.
.equ UseUartInvert = 1 ; invert UART levels (for RS232 drivers such as MAX232)
.equ UseRS485 = 0 ; activate RS-485 Data Enable pin
.equ UseRS485Invert = 0 ; inverted logic of RS-485 DE pin (HIHGH for receive, LOW for transmit)
.equ RX_PORT = PORTD ; Receive port and pin
.equ RX = PD0
.equ TX_PORT = PORTD ; Transmit port and pin
.equ TX = PD0
.if UseRS485
.equ DE_PORT = PORTB ; DE enable pin of RS-485
.equ DE = PB2 ; must be only set if RS485 DE is used
.endif
.set XTAL = 16000000 ;
.set BootDelay = XTAL/4 ; about 250ms (don't set to fast to avoid connection problems)
.set BootBaudrate = 115200 ; only used if no Baudrate detection activated, XTAL is than important
.set BootVersion = 6 ; Version 6 (must be not changed)
.set BootCodeSize = 484 ; set to 0, compile and set to value in [.cseg] Used, compile again
; after this step cseg used is +2 bytes greater, ignore it (AVRStudio 4.16 bugfix)