1 ;***** THIS IS A MACHINE GENERATED FILE - DO NOT EDIT ********************
\r
2 ;***** Created: 2005-11-04 09:37 ******* Source: ATtiny2313.xml **********
\r
3 ;*************************************************************************
\r
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
\r
7 ;* File Name : "tn2313def.inc"
\r
8 ;* Title : Register/Bit Definitions for the ATtiny2313
\r
11 ;* Support E-mail : avr@atmel.com
\r
12 ;* Target MCU : ATtiny2313
\r
15 ;* When including this file in the assembly program file, all I/O register
\r
16 ;* names and I/O register bit names appearing in the data book can be used.
\r
17 ;* In addition, the six registers forming the three data pointers X, Y and
\r
18 ;* Z have been assigned names XL - ZH. Highest RAM address for Internal
\r
19 ;* SRAM is also defined
\r
21 ;* The Register names are represented by their hexadecimal address.
\r
23 ;* The Register Bit names are represented by their bit number (0-7).
\r
25 ;* Please observe the difference in using the bit names with instructions
\r
26 ;* such as "sbr"/"cbr" (set/clear bit in register) and "sbrs"/"sbrc"
\r
27 ;* (skip if bit in register set/cleared). The following example illustrates
\r
30 ;* in r16,PORTB ;read PORTB latch
\r
31 ;* sbr r16,(1<<PB6)+(1<<PB5) ;set PB6 and PB5 (use masks, not bit#)
\r
32 ;* out PORTB,r16 ;output to PORTB
\r
34 ;* in r16,TIFR ;read the Timer Interrupt Flag Register
\r
35 ;* sbrc r16,TOV0 ;test the overflow flag (use bit#)
\r
36 ;* rjmp TOV0_is_set ;jump if set
\r
37 ;* ... ;otherwise do something else
\r
38 ;*************************************************************************
\r
41 ; ***** SPECIFY DEVICE ***************************************************
\r
43 .equ SIGNATURE_000 = 0x1e
\r
44 .equ SIGNATURE_001 = 0x91
\r
45 .equ SIGNATURE_002 = 0x0a
\r
49 ; ***** I/O REGISTER DEFINITIONS *****************************************
\r
51 ; Definitions marked "MEMORY MAPPED"are extended I/O ports
\r
52 ; and cannot be used with IN/OUT instructions
\r
111 ; ***** BIT DEFINITIONS **************************************************
\r
113 ; ***** PORTB ************************
\r
114 ; PORTB - Port B Data Register
\r
115 .equ PORTB0 = 0 ; Port B Data Register bit 0
\r
116 .equ PB0 = 0 ; For compatibility
\r
117 .equ PORTB1 = 1 ; Port B Data Register bit 1
\r
118 .equ PB1 = 1 ; For compatibility
\r
119 .equ PORTB2 = 2 ; Port B Data Register bit 2
\r
120 .equ PB2 = 2 ; For compatibility
\r
121 .equ PORTB3 = 3 ; Port B Data Register bit 3
\r
122 .equ PB3 = 3 ; For compatibility
\r
123 .equ PORTB4 = 4 ; Port B Data Register bit 4
\r
124 .equ PB4 = 4 ; For compatibility
\r
125 .equ PORTB5 = 5 ; Port B Data Register bit 5
\r
126 .equ PB5 = 5 ; For compatibility
\r
127 .equ PORTB6 = 6 ; Port B Data Register bit 6
\r
128 .equ PB6 = 6 ; For compatibility
\r
129 .equ PORTB7 = 7 ; Port B Data Register bit 7
\r
130 .equ PB7 = 7 ; For compatibility
\r
132 ; DDRB - Port B Data Direction Register
\r
133 .equ DDB0 = 0 ; Port B Data Direction Register bit 0
\r
134 .equ DDB1 = 1 ; Port B Data Direction Register bit 1
\r
135 .equ DDB2 = 2 ; Port B Data Direction Register bit 2
\r
136 .equ DDB3 = 3 ; Port B Data Direction Register bit 3
\r
137 .equ DDB4 = 4 ; Port B Data Direction Register bit 4
\r
138 .equ DDB5 = 5 ; Port B Data Direction Register bit 5
\r
139 .equ DDB6 = 6 ; Port B Data Direction Register bit 6
\r
140 .equ DDB7 = 7 ; Port B Data Direction Register bit 7
\r
142 ; PINB - Port B Input Pins
\r
143 .equ PINB0 = 0 ; Port B Input Pins bit 0
\r
144 .equ PINB1 = 1 ; Port B Input Pins bit 1
\r
145 .equ PINB2 = 2 ; Port B Input Pins bit 2
\r
146 .equ PINB3 = 3 ; Port B Input Pins bit 3
\r
147 .equ PINB4 = 4 ; Port B Input Pins bit 4
\r
148 .equ PINB5 = 5 ; Port B Input Pins bit 5
\r
149 .equ PINB6 = 6 ; Port B Input Pins bit 6
\r
150 .equ PINB7 = 7 ; Port B Input Pins bit 7
\r
153 ; ***** TIMER_COUNTER_0 **************
\r
154 ; TIMSK - Timer/Counter Interrupt Mask Register
\r
155 .equ OCIE0A = 0 ; Timer/Counter0 Output Compare Match A Interrupt Enable
\r
156 .equ TOIE0 = 1 ; Timer/Counter0 Overflow Interrupt Enable
\r
157 .equ OCIE0B = 2 ; Timer/Counter0 Output Compare Match B Interrupt Enable
\r
159 ; TIFR - Timer/Counter Interrupt Flag register
\r
160 .equ OCF0A = 0 ; Timer/Counter0 Output Compare Flag 0A
\r
161 .equ TOV0 = 1 ; Timer/Counter0 Overflow Flag
\r
162 .equ OCF0B = 2 ; Timer/Counter0 Output Compare Flag 0B
\r
164 ; OCR0B - Timer/Counter0 Output Compare Register
\r
174 ; OCR0A - Timer/Counter0 Output Compare Register
\r
175 ;.equ OCR0_0 = 0 ;
\r
176 ;.equ OCR0_1 = 1 ;
\r
177 ;.equ OCR0_2 = 2 ;
\r
178 ;.equ OCR0_3 = 3 ;
\r
179 ;.equ OCR0_4 = 4 ;
\r
180 ;.equ OCR0_5 = 5 ;
\r
181 ;.equ OCR0_6 = 6 ;
\r
182 ;.equ OCR0_7 = 7 ;
\r
184 ; TCCR0A - Timer/Counter Control Register A
\r
185 .equ WGM00 = 0 ; Waveform Generation Mode
\r
186 .equ WGM01 = 1 ; Waveform Generation Mode
\r
187 .equ COM0B0 = 4 ; Compare Match Output B Mode
\r
188 .equ COM0B1 = 5 ; Compare Match Output B Mode
\r
189 .equ COM0A0 = 6 ; Compare Match Output A Mode
\r
190 .equ COM0A1 = 7 ; Compare Match Output A Mode
\r
192 ; TCNT0 - Timer/Counter0
\r
193 .equ TCNT0_0 = 0 ;
\r
194 .equ TCNT0_1 = 1 ;
\r
195 .equ TCNT0_2 = 2 ;
\r
196 .equ TCNT0_3 = 3 ;
\r
197 .equ TCNT0_4 = 4 ;
\r
198 .equ TCNT0_5 = 5 ;
\r
199 .equ TCNT0_6 = 6 ;
\r
200 .equ TCNT0_7 = 7 ;
\r
202 ; TCCR0B - Timer/Counter Control Register B
\r
203 .equ TCCR0 = TCCR0B ; For compatibility
\r
204 .equ CS00 = 0 ; Clock Select
\r
205 .equ CS01 = 1 ; Clock Select
\r
206 .equ CS02 = 2 ; Clock Select
\r
208 .equ FOC0B = 6 ; Force Output Compare B
\r
209 .equ FOC0A = 7 ; Force Output Compare B
\r
212 ; ***** TIMER_COUNTER_1 **************
\r
213 ; TIMSK - Timer/Counter Interrupt Mask Register
\r
214 .equ ICIE1 = 3 ; Timer/Counter1 Input Capture Interrupt Enable
\r
215 .equ TICIE = ICIE1 ; For compatibility
\r
216 .equ OCIE1B = 5 ; Timer/Counter1 Output CompareB Match Interrupt Enable
\r
217 .equ OCIE1A = 6 ; Timer/Counter1 Output CompareA Match Interrupt Enable
\r
218 .equ TOIE1 = 7 ; Timer/Counter1 Overflow Interrupt Enable
\r
220 ; TIFR - Timer/Counter Interrupt Flag register
\r
221 .equ ICF1 = 3 ; Input Capture Flag 1
\r
222 .equ OCF1B = 5 ; Output Compare Flag 1B
\r
223 .equ OCF1A = 6 ; Output Compare Flag 1A
\r
224 .equ TOV1 = 7 ; Timer/Counter1 Overflow Flag
\r
226 ; TCCR1A - Timer/Counter1 Control Register A
\r
227 .equ WGM10 = 0 ; Pulse Width Modulator Select Bit 0
\r
228 .equ PWM10 = WGM10 ; For compatibility
\r
229 .equ WGM11 = 1 ; Pulse Width Modulator Select Bit 1
\r
230 .equ PWM11 = WGM11 ; For compatibility
\r
231 .equ COM1B0 = 4 ; Comparet Ouput Mode 1B, bit 0
\r
232 .equ COM1B1 = 5 ; Compare Output Mode 1B, bit 1
\r
233 .equ COM1A0 = 6 ; Comparet Ouput Mode 1A, bit 0
\r
234 .equ COM1A1 = 7 ; Compare Output Mode 1A, bit 1
\r
236 ; TCCR1B - Timer/Counter1 Control Register B
\r
237 .equ CS10 = 0 ; Clock Select bit 0
\r
238 .equ CS11 = 1 ; Clock Select 1 bit 1
\r
239 .equ CS12 = 2 ; Clock Select1 bit 2
\r
240 .equ WGM12 = 3 ; Waveform Generation Mode Bit 2
\r
241 .equ CTC1 = WGM12 ; For compatibility
\r
242 .equ WGM13 = 4 ; Waveform Generation Mode Bit 3
\r
243 .equ ICES1 = 6 ; Input Capture 1 Edge Select
\r
244 .equ ICNC1 = 7 ; Input Capture 1 Noise Canceler
\r
246 ; TCCR1C - Timer/Counter1 Control Register C
\r
247 .equ FOC1B = 6 ; Force Output Compare for Channel B
\r
248 .equ FOC1A = 7 ; Force Output Compare for Channel A
\r
251 ; ***** WATCHDOG *********************
\r
252 ; WDTCR - Watchdog Timer Control Register
\r
253 .equ WDTCSR = WDTCR ; For compatibility
\r
254 .equ WDP0 = 0 ; Watch Dog Timer Prescaler bit 0
\r
255 .equ WDP1 = 1 ; Watch Dog Timer Prescaler bit 1
\r
256 .equ WDP2 = 2 ; Watch Dog Timer Prescaler bit 2
\r
257 .equ WDE = 3 ; Watch Dog Enable
\r
258 .equ WDCE = 4 ; Watchdog Change Enable
\r
259 .equ WDTOE = WDCE ; For compatibility
\r
260 .equ WDP3 = 5 ; Watchdog Timer Prescaler Bit 3
\r
261 .equ WDIE = 6 ; Watchdog Timeout Interrupt Enable
\r
262 .equ WDIF = 7 ; Watchdog Timeout Interrupt Flag
\r
265 ; ***** EXTERNAL_INTERRUPT ***********
\r
266 ; GIMSK - General Interrupt Mask Register
\r
268 .equ INT0 = 6 ; External Interrupt Request 0 Enable
\r
269 .equ INT1 = 7 ; External Interrupt Request 1 Enable
\r
271 ; EIFR - Extended Interrupt Flag Register
\r
272 .equ GIFR = EIFR ; For compatibility
\r
274 .equ INTF0 = 6 ; External Interrupt Flag 0
\r
275 .equ INTF1 = 7 ; External Interrupt Flag 1
\r
278 ; ***** USART ************************
\r
279 ; UDR - USART I/O Data Register
\r
280 .equ UDR0 = 0 ; USART I/O Data Register bit 0
\r
281 .equ UDR1 = 1 ; USART I/O Data Register bit 1
\r
282 .equ UDR2 = 2 ; USART I/O Data Register bit 2
\r
283 .equ UDR3 = 3 ; USART I/O Data Register bit 3
\r
284 .equ UDR4 = 4 ; USART I/O Data Register bit 4
\r
285 .equ UDR5 = 5 ; USART I/O Data Register bit 5
\r
286 .equ UDR6 = 6 ; USART I/O Data Register bit 6
\r
287 .equ UDR7 = 7 ; USART I/O Data Register bit 7
\r
289 ; UCSRA - USART Control and Status Register A
\r
290 .equ USR = UCSRA ; For compatibility
\r
291 .equ MPCM = 0 ; Multi-processor Communication Mode
\r
292 .equ U2X = 1 ; Double the USART Transmission Speed
\r
293 .equ UPE = 2 ; USART Parity Error
\r
294 .equ PE = UPE ; For compatibility
\r
295 .equ DOR = 3 ; Data overRun
\r
296 .equ FE = 4 ; Framing Error
\r
297 .equ UDRE = 5 ; USART Data Register Empty
\r
298 .equ TXC = 6 ; USART Transmitt Complete
\r
299 .equ RXC = 7 ; USART Receive Complete
\r
301 ; UCSRB - USART Control and Status Register B
\r
302 .equ UCR = UCSRB ; For compatibility
\r
303 .equ TXB8 = 0 ; Transmit Data Bit 8
\r
304 .equ RXB8 = 1 ; Receive Data Bit 8
\r
305 .equ UCSZ2 = 2 ; Character Size
\r
306 .equ CHR9 = UCSZ2 ; For compatibility
\r
307 .equ TXEN = 3 ; Transmitter Enable
\r
308 .equ RXEN = 4 ; Receiver Enable
\r
309 .equ UDRIE = 5 ; USART Data register Empty Interrupt Enable
\r
310 .equ TXCIE = 6 ; TX Complete Interrupt Enable
\r
311 .equ RXCIE = 7 ; RX Complete Interrupt Enable
\r
313 ; UCSRC - USART Control and Status Register C
\r
314 .equ UCPOL = 0 ; Clock Polarity
\r
315 .equ UCSZ0 = 1 ; Character Size Bit 0
\r
316 .equ UCSZ1 = 2 ; Character Size Bit 1
\r
317 .equ USBS = 3 ; Stop Bit Select
\r
318 .equ UPM0 = 4 ; Parity Mode Bit 0
\r
319 .equ UPM1 = 5 ; Parity Mode Bit 1
\r
320 .equ UMSEL = 6 ; USART Mode Select
\r
322 .equ UBRR = UBRRL ; For compatibility
\r
324 ; ***** ANALOG_COMPARATOR ************
\r
325 ; ACSR - Analog Comparator Control And Status Register
\r
326 .equ ACIS0 = 0 ; Analog Comparator Interrupt Mode Select bit 0
\r
327 .equ ACIS1 = 1 ; Analog Comparator Interrupt Mode Select bit 1
\r
329 .equ ACIE = 3 ; Analog Comparator Interrupt Enable
\r
330 .equ ACI = 4 ; Analog Comparator Interrupt Flag
\r
331 .equ ACO = 5 ; Analog Compare Output
\r
332 .equ ACBG = 6 ; Analog Comparator Bandgap Select
\r
333 .equ ACD = 7 ; Analog Comparator Disable
\r
335 ; DIDR - Digital Input Disable Register 1
\r
336 .equ AIN0D = 0 ; AIN0 Digital Input Disable
\r
337 .equ AIN1D = 1 ; AIN1 Digital Input Disable
\r
340 ; ***** PORTD ************************
\r
341 ; PORTD - Data Register, Port D
\r
343 .equ PD0 = 0 ; For compatibility
\r
345 .equ PD1 = 1 ; For compatibility
\r
347 .equ PD2 = 2 ; For compatibility
\r
349 .equ PD3 = 3 ; For compatibility
\r
351 .equ PD4 = 4 ; For compatibility
\r
353 .equ PD5 = 5 ; For compatibility
\r
355 .equ PD6 = 6 ; For compatibility
\r
366 ; PIND - Input Pins, Port D
\r
376 ; ***** EEPROM ***********************
\r
377 ; EEAR - EEPROM Read/Write Access
\r
378 .equ EEARL = EEAR ; For compatibility
\r
379 .equ EEAR0 = 0 ; EEPROM Read/Write Access bit 0
\r
380 .equ EEAR1 = 1 ; EEPROM Read/Write Access bit 1
\r
381 .equ EEAR2 = 2 ; EEPROM Read/Write Access bit 2
\r
382 .equ EEAR3 = 3 ; EEPROM Read/Write Access bit 3
\r
383 .equ EEAR4 = 4 ; EEPROM Read/Write Access bit 4
\r
384 .equ EEAR5 = 5 ; EEPROM Read/Write Access bit 5
\r
385 .equ EEAR6 = 6 ; EEPROM Read/Write Access bit 6
\r
387 ; EEDR - EEPROM Data Register
\r
388 .equ EEDR0 = 0 ; EEPROM Data Register bit 0
\r
389 .equ EEDR1 = 1 ; EEPROM Data Register bit 1
\r
390 .equ EEDR2 = 2 ; EEPROM Data Register bit 2
\r
391 .equ EEDR3 = 3 ; EEPROM Data Register bit 3
\r
392 .equ EEDR4 = 4 ; EEPROM Data Register bit 4
\r
393 .equ EEDR5 = 5 ; EEPROM Data Register bit 5
\r
394 .equ EEDR6 = 6 ; EEPROM Data Register bit 6
\r
395 .equ EEDR7 = 7 ; EEPROM Data Register bit 7
\r
397 ; EECR - EEPROM Control Register
\r
398 .equ EERE = 0 ; EEPROM Read Enable
\r
399 .equ EEPE = 1 ; EEPROM Write Enable
\r
400 .equ EEWE = EEPE ; For compatibility
\r
401 .equ EEMPE = 2 ; EEPROM Master Write Enable
\r
402 .equ EEMWE = EEMPE ; For compatibility
\r
403 .equ EERIE = 3 ; EEProm Ready Interrupt Enable
\r
408 ; ***** PORTA ************************
\r
409 ; PORTA - Port A Data Register
\r
410 .equ PORTA0 = 0 ; Port A Data Register bit 0
\r
411 .equ PA0 = 0 ; For compatibility
\r
412 .equ PORTA1 = 1 ; Port A Data Register bit 1
\r
413 .equ PA1 = 1 ; For compatibility
\r
414 .equ PORTA2 = 2 ; Port A Data Register bit 2
\r
415 .equ PA2 = 2 ; For compatibility
\r
417 ; DDRA - Port A Data Direction Register
\r
418 .equ DDA0 = 0 ; Data Direction Register, Port A, bit 0
\r
419 .equ DDA1 = 1 ; Data Direction Register, Port A, bit 1
\r
420 .equ DDA2 = 2 ; Data Direction Register, Port A, bit 2
\r
422 ; PINA - Port A Input Pins
\r
423 .equ PINA0 = 0 ; Input Pins, Port A bit 0
\r
424 .equ PINA1 = 1 ; Input Pins, Port A bit 1
\r
425 .equ PINA2 = 2 ; Input Pins, Port A bit 2
\r
428 ; ***** CPU **************************
\r
429 ; SREG - Status Register
\r
430 .equ SREG_C = 0 ; Carry Flag
\r
431 .equ SREG_Z = 1 ; Zero Flag
\r
432 .equ SREG_N = 2 ; Negative Flag
\r
433 .equ SREG_V = 3 ; Two's Complement Overflow Flag
\r
434 .equ SREG_S = 4 ; Sign Bit
\r
435 .equ SREG_H = 5 ; Half Carry Flag
\r
436 .equ SREG_T = 6 ; Bit Copy Storage
\r
437 .equ SREG_I = 7 ; Global Interrupt Enable
\r
439 ; SPMCSR - Store Program Memory Control and Status register
\r
440 .equ SPMEN = 0 ; Store Program Memory Enable
\r
441 .equ PGERS = 1 ; Page Erase
\r
442 .equ PGWRT = 2 ; Page Write
\r
443 .equ RFLB = 3 ; Read Fuse and Lock Bits
\r
446 ; MCUCR - MCU Control Register
\r
447 .equ ISC00 = 0 ; Interrupt Sense Control 0 bit 0
\r
448 .equ ISC01 = 1 ; Interrupt Sense Control 0 bit 1
\r
449 .equ ISC10 = 2 ; Interrupt Sense Control 1 bit 0
\r
450 .equ ISC11 = 3 ; Interrupt Sense Control 1 bit 1
\r
451 .equ SM0 = 4 ; Sleep Mode Select Bit 0
\r
452 .equ SM = SM0 ; For compatibility
\r
453 .equ SE = 5 ; Sleep Enable
\r
454 .equ SM1 = 6 ; Sleep Mode Select Bit 1
\r
455 .equ PUD = 7 ; Pull-up Disable
\r
457 ; CLKPR - Clock Prescale Register
\r
458 .equ CLKPS0 = 0 ; Clock Prescaler Select Bit 0
\r
459 .equ CLKPS1 = 1 ; Clock Prescaler Select Bit 1
\r
460 .equ CLKPS2 = 2 ; Clock Prescaler Select Bit 2
\r
461 .equ CLKPS3 = 3 ; Clock Prescaler Select Bit 3
\r
462 .equ CLKPCE = 7 ; Clock Prescaler Change Enable
\r
464 ; MCUSR - MCU Status register
\r
465 .equ PORF = 0 ; Power-On Reset Flag
\r
466 .equ EXTRF = 1 ; External Reset Flag
\r
467 .equ BORF = 2 ; Brown-out Reset Flag
\r
468 .equ WDRF = 3 ; Watchdog Reset Flag
\r
470 ; OSCCAL - Oscillator Calibration Register
\r
471 .equ CAL0 = 0 ; Oscillatro Calibration Value Bit 0
\r
472 .equ CAL1 = 1 ; Oscillatro Calibration Value Bit 1
\r
473 .equ CAL2 = 2 ; Oscillatro Calibration Value Bit 2
\r
474 .equ CAL3 = 3 ; Oscillatro Calibration Value Bit 3
\r
475 .equ CAL4 = 4 ; Oscillatro Calibration Value Bit 4
\r
476 .equ CAL5 = 5 ; Oscillatro Calibration Value Bit 5
\r
477 .equ CAL6 = 6 ; Oscillatro Calibration Value Bit 6
\r
479 ; GTCCR - General Timer Counter Control Register
\r
480 .equ SFIOR = GTCCR ; For compatibility
\r
483 ; PCMSK - Pin-Change Mask register
\r
484 .equ PCINT0 = 0 ; Pin-Change Interrupt 0
\r
485 .equ PCINT1 = 1 ; Pin-Change Interrupt 1
\r
486 .equ PCINT2 = 2 ; Pin-Change Interrupt 2
\r
487 .equ PCINT3 = 3 ; Pin-Change Interrupt 3
\r
488 .equ PCINT4 = 4 ; Pin-Change Interrupt 4
\r
489 .equ PCINT5 = 5 ; Pin-Change Interrupt 5
\r
490 .equ PCINT6 = 6 ; Pin-Change Interrupt 6
\r
491 .equ PCINT7 = 7 ; Pin-Change Interrupt 7
\r
493 ; GPIOR2 - General Purpose I/O Register 2
\r
494 .equ GPIOR20 = 0 ; General Purpose I/O Register 2 bit 0
\r
495 .equ GPIOR21 = 1 ; General Purpose I/O Register 2 bit 1
\r
496 .equ GPIOR22 = 2 ; General Purpose I/O Register 2 bit 2
\r
497 .equ GPIOR23 = 3 ; General Purpose I/O Register 2 bit 3
\r
498 .equ GPIOR24 = 4 ; General Purpose I/O Register 2 bit 4
\r
499 .equ GPIOR25 = 5 ; General Purpose I/O Register 2 bit 5
\r
500 .equ GPIOR26 = 6 ; General Purpose I/O Register 2 bit 6
\r
501 .equ GPIOR27 = 7 ; General Purpose I/O Register 2 bit 7
\r
503 ; GPIOR1 - General Purpose I/O Register 1
\r
504 .equ GPIOR10 = 0 ; General Purpose I/O Register 1 bit 0
\r
505 .equ GPIOR11 = 1 ; General Purpose I/O Register 1 bit 1
\r
506 .equ GPIOR12 = 2 ; General Purpose I/O Register 1 bit 2
\r
507 .equ GPIOR13 = 3 ; General Purpose I/O Register 1 bit 3
\r
508 .equ GPIOR14 = 4 ; General Purpose I/O Register 1 bit 4
\r
509 .equ GPIOR15 = 5 ; General Purpose I/O Register 1 bit 5
\r
510 .equ GPIOR16 = 6 ; General Purpose I/O Register 1 bit 6
\r
511 .equ GPIOR17 = 7 ; General Purpose I/O Register 1 bit 7
\r
513 ; GPIOR0 - General Purpose I/O Register 0
\r
514 .equ GPIOR00 = 0 ; General Purpose I/O Register 0 bit 0
\r
515 .equ GPIOR01 = 1 ; General Purpose I/O Register 0 bit 1
\r
516 .equ GPIOR02 = 2 ; General Purpose I/O Register 0 bit 2
\r
517 .equ GPIOR03 = 3 ; General Purpose I/O Register 0 bit 3
\r
518 .equ GPIOR04 = 4 ; General Purpose I/O Register 0 bit 4
\r
519 .equ GPIOR05 = 5 ; General Purpose I/O Register 0 bit 5
\r
520 .equ GPIOR06 = 6 ; General Purpose I/O Register 0 bit 6
\r
521 .equ GPIOR07 = 7 ; General Purpose I/O Register 0 bit 7
\r
524 ; ***** USI **************************
\r
525 ; USIDR - USI Data Register
\r
526 .equ USIDR0 = 0 ; USI Data Register bit 0
\r
527 .equ USIDR1 = 1 ; USI Data Register bit 1
\r
528 .equ USIDR2 = 2 ; USI Data Register bit 2
\r
529 .equ USIDR3 = 3 ; USI Data Register bit 3
\r
530 .equ USIDR4 = 4 ; USI Data Register bit 4
\r
531 .equ USIDR5 = 5 ; USI Data Register bit 5
\r
532 .equ USIDR6 = 6 ; USI Data Register bit 6
\r
533 .equ USIDR7 = 7 ; USI Data Register bit 7
\r
535 ; USISR - USI Status Register
\r
536 .equ USICNT0 = 0 ; USI Counter Value Bit 0
\r
537 .equ USICNT1 = 1 ; USI Counter Value Bit 1
\r
538 .equ USICNT2 = 2 ; USI Counter Value Bit 2
\r
539 .equ USICNT3 = 3 ; USI Counter Value Bit 3
\r
540 .equ USIDC = 4 ; Data Output Collision
\r
541 .equ USIPF = 5 ; Stop Condition Flag
\r
542 .equ USIOIF = 6 ; Counter Overflow Interrupt Flag
\r
543 .equ USISIF = 7 ; Start Condition Interrupt Flag
\r
545 ; USICR - USI Control Register
\r
546 .equ USITC = 0 ; Toggle Clock Port Pin
\r
547 .equ USICLK = 1 ; Clock Strobe
\r
548 .equ USICS0 = 2 ; USI Clock Source Select Bit 0
\r
549 .equ USICS1 = 3 ; USI Clock Source Select Bit 1
\r
550 .equ USIWM0 = 4 ; USI Wire Mode Bit 0
\r
551 .equ USIWM1 = 5 ; USI Wire Mode Bit 1
\r
552 .equ USIOIE = 6 ; Counter Overflow Interrupt Enable
\r
553 .equ USISIE = 7 ; Start Condition Interrupt Enable
\r
557 ; ***** LOCKSBITS ********************************************************
\r
558 .equ LB1 = 0 ; Lockbit
\r
559 .equ LB2 = 1 ; Lockbit
\r
562 ; ***** FUSES ************************************************************
\r
564 .equ CKSEL0 = 0 ; Select Clock Source
\r
565 .equ CKSEL1 = 1 ; Select Clock Source
\r
566 .equ CKSEL2 = 2 ; Select Clock Source
\r
567 .equ CKSEL3 = 3 ; Select Clock Source
\r
568 .equ SUT0 = 4 ; Select start-up time
\r
569 .equ SUT1 = 5 ; Select start-up time
\r
570 .equ CKOUT = 6 ; Clock output
\r
571 .equ CKDIV8 = 7 ; Divide clock by 8
\r
574 .equ BODLEVEL0 = 0 ; Brown-out Detector trigger level
\r
575 .equ BODLEVEL1 = 1 ; Brown-out Detector trigger level
\r
576 .equ BODLEVEL2 = 2 ; Brown-out Detector trigger level
\r
577 .equ EESAVE = 3 ; EEPROM memory is preserved through chip erase
\r
578 .equ WDTON = 4 ; Watchdog Timer Always On
\r
579 .equ SPIEN = 5 ; Enable Serial programming and Data Downloading
\r
580 .equ DWEN = 6 ; debugWIRE Enable
\r
581 .equ RSTDISBL = 7 ; External reset disable
\r
583 ; EXTENDED fuse bits
\r
584 .equ SELFPRGEN = 0 ; Self Programming Enable
\r
588 ; ***** CPU REGISTER DEFINITIONS *****************************************
\r
598 ; ***** DATA MEMORY DECLARATIONS *****************************************
\r
599 .equ FLASHEND = 0x03ff ; Note: Word address
\r
600 .equ IOEND = 0x003f
\r
601 .equ SRAM_START = 0x0060
\r
602 .equ SRAM_SIZE = 128
\r
603 .equ RAMEND = 0x00df
\r
604 .equ XRAMEND = 0x0000
\r
605 .equ E2END = 0x007f
\r
606 .equ EEPROMEND = 0x007f
\r
611 ; ***** BOOTLOADER DECLARATIONS ******************************************
\r
612 .equ NRWW_START_ADDR = 0x0
\r
613 .equ NRWW_STOP_ADDR = 0x3ff
\r
614 .equ RWW_START_ADDR = 0x0
\r
615 .equ RWW_STOP_ADDR = 0x0
\r
620 ; ***** INTERRUPT VECTORS ************************************************
\r
621 .equ INT0addr = 0x0001 ; External Interrupt Request 0
\r
622 .equ INT1addr = 0x0002 ; External Interrupt Request 1
\r
623 .equ ICP1addr = 0x0003 ; Timer/Counter1 Capture Event
\r
624 .equ OC1Aaddr = 0x0004 ; Timer/Counter1 Compare Match A
\r
625 .equ OC1addr = 0x0004 ; For compatibility
\r
626 .equ OVF1addr = 0x0005 ; Timer/Counter1 Overflow
\r
627 .equ OVF0addr = 0x0006 ; Timer/Counter0 Overflow
\r
628 .equ URXCaddr = 0x0007 ; USART, Rx Complete
\r
629 .equ URXC0addr = 0x0007 ; For compatibility
\r
630 .equ UDREaddr = 0x0008 ; USART Data Register Empty
\r
631 .equ UDRE0addr = 0x0008 ; For compatibility
\r
632 .equ UTXCaddr = 0x0009 ; USART, Tx Complete
\r
633 .equ UTXC0addr = 0x0009 ; For compatibility
\r
634 .equ ACIaddr = 0x000a ; Analog Comparator
\r
635 .equ PCIaddr = 0x000b ;
\r
636 .equ OC1Baddr = 0x000c ;
\r
637 .equ OC0Aaddr = 0x000d ;
\r
638 .equ OC0Baddr = 0x000e ;
\r
639 .equ USI_STARTaddr = 0x000f ; USI Start Condition
\r
640 .equ USI_OVFaddr = 0x0010 ; USI Overflow
\r
641 .equ ERDYaddr = 0x0011 ;
\r
642 .equ WDTaddr = 0x0012 ; Watchdog Timer Overflow
\r
644 .equ INT_VECTORS_SIZE = 19 ; size in words
\r
647 ; ***** END OF FILE ******************************************************
\r