Subversion Repositories Kolibri OS

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
6400 punk_joker 1
;***** THIS IS A MACHINE GENERATED FILE - DO NOT EDIT ********************
2
;***** Created: 2005-01-11 10:31 ******* Source: ATmega325.xml ***********
3
;*************************************************************************
4
;* 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
5
;*
6
;* Number            : AVR000
7
;* File Name         : "m325def.inc"
8
;* Title             : Register/Bit Definitions for the ATmega325
9
;* Date              : 2005-01-11
10
;* Version           : 2.14
11
;* Support E-mail    : avr@atmel.com
12
;* Target MCU        : ATmega325
13
;*
14
;* DESCRIPTION
15
;* When including this file in the assembly program file, all I/O register
16
;* names and I/O register bit names appearing in the data book can be used.
17
;* In addition, the six registers forming the three data pointers X, Y and
18
;* Z have been assigned names XL - ZH. Highest RAM address for Internal
19
;* SRAM is also defined
20
;*
21
;* The Register names are represented by their hexadecimal address.
22
;*
23
;* The Register Bit names are represented by their bit number (0-7).
24
;*
25
;* Please observe the difference in using the bit names with instructions
26
;* such as "sbr"/"cbr" (set/clear bit in register) and "sbrs"/"sbrc"
27
;* (skip if bit in register set/cleared). The following example illustrates
28
;* this:
29
;*
30
;* in    r16,PORTB             ;read PORTB latch
31
;* sbr   r16,(1<
32
;* out   PORTB,r16             ;output to PORTB
33
;*
34
;* in    r16,TIFR              ;read the Timer Interrupt Flag Register
35
;* sbrc  r16,TOV0              ;test the overflow flag (use bit#)
36
;* rjmp  TOV0_is_set           ;jump if set
37
;* ...                         ;otherwise do something else
38
;*************************************************************************
39
 
40
#ifndef _M325DEF_INC_
41
#define _M325DEF_INC_
42
 
43
 
44
#pragma partinc 0
45
 
46
; ***** SPECIFY DEVICE ***************************************************
47
.device ATmega325
48
#pragma AVRPART ADMIN PART_NAME ATmega325
49
.equ	SIGNATURE_000	= 0x1e
50
.equ	SIGNATURE_001	= 0x95
51
.equ	SIGNATURE_002	= 0x05
52
 
53
#pragma AVRPART CORE CORE_VERSION V2E
54
 
55
 
56
; ***** I/O REGISTER DEFINITIONS *****************************************
57
; NOTE:
58
; Definitions marked "MEMORY MAPPED"are extended I/O ports
59
; and cannot be used with IN/OUT instructions
60
.equ	PORTJ	= 0xdd	; MEMORY MAPPED
61
.equ	DDRJ	= 0xdc	; MEMORY MAPPED
62
.equ	PINJ	= 0xdb	; MEMORY MAPPED
63
.equ	PORTH	= 0xda	; MEMORY MAPPED
64
.equ	DDRH	= 0xd9	; MEMORY MAPPED
65
.equ	PINH	= 0xd8	; MEMORY MAPPED
66
.equ	UDR	= 0xc6	; MEMORY MAPPED
67
.equ	UBRRH	= 0xc5	; MEMORY MAPPED
68
.equ	UBRRL	= 0xc4	; MEMORY MAPPED
69
.equ	UCSRC	= 0xc2	; MEMORY MAPPED
70
.equ	UCSRB	= 0xc1	; MEMORY MAPPED
71
.equ	UCSRA	= 0xc0	; MEMORY MAPPED
72
.equ	USIDR	= 0xba	; MEMORY MAPPED
73
.equ	USISR	= 0xb9	; MEMORY MAPPED
74
.equ	USICR	= 0xb8	; MEMORY MAPPED
75
.equ	ASSR	= 0xb6	; MEMORY MAPPED
76
.equ	OCR2A	= 0xb3	; MEMORY MAPPED
77
.equ	TCNT2	= 0xb2	; MEMORY MAPPED
78
.equ	TCCR2A	= 0xb0	; MEMORY MAPPED
79
.equ	OCR1BH	= 0x8b	; MEMORY MAPPED
80
.equ	OCR1BL	= 0x8a	; MEMORY MAPPED
81
.equ	OCR1AH	= 0x89	; MEMORY MAPPED
82
.equ	OCR1AL	= 0x88	; MEMORY MAPPED
83
.equ	ICR1H	= 0x87	; MEMORY MAPPED
84
.equ	ICR1L	= 0x86	; MEMORY MAPPED
85
.equ	TCNT1H	= 0x85	; MEMORY MAPPED
86
.equ	TCNT1L	= 0x84	; MEMORY MAPPED
87
.equ	TCCR1C	= 0x82	; MEMORY MAPPED
88
.equ	TCCR1B	= 0x81	; MEMORY MAPPED
89
.equ	TCCR1A	= 0x80	; MEMORY MAPPED
90
.equ	DIDR1	= 0x7f	; MEMORY MAPPED
91
.equ	DIDR0	= 0x7e	; MEMORY MAPPED
92
.equ	ADMUX	= 0x7c	; MEMORY MAPPED
93
.equ	ADCSRB	= 0x7b	; MEMORY MAPPED
94
.equ	ADCSRA	= 0x7a	; MEMORY MAPPED
95
.equ	ADCH	= 0x79	; MEMORY MAPPED
96
.equ	ADCL	= 0x78	; MEMORY MAPPED
97
.equ	PCMSK3	= 0x73	; MEMORY MAPPED
98
.equ	TIMSK2	= 0x70	; MEMORY MAPPED
99
.equ	TIMSK1	= 0x6f	; MEMORY MAPPED
100
.equ	TIMSK0	= 0x6e	; MEMORY MAPPED
101
.equ	PCMSK2	= 0x6d	; MEMORY MAPPED
102
.equ	PCMSK1	= 0x6c	; MEMORY MAPPED
103
.equ	PCMSK0	= 0x6b	; MEMORY MAPPED
104
.equ	EICRA	= 0x69	; MEMORY MAPPED
105
.equ	OSCCAL	= 0x66	; MEMORY MAPPED
106
.equ	PRR	= 0x64	; MEMORY MAPPED
107
.equ	CLKPR	= 0x61	; MEMORY MAPPED
108
.equ	WDTCR	= 0x60	; MEMORY MAPPED
109
.equ	SREG	= 0x3f
110
.equ	SPH	= 0x3e
111
.equ	SPL	= 0x3d
112
.equ	SPMCSR	= 0x37
113
.equ	MCUCR	= 0x35
114
.equ	MCUSR	= 0x34
115
.equ	SMCR	= 0x33
116
.equ	OCDR	= 0x31
117
.equ	ACSR	= 0x30
118
.equ	SPDR	= 0x2e
119
.equ	SPSR	= 0x2d
120
.equ	SPCR	= 0x2c
121
.equ	GPIOR2	= 0x2b
122
.equ	GPIOR1	= 0x2a
123
.equ	OCR0A	= 0x27
124
.equ	TCNT0	= 0x26
125
.equ	TCCR0A	= 0x24
126
.equ	GTCCR	= 0x23
127
.equ	EEARH	= 0x22
128
.equ	EEARL	= 0x21
129
.equ	EEDR	= 0x20
130
.equ	EECR	= 0x1f
131
.equ	GPIOR0	= 0x1e
132
.equ	EIMSK	= 0x1d
133
.equ	EIFR	= 0x1c
134
.equ	TIFR2	= 0x17
135
.equ	TIFR1	= 0x16
136
.equ	TIFR0	= 0x15
137
.equ	PORTG	= 0x14
138
.equ	DDRG	= 0x13
139
.equ	PING	= 0x12
140
.equ	PORTF	= 0x11
141
.equ	DDRF	= 0x10
142
.equ	PINF	= 0x0f
143
.equ	PORTE	= 0x0e
144
.equ	DDRE	= 0x0d
145
.equ	PINE	= 0x0c
146
.equ	PORTD	= 0x0b
147
.equ	DDRD	= 0x0a
148
.equ	PIND	= 0x09
149
.equ	PORTC	= 0x08
150
.equ	DDRC	= 0x07
151
.equ	PINC	= 0x06
152
.equ	PORTB	= 0x05
153
.equ	DDRB	= 0x04
154
.equ	PINB	= 0x03
155
.equ	PORTA	= 0x02
156
.equ	DDRA	= 0x01
157
.equ	PINA	= 0x00
158
 
159
 
160
; ***** BIT DEFINITIONS **************************************************
161
 
162
; ***** AD_CONVERTER *****************
163
; ADMUX - The ADC multiplexer Selection Register
164
.equ	MUX0	= 0	; Analog Channel and Gain Selection Bits
165
.equ	MUX1	= 1	; Analog Channel and Gain Selection Bits
166
.equ	MUX2	= 2	; Analog Channel and Gain Selection Bits
167
.equ	MUX3	= 3	; Analog Channel and Gain Selection Bits
168
.equ	MUX4	= 4	; Analog Channel and Gain Selection Bits
169
.equ	ADLAR	= 5	; Left Adjust Result
170
.equ	REFS0	= 6	; Reference Selection Bit 0
171
.equ	REFS1	= 7	; Reference Selection Bit 1
172
 
173
; ADCSRA - The ADC Control and Status register
174
.equ	ADPS0	= 0	; ADC  Prescaler Select Bits
175
.equ	ADPS1	= 1	; ADC  Prescaler Select Bits
176
.equ	ADPS2	= 2	; ADC  Prescaler Select Bits
177
.equ	ADIE	= 3	; ADC Interrupt Enable
178
.equ	ADIF	= 4	; ADC Interrupt Flag
179
.equ	ADATE	= 5	; ADC Auto Trigger Enable
180
.equ	ADSC	= 6	; ADC Start Conversion
181
.equ	ADEN	= 7	; ADC Enable
182
 
183
; ADCH - ADC Data Register High Byte
184
.equ	ADCH0	= 0	; ADC Data Register High Byte Bit 0
185
.equ	ADCH1	= 1	; ADC Data Register High Byte Bit 1
186
.equ	ADCH2	= 2	; ADC Data Register High Byte Bit 2
187
.equ	ADCH3	= 3	; ADC Data Register High Byte Bit 3
188
.equ	ADCH4	= 4	; ADC Data Register High Byte Bit 4
189
.equ	ADCH5	= 5	; ADC Data Register High Byte Bit 5
190
.equ	ADCH6	= 6	; ADC Data Register High Byte Bit 6
191
.equ	ADCH7	= 7	; ADC Data Register High Byte Bit 7
192
 
193
; ADCL - ADC Data Register Low Byte
194
.equ	ADCL0	= 0	; ADC Data Register Low Byte Bit 0
195
.equ	ADCL1	= 1	; ADC Data Register Low Byte Bit 1
196
.equ	ADCL2	= 2	; ADC Data Register Low Byte Bit 2
197
.equ	ADCL3	= 3	; ADC Data Register Low Byte Bit 3
198
.equ	ADCL4	= 4	; ADC Data Register Low Byte Bit 4
199
.equ	ADCL5	= 5	; ADC Data Register Low Byte Bit 5
200
.equ	ADCL6	= 6	; ADC Data Register Low Byte Bit 6
201
.equ	ADCL7	= 7	; ADC Data Register Low Byte Bit 7
202
 
203
; ADCSRB - ADC Control and Status Register B
204
.equ	ADTS0	= 0	; ADC Auto Trigger Source 0
205
.equ	ADTS1	= 1	; ADC Auto Trigger Source 1
206
.equ	ADTS2	= 2	; ADC Auto Trigger Source 2
207
 
208
; DIDR0 - Digital Input Disable Register 0
209
.equ	ADC0D	= 0	; ADC0 Digital input Disable
210
.equ	ADC1D	= 1	; ADC1 Digital input Disable
211
.equ	ADC2D	= 2	; ADC2 Digital input Disable
212
.equ	ADC3D	= 3	; ADC3 Digital input Disable
213
.equ	ADC4D	= 4	; ADC4 Digital input Disable
214
.equ	ADC5D	= 5	; ADC5 Digital input Disable
215
.equ	ADC6D	= 6	; ADC6 Digital input Disable
216
.equ	ADC7D	= 7	; ADC7 Digital input Disable
217
 
218
 
219
; ***** ANALOG_COMPARATOR ************
220
; ADCSRB - ADC Control and Status Register B
221
.equ	ACME	= 6	; Analog Comparator Multiplexer Enable
222
 
223
; ACSR - Analog Comparator Control And Status Register
224
.equ	ACIS0	= 0	; Analog Comparator Interrupt Mode Select bit 0
225
.equ	ACIS1	= 1	; Analog Comparator Interrupt Mode Select bit 1
226
.equ	ACIC	= 2	; Analog Comparator Input Capture Enable
227
.equ	ACIE	= 3	; Analog Comparator Interrupt Enable
228
.equ	ACI	= 4	; Analog Comparator Interrupt Flag
229
.equ	ACO	= 5	; Analog Compare Output
230
.equ	ACBG	= 6	; Analog Comparator Bandgap Select
231
.equ	ACD	= 7	; Analog Comparator Disable
232
 
233
; DIDR1 - Digital Input Disable Register 1
234
.equ	AIN0D	= 0	; AIN0 Digital Input Disable
235
.equ	AIN1D	= 1	; AIN1 Digital Input Disable
236
 
237
 
238
; ***** USART0 ***********************
239
; UDR - USART I/O Data Register
240
.equ	UDR0	= UDR	; For compatibility
241
.equ	UDR00	= 0	; USART I/O Data Register bit 0
242
.equ	UDR01	= 1	; USART I/O Data Register bit 1
243
.equ	UDR02	= 2	; USART I/O Data Register bit 2
244
.equ	UDR03	= 3	; USART I/O Data Register bit 3
245
.equ	UDR04	= 4	; USART I/O Data Register bit 4
246
.equ	UDR05	= 5	; USART I/O Data Register bit 5
247
.equ	UDR06	= 6	; USART I/O Data Register bit 6
248
.equ	UDR07	= 7	; USART I/O Data Register bit 7
249
 
250
; UCSRA - USART Control and Status Register A
251
.equ	UCSR0A	= UCSRA	; For compatibility
252
.equ	USR	= UCSRA	; For compatibility
253
.equ	MPCM	= 0	; Multi-processor Communication Mode
254
.equ	MPCM0	= MPCM	; For compatibility
255
.equ	U2X	= 1	; Double the USART Transmission Speed
256
.equ	U2X0	= U2X	; For compatibility
257
.equ	UPE	= 2	; USART Parity Error
258
.equ	UPE0	= UPE	; For compatibility
259
.equ	DOR	= 3	; Data OverRun
260
.equ	DOR0	= DOR	; For compatibility
261
.equ	FE	= 4	; Framing Error
262
.equ	FE0	= FE	; For compatibility
263
.equ	UDRE	= 5	; USART Data Register Empty
264
.equ	UDRE0	= UDRE	; For compatibility
265
.equ	TXC	= 6	; USART Transmit Complete
266
.equ	TXC0	= TXC	; For compatibility
267
.equ	RXC	= 7	; USART Receive Complete
268
.equ	RXC0	= RXC	; For compatibility
269
 
270
; UCSRB - USART Control and Status Register B
271
.equ	UCSR0B	= UCSRB	; For compatibility
272
.equ	UCR	= UCSRB	; For compatibility
273
.equ	TXB8	= 0	; Transmit Data Bit 8
274
.equ	TXB80	= TXB8	; For compatibility
275
.equ	RXB8	= 1	; Receive Data Bit 8
276
.equ	RXB80	= RXB8	; For compatibility
277
.equ	UCSZ2	= 2	; Character Size
278
.equ	UCSZ02	= UCSZ2	; For compatibility
279
.equ	TXEN	= 3	; Transmitter Enable
280
.equ	TXEN0	= TXEN	; For compatibility
281
.equ	RXEN	= 4	; Receiver Enable
282
.equ	RXEN0	= RXEN	; For compatibility
283
.equ	UDRIE	= 5	; USART Data Register Empty Interrupt Enable
284
.equ	UDRIE0	= UDRIE	; For compatibility
285
.equ	TXCIE	= 6	; TX Complete Interrupt Enable
286
.equ	TXCIE0	= TXCIE	; For compatibility
287
.equ	RXCIE	= 7	; RX Complete Interrupt Enable
288
.equ	RXCIE0	= RXCIE	; For compatibility
289
 
290
; UCSRC - USART Control and Status Register C
291
.equ	UCSR0C	= UCSRC	; For compatibility
292
.equ	UCPOL	= 0	; Clock Polarity
293
.equ	UCPOL0	= UCPOL	; For compatibility
294
.equ	UCSZ0	= 1	; Character Size
295
.equ	UCSZ00	= UCSZ0	; For compatibility
296
.equ	UCSZ1	= 2	; Character Size
297
.equ	UCSZ01	= UCSZ1	; For compatibility
298
.equ	USBS	= 3	; Stop Bit Select
299
.equ	USBS0	= USBS	; For compatibility
300
.equ	UPM0	= 4	; Parity Mode Bit 0
301
.equ	UPM00	= UPM0	; For compatibility
302
.equ	UPM1	= 5	; Parity Mode Bit 1
303
.equ	UPM01	= UPM1	; For compatibility
304
.equ	UMSEL	= 6	; USART Mode Select
305
.equ	UMSEL0	= UMSEL	; For compatibility
306
 
307
.equ	UBRR0H	= UBRRH	; For compatibility
308
.equ	UBRR0L	= UBRRL	; For compatibility
309
.equ	UBRR0	= UBRRL	; For compatibility
310
.equ	UBRR	= UBRRL	; For compatibility
311
 
312
; ***** USI **************************
313
; USIDR - USI Data Register
314
.equ	USIDR0	= 0	; USI Data Register bit 0
315
.equ	USIDR1	= 1	; USI Data Register bit 1
316
.equ	USIDR2	= 2	; USI Data Register bit 2
317
.equ	USIDR3	= 3	; USI Data Register bit 3
318
.equ	USIDR4	= 4	; USI Data Register bit 4
319
.equ	USIDR5	= 5	; USI Data Register bit 5
320
.equ	USIDR6	= 6	; USI Data Register bit 6
321
.equ	USIDR7	= 7	; USI Data Register bit 7
322
 
323
; USISR - USI Status Register
324
.equ	USICNT0	= 0	; USI Counter Value Bit 0
325
.equ	USICNT1	= 1	; USI Counter Value Bit 1
326
.equ	USICNT2	= 2	; USI Counter Value Bit 2
327
.equ	USICNT3	= 3	; USI Counter Value Bit 3
328
.equ	USIDC	= 4	; Data Output Collision
329
.equ	USIPF	= 5	; Stop Condition Flag
330
.equ	USIOIF	= 6	; Counter Overflow Interrupt Flag
331
.equ	USISIF	= 7	; Start Condition Interrupt Flag
332
 
333
; USICR - USI Control Register
334
.equ	USITC	= 0	; Toggle Clock Port Pin
335
.equ	USICLK	= 1	; Clock Strobe
336
.equ	USICS0	= 2	; USI Clock Source Select Bit 0
337
.equ	USICS1	= 3	; USI Clock Source Select Bit 1
338
.equ	USIWM0	= 4	; USI Wire Mode Bit 0
339
.equ	USIWM1	= 5	; USI Wire Mode Bit 1
340
.equ	USIOIE	= 6	; Counter Overflow Interrupt Enable
341
.equ	USISIE	= 7	; Start Condition Interrupt Enable
342
 
343
 
344
; ***** SPI **************************
345
; SPDR - SPI Data Register
346
.equ	SPDR0	= 0	; SPI Data Register bit 0
347
.equ	SPDR1	= 1	; SPI Data Register bit 1
348
.equ	SPDR2	= 2	; SPI Data Register bit 2
349
.equ	SPDR3	= 3	; SPI Data Register bit 3
350
.equ	SPDR4	= 4	; SPI Data Register bit 4
351
.equ	SPDR5	= 5	; SPI Data Register bit 5
352
.equ	SPDR6	= 6	; SPI Data Register bit 6
353
.equ	SPDR7	= 7	; SPI Data Register bit 7
354
 
355
; SPSR - SPI Status Register
356
.equ	SPI2X	= 0	; Double SPI Speed Bit
357
.equ	WCOL	= 6	; Write Collision Flag
358
.equ	SPIF	= 7	; SPI Interrupt Flag
359
 
360
; SPCR - SPI Control Register
361
.equ	SPR0	= 0	; SPI Clock Rate Select 0
362
.equ	SPR1	= 1	; SPI Clock Rate Select 1
363
.equ	CPHA	= 2	; Clock Phase
364
.equ	CPOL	= 3	; Clock polarity
365
.equ	MSTR	= 4	; Master/Slave Select
366
.equ	DORD	= 5	; Data Order
367
.equ	SPE	= 6	; SPI Enable
368
.equ	SPIE	= 7	; SPI Interrupt Enable
369
 
370
 
371
; ***** BOOT_LOAD ********************
372
; SPMCSR - Store Program Memory Control Register
373
.equ	SPMCR	= SPMCSR	; For compatibility
374
.equ	SPMEN	= 0	; Store Program Memory Enable
375
.equ	PGERS	= 1	; Page Erase
376
.equ	PGWRT	= 2	; Page Write
377
.equ	BLBSET	= 3	; Boot Lock Bit Set
378
.equ	RWWSRE	= 4	; Read While Write section read enable
379
.equ	ASRE	= RWWSRE	; For compatibility
380
.equ	RWWSB	= 6	; Read While Write Section Busy
381
.equ	ASB	= RWWSB	; For compatibility
382
.equ	SPMIE	= 7	; SPM Interrupt Enable
383
 
384
 
385
; ***** JTAG *************************
386
; OCDR - On-Chip Debug Related Register in I/O Memory
387
.equ	OCDR0	= 0	; On-Chip Debug Register Bit 0
388
.equ	OCDR1	= 1	; On-Chip Debug Register Bit 1
389
.equ	OCDR2	= 2	; On-Chip Debug Register Bit 2
390
.equ	OCDR3	= 3	; On-Chip Debug Register Bit 3
391
.equ	OCDR4	= 4	; On-Chip Debug Register Bit 4
392
.equ	OCDR5	= 5	; On-Chip Debug Register Bit 5
393
.equ	OCDR6	= 6	; On-Chip Debug Register Bit 6
394
.equ	OCDR7	= 7	; On-Chip Debug Register Bit 7
395
.equ	IDRD	= OCDR7	; For compatibility
396
 
397
; MCUCR - MCU Control Register
398
.equ	JTD	= 7	; JTAG Interface Disable
399
 
400
; MCUSR - MCU Status Register
401
.equ	JTRF	= 4	; JTAG Reset Flag
402
 
403
 
404
; ***** EXTERNAL_INTERRUPT ***********
405
; EICRA - External Interrupt Control Register A
406
.equ	ISC00	= 0	; External Interrupt Sense Control 0 Bit 0
407
.equ	ISC01	= 1	; External Interrupt Sense Control 0 Bit 1
408
 
409
; EIMSK - External Interrupt Mask Register
410
.equ	INT0	= 0	; External Interrupt Request 0 Enable
411
.equ	PCIE0	= 4	; Pin Change Interrupt Enable 0
412
.equ	PCIE1	= 5	; Pin Change Interrupt Enable 1
413
.equ	PCIE2	= 6	; Pin Change Interrupt Enable 2
414
.equ	PCIE3	= 7	; Pin Change Interrupt Enable 3
415
 
416
; EIFR - External Interrupt Flag Register
417
.equ	INTF0	= 0	; External Interrupt Flag 0
418
.equ	PCIF0	= 4	; Pin Change Interrupt Flag 0
419
.equ	PCIF1	= 5	; Pin Change Interrupt Flag 1
420
.equ	PCIF2	= 6	; Pin Change Interrupt Flag 2
421
.equ	PCIF3	= 7	; Pin Change Interrupt Flag 3
422
 
423
 
424
; ***** EEPROM ***********************
425
; EEDR - EEPROM Data Register
426
.equ	EEDR0	= 0	; EEPROM Data Register bit 0
427
.equ	EEDR1	= 1	; EEPROM Data Register bit 1
428
.equ	EEDR2	= 2	; EEPROM Data Register bit 2
429
.equ	EEDR3	= 3	; EEPROM Data Register bit 3
430
.equ	EEDR4	= 4	; EEPROM Data Register bit 4
431
.equ	EEDR5	= 5	; EEPROM Data Register bit 5
432
.equ	EEDR6	= 6	; EEPROM Data Register bit 6
433
.equ	EEDR7	= 7	; EEPROM Data Register bit 7
434
 
435
; EECR - EEPROM Control Register
436
.equ	EERE	= 0	; EEPROM Read Enable
437
.equ	EEWE	= 1	; EEPROM Write Enable
438
.equ	EEMWE	= 2	; EEPROM Master Write Enable
439
.equ	EERIE	= 3	; EEPROM Ready Interrupt Enable
440
 
441
 
442
; ***** PORTA ************************
443
; PORTA - Port A Data Register
444
.equ	PORTA0	= 0	; Port A Data Register bit 0
445
.equ	PA0	= 0	; For compatibility
446
.equ	PORTA1	= 1	; Port A Data Register bit 1
447
.equ	PA1	= 1	; For compatibility
448
.equ	PORTA2	= 2	; Port A Data Register bit 2
449
.equ	PA2	= 2	; For compatibility
450
.equ	PORTA3	= 3	; Port A Data Register bit 3
451
.equ	PA3	= 3	; For compatibility
452
.equ	PORTA4	= 4	; Port A Data Register bit 4
453
.equ	PA4	= 4	; For compatibility
454
.equ	PORTA5	= 5	; Port A Data Register bit 5
455
.equ	PA5	= 5	; For compatibility
456
.equ	PORTA6	= 6	; Port A Data Register bit 6
457
.equ	PA6	= 6	; For compatibility
458
.equ	PORTA7	= 7	; Port A Data Register bit 7
459
.equ	PA7	= 7	; For compatibility
460
 
461
; DDRA - Port A Data Direction Register
462
.equ	DDA0	= 0	; Data Direction Register, Port A, bit 0
463
.equ	DDA1	= 1	; Data Direction Register, Port A, bit 1
464
.equ	DDA2	= 2	; Data Direction Register, Port A, bit 2
465
.equ	DDA3	= 3	; Data Direction Register, Port A, bit 3
466
.equ	DDA4	= 4	; Data Direction Register, Port A, bit 4
467
.equ	DDA5	= 5	; Data Direction Register, Port A, bit 5
468
.equ	DDA6	= 6	; Data Direction Register, Port A, bit 6
469
.equ	DDA7	= 7	; Data Direction Register, Port A, bit 7
470
 
471
; PINA - Port A Input Pins
472
.equ	PINA0	= 0	; Input Pins, Port A bit 0
473
.equ	PINA1	= 1	; Input Pins, Port A bit 1
474
.equ	PINA2	= 2	; Input Pins, Port A bit 2
475
.equ	PINA3	= 3	; Input Pins, Port A bit 3
476
.equ	PINA4	= 4	; Input Pins, Port A bit 4
477
.equ	PINA5	= 5	; Input Pins, Port A bit 5
478
.equ	PINA6	= 6	; Input Pins, Port A bit 6
479
.equ	PINA7	= 7	; Input Pins, Port A bit 7
480
 
481
 
482
; ***** PORTB ************************
483
; PORTB - Port B Data Register
484
.equ	PORTB0	= 0	; Port B Data Register bit 0
485
.equ	PB0	= 0	; For compatibility
486
.equ	PORTB1	= 1	; Port B Data Register bit 1
487
.equ	PB1	= 1	; For compatibility
488
.equ	PORTB2	= 2	; Port B Data Register bit 2
489
.equ	PB2	= 2	; For compatibility
490
.equ	PORTB3	= 3	; Port B Data Register bit 3
491
.equ	PB3	= 3	; For compatibility
492
.equ	PORTB4	= 4	; Port B Data Register bit 4
493
.equ	PB4	= 4	; For compatibility
494
.equ	PORTB5	= 5	; Port B Data Register bit 5
495
.equ	PB5	= 5	; For compatibility
496
.equ	PORTB6	= 6	; Port B Data Register bit 6
497
.equ	PB6	= 6	; For compatibility
498
.equ	PORTB7	= 7	; Port B Data Register bit 7
499
.equ	PB7	= 7	; For compatibility
500
 
501
; DDRB - Port B Data Direction Register
502
.equ	DDB0	= 0	; Port B Data Direction Register bit 0
503
.equ	DDB1	= 1	; Port B Data Direction Register bit 1
504
.equ	DDB2	= 2	; Port B Data Direction Register bit 2
505
.equ	DDB3	= 3	; Port B Data Direction Register bit 3
506
.equ	DDB4	= 4	; Port B Data Direction Register bit 4
507
.equ	DDB5	= 5	; Port B Data Direction Register bit 5
508
.equ	DDB6	= 6	; Port B Data Direction Register bit 6
509
.equ	DDB7	= 7	; Port B Data Direction Register bit 7
510
 
511
; PINB - Port B Input Pins
512
.equ	PINB0	= 0	; Port B Input Pins bit 0
513
.equ	PINB1	= 1	; Port B Input Pins bit 1
514
.equ	PINB2	= 2	; Port B Input Pins bit 2
515
.equ	PINB3	= 3	; Port B Input Pins bit 3
516
.equ	PINB4	= 4	; Port B Input Pins bit 4
517
.equ	PINB5	= 5	; Port B Input Pins bit 5
518
.equ	PINB6	= 6	; Port B Input Pins bit 6
519
.equ	PINB7	= 7	; Port B Input Pins bit 7
520
 
521
 
522
; ***** PORTC ************************
523
; PORTC - Port C Data Register
524
.equ	PORTC0	= 0	; Port C Data Register bit 0
525
.equ	PC0	= 0	; For compatibility
526
.equ	PORTC1	= 1	; Port C Data Register bit 1
527
.equ	PC1	= 1	; For compatibility
528
.equ	PORTC2	= 2	; Port C Data Register bit 2
529
.equ	PC2	= 2	; For compatibility
530
.equ	PORTC3	= 3	; Port C Data Register bit 3
531
.equ	PC3	= 3	; For compatibility
532
.equ	PORTC4	= 4	; Port C Data Register bit 4
533
.equ	PC4	= 4	; For compatibility
534
.equ	PORTC5	= 5	; Port C Data Register bit 5
535
.equ	PC5	= 5	; For compatibility
536
.equ	PORTC6	= 6	; Port C Data Register bit 6
537
.equ	PC6	= 6	; For compatibility
538
.equ	PORTC7	= 7	; Port C Data Register bit 7
539
.equ	PC7	= 7	; For compatibility
540
 
541
; DDRC - Port C Data Direction Register
542
.equ	DDC0	= 0	; Port C Data Direction Register bit 0
543
.equ	DDC1	= 1	; Port C Data Direction Register bit 1
544
.equ	DDC2	= 2	; Port C Data Direction Register bit 2
545
.equ	DDC3	= 3	; Port C Data Direction Register bit 3
546
.equ	DDC4	= 4	; Port C Data Direction Register bit 4
547
.equ	DDC5	= 5	; Port C Data Direction Register bit 5
548
.equ	DDC6	= 6	; Port C Data Direction Register bit 6
549
.equ	DDC7	= 7	; Port C Data Direction Register bit 7
550
 
551
; PINC - Port C Input Pins
552
.equ	PINC0	= 0	; Port C Input Pins bit 0
553
.equ	PINC1	= 1	; Port C Input Pins bit 1
554
.equ	PINC2	= 2	; Port C Input Pins bit 2
555
.equ	PINC3	= 3	; Port C Input Pins bit 3
556
.equ	PINC4	= 4	; Port C Input Pins bit 4
557
.equ	PINC5	= 5	; Port C Input Pins bit 5
558
.equ	PINC6	= 6	; Port C Input Pins bit 6
559
.equ	PINC7	= 7	; Port C Input Pins bit 7
560
 
561
 
562
; ***** PORTD ************************
563
; PORTD - Port D Data Register
564
.equ	PORTD0	= 0	; Port D Data Register bit 0
565
.equ	PD0	= 0	; For compatibility
566
.equ	PORTD1	= 1	; Port D Data Register bit 1
567
.equ	PD1	= 1	; For compatibility
568
.equ	PORTD2	= 2	; Port D Data Register bit 2
569
.equ	PD2	= 2	; For compatibility
570
.equ	PORTD3	= 3	; Port D Data Register bit 3
571
.equ	PD3	= 3	; For compatibility
572
.equ	PORTD4	= 4	; Port D Data Register bit 4
573
.equ	PD4	= 4	; For compatibility
574
.equ	PORTD5	= 5	; Port D Data Register bit 5
575
.equ	PD5	= 5	; For compatibility
576
.equ	PORTD6	= 6	; Port D Data Register bit 6
577
.equ	PD6	= 6	; For compatibility
578
.equ	PORTD7	= 7	; Port D Data Register bit 7
579
.equ	PD7	= 7	; For compatibility
580
 
581
; DDRD - Port D Data Direction Register
582
.equ	DDD0	= 0	; Port D Data Direction Register bit 0
583
.equ	DDD1	= 1	; Port D Data Direction Register bit 1
584
.equ	DDD2	= 2	; Port D Data Direction Register bit 2
585
.equ	DDD3	= 3	; Port D Data Direction Register bit 3
586
.equ	DDD4	= 4	; Port D Data Direction Register bit 4
587
.equ	DDD5	= 5	; Port D Data Direction Register bit 5
588
.equ	DDD6	= 6	; Port D Data Direction Register bit 6
589
.equ	DDD7	= 7	; Port D Data Direction Register bit 7
590
 
591
; PIND - Port D Input Pins
592
.equ	PIND0	= 0	; Port D Input Pins bit 0
593
.equ	PIND1	= 1	; Port D Input Pins bit 1
594
.equ	PIND2	= 2	; Port D Input Pins bit 2
595
.equ	PIND3	= 3	; Port D Input Pins bit 3
596
.equ	PIND4	= 4	; Port D Input Pins bit 4
597
.equ	PIND5	= 5	; Port D Input Pins bit 5
598
.equ	PIND6	= 6	; Port D Input Pins bit 6
599
.equ	PIND7	= 7	; Port D Input Pins bit 7
600
 
601
 
602
; ***** PORTE ************************
603
; PORTE - Data Register, Port E
604
.equ	PORTE0	= 0	;
605
.equ	PE0	= 0	; For compatibility
606
.equ	PORTE1	= 1	;
607
.equ	PE1	= 1	; For compatibility
608
.equ	PORTE2	= 2	;
609
.equ	PE2	= 2	; For compatibility
610
.equ	PORTE3	= 3	;
611
.equ	PE3	= 3	; For compatibility
612
.equ	PORTE4	= 4	;
613
.equ	PE4	= 4	; For compatibility
614
.equ	PORTE5	= 5	;
615
.equ	PE5	= 5	; For compatibility
616
.equ	PORTE6	= 6	;
617
.equ	PE6	= 6	; For compatibility
618
.equ	PORTE7	= 7	;
619
.equ	PE7	= 7	; For compatibility
620
 
621
; DDRE - Data Direction Register, Port E
622
.equ	DDE0	= 0	;
623
.equ	DDE1	= 1	;
624
.equ	DDE2	= 2	;
625
.equ	DDE3	= 3	;
626
.equ	DDE4	= 4	;
627
.equ	DDE5	= 5	;
628
.equ	DDE6	= 6	;
629
.equ	DDE7	= 7	;
630
 
631
; PINE - Input Pins, Port E
632
.equ	PINE0	= 0	;
633
.equ	PINE1	= 1	;
634
.equ	PINE2	= 2	;
635
.equ	PINE3	= 3	;
636
.equ	PINE4	= 4	;
637
.equ	PINE5	= 5	;
638
.equ	PINE6	= 6	;
639
.equ	PINE7	= 7	;
640
 
641
 
642
; ***** PORTF ************************
643
; PORTF - Data Register, Port F
644
.equ	PORTF0	= 0	;
645
.equ	PF0	= 0	; For compatibility
646
.equ	PORTF1	= 1	;
647
.equ	PF1	= 1	; For compatibility
648
.equ	PORTF2	= 2	;
649
.equ	PF2	= 2	; For compatibility
650
.equ	PORTF3	= 3	;
651
.equ	PF3	= 3	; For compatibility
652
.equ	PORTF4	= 4	;
653
.equ	PF4	= 4	; For compatibility
654
.equ	PORTF5	= 5	;
655
.equ	PF5	= 5	; For compatibility
656
.equ	PORTF6	= 6	;
657
.equ	PF6	= 6	; For compatibility
658
.equ	PORTF7	= 7	;
659
.equ	PF7	= 7	; For compatibility
660
 
661
; DDRF - Data Direction Register, Port F
662
.equ	DDF0	= 0	;
663
.equ	DDF1	= 1	;
664
.equ	DDF2	= 2	;
665
.equ	DDF3	= 3	;
666
.equ	DDF4	= 4	;
667
.equ	DDF5	= 5	;
668
.equ	DDF6	= 6	;
669
.equ	DDF7	= 7	;
670
 
671
; PINF - Input Pins, Port F
672
.equ	PINF0	= 0	;
673
.equ	PINF1	= 1	;
674
.equ	PINF2	= 2	;
675
.equ	PINF3	= 3	;
676
.equ	PINF4	= 4	;
677
.equ	PINF5	= 5	;
678
.equ	PINF6	= 6	;
679
.equ	PINF7	= 7	;
680
 
681
 
682
; ***** PORTG ************************
683
; PORTG - Port G Data Register
684
.equ	PORTG0	= 0	;
685
.equ	PG0	= 0	; For compatibility
686
.equ	PORTG1	= 1	;
687
.equ	PG1	= 1	; For compatibility
688
.equ	PORTG2	= 2	;
689
.equ	PG2	= 2	; For compatibility
690
.equ	PORTG3	= 3	;
691
.equ	PG3	= 3	; For compatibility
692
.equ	PORTG4	= 4	;
693
.equ	PG4	= 4	; For compatibility
694
 
695
; DDRG - Port G Data Direction Register
696
.equ	DDG0	= 0	;
697
.equ	DDG1	= 1	;
698
.equ	DDG2	= 2	;
699
.equ	DDG3	= 3	;
700
.equ	DDG4	= 4	;
701
 
702
; PING - Port G Input Pins
703
.equ	PING0	= 0	;
704
.equ	PING1	= 1	;
705
.equ	PING2	= 2	;
706
.equ	PING3	= 3	;
707
.equ	PING4	= 4	;
708
.equ	PING5	= 5	;
709
 
710
 
711
; ***** TIMER_COUNTER_0 **************
712
; TCCR0A - Timer/Counter0 Control Register
713
.equ	CS00	= 0	; Clock Select 1
714
.equ	CS01	= 1	; Clock Select 1
715
.equ	CS02	= 2	; Clock Select 2
716
.equ	WGM01	= 3	; Waveform Generation Mode 1
717
.equ	COM0A0	= 4	; Compare match Output Mode 0
718
.equ	COM0A1	= 5	; Compare Match Output Mode 1
719
.equ	WGM00	= 6	; Waveform Generation Mode 0
720
.equ	FOC0A	= 7	; Force Output Compare
721
 
722
; TCNT0 - Timer/Counter0
723
.equ	TCNT0_0	= 0	;
724
.equ	TCNT0_1	= 1	;
725
.equ	TCNT0_2	= 2	;
726
.equ	TCNT0_3	= 3	;
727
.equ	TCNT0_4	= 4	;
728
.equ	TCNT0_5	= 5	;
729
.equ	TCNT0_6	= 6	;
730
.equ	TCNT0_7	= 7	;
731
 
732
; OCR0A - Timer/Counter0 Output Compare Register
733
.equ	OCR0A0	= 0	;
734
.equ	OCR0A1	= 1	;
735
.equ	OCR0A2	= 2	;
736
.equ	OCR0A3	= 3	;
737
.equ	OCR0A4	= 4	;
738
.equ	OCR0A5	= 5	;
739
.equ	OCR0A6	= 6	;
740
.equ	OCR0A7	= 7	;
741
 
742
; TIMSK0 - Timer/Counter0 Interrupt Mask Register
743
.equ	TOIE0	= 0	; Timer/Counter0 Overflow Interrupt Enable
744
.equ	OCIE0A	= 1	; Timer/Counter0 Output Compare Match Interrupt Enable
745
 
746
; TIFR0 - Timer/Counter0 Interrupt Flag register
747
.equ	TOV0	= 0	; Timer/Counter0 Overflow Flag
748
.equ	OCF0A	= 1	; Timer/Counter0 Output Compare Flag 0
749
 
750
; GTCCR - General Timer/Control Register
751
.equ	PSR310	= 0	; Prescaler Reset Timer/Counter1 and Timer/Counter0
752
.equ	PSR10	= PSR310	; For compatibility
753
.equ	PSR0	= PSR310	; For compatibility
754
.equ	PSR1	= PSR310	; For compatibility
755
.equ	PSR3	= PSR310	; For compatibility
756
.equ	TSM	= 7	; Timer/Counter Synchronization Mode
757
 
758
 
759
; ***** TIMER_COUNTER_1 **************
760
; TIMSK1 - Timer/Counter1 Interrupt Mask Register
761
.equ	TOIE1	= 0	; Timer/Counter1 Overflow Interrupt Enable
762
.equ	OCIE1A	= 1	; Timer/Counter1 Output Compare A Match Interrupt Enable
763
.equ	OCIE1B	= 2	; Timer/Counter1 Output Compare B Match Interrupt Enable
764
.equ	ICIE1	= 5	; Timer/Counter1 Input Capture Interrupt Enable
765
 
766
; TIFR1 - Timer/Counter1 Interrupt Flag register
767
.equ	TOV1	= 0	; Timer/Counter1 Overflow Flag
768
.equ	OCF1A	= 1	; Output Compare Flag 1A
769
.equ	OCF1B	= 2	; Output Compare Flag 1B
770
.equ	ICF1	= 5	; Input Capture Flag 1
771
 
772
; TCCR1A - Timer/Counter1 Control Register A
773
.equ	WGM10	= 0	; Waveform Generation Mode
774
.equ	WGM11	= 1	; Waveform Generation Mode
775
.equ	COM1B0	= 4	; Compare Output Mode 1B, bit 0
776
.equ	COM1B1	= 5	; Compare Output Mode 1B, bit 1
777
.equ	COM1A0	= 6	; Compare Output Mode 1A, bit 0
778
.equ	COM1A1	= 7	; Compare Output Mode 1A, bit 1
779
 
780
; TCCR1B - Timer/Counter1 Control Register B
781
.equ	CS10	= 0	; Prescaler source of Timer/Counter 1
782
.equ	CS11	= 1	; Prescaler source of Timer/Counter 1
783
.equ	CS12	= 2	; Prescaler source of Timer/Counter 1
784
.equ	WGM12	= 3	; Waveform Generation Mode
785
.equ	WGM13	= 4	; Waveform Generation Mode
786
.equ	ICES1	= 6	; Input Capture 1 Edge Select
787
.equ	ICNC1	= 7	; Input Capture 1 Noise Canceler
788
 
789
; TCCR1C - Timer/Counter 1 Control Register C
790
.equ	FOC1B	= 6	; Force Output Compare 1B
791
.equ	FOC1A	= 7	; Force Output Compare 1A
792
 
793
 
794
; ***** TIMER_COUNTER_2 **************
795
; TIMSK2 - Timer/Counter2 Interrupt Mask register
796
.equ	TOIE2	= 0	; Timer/Counter2 Overflow Interrupt Enable
797
.equ	OCIE2A	= 1	; Timer/Counter2 Output Compare Match Interrupt Enable
798
 
799
; TIFR2 - Timer/Counter2 Interrupt Flag Register
800
.equ	TOV2	= 0	; Timer/Counter2 Overflow Flag
801
.equ	OCF2A	= 1	; Timer/Counter2 Output Compare Flag 2
802
 
803
; TCCR2A - Timer/Counter2 Control Register
804
.equ	CS20	= 0	; Clock Select bit 0
805
.equ	CS21	= 1	; Clock Select bit 1
806
.equ	CS22	= 2	; Clock Select bit 2
807
.equ	WGM21	= 3	; Waveform Generation Mode
808
.equ	COM2A0	= 4	; Compare Output Mode bit 0
809
.equ	COM2A1	= 5	; Compare Output Mode bit 1
810
.equ	WGM20	= 6	; Waveform Generation Mode
811
.equ	FOC2A	= 7	; Force Output Compare A
812
 
813
; TCNT2 - Timer/Counter2
814
.equ	TCNT2_0	= 0	; Timer/Counter 2 bit 0
815
.equ	TCNT2_1	= 1	; Timer/Counter 2 bit 1
816
.equ	TCNT2_2	= 2	; Timer/Counter 2 bit 2
817
.equ	TCNT2_3	= 3	; Timer/Counter 2 bit 3
818
.equ	TCNT2_4	= 4	; Timer/Counter 2 bit 4
819
.equ	TCNT2_5	= 5	; Timer/Counter 2 bit 5
820
.equ	TCNT2_6	= 6	; Timer/Counter 2 bit 6
821
.equ	TCNT2_7	= 7	; Timer/Counter 2 bit 7
822
 
823
; OCR2A - Timer/Counter2 Output Compare Register
824
.equ	OCR2A0	= 0	; Timer/Counter2 Output Compare Register Bit 0
825
.equ	OCR2A1	= 1	; Timer/Counter2 Output Compare Register Bit 1
826
.equ	OCR2A2	= 2	; Timer/Counter2 Output Compare Register Bit 2
827
.equ	OCR2A3	= 3	; Timer/Counter2 Output Compare Register Bit 3
828
.equ	OCR2A4	= 4	; Timer/Counter2 Output Compare Register Bit 4
829
.equ	OCR2A5	= 5	; Timer/Counter2 Output Compare Register Bit 5
830
.equ	OCR2A6	= 6	; Timer/Counter2 Output Compare Register Bit 6
831
.equ	OCR2A7	= 7	; Timer/Counter2 Output Compare Register Bit 7
832
 
833
; GTCCR - General Timer/Counter Control Register
834
.equ	PSR2	= 1	; Prescaler Reset Timer/Counter2
835
 
836
; ASSR - Asynchronous Status Register
837
.equ	TCR2UB	= 0	; TCR2UB: Timer/Counter Control Register2 Update Busy
838
.equ	OCR2UB	= 1	; Output Compare Register2 Update Busy
839
.equ	TCN2UB	= 2	; TCN2UB: Timer/Counter2 Update Busy
840
.equ	AS2	= 3	; AS2: Asynchronous Timer/Counter2
841
.equ	EXCLK	= 4	; Enable External Clock Interrupt
842
 
843
 
844
; ***** WATCHDOG *********************
845
; WDTCR - Watchdog Timer Control Register
846
.equ	WDTCSR	= WDTCR	; For compatibility
847
.equ	WDP0	= 0	; Watch Dog Timer Prescaler bit 0
848
.equ	WDP1	= 1	; Watch Dog Timer Prescaler bit 1
849
.equ	WDP2	= 2	; Watch Dog Timer Prescaler bit 2
850
.equ	WDE	= 3	; Watch Dog Enable
851
.equ	WDCE	= 4	; Watchdog Change Enable
852
.equ	WDTOE	= WDCE	; For compatibility
853
 
854
 
855
; ***** CPU **************************
856
; SREG - Status Register
857
.equ	SREG_C	= 0	; Carry Flag
858
.equ	SREG_Z	= 1	; Zero Flag
859
.equ	SREG_N	= 2	; Negative Flag
860
.equ	SREG_V	= 3	; Two's Complement Overflow Flag
861
.equ	SREG_S	= 4	; Sign Bit
862
.equ	SREG_H	= 5	; Half Carry Flag
863
.equ	SREG_T	= 6	; Bit Copy Storage
864
.equ	SREG_I	= 7	; Global Interrupt Enable
865
 
866
; MCUCR - MCU Control Register
867
.equ	IVCE	= 0	; Interrupt Vector Change Enable
868
.equ	IVSEL	= 1	; Interrupt Vector Select
869
.equ	PUD	= 4	; Pull-up disable
870
 
871
; MCUSR - MCU Status Register
872
.equ	PORF	= 0	; Power-on reset flag
873
.equ	EXTRF	= 1	; External Reset Flag
874
.equ	BORF	= 2	; Brown-out Reset Flag
875
.equ	WDRF	= 3	; Watchdog Reset Flag
876
;.equ	JTRF	= 4	; JTAG Reset Flag
877
 
878
; OSCCAL - Oscillator Calibration Value
879
.equ	CAL0	= 0	; Oscillator Calibration Value Bit0
880
.equ	CAL1	= 1	; Oscillator Calibration Value Bit1
881
.equ	CAL2	= 2	; Oscillator Calibration Value Bit2
882
.equ	CAL3	= 3	; Oscillator Calibration Value Bit3
883
.equ	CAL4	= 4	; Oscillator Calibration Value Bit4
884
.equ	CAL5	= 5	; Oscillator Calibration Value Bit5
885
.equ	CAL6	= 6	; Oscillator Calibration Value Bit6
886
.equ	CAL7	= 7	; Oscillator Calibration Value Bit7
887
 
888
; CLKPR - Clock Prescale Register
889
.equ	CLKPS0	= 0	; Clock Prescaler Select Bit 0
890
.equ	CLKPS1	= 1	; Clock Prescaler Select Bit 1
891
.equ	CLKPS2	= 2	; Clock Prescaler Select Bit 2
892
.equ	CLKPS3	= 3	; Clock Prescaler Select Bit 3
893
.equ	CLKPCE	= 7	; Clock Prescaler Change Enable
894
 
895
; PRR - Power Reduction Register
896
.equ	PRADC	= 0	; Power Reduction ADC
897
.equ	PRUSART0	= 1	; Power Reduction USART
898
.equ	PRSPI	= 2	; Power Reduction Serial Peripheral Interface
899
.equ	PRTIM1	= 3	; Power Reduction Timer/Counter1
900
 
901
; SMCR - Sleep Mode Control Register
902
.equ	SE	= 0	; Sleep Enable
903
.equ	SM0	= 1	; Sleep Mode Select bit 0
904
.equ	SM1	= 2	; Sleep Mode Select bit 1
905
.equ	SM2	= 3	; Sleep Mode Select bit 2
906
 
907
; GPIOR2 - General Purpose IO Register 2
908
.equ	GPIOR20	= 0	; General Purpose IO Register 2 bit 0
909
.equ	GPIOR21	= 1	; General Purpose IO Register 2 bit 1
910
.equ	GPIOR22	= 2	; General Purpose IO Register 2 bit 2
911
.equ	GPIOR23	= 3	; General Purpose IO Register 2 bit 3
912
.equ	GPIOR24	= 4	; General Purpose IO Register 2 bit 4
913
.equ	GPIOR25	= 5	; General Purpose IO Register 2 bit 5
914
.equ	GPIOR26	= 6	; General Purpose IO Register 2 bit 6
915
.equ	GPIOR27	= 7	; General Purpose IO Register 2 bit 7
916
 
917
; GPIOR1 - General Purpose IO Register 1
918
.equ	GPIOR10	= 0	; General Purpose IO Register 1 bit 0
919
.equ	GPIOR11	= 1	; General Purpose IO Register 1 bit 1
920
.equ	GPIOR12	= 2	; General Purpose IO Register 1 bit 2
921
.equ	GPIOR13	= 3	; General Purpose IO Register 1 bit 3
922
.equ	GPIOR14	= 4	; General Purpose IO Register 1 bit 4
923
.equ	GPIOR15	= 5	; General Purpose IO Register 1 bit 5
924
.equ	GPIOR16	= 6	; General Purpose IO Register 1 bit 6
925
.equ	GPIOR17	= 7	; General Purpose IO Register 1 bit 7
926
 
927
; GPIOR0 - General Purpose IO Register 0
928
.equ	GPIOR00	= 0	; General Purpose IO Register 0 bit 0
929
.equ	GPIOR01	= 1	; General Purpose IO Register 0 bit 1
930
.equ	GPIOR02	= 2	; General Purpose IO Register 0 bit 2
931
.equ	GPIOR03	= 3	; General Purpose IO Register 0 bit 3
932
.equ	GPIOR04	= 4	; General Purpose IO Register 0 bit 4
933
.equ	GPIOR05	= 5	; General Purpose IO Register 0 bit 5
934
.equ	GPIOR06	= 6	; General Purpose IO Register 0 bit 6
935
.equ	GPIOR07	= 7	; General Purpose IO Register 0 bit 7
936
 
937
 
938
 
939
; ***** LOCKSBITS ********************************************************
940
.equ	LB1	= 0	; Lock bit
941
.equ	LB2	= 1	; Lock bit
942
.equ	BLB01	= 2	; Boot Lock bit
943
.equ	BLB02	= 3	; Boot Lock bit
944
.equ	BLB11	= 4	; Boot lock bit
945
.equ	BLB12	= 5	; Boot lock bit
946
 
947
 
948
; ***** FUSES ************************************************************
949
; LOW fuse bits
950
.equ	CKSEL0	= 0	; Select Clock Source
951
.equ	CKSEL1	= 1	; Select Clock Source
952
.equ	CKSEL2	= 2	; Select Clock Source
953
.equ	CKSEL3	= 3	; Select Clock Source
954
.equ	SUT0	= 4	; Select start-up time
955
.equ	SUT1	= 5	; Select start-up time
956
.equ	CKOUT	= 6	; Oscillator options
957
.equ	CLKDIV8	= 7	; Divide clock by 8
958
 
959
; HIGH fuse bits
960
.equ	BOOTRST	= 0	; Select Reset Vector
961
.equ	BOOTSZ0	= 1	; Select Boot Size
962
.equ	BOOTSZ1	= 2	; Select Boot Size
963
.equ	EESAVE	= 3	; EEPROM memory is preserved through chip erase
964
.equ	WDTON	= 4	; Watchdog timer always on
965
.equ	SPIEN	= 5	; Enable Serial programming and Data Downloading
966
.equ	JTAGEN	= 6	; Enable JTAG
967
.equ	OCDEN	= 7	; Enable OCD
968
 
969
; EXTENDED fuse bits
970
.equ	RSTDISBL	= 0	; External Reset Disable
971
.equ	BODLEVEL0	= 1	; Brown-out Detector trigger level
972
.equ	BODLEVEL1	= 2	; Brown-out Detector trigger level
973
 
974
 
975
 
976
; ***** CPU REGISTER DEFINITIONS *****************************************
977
.def	XH	= r27
978
.def	XL	= r26
979
.def	YH	= r29
980
.def	YL	= r28
981
.def	ZH	= r31
982
.def	ZL	= r30
983
 
984
 
985
 
986
; ***** DATA MEMORY DECLARATIONS *****************************************
987
.equ	FLASHEND	= 0x3fff	; Note: Word address
988
.equ	IOEND	= 0x00ff
989
.equ	SRAM_START	= 0x0100
990
.equ	SRAM_SIZE	= 2048
991
.equ	RAMEND	= 0x08ff
992
.equ	XRAMEND	= 0x0000
993
.equ	E2END	= 0x03ff
994
.equ	EEPROMEND	= 0x03ff
995
.equ	EEADRBITS	= 10
996
#pragma AVRPART MEMORY PROG_FLASH 32768
997
#pragma AVRPART MEMORY EEPROM 1024
998
#pragma AVRPART MEMORY INT_SRAM SIZE 2048
999
#pragma AVRPART MEMORY INT_SRAM START_ADDR 0x100
1000
 
1001
 
1002
 
1003
; ***** BOOTLOADER DECLARATIONS ******************************************
1004
.equ	NRWW_START_ADDR	= 0x3800
1005
.equ	NRWW_STOP_ADDR	= 0x3fff
1006
.equ	RWW_START_ADDR	= 0x0
1007
.equ	RWW_STOP_ADDR	= 0x37ff
1008
.equ	PAGESIZE	= 64
1009
.equ	FIRSTBOOTSTART	= 0x3f00
1010
.equ	SECONDBOOTSTART	= 0x3e00
1011
.equ	THIRDBOOTSTART	= 0x3c00
1012
.equ	FOURTHBOOTSTART	= 0x3800
1013
.equ	SMALLBOOTSTART	= FIRSTBOOTSTART
1014
.equ	LARGEBOOTSTART	= FOURTHBOOTSTART
1015
 
1016
 
1017
 
1018
; ***** INTERRUPT VECTORS ************************************************
1019
.equ	INT0addr	= 0x0002	; External Interrupt Request 0
1020
.equ	PCI0addr	= 0x0004	; Pin Change Interrupt Request 0
1021
.equ	PCI1addr	= 0x0006	; Pin Change Interrupt Request 1
1022
.equ	OC2addr	= 0x0008	; Timer/Counter2 Compare Match
1023
.equ	OVF2addr	= 0x000a	; Timer/Counter2 Overflow
1024
.equ	ICP1addr	= 0x000c	; Timer/Counter1 Capture Event
1025
.equ	OC1Aaddr	= 0x000e	; Timer/Counter1 Compare Match A
1026
.equ	OC1Baddr	= 0x0010	; Timer/Counter Compare Match B
1027
.equ	OVF1addr	= 0x0012	; Timer/Counter1 Overflow
1028
.equ	OC0addr	= 0x0014	; Timer/Counter0 Compare Match
1029
.equ	OVF0addr	= 0x0016	; Timer/Counter0 Overflow
1030
.equ	SPIaddr	= 0x0018	; SPI Serial Transfer Complete
1031
.equ	URXC0addr	= 0x001a	; USART0, Rx Complete
1032
.equ	URXCaddr	= 0x001a	; For compatibility
1033
.equ	UDRE0addr	= 0x001c	; USART0 Data register Empty
1034
.equ	UDREaddr	= 0x001c	; For compatibility
1035
.equ	UTXC0addr	= 0x001e	; USART0, Tx Complete
1036
.equ	UTXCaddr	= 0x001e	; For compatibility
1037
.equ	USI_STARTaddr	= 0x0020	; USI Start Condition
1038
.equ	USI_OVFaddr	= 0x0022	; USI Overflow
1039
.equ	ACIaddr	= 0x0024	; Analog Comparator
1040
.equ	ADCCaddr	= 0x0026	; ADC Conversion Complete
1041
.equ	ERDYaddr	= 0x0028	; EEPROM Ready
1042
.equ	SPMRaddr	= 0x002a	; Store Program Memory Read
1043
 
1044
.equ	INT_VECTORS_SIZE	= 44	; size in words
1045
 
1046
#endif  /* _M325DEF_INC_ */
1047
 
1048
; ***** END OF FILE ******************************************************