From 343562f6ca9c08bfe1e9632e9e27580ad8a92fa4 Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Mon, 29 Jun 2026 17:42:40 +0200 Subject: [PATCH] avr: added hw code for ATtiny 861. --- avr/devices/all/0BUILD | 1 + avr/devices/all/hw_tn861.asm | 139 +++++++++++++++++++++++++++++++++++ 2 files changed, 140 insertions(+) create mode 100644 avr/devices/all/hw_tn861.asm diff --git a/avr/devices/all/0BUILD b/avr/devices/all/0BUILD index 72eda573..33b3b872 100644 --- a/avr/devices/all/0BUILD +++ b/avr/devices/all/0BUILD @@ -9,6 +9,7 @@ hw_tn84.asm hw_tn85.asm hw_tn841.asm + hw_tn861.asm hw_m8515.asm includes.asm main.asm diff --git a/avr/devices/all/hw_tn861.asm b/avr/devices/all/hw_tn861.asm new file mode 100644 index 00000000..e6cea14c --- /dev/null +++ b/avr/devices/all/hw_tn861.asm @@ -0,0 +1,139 @@ +; *************************************************************************** +; 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. * +; *************************************************************************** + +; Hardware routine for AtTiny 861 devices + + +.cseg + + +; --------------------------------------------------------------------------- +; @routine systemInitHardware +; + +systemInitHardware: + ; set 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 + ret +; @end + + + +; --------------------------------------------------------------------------- +; @routine systemSetSpeed +; + +systemSetSpeed: +.if clock == 8000000 + ldi r16, (1<