avr: t03 runs in basic mode now, flashing of AtTiny841 finally works!!
This commit is contained in:
@@ -115,6 +115,7 @@
|
||||
reti ; 31: RESERVED reserved
|
||||
|
||||
|
||||
|
||||
devInfoBlock: ; 12 bytes
|
||||
devInfoManufacturer: .db 'A', 'Q', 'U', 'A'
|
||||
devInfoId: .db DEVICEINFO_ID, 0
|
||||
@@ -122,38 +123,8 @@ devInfoVersion: .db DEVICEINFO_VERSION, DEVICEINFO_REVISION ; v
|
||||
firmwareVersion: .db FIRMWARE_VARIANT_TEMP_WINDOW, FIRMWARE_VERSION_MAJOR
|
||||
.db FIRMWARE_VERSION_MINOR, FIRMWARE_VERSION_PATCHLEVEL
|
||||
|
||||
firmwareStart: rjmp main
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; includes
|
||||
|
||||
.include "common/utils.asm"
|
||||
.include "common/utils_wait_fixed.asm"
|
||||
.include "common/utils_copy_from_flash.asm"
|
||||
.include "common/utils_copy_sdram.asm"
|
||||
.include "common/crc8.asm"
|
||||
|
||||
.include "modules/basetimer/main.asm"
|
||||
.include "modules/led_simple/main.asm"
|
||||
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; data in SRAM
|
||||
|
||||
.dseg
|
||||
|
||||
programRamBegin:
|
||||
; nothing for now
|
||||
programRamEnd:
|
||||
|
||||
|
||||
|
||||
.cseg
|
||||
|
||||
|
||||
main:
|
||||
;firmwareStart: rjmp main
|
||||
firmwareStart:
|
||||
cli
|
||||
; setup stack
|
||||
.ifdef SPH ; if SPH is defined
|
||||
@@ -163,35 +134,41 @@ main:
|
||||
ldi r16, Low(RAMEND)
|
||||
out SPL, r16 ; init LSB stack pointer
|
||||
|
||||
#if 0
|
||||
; start by setting all ports as inputs and enable internal pull-up resistors
|
||||
ldi r16, 0xff
|
||||
clr r17
|
||||
.ifdef PORTA
|
||||
out DDRA, r17 ; all input
|
||||
out PORTA, r16 ; enable pull-up on all
|
||||
sts PUEA, r16 ; enable pull-up on all
|
||||
.endif
|
||||
|
||||
.ifdef PORTB
|
||||
out DDRB, r17 ; all input
|
||||
out PORTB, r16 ; enable pull-up on all
|
||||
sts PUEB, r16 ; enable pull-up on all
|
||||
.endif
|
||||
|
||||
.ifdef PORTC
|
||||
out DDRC, r17 ; all input
|
||||
out PORTC, r16 ; enable pull-up on all
|
||||
sts PUEC, r16 ; enable pull-up on all
|
||||
.endif
|
||||
|
||||
#endif
|
||||
|
||||
rcall systemSetSpeed
|
||||
; rcall watchdogOff ; turn off watchdog timer (sometimes it stays on after reboot)
|
||||
|
||||
rcall Utils_Init
|
||||
rcall BaseTimer_Init
|
||||
rcall LedSimple_Init
|
||||
|
||||
rcall Utils_SetupUid
|
||||
|
||||
rcall LedSimple_Init
|
||||
sbi LED_SIMPLE_DDR, LED_SIMPLE_PINNUM ; out
|
||||
sbi LED_SIMPLE_PORT, LED_SIMPLE_PINNUM ; off
|
||||
|
||||
sei
|
||||
main_loop:
|
||||
; do something
|
||||
|
||||
; only modify SE, SM1 and SM0
|
||||
cli
|
||||
in r16, MCUCR
|
||||
@@ -202,6 +179,9 @@ main_loop:
|
||||
out MCUCR, r16
|
||||
sei ; make sure interrupts really are enabled
|
||||
sleep ; sleep, wait for interrupt
|
||||
|
||||
rcall BaseTimer_Run
|
||||
|
||||
rjmp main_loop
|
||||
|
||||
|
||||
@@ -237,3 +217,34 @@ onSystemTimerTick:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; includes
|
||||
|
||||
.include "common/utils.asm"
|
||||
.include "common/utils_wait_fixed.asm"
|
||||
.include "common/utils_copy_from_flash.asm"
|
||||
.include "common/utils_copy_sdram.asm"
|
||||
.include "common/crc8.asm"
|
||||
.include "modules/flash/wait.asm"
|
||||
.include "modules/basetimer/main.asm"
|
||||
.include "modules/led_simple/main.asm"
|
||||
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; data in SRAM
|
||||
|
||||
.dseg
|
||||
|
||||
programRamBegin:
|
||||
; nothing for now
|
||||
flashUid: .byte 4
|
||||
programRamEnd:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user