2
; Copyright (C) 2013 Milan Kupcevic
4
; You can redistribute and/or modify this file under the
5
; terms of the GNU General Public License version 2, or
6
; (at your option) any later version, as published by
7
; the Free Software Foundation.
9
; This file is distributed in the hope that it will be useful,
10
; but WITHOUT ANY WARRANTY; without even the implied warranty of
11
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
; GNU General Public License for more details.
14
; You should have received a copy of the GNU General Public License
15
; along with this program. If not, see <http://www.gnu.org/licenses/>.
18
; Based on ATtiny4/5/9/10 Datasheet 8127F-AVR-02/2013.
23
.equ SIGNATURE_000 = 0x1e
24
.equ SIGNATURE_001 = 0x8f
25
.equ SIGNATURE_002 = 0x0a
34
; Port B Data Direction Register
45
; Port B Data Register
56
; Port B Pull-up Enable Control Register
63
; Port Control Register
67
; Pin Change Mask Register
74
; Pin Change Interrupt Flag Register
78
; Pin Change Interrupt Control Register
82
; External Interrupt Mask Register
86
; External Interrupt Flag Register
90
; External Interrupt Control Register A
95
; Digital Input Disable Register 0
100
; Analog Comparator Control and Status Register
110
; Input Capture Register 0
114
; Output Compare Register 0 B
118
; Output Compare Register 0 A
126
; Timer/Counter Interrupt Flag Register 0
133
; Timer/Counter Interrupt Mask Register 0
140
; Timer/Counter0 Control Register C
145
; Timer/Counter0 Control Register B
155
; Timer/Counter0 Control Register A
164
; General Timer/Counter Control Register
169
; Watchdog Timer Control and Status Register
179
; Non-Volatile Memory Control and Status Register
183
; Non-Volatile Memory Command Register
192
; Vcc Level Monitoring Control and Status Register
200
; Power Reduction Register
205
; Clock Prescale Register
212
; Clock Main Settings Register
217
; Oscillator Calibration Register
228
; Sleep Mode Control Register
235
; Reset Flag Register
241
; Configuration Change Protection Register
252
; Stack Pointer Register
267
; Indirect address registers
275
; Non-Volatile Memory Lock Bits
276
.equ MAPPED_LOCKBITS_0 = 0x3f00
284
.equ FLASHEND = 0x00ff
285
.equ MAPPED_FLASH_START = 0x4000
286
.equ MAPPED_FLASH_SIZE = 0x0200
287
.equ MAPPED_FLASH_END = 0x41ff
292
.equ SRAM_START = 0x0040
296
.equ MAPPED_CONFIG_0 = 0x3f40
302
.equ MAPPED_CALIB_0 = 0x3f80
305
.equ MAPPED_SIGN_0 = 0x3fc0
306
.equ MAPPED_SIGN_1 = 0x3fc1
307
.equ MAPPED_SIGN_2 = 0x3fc2
310
.equ INT_VECTORS_SIZE = 10
311
.equ INT0addr = 0x0001
312
.equ PCI0addr = 0x0002
313
.equ ICP0addr = 0x0003
314
.equ OVF0addr = 0x0004
315
.equ OC0Aaddr = 0x0005
316
.equ OC0Baddr = 0x0006
317
.equ ACIaddr = 0x0007
318
.equ WDTaddr = 0x0008
319
.equ VLMaddr = 0x0009