From ffe81b4aa631ae2a32da19cb4ba64cc187b2c036 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sat, 8 Apr 2017 17:13:36 +0200 Subject: compiliert jetzt --- .gitignore | 5 + Fernbedienung.asm | 35 +-- Makefile | 17 ++ tn24def.inc | 673 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 713 insertions(+), 17 deletions(-) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 tn24def.inc diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..22acbed --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +Debug +Release +*.o +*.elf +*.hex diff --git a/Fernbedienung.asm b/Fernbedienung.asm index c0b3ae8..74ea21c 100644 --- a/Fernbedienung.asm +++ b/Fernbedienung.asm @@ -5,22 +5,23 @@ * Author: Erich */ - -.DEF sbuff0 = r0 ; serieller Puffer 0 bis -.DEF sbuff1 = r1 -.DEF sbuff2 = r2 -.DEF sbuff3 = r3 -.DEF sbuff4 = r4 ; 4 -.DEF lastB = r5 ; letzter Zustand von PINB -.DEF lt1p0l = r6 ; letzte Flankenposition PINB0 (Timer 1) low -.DEF lt1p0h = r7 ; dito high -.DEF lt1p1l = r8 ; dito PINB1 low -.DEF lt1p1h = r9 ; dito high -.DEF bcnt0 = r10 ; Bitzähler PINB0 -.DEF bcnt1 = r11 ; Bitzähler PINB1 -.DEF t1moml = r12 ; momentane Position Timer 1 low -.DEF t1momh = r13 ; dito high -.DEF aender = r14 ; Änderungen in PINB +.INCLUDE "tn24def.inc" + +.EQU sbuff0, 0 ; serieller Puffer 0 bis +.EQU sbuff1, 1 +.EQU sbuff2, 2 +.EQU sbuff3, 3 +.EQU sbuff4, 4 ; 4 +.EQU lastB, 5 ; letzter Zustand von PINB +.EQU lt1p0l, 6 ; letzte Flankenposition PINB0 (Timer 1) low +.EQU lt1p0h, 7 ; dito high +.EQU lt1p1l, 8 ; dito PINB1 low +.EQU lt1p1h, 9 ; dito high +.EQU bcnt0, 10 ; Bitzähler PINB0 +.EQU bcnt1, 11 ; Bitzähler PINB1 +.EQU t1moml, 12 ; momentane Position Timer 1 low +.EQU t1momh, 13 ; dito high +.EQU aender, 14 ; Änderungen in PINB rjmp RESET reti @@ -41,7 +42,7 @@ reti RESET: - ldi r16,low(RAMEND) ; Stackpointer initialisieren + ldi r16,lo8(RAMEND) ; Stackpointer initialisieren out SPL,r16 ldi r16,0x80 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7c6c1e7 --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ + +all: Fernbedienung.hex + +install: all + avrdude -c avrispmkII -p t24 -U flash:w:Fernbedienung.hex:i + +check: + avrdude -c avrispmkII -p t24 -U flash:v:Fernbedienung.hex:i + +%.o: %.asm *.inc + avr-as $< -mmcu=attiny24 -o $@ + +%.elf: %.o + avr-ld -o $@ $< + +%.hex: %.elf + avr-objcopy --output-target=ihex $< $@ diff --git a/tn24def.inc b/tn24def.inc new file mode 100644 index 0000000..ba4d286 --- /dev/null +++ b/tn24def.inc @@ -0,0 +1,673 @@ +;***** THIS IS A MACHINE GENERATED FILE - DO NOT EDIT ******************** +;***** Created: 2011-02-09 12:04 ******* Source: ATtiny24.xml ************ +;************************************************************************* +;* A P P L I C A T I O N N O T E F O R T H E A V R F A M I L Y +;* +;* Number : AVR000 +;* File Name : "tn24def.inc" +;* Title : Register/Bit Definitions for the ATtiny24 +;* Date : 2011-02-09 +;* Version : 2.35 +;* Support E-mail : avr@atmel.com +;* Target MCU : ATtiny24 +;* +;* DESCRIPTION +;* When including this file in the assembly program file, all I/O register +;* names and I/O register bit names appearing in the data book can be used. +;* In addition, the six registers forming the three data pointers X, Y and +;* Z have been assigned names XL - ZH. Highest RAM address for Internal +;* SRAM is also defined +;* +;* The Register names are represented by their hexadecimal address. +;* +;* The Register Bit names are represented by their bit number (0-7). +;* +;* Please observe the difference in using the bit names with instructions +;* such as "sbr"/"cbr" (set/clear bit in register) and "sbrs"/"sbrc" +;* (skip if bit in register set/cleared). The following example illustrates +;* this: +;* +;* in r16,PORTB ;read PORTB latch +;* sbr r16,(1<