diff --git a/avr/devices/n12/n12_boot.asm b/avr/devices/n12/n12_boot.asm index bb1428e..c5fd806 100644 --- a/avr/devices/n12/n12_boot.asm +++ b/avr/devices/n12/n12_boot.asm @@ -6,17 +6,6 @@ ; All definitions and changes should go into this file. ; ; -; AtTiny84 -; -------- -; VCC 1 14 GND -; PB0 2 13 PA0 -; PB1 3 12 PA1 COM-DATA -; /RESET PB3 4 11 PA2 -; KEY1 PB2 5 10 PA3 LED -; COM_ATTN PA7 6 9 PA4 -; PA6 7 8 PA5 -; -------- -; ; *************************************************************************** @@ -65,15 +54,15 @@ .equ COM_DDR_DATA = DDRA .equ COM_PORT_DATA = PORTA .equ COM_PIN_DATA = PINA -.equ COM_PINNUM_DATA = PORTA1 +.equ COM_PINNUM_DATA = PORTA0 .equ COM_DDR_ATTN = DDRA .equ COM_PORT_ATTN = PORTA .equ COM_PIN_ATTN = PINA -.equ COM_PINNUM_ATTN = PORTA7 +.equ COM_PINNUM_ATTN = PORTA1 .equ COM_IRQ_ADDR_ATTN = PCMSK0 -.equ COM_IRQ_BIT_ATTN = 7 ; bit 7 in PCMSK0 +.equ COM_IRQ_BIT_ATTN = 1 ; bit 1 in PCMSK0 .equ COM_IRQ_GIFR_ATTN = PCIF0 .equ COM_IRQ_GIMSK_ATTN = PCIE0 @@ -81,7 +70,7 @@ .equ LED_DDR = DDRA .equ LED_PORT = PORTA .equ LED_PIN = PINA -.equ LED_PINNUM = PORTA3 +.equ LED_PINNUM = PORTA7 ; *************************************************************************** @@ -114,9 +103,11 @@ reti ; USI_OVF -firmwareType: .dw FW_TYPE -firmwareVersion: .dw FW_VERSION -firmwareModules: .dw 0 +devInfoBlock: +devInfoManufacturer: .db 'A', 'Q', 'U', 'A' +devInfoId: .db 'N', 0 +devInfoVersion: .db 11, 0 ; version, revision + firmwareStart: rjmp main ; will be overwritten when flashing @@ -142,6 +133,8 @@ main: .include "modules/com2/packets.asm" .include "common/crc8.asm" .include "common/utils_wait_fixed.asm" +.include "common/utils_copy_from_flash.asm" +.include "common/utils_copy_sdram.asm" .include "modules/flash/bootloader.asm" .include "modules/flash/flash.asm" .include "modules/flash/recv.asm" diff --git a/avr/devices/n12/n12_defs.asm b/avr/devices/n12/n12_defs.asm index 7404c12..4b864db 100644 --- a/avr/devices/n12/n12_defs.asm +++ b/avr/devices/n12/n12_defs.asm @@ -1,5 +1,5 @@ ; *************************************************************************** -; copyright : (C) 2023 by Martin Preuss +; copyright : (C) 2024 by Martin Preuss ; email : martin@libchipcard.de ; ; *************************************************************************** @@ -7,6 +7,21 @@ ; * Please see toplevel file COPYING of that project for license details. * ; *************************************************************************** +; *************************************************************************** +; +; AtTiny84 +; -------- +; VCC 1 14 GND +; [PCINT8] REED_IN1 PB0 2 13 PA0 COM-DATA +; [PCINT9] REED_IN2 PB1 3 12 PA1 COM_ATTN [PCINT1] +; /RESET PB3 4 11 PA2 TWI-SDA +; [KEY1] PB2 5 10 PA3 TWI-SCL +; LED PA7 6 9 PA4 [USCK/SCL] +; [DI/SDA/OC1A] PA6 7 8 PA5 REED_OUT [DO/OC1B] +; -------- +; +; *************************************************************************** + .equ BOOTLOADER_ADDR = 0xd00 diff --git a/avr/devices/n12/n12_main.asm b/avr/devices/n12/n12_main.asm index 1e6047d..8c4e140 100644 --- a/avr/devices/n12/n12_main.asm +++ b/avr/devices/n12/n12_main.asm @@ -223,7 +223,7 @@ ; --------------------------------------------------------------------------- -; Reset and interrupt vectors (will be removed as soon as we can flash data over COM) +; Reset and interrupt vectors ; rjmp main ; Reset vector rjmp BOOTLOADER_ADDR ; Reset vector ; use this for flashed system @@ -249,14 +249,10 @@ reti ; USI_OVF -; remove later -firmwareType: .dw FW_TYPE -firmwareVersion: .dw FW_VERSION -firmwareModules: .dw MODULES_MASK - +devInfoBlock: devInfoManufacturer: .db 'A', 'Q', 'U', 'A' devInfoId: .db 'N', 0 -devInfoVersion: .db 1, 0 ; version, revision +devInfoVersion: .db 12, 0 ; version, revision firmwareStart: rjmp main @@ -266,6 +262,8 @@ firmwareStart: rjmp main .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" #ifdef MODULES_TIMER