From 5e7c01c100e8cc74a90c7e77d831482216aedf67 Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Mon, 27 Apr 2026 00:40:00 +0200 Subject: [PATCH] avr: added e04 and e05. --- avr/devices/0BUILD | 2 + avr/devices/e04/.gitignore | 4 + avr/devices/e04/0BUILD | 18 +++ avr/devices/e04/README | 11 ++ avr/devices/e04/boot/0BUILD | 32 +++++ avr/devices/e04/boot/boot.asm | 155 ++++++++++++++++++++++++ avr/devices/e04/defs.asm | 122 +++++++++++++++++++ avr/devices/e04/main/0BUILD | 34 ++++++ avr/devices/e04/main/main.asm | 207 ++++++++++++++++++++++++++++++++ avr/devices/e04/main/screen.asm | 99 +++++++++++++++ avr/devices/e05/.gitignore | 4 + avr/devices/e05/0BUILD | 18 +++ avr/devices/e05/README | 13 ++ avr/devices/e05/boot/0BUILD | 32 +++++ avr/devices/e05/boot/boot.asm | 155 ++++++++++++++++++++++++ avr/devices/e05/defs.asm | 73 +++++++++++ avr/devices/e05/main/0BUILD | 34 ++++++ avr/devices/e05/main/data.asm | 14 +++ avr/devices/e05/main/main.asm | 204 +++++++++++++++++++++++++++++++ flashnode.sh | 16 +++ 20 files changed, 1247 insertions(+) create mode 100644 avr/devices/e04/.gitignore create mode 100644 avr/devices/e04/0BUILD create mode 100644 avr/devices/e04/README create mode 100644 avr/devices/e04/boot/0BUILD create mode 100644 avr/devices/e04/boot/boot.asm create mode 100644 avr/devices/e04/defs.asm create mode 100644 avr/devices/e04/main/0BUILD create mode 100644 avr/devices/e04/main/main.asm create mode 100644 avr/devices/e04/main/screen.asm create mode 100644 avr/devices/e05/.gitignore create mode 100644 avr/devices/e05/0BUILD create mode 100644 avr/devices/e05/README create mode 100644 avr/devices/e05/boot/0BUILD create mode 100644 avr/devices/e05/boot/boot.asm create mode 100644 avr/devices/e05/defs.asm create mode 100644 avr/devices/e05/main/0BUILD create mode 100644 avr/devices/e05/main/data.asm create mode 100644 avr/devices/e05/main/main.asm diff --git a/avr/devices/0BUILD b/avr/devices/0BUILD index 2b8a75b..4c1a4d3 100644 --- a/avr/devices/0BUILD +++ b/avr/devices/0BUILD @@ -13,6 +13,8 @@ e01 e02 e03 + e04 + e05 n14 n16 n21 diff --git a/avr/devices/e04/.gitignore b/avr/devices/e04/.gitignore new file mode 100644 index 0000000..25dc86f --- /dev/null +++ b/avr/devices/e04/.gitignore @@ -0,0 +1,4 @@ +*.eep.hex +*.obj +n29-enclosure.stl +n29-enclosure-2.stl diff --git a/avr/devices/e04/0BUILD b/avr/devices/e04/0BUILD new file mode 100644 index 0000000..dc4c439 --- /dev/null +++ b/avr/devices/e04/0BUILD @@ -0,0 +1,18 @@ + + + + + + boot + main + + + + defs.asm + README + + + + + + diff --git a/avr/devices/e04/README b/avr/devices/e04/README new file mode 100644 index 0000000..5912c02 --- /dev/null +++ b/avr/devices/e04/README @@ -0,0 +1,11 @@ + +E04 +=== + +- Role: Extension for S06 +- MCU: AtTiny84 +- Connection: S06-internal +- Predecessor: E03 +- Periphery: + - TWI interface + - clock diff --git a/avr/devices/e04/boot/0BUILD b/avr/devices/e04/boot/0BUILD new file mode 100644 index 0000000..91a5fbc --- /dev/null +++ b/avr/devices/e04/boot/0BUILD @@ -0,0 +1,32 @@ + + + + + + + + -I $(builddir) + -I $(srcdir) + -I $(topsrcdir)/avr + -I $(topbuilddir)/avr + + + + + boot.asm + + + + + + + + + + + + + + + + diff --git a/avr/devices/e04/boot/boot.asm b/avr/devices/e04/boot/boot.asm new file mode 100644 index 0000000..9b513eb --- /dev/null +++ b/avr/devices/e04/boot/boot.asm @@ -0,0 +1,155 @@ +; *************************************************************************** +; copyright : (C) 2026 by Martin Preuss +; email : martin@libchipcard.de +; +; *************************************************************************** +; * This file is part of the project "AqHome". * +; * Please see toplevel file COPYING of that project for license details. * +; *************************************************************************** + + +; *************************************************************************** +; Source file for base system node on AtTiny 84 +; +; This is for the maintenance system (i.e. the flash loader). +; +; All definitions and changes should go into this file. +; *************************************************************************** + +.equ clock=1000000 ; Define the clock frequency + +.nolist +.include "include/tn84def.inc" ; Define device ATtiny84 +.list + +.include "version.asm" +.include "../defs.asm" + +.include "common/calls.asm" +.include "common/utils_io.asm" +.include "devices/all/defs.asm" + + +#define COM_ACCEPT_ALL_DEST + + + +; *************************************************************************** +; defines + +; --------------------------------------------------------------------------- +; generic + +.include "common/utils_wait.asm" + + + +; --------------------------------------------------------------------------- +; firmware settings + + + +; --------------------------------------------------------------------------- +; LED + +.equ LED_DDR = DDRA +.equ LED_PORT = PORTA +.equ LED_PIN = PINA +.equ LED_PINNUM = PORTA3 + + +; *************************************************************************** +; code segment + +.cseg +.org 0x0000 + + + +; --------------------------------------------------------------------------- +; Reset and interrupt vectors +; rjmp start ; Reset vector + rjmp main ; Reset vector + reti ; EXT_INT0 + reti ; PCI0 + reti ; PCI1 + reti ; WATCHDOG + reti ; ICP1 + reti ; OC1A + reti ; OC1B + reti ; OVF1 + reti ; OC0A + reti ; OC0B + reti ; OVF0 + reti ; ACI + reti ; ADCC + reti ; ERDY + reti ; USI_STR + reti ; USI_OVF + + +devInfoBlock: ; 12 bytes +devInfoManufacturer: .db 'A', 'Q', 'U', 'A' +devInfoId: .db DEVICEINFO_ID, 0 +devInfoVersion: .db DEVICEINFO_VERSION, DEVICEINFO_REVISION ; version, revision +firmwareVersion: .db FIRMWARE_VARIANT_BOOT, FIRMWARE_VERSION_MAJOR + .db FIRMWARE_VERSION_MINOR, FIRMWARE_VERSION_PATCHLEVEL + +firmwareStart: rjmp main ; will be overwritten when flashing + + + +; *************************************************************************** +; main code + + +.org BOOTLOADER_ADDR + + +main: + rjmp bootLoader ; this routine is in modules/bootloader/main.asm + + + +; *************************************************************************** +; includes + +.include "common/utils_wait_fixed.asm" +.include "common/utils_copy_from_flash.asm" +.include "common/utils_copy_sdram.asm" + +.include "modules/flash/defs.asm" +.include "modules/flash/eeprom.asm" +.include "modules/flash/io.asm" +.include "modules/flash/io_com2w.asm" +.include "modules/flash/flash1p.asm" +.include "modules/flash/flashxp.asm" +.include "modules/flash/flashprocess.asm" +.include "modules/flash/wait.asm" +.include "modules/bootloader/main.asm" +.include "modules/network/msg/defs.asm" +.include "modules/network/msg/crc.asm" + +;.include "common/debug.asm" + + + +systemSetSpeed: +.if clock == 8000000 + ldi r16, (1< + + + + + + + -I $(builddir) + -I $(srcdir) + -I $(topsrcdir)/avr + -I $(topbuilddir)/avr + + + + + main.asm + + + + + + + + + + + + screen.asm + + + + + + diff --git a/avr/devices/e04/main/main.asm b/avr/devices/e04/main/main.asm new file mode 100644 index 0000000..e174407 --- /dev/null +++ b/avr/devices/e04/main/main.asm @@ -0,0 +1,207 @@ +; *************************************************************************** +; copyright : (C) 2026 by Martin Preuss +; email : martin@libchipcard.de +; +; *************************************************************************** +; * This file is part of the project "AqHome". * +; * Please see toplevel file COPYING of that project for license details. * +; *************************************************************************** + + + + +; *************************************************************************** +; Source file for temperature sensor node on AtTiny 84 +; +; This is for the full system (i.e. not the boot loader). +; +; All definitions and changes should go into this file. +; +; +; *************************************************************************** + + +.equ clock=1000000 ; Define the clock frequency +;.equ clock=8000000 ; Define the clock frequency + + + +.nolist +.include "include/tn84def.inc" ; Define device ATtiny84 +.list + +.include "../defs.asm" + +.include "version.asm" +.include "devices/all/defs.asm" +.include "common/calls.asm" +.include "common/utils_io.asm" +.include "common/utils_wait.asm" + + + +; *************************************************************************** +; defines + +; --------------------------------------------------------------------------- +; generic + +.equ NET_BUFFERS_NUM = 6 +.equ NET_MSGNUMINBUF_SIZE = 8 ; max buffer nums in ringbuffer (global incoming) +.equ NET_IFACE_OUTMSGBUF_SIZE = 8 ; max buffer nums in ringbuffer (per interface outbound) + + + + +; --------------------------------------------------------------------------- +; firmware settings including list of modules used + +; #define MODULES_TIMER +#define MODULES_CLOCK +#define MODULES_LED_SIMPLE +#define MODULES_NETWORK +#define MODULES_COM2W +#define MODULES_TWI_MASTER +#define MODULES_LCD +#define LCD_MINIMAL_FONT +#define MODULES_DS1307 + +#define APPS_NETWORK +#define APPS_STATS + + + +; --------------------------------------------------------------------------- +; defines for values + +; none + + + +; *************************************************************************** +; code segment + +.cseg +.org 000000 + + + +; --------------------------------------------------------------------------- +; Reset and interrupt vectors (will be removed as soon as we can flash data over COM) + +; rjmp main ; Reset vector + rjmp BOOTLOADER_ADDR ; Reset vector ; use this for flashed system + reti ; EXT_INT0 + rjmp com2wPcintIsr ; PCI0 + reti ; PCI1 + reti ; WATCHDOG + reti ; ICP1 + reti ; OC1A + reti ; OC1B + reti ; OVF1 + rjmp baseTimerIrqOC0A ; OC0A + reti ; OC0B + reti ; OVF0 + reti ; ACI + reti ; ADCC + reti ; ERDY + reti ; USI_STR + reti ; USI_OVF + + +devInfoBlock: ; 12 bytes +devInfoManufacturer: .db 'A', 'Q', 'U', 'A' +devInfoId: .db DEVICEINFO_ID, 0 +devInfoVersion: .db DEVICEINFO_VERSION, DEVICEINFO_REVISION ; version, revision +firmwareVersion: .db FIRMWARE_VARIANT_TEMP_WINDOW, FIRMWARE_VERSION_MAJOR + .db FIRMWARE_VERSION_MINOR, FIRMWARE_VERSION_PATCHLEVEL + + + +; --------------------------------------------------------------------------- +; @routine firmwareStart @global + +firmwareStart: + rjmp main +; @end + + + +; --------------------------------------------------------------------------- +; @routine onSystemStart + +onSystemStart: + rcall ScreenPrintErrors + ret +; @end + + + +; --------------------------------------------------------------------------- +; @routine onMessageReceived +; +; Called on every message received + +onMessageReceived: + clc + ret +; @end + + + +; --------------------------------------------------------------------------- +; @routine onEvery100ms +; +; Called every 100ms. Add your routine calls here. No arguments, no results. + +onEvery100ms: +onEverySecond: +onEveryHour: +onEveryDay: + ret +; @end + + +onEveryMinute: + rcall ScreenPrintErrors + + + +; --------------------------------------------------------------------------- +; @routine onEveryLoop +; +; Called on every loop (i.e. after awakening from sleep). +; +onEveryLoop: + ret +; @end + + + + + +; *************************************************************************** +; includes + +.include "devices/all/hw_tn84.asm" +.include "devices/all/includes.asm" + +.include "common/debug.asm" +;.include "modules/network/msg/debug-w.asm" + +.include "screen.asm" + + + +; --------------------------------------------------------------------------- +; defines for network interface + +.equ netInterfaceData = com2w_iface + + + +deviceCodeEnd: + .if deviceCodeEnd >= BOOTLOADER_ADDR + .warning "Code reaches into boot loader!" + .endif + diff --git a/avr/devices/e04/main/screen.asm b/avr/devices/e04/main/screen.asm new file mode 100644 index 0000000..9f62359 --- /dev/null +++ b/avr/devices/e04/main/screen.asm @@ -0,0 +1,99 @@ +; *************************************************************************** +; copyright : (C) 2025 by Martin Preuss +; email : martin@libchipcard.de +; +; *************************************************************************** +; * This file is part of the project "AqHome". * +; * Please see toplevel file COPYING of that project for license details. * +; *************************************************************************** + + + +.cseg + + + +ScreenPrintErrors: + ldi yl, LOW(netInterfaceData) + ldi yh, HIGH(netInterfaceData) + + ldi r16, 0 + rcall LCD_Fill + + ldi r18, 0 + ldi r19, 0 + rcall LCD_SetCursor + ldi zl, LOW(screenTxtSystem) + ldi zh, HIGH(screenTxtSystem) + rcall LCD_PrintFromFlash + + ldi r18, 0 + ldi r19, 2 + rcall LCD_SetCursor + ldi zl, LOW(screenTxtPacketsIn) + ldi zh, HIGH(screenTxtPacketsIn) + rcall LCD_PrintFromFlash + ldi r18, 64 + ldi r19, 2 + rcall LCD_SetCursor + ldd r18, Y+NET_IFACE_OFFS_PACKETSIN_LOW + ldd r19, Y+NET_IFACE_OFFS_PACKETSIN_HIGH + rcall LCD_PrintHexWord + + ldi r18, 0 + ldi r19, 3 + rcall LCD_SetCursor + ldi zl, LOW(screenTxtPacketsOut) + ldi zh, HIGH(screenTxtPacketsOut) + rcall LCD_PrintFromFlash + ldi r18, 64 + ldi r19, 3 + rcall LCD_SetCursor + ldd r18, Y+NET_IFACE_OFFS_PACKETSOUT_LOW + ldd r19, Y+NET_IFACE_OFFS_PACKETSOUT_HIGH + rcall LCD_PrintHexWord + + ldi r18, 0 + ldi r19, 4 + rcall LCD_SetCursor + ldi zl, LOW(screenTxtEContent) + ldi zh, HIGH(screenTxtEContent) + rcall LCD_PrintFromFlash + ldi r18, 64 + ldi r19, 4 + rcall LCD_SetCursor + ldd r18, Y+NET_IFACE_OFFS_ERR_CONTENT_LOW + ldd r19, Y+NET_IFACE_OFFS_ERR_CONTENT_HIGH + rcall LCD_PrintHexWord + + ldi r18, 0 + ldi r19, 5 + rcall LCD_SetCursor + ldi zl, LOW(screenTxtEMsgSize) + ldi zh, HIGH(screenTxtEMsgSize) + rcall LCD_PrintFromFlash + ldi r18, 64 + ldi r19, 5 + rcall LCD_SetCursor + ldd r18, Y+NET_IFACE_OFFS_ERR_MSGSIZE_LOW + ldd r19, Y+NET_IFACE_OFFS_ERR_MSGSIZE_HIGH + rcall LCD_PrintHexWord + + ret +; @end + + +screenTxtSystem: .db "AqHOME %YEAR%/%MONTH%/%DAY%-%HOUR%:%MINUTE%", 0 + +screenTxtPacketsIn: + .db "In:", 0 + +screenTxtPacketsOut: + .db "Out:", 0, 0 + +screenTxtEContent: + .db "eCRC:", 0 + +screenTxtEMsgSize: + .db "eSize:", 0, 0 + diff --git a/avr/devices/e05/.gitignore b/avr/devices/e05/.gitignore new file mode 100644 index 0000000..25dc86f --- /dev/null +++ b/avr/devices/e05/.gitignore @@ -0,0 +1,4 @@ +*.eep.hex +*.obj +n29-enclosure.stl +n29-enclosure-2.stl diff --git a/avr/devices/e05/0BUILD b/avr/devices/e05/0BUILD new file mode 100644 index 0000000..dc4c439 --- /dev/null +++ b/avr/devices/e05/0BUILD @@ -0,0 +1,18 @@ + + + + + + boot + main + + + + defs.asm + README + + + + + + diff --git a/avr/devices/e05/README b/avr/devices/e05/README new file mode 100644 index 0000000..645a5ac --- /dev/null +++ b/avr/devices/e05/README @@ -0,0 +1,13 @@ + +E05 +=== + +- Role: Extension for S06 +- MCU: AtTiny84 +- Connection: S06-internal +- Predecessor: +- Periphery: + - SPI interface + - RAM + - EEPROM + diff --git a/avr/devices/e05/boot/0BUILD b/avr/devices/e05/boot/0BUILD new file mode 100644 index 0000000..3b75a26 --- /dev/null +++ b/avr/devices/e05/boot/0BUILD @@ -0,0 +1,32 @@ + + + + + + + + -I $(builddir) + -I $(srcdir) + -I $(topsrcdir)/avr + -I $(topbuilddir)/avr + + + + + boot.asm + + + + + + + + + + + + + + + + diff --git a/avr/devices/e05/boot/boot.asm b/avr/devices/e05/boot/boot.asm new file mode 100644 index 0000000..9b513eb --- /dev/null +++ b/avr/devices/e05/boot/boot.asm @@ -0,0 +1,155 @@ +; *************************************************************************** +; copyright : (C) 2026 by Martin Preuss +; email : martin@libchipcard.de +; +; *************************************************************************** +; * This file is part of the project "AqHome". * +; * Please see toplevel file COPYING of that project for license details. * +; *************************************************************************** + + +; *************************************************************************** +; Source file for base system node on AtTiny 84 +; +; This is for the maintenance system (i.e. the flash loader). +; +; All definitions and changes should go into this file. +; *************************************************************************** + +.equ clock=1000000 ; Define the clock frequency + +.nolist +.include "include/tn84def.inc" ; Define device ATtiny84 +.list + +.include "version.asm" +.include "../defs.asm" + +.include "common/calls.asm" +.include "common/utils_io.asm" +.include "devices/all/defs.asm" + + +#define COM_ACCEPT_ALL_DEST + + + +; *************************************************************************** +; defines + +; --------------------------------------------------------------------------- +; generic + +.include "common/utils_wait.asm" + + + +; --------------------------------------------------------------------------- +; firmware settings + + + +; --------------------------------------------------------------------------- +; LED + +.equ LED_DDR = DDRA +.equ LED_PORT = PORTA +.equ LED_PIN = PINA +.equ LED_PINNUM = PORTA3 + + +; *************************************************************************** +; code segment + +.cseg +.org 0x0000 + + + +; --------------------------------------------------------------------------- +; Reset and interrupt vectors +; rjmp start ; Reset vector + rjmp main ; Reset vector + reti ; EXT_INT0 + reti ; PCI0 + reti ; PCI1 + reti ; WATCHDOG + reti ; ICP1 + reti ; OC1A + reti ; OC1B + reti ; OVF1 + reti ; OC0A + reti ; OC0B + reti ; OVF0 + reti ; ACI + reti ; ADCC + reti ; ERDY + reti ; USI_STR + reti ; USI_OVF + + +devInfoBlock: ; 12 bytes +devInfoManufacturer: .db 'A', 'Q', 'U', 'A' +devInfoId: .db DEVICEINFO_ID, 0 +devInfoVersion: .db DEVICEINFO_VERSION, DEVICEINFO_REVISION ; version, revision +firmwareVersion: .db FIRMWARE_VARIANT_BOOT, FIRMWARE_VERSION_MAJOR + .db FIRMWARE_VERSION_MINOR, FIRMWARE_VERSION_PATCHLEVEL + +firmwareStart: rjmp main ; will be overwritten when flashing + + + +; *************************************************************************** +; main code + + +.org BOOTLOADER_ADDR + + +main: + rjmp bootLoader ; this routine is in modules/bootloader/main.asm + + + +; *************************************************************************** +; includes + +.include "common/utils_wait_fixed.asm" +.include "common/utils_copy_from_flash.asm" +.include "common/utils_copy_sdram.asm" + +.include "modules/flash/defs.asm" +.include "modules/flash/eeprom.asm" +.include "modules/flash/io.asm" +.include "modules/flash/io_com2w.asm" +.include "modules/flash/flash1p.asm" +.include "modules/flash/flashxp.asm" +.include "modules/flash/flashprocess.asm" +.include "modules/flash/wait.asm" +.include "modules/bootloader/main.asm" +.include "modules/network/msg/defs.asm" +.include "modules/network/msg/crc.asm" + +;.include "common/debug.asm" + + + +systemSetSpeed: +.if clock == 8000000 + ldi r16, (1< + + + + + + + -I $(builddir) + -I $(srcdir) + -I $(topsrcdir)/avr + -I $(topbuilddir)/avr + + + + + main.asm + + + + + + + + + + + + data.asm + + + + + + diff --git a/avr/devices/e05/main/data.asm b/avr/devices/e05/main/data.asm new file mode 100644 index 0000000..31ccc2f --- /dev/null +++ b/avr/devices/e05/main/data.asm @@ -0,0 +1,14 @@ +; *************************************************************************** +; copyright : (C) 2025 by Martin Preuss +; email : martin@libchipcard.de +; +; *************************************************************************** +; * This file is part of the project "AqHome". * +; * Please see toplevel file COPYING of that project for license details. * +; *************************************************************************** + + + +.dseg + + diff --git a/avr/devices/e05/main/main.asm b/avr/devices/e05/main/main.asm new file mode 100644 index 0000000..dddb454 --- /dev/null +++ b/avr/devices/e05/main/main.asm @@ -0,0 +1,204 @@ +; *************************************************************************** +; copyright : (C) 2026 by Martin Preuss +; email : martin@libchipcard.de +; +; *************************************************************************** +; * This file is part of the project "AqHome". * +; * Please see toplevel file COPYING of that project for license details. * +; *************************************************************************** + + + + +; *************************************************************************** +; Source file for temperature sensor node on AtTiny 84 +; +; This is for the full system (i.e. not the boot loader). +; +; All definitions and changes should go into this file. +; +; +; *************************************************************************** + + +.equ clock=1000000 ; Define the clock frequency +;.equ clock=8000000 ; Define the clock frequency + + + +.nolist +.include "include/tn84def.inc" ; Define device ATtiny84 +.list + +.include "../defs.asm" +.include "./data.asm" + +.include "version.asm" +.include "devices/all/defs.asm" +.include "common/calls.asm" +.include "common/utils_io.asm" +.include "common/utils_wait.asm" + + + +; *************************************************************************** +; defines + +; --------------------------------------------------------------------------- +; generic + +.equ NET_BUFFERS_NUM = 6 +.equ NET_MSGNUMINBUF_SIZE = 8 ; max buffer nums in ringbuffer (global incoming) +.equ NET_IFACE_OUTMSGBUF_SIZE = 8 ; max buffer nums in ringbuffer (per interface outbound) + + + + +; --------------------------------------------------------------------------- +; firmware settings including list of modules used + +; #define MODULES_TIMER +#define MODULES_CLOCK +#define MODULES_LED_SIMPLE +;#define MODULES_LED_ACTIVITY +#define MODULES_NETWORK +#define MODULES_COM2W +;#define MODULES_TWI_MASTER +;#define MODULES_LCD +;#define LCD_MINIMAL_FONT +;#define MODULES_DS3231 + +#define APPS_NETWORK +#define APPS_STATS + + + +; --------------------------------------------------------------------------- +; defines for values + + + + + +; *************************************************************************** +; code segment + +.cseg +.org 000000 + + + +; --------------------------------------------------------------------------- +; Reset and interrupt vectors (will be removed as soon as we can flash data over COM) + +; rjmp main ; Reset vector + rjmp BOOTLOADER_ADDR ; Reset vector ; use this for flashed system + reti ; EXT_INT0 + rjmp com2wPcintIsr ; PCI0 + reti ; PCI1 + reti ; WATCHDOG + reti ; ICP1 + reti ; OC1A + reti ; OC1B + reti ; OVF1 + rjmp baseTimerIrqOC0A ; OC0A + reti ; OC0B + reti ; OVF0 + reti ; ACI + reti ; ADCC + reti ; ERDY + reti ; USI_STR + reti ; USI_OVF + + +devInfoBlock: ; 12 bytes +devInfoManufacturer: .db 'A', 'Q', 'U', 'A' +devInfoId: .db DEVICEINFO_ID, 0 +devInfoVersion: .db DEVICEINFO_VERSION, DEVICEINFO_REVISION ; version, revision +firmwareVersion: .db FIRMWARE_VARIANT_TEMP_WINDOW, FIRMWARE_VERSION_MAJOR + .db FIRMWARE_VERSION_MINOR, FIRMWARE_VERSION_PATCHLEVEL + + + +; --------------------------------------------------------------------------- +; @routine firmwareStart @global + +firmwareStart: + rjmp main +; @end + + + +; --------------------------------------------------------------------------- +; @routine onSystemStart + +onSystemStart: + ret +; @end + + + +; --------------------------------------------------------------------------- +; @routine onMessageReceived +; +; Called on every message received + +onMessageReceived: + clc + ret +; @end + + + +; --------------------------------------------------------------------------- +; @routine onEvery100ms +; +; Called every 100ms. Add your routine calls here. No arguments, no results. + +onEvery100ms: +onEverySecond: +onEveryMinute: +onEveryHour: +onEveryDay: + ret +; @end + + + +; --------------------------------------------------------------------------- +; @routine onEveryLoop +; +; Called on every loop (i.e. after awakening from sleep). +; +onEveryLoop: + ret +; @end + + + + + +; *************************************************************************** +; includes + +.include "devices/all/hw_tn84.asm" +.include "devices/all/includes.asm" + +;.include "common/debug.asm" +;.include "modules/network/msg/debug-w.asm" + + + + +; --------------------------------------------------------------------------- +; defines for network interface + +.equ netInterfaceData = com2w_iface + + + +deviceCodeEnd: + .if deviceCodeEnd >= BOOTLOADER_ADDR + .warning "Code reaches into boot loader!" + .endif + diff --git a/flashnode.sh b/flashnode.sh index 0a99458..8dff09f 100755 --- a/flashnode.sh +++ b/flashnode.sh @@ -153,6 +153,22 @@ case $NODE in FILE_ARG="-U flash:w:./0-build/avr/devices/e03/boot/e03_boot.hex" ;; + e04) + DEVICE_ARG="-p t84" + HFUSE_ARG="-U hfuse:w:0xD7:m" + LFUSE_ARG="" + EFUSE_ARG="-U efuse:w:0xFE:m" + FILE_ARG="-U flash:w:./0-build/avr/devices/e04/boot/e04_boot.hex" + ;; + + e05) + DEVICE_ARG="-p t84" + HFUSE_ARG="-U hfuse:w:0xD7:m" + LFUSE_ARG="" + EFUSE_ARG="-U efuse:w:0xFE:m" + FILE_ARG="-U flash:w:./0-build/avr/devices/e05/boot/e05_boot.hex" + ;; + *) echo "Unknown node $NODE". exit 1