gavrasm Gerd's AVR assembler version 5.4 (C)2022 by DG4FAC ---------------------------------------------------------- Path: /home/sergeyyarkov/Documents/Applications/attiny2313a_thermostat/ Source file: firmware.asm Hex file: firmware.hex Eeprom file: firmware.eep Compiled: 28.01.2023, 02:47:03 Pass: 2 1: ; 2: ; Project name: thermostat 3: ; Description: Electronic thermostat on AVR Microcontroller 4: ; Source code: https://github.com/sergeyyarkov/attiny2313a_thermostat 5: ; Device: ATtiny2313A 6: ; Device Datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/doc8246.pdf 7: ; Package: SOIC-20W_7.5x12.8mm_P1.27mm 8: ; Assembler: AVR macro assembler 2.2.7 9: ; Clock frequency: 12 MHz External Crystal Oscillator 10: ; Fuses: lfuse: 0x4F, hfuse: 0x9F, efuse: 0xFF, lock: 0xFF 11: ; 12: ; Written by Sergey Yarkov 22.01.2023 13: 14: .INCLUDE "tn2313Adef.inc" -> Warning 009: Include defs not necessary, using internal values! File: /home/sergeyyarkov/Documents/Applications/attiny2313a_thermostat/firmware.asm, Line: 14 Source line: .INCLUDE "tn2313Adef.inc" 15: .LIST 16: 17: .DEF tmp_r_a = r16 18: .DEF COUNTER = r20 19: 20: ;========================================; 21: ; LABELS ; 22: ;========================================; 23: 24: .EQU LED_POWER_PORT = PD6 25: .EQU CLOCK_PIN = PB0 ; ST_CP on 74HC595 26: .EQU LATCH_PIN = PB1 ; SH_CP on 74HC595 27: .EQU DATA_PIN = PB2 ; DS on 74HC595 28: 29: ;========================================; 30: ; CODE SEGMENT ; 31: ;========================================; 32: 33: .CSEG 34: .ORG 0x00 35: 36: ;========================================; 37: ; VECTORS ; 38: ;========================================; 39: 40: 000000 C000 rjmp RESET_vect ; Program start at RESET vector 41: ;reti ; External Interrupt Request 0 / inactive 42: ;reti ; External Interrupt Request 1 / inactive 43: ;reti ; Timer/Counter1 Capture Event / inactive 44: ;reti ; Timer/Counter1 Compare Match A / inactive 45: ;reti ; Timer/Counter1 Overflow / inactive 46: ;reti ; Timer/Counter0 Overflow / inactive 47: ;reti ; USART0, Rx Complete / inactive 48: ;reti ; USART0 Data Register Empty / inactive 49: ;reti ; USART0, Tx Complete / inactive 50: ;reti ; Analog Comparator / inactive 51: ;reti ; Pin Change Interrupt Request 0/ inactive 52: ;reti ; Timer/Counter1 Compare Match B / inactive 53: ;reti ; Timer/Counter0 Compare Match A / inactive 54: ;reti ; Timer/Counter0 Compare Match B / inactive 55: ;reti ; USI Start Condition/ inactive 56: ;reti ; USI Overflow / inactive 57: ;reti ; EEPROM Ready/ inactive 58: ;reti ; Watchdog Timer Overflow / inactive 59: ;reti ; Pin Change Interrupt Request 1 / inactive 60: ;reti ; Pin Change Interrupt Request 2 / inactive 61: 62: RESET_vect: 63: ;========================================; 64: ; INITIALIZE STACK POINTER ; 65: ;========================================; 66: 000001 ED0F ldi tmp_r_a, low(RAMEND) 67: 000002 BF0D out SPL, tmp_r_a 68: 69: MCU_INIT: 70: ;======================================================= 71: ; POWER LED <------------> PD6 ; 72: ; - This LED is used to indicate that device ; 73: ; is working correctly ; 74: ; ; 75: ;======================================================= 76: 000003 D002 rcall INIT_PORTS 77: 78: ;========================================; 79: ; USI IS USED TO COMMUNICATE ; 80: ; WITH SHIFT REGISTER (74HC595N) ; 81: ;========================================; 82: 000004 D006 rcall INIT_USI 83: 84: 000005 C01D rjmp LOOP 85: 86: INIT_PORTS: 87: 000006 E400 ldi r16, (1<