avr: adapted boot firmware to latest changes (mainly switch to uart_bitbang).

This commit is contained in:
Martin Preuss
2024-10-28 23:42:30 +01:00
parent 061438b7c8
commit 9c35e7a006
2 changed files with 27 additions and 6 deletions

View File

@@ -69,14 +69,33 @@ bootLoader:
ldi r16, Low(RAMEND)
out SPL, r16 ; init LSB stack pointer
; 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
.endif
.ifdef PORTB
out DDRB, r17 ; all input
out PORTB, r16 ; enable pull-up on all
.endif
.ifdef PORTC
out DDRC, r17 ; all input
out PORTC, r16 ; enable pull-up on all
.endif
; rcall watchdogOff ; turn off watchdog timer (sometimes it stays on after reboot)
; setup pins and interrupts
cbi COM_TXD_DATA, COM_TXD_PIN ; disable internal pullup for DATA
cbi COM_TXD_DDR, COM_TXD_PIN ; set DATA port as input
cbi COM_DATA_DDR, COM_DATA_PIN ; set TXD port as input
cbi COM_DATA_OUTPUT, COM_DATA_PIN ; disable internal pullup for TXD
cbi COM_ATTN_OUTPUT, COM_ATTN_PIN ; disable internal pullup for ATTN
cbi COM_ATTN_DDR, COM_ATTN_PIN ; set ATTN port as input
cbi COM_ATTN_OUTPUT, COM_ATTN_PIN ; disable internal pullup for ATTN
sbi LED_DDR, LED_PINNUM ; out
cbi LED_PORT, LED_PINNUM ; on

View File

@@ -122,6 +122,8 @@ flashWaitForSpecificMessage_received: ; R16 contains message type
; REGS: R24 (R22)
flashWaitForAttnState1ms:
cbi COM_ATTN_DDR, COM_ATTN_PIN ; set ATTN port as input
cbi COM_ATTN_OUTPUT, COM_ATTN_PIN ; disable internal pullup for ATTN
ldi r24, 100
flashWaitForAttnState1ms_loop:
push r17