From 9ca3fd9a8c4a66d9fbeae16b17faeb1152013afc Mon Sep 17 00:00:00 2001 From: sergeyyarkov Date: Thu, 8 Jun 2023 22:53:05 +0300 Subject: [PATCH] 1 --- Makefile | 16 ++ build/main.hex | 10 + build/main.lss | 707 +++++++++++++++++++++++++++++++++++++++++++++++++ main.asm | 106 ++++++++ main.hex | 6 + main.lst | 90 +++++++ main.pro | 8 + tn26def.inc | 541 +++++++++++++++++++++++++++++++++++++ 8 files changed, 1484 insertions(+) create mode 100644 Makefile create mode 100644 build/main.hex create mode 100644 build/main.lss create mode 100644 main.asm create mode 100644 main.hex create mode 100644 main.lst create mode 100644 main.pro create mode 100644 tn26def.inc diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..90363e8 --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +SRC_FILE = main +MCU = t26 +PROGRAMMER = usbtiny +BUILD_DIR = build + +all: build_dir + avrasm2 -fI -W+ie $(SRC_FILE).asm -o ./$(BUILD_DIR)/$(SRC_FILE).hex -l ./$(BUILD_DIR)/$(SRC_FILE).lss + +flash: + avrdude -c $(PROGRAMMER) -p $(MCU) -U flash:w:./$(BUILD_DIR)/$(SRC_FILE).hex:i + +clean: + rm -f $(BUILD_DIR)/* + +build_dir: + mkdir -p ${BUILD_DIR} \ No newline at end of file diff --git a/build/main.hex b/build/main.hex new file mode 100644 index 0000000..a3ca65d --- /dev/null +++ b/build/main.hex @@ -0,0 +1,10 @@ +:020000020000FC +:020000000FC02F +:1000040000C01F931FB729B3232739B326FF03C0AA +:1000140000C0CE9B1CD01FBF1F9118950FED0DBFC4 +:1000240000E80ABB00E40BBB00E808B900E20BBF20 +:100034003FEF78940000FECF0F931F931FEF04E669 +:100044000A95F1F71A95D9F71F910F910895F4DFE6 +:100054000F931F9319B300E810271BBB1F910F9137 +:020064000895FD +:00000001FF diff --git a/build/main.lss b/build/main.lss new file mode 100644 index 0000000..1e6df94 --- /dev/null +++ b/build/main.lss @@ -0,0 +1,707 @@ + +AVRASM ver. 2.2.7 main.asm Thu Jun 08 22:45:48 2023 + +main.asm(1): Including file 'tn26def.inc' +main.asm(1): Including file 'tn26def.inc' + + + + ;***** Created: 2011-02-09 12:04 ******* Source: ATtiny26.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 : "tn26def.inc" + ;* Title : Register/Bit Definitions for the ATtiny26 + ;* Date : 2011-02-09 + ;* Version : 2.35 + ;* Support E-mail : avr@atmel.com + ;* Target MCU : ATtiny26 + ;* + ;* 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< Warning 009: Include defs not necessary, using internal values! + File: /home/sergeyyarkov/Documents/Projects/Firmwares/AVR/attiny26l_push-to-toggle/main.asm, Line: 1 + Source line: .INCLUDE "tn26def.inc" + 2: .LIST + 3: + 4: ; **** LABLES **************************************************** + 5: + 6: .EQU LED_PORT = PA7 + 7: .EQU SW_PORT = PA6 + 8: + 9: + 10: ; **** CODE SEGMENT ********************************************** + 11: + 12: .CSEG + 13: + 14: ; **** VECTORS *************************************************** + 15: .ORG 0x00 + 16: + 17: 000000 C005 rjmp RESET_vect + 18: + 19: .ORG $002 + 20: + 21: 000002 C000 rjmp PIN_CHANGE_vect + 22: + 23: PIN_CHANGE_vect: + 24: ; rcall ENABLE_LED + 25: 000003 E800 ldi r16, (1<