From edf5f145013aa28ffbc7f19f874cd489a92f8449 Mon Sep 17 00:00:00 2001 From: rodri Date: Sat, 5 Jun 2021 11:10:23 +0000 Subject: public release. --- asm/dht11/avrdasm | 2 ++ asm/dht11/blink.s | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ asm/dht11/dat.h | 25 +++++++++++++++++++ asm/dht11/link.ld | 34 ++++++++++++++++++++++++++ asm/dht11/makefile | 19 +++++++++++++++ 5 files changed, 151 insertions(+) create mode 100755 asm/dht11/avrdasm create mode 100644 asm/dht11/blink.s create mode 100644 asm/dht11/dat.h create mode 100644 asm/dht11/link.ld create mode 100644 asm/dht11/makefile (limited to 'asm/dht11') diff --git a/asm/dht11/avrdasm b/asm/dht11/avrdasm new file mode 100755 index 0000000..ea0707b --- /dev/null +++ b/asm/dht11/avrdasm @@ -0,0 +1,2 @@ +#!/bin/sh +avr-objdump -D *.elf diff --git a/asm/dht11/blink.s b/asm/dht11/blink.s new file mode 100644 index 0000000..5fe337f --- /dev/null +++ b/asm/dht11/blink.s @@ -0,0 +1,71 @@ +.include "dat.h" + +vectors: + jmp start + jmp badirq ; IRQ0 + jmp badirq ; IRQ1 + jmp badirq ; PCINT0 + jmp badirq ; PCINT1 + jmp badirq ; PCINT2 + jmp badirq ; Watchdog Timeout + jmp badirq ; Timer2 CompareA + jmp badirq ; Timer2 CompareB + jmp badirq ; Timer2 Overflow + jmp badirq ; Timer1 Capture + jmp badirq ; Timer1 CompareA + jmp badirq ; Timer1 CompareB + jmp badirq ; Timer1 Overflow + jmp badirq ; Timer0 CompareA + jmp badirq ; Timer0 CompareB + jmp badirq ; Timer0 Overflow + jmp badirq ; SPI Transfer Complete + jmp badirq ; USART RX Complete + jmp badirq ; USART UDR Empty + jmp badirq ; USART TX Complete + jmp badirq ; ADC Conversion Complete + jmp badirq ; EEPROM Ready + jmp badirq ; Analog Comparator + jmp badirq ; 2-wire Serial + jmp badirq ; SPM Ready + +start: + eor r1, r1 + out SREG, r1 + ldi r28, 0xff + ldi r29, 0x8 + out SPL, r28 + out SPH, r29 + call main +halt: + rjmp halt + +badirq: + jmp vectors + +.globl delayloop +delayloop: + ldi r18, 82 + ldi r19, 43 + ldi r20, 0 +l1: + dec r20 + brne l1 + dec r19 + brne l1 + dec r18 + brne l1 + ret + +.globl main +main: + ldi r16, 1<text + .data : + { + *(.data) + . = ALIGN(2); + _edata = . ; + } >data AT>text + .bss ADDR(.data) + SIZEOF (.data) : AT (ADDR (.bss)) + { + *(.bss) + *(COMMON) + . = ALIGN(2); + } >data + .eeprom : + { + *(.eeprom*) + } >eeprom + _end = .; +} diff --git a/asm/dht11/makefile b/asm/dht11/makefile new file mode 100644 index 0000000..063bd39 --- /dev/null +++ b/asm/dht11/makefile @@ -0,0 +1,19 @@ +AS=avr-as +LD=avr-ld +LDSCRIPT=link.ld + +PORT=/dev/ttyACM0 +TARG=blink + +all: build + +build: + $(AS) -mmcu=atmega328p -c -o $(TARG).o $(TARG).s + $(LD) -T$(LDSCRIPT) -o $(TARG).elf $(TARG).o + avr-objcopy -j .text -j .data -O ihex $(TARG).elf $(TARG).hex + +burn: + avrdude -v -p atmega328p -c arduino -P $(PORT) -b 115200 -D -U flash:w:$(TARG).hex + +clean: + rm -f $(TARG).elf $(TARG).o $(TARG).hex -- cgit v1.2.3