Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  1. ;***** THIS IS A MACHINE GENERATED FILE - DO NOT EDIT ********************
  2. ;***** Created: 2005-01-11 10:31 ******* Source: ATmega3250.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         : "m3250def.inc"
  8. ;* Title             : Register/Bit Definitions for the ATmega3250
  9. ;* Date              : 2005-01-11
  10. ;* Version           : 2.14
  11. ;* Support E-mail    : avr@atmel.com
  12. ;* Target MCU        : ATmega3250
  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<<PB6)+(1<<PB5) ;set PB6 and PB5 (use masks, not bit#)
  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 _M3250DEF_INC_
  41. #define _M3250DEF_INC_
  42.  
  43.  
  44. #pragma partinc 0
  45.  
  46. ; ***** SPECIFY DEVICE ***************************************************
  47. .device ATmega3250
  48. #pragma AVRPART ADMIN PART_NAME ATmega3250
  49. .equ    SIGNATURE_000   = 0x1e
  50. .equ    SIGNATURE_001   = 0x95
  51. .equ    SIGNATURE_002   = 0x06
  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. ; ***** TIMER_COUNTER_0 **************
  163. ; TCCR0A - Timer/Counter0 Control Register
  164. .equ    CS00    = 0     ; Clock Select 1
  165. .equ    CS01    = 1     ; Clock Select 1
  166. .equ    CS02    = 2     ; Clock Select 2
  167. .equ    WGM01   = 3     ; Waveform Generation Mode 1
  168. .equ    COM0A0  = 4     ; Compare match Output Mode 0
  169. .equ    COM0A1  = 5     ; Compare Match Output Mode 1
  170. .equ    WGM00   = 6     ; Waveform Generation Mode 0
  171. .equ    FOC0A   = 7     ; Force Output Compare
  172.  
  173. ; TCNT0 - Timer/Counter0
  174. .equ    TCNT0_0 = 0     ;
  175. .equ    TCNT0_1 = 1     ;
  176. .equ    TCNT0_2 = 2     ;
  177. .equ    TCNT0_3 = 3     ;
  178. .equ    TCNT0_4 = 4     ;
  179. .equ    TCNT0_5 = 5     ;
  180. .equ    TCNT0_6 = 6     ;
  181. .equ    TCNT0_7 = 7     ;
  182.  
  183. ; OCR0A - Timer/Counter0 Output Compare Register
  184. .equ    OCR0A0  = 0     ;
  185. .equ    OCR0A1  = 1     ;
  186. .equ    OCR0A2  = 2     ;
  187. .equ    OCR0A3  = 3     ;
  188. .equ    OCR0A4  = 4     ;
  189. .equ    OCR0A5  = 5     ;
  190. .equ    OCR0A6  = 6     ;
  191. .equ    OCR0A7  = 7     ;
  192.  
  193. ; TIMSK0 - Timer/Counter0 Interrupt Mask Register
  194. .equ    TOIE0   = 0     ; Timer/Counter0 Overflow Interrupt Enable
  195. .equ    OCIE0A  = 1     ; Timer/Counter0 Output Compare Match Interrupt Enable
  196.  
  197. ; TIFR0 - Timer/Counter0 Interrupt Flag register
  198. .equ    TOV0    = 0     ; Timer/Counter0 Overflow Flag
  199. .equ    OCF0A   = 1     ; Timer/Counter0 Output Compare Flag 0
  200.  
  201. ; GTCCR - General Timer/Control Register
  202. .equ    PSR310  = 0     ; Prescaler Reset Timer/Counter1 and Timer/Counter0
  203. .equ    PSR10   = PSR310        ; For compatibility
  204. .equ    PSR0    = PSR310        ; For compatibility
  205. .equ    PSR1    = PSR310        ; For compatibility
  206. .equ    PSR3    = PSR310        ; For compatibility
  207. .equ    TSM     = 7     ; Timer/Counter Synchronization Mode
  208.  
  209.  
  210. ; ***** TIMER_COUNTER_1 **************
  211. ; TIMSK1 - Timer/Counter1 Interrupt Mask Register
  212. .equ    TOIE1   = 0     ; Timer/Counter1 Overflow Interrupt Enable
  213. .equ    OCIE1A  = 1     ; Timer/Counter1 Output Compare A Match Interrupt Enable
  214. .equ    OCIE1B  = 2     ; Timer/Counter1 Output Compare B Match Interrupt Enable
  215. .equ    ICIE1   = 5     ; Timer/Counter1 Input Capture Interrupt Enable
  216.  
  217. ; TIFR1 - Timer/Counter1 Interrupt Flag register
  218. .equ    TOV1    = 0     ; Timer/Counter1 Overflow Flag
  219. .equ    OCF1A   = 1     ; Output Compare Flag 1A
  220. .equ    OCF1B   = 2     ; Output Compare Flag 1B
  221. .equ    ICF1    = 5     ; Input Capture Flag 1
  222.  
  223. ; TCCR1A - Timer/Counter1 Control Register A
  224. .equ    WGM10   = 0     ; Waveform Generation Mode
  225. .equ    WGM11   = 1     ; Waveform Generation Mode
  226. .equ    COM1B0  = 4     ; Compare Output Mode 1B, bit 0
  227. .equ    COM1B1  = 5     ; Compare Output Mode 1B, bit 1
  228. .equ    COM1A0  = 6     ; Compare Output Mode 1A, bit 0
  229. .equ    COM1A1  = 7     ; Compare Output Mode 1A, bit 1
  230.  
  231. ; TCCR1B - Timer/Counter1 Control Register B
  232. .equ    CS10    = 0     ; Prescaler source of Timer/Counter 1
  233. .equ    CS11    = 1     ; Prescaler source of Timer/Counter 1
  234. .equ    CS12    = 2     ; Prescaler source of Timer/Counter 1
  235. .equ    WGM12   = 3     ; Waveform Generation Mode
  236. .equ    WGM13   = 4     ; Waveform Generation Mode
  237. .equ    ICES1   = 6     ; Input Capture 1 Edge Select
  238. .equ    ICNC1   = 7     ; Input Capture 1 Noise Canceler
  239.  
  240. ; TCCR1C - Timer/Counter 1 Control Register C
  241. .equ    FOC1B   = 6     ; Force Output Compare 1B
  242. .equ    FOC1A   = 7     ; Force Output Compare 1A
  243.  
  244.  
  245. ; ***** TIMER_COUNTER_2 **************
  246. ; TIMSK2 - Timer/Counter2 Interrupt Mask register
  247. .equ    TOIE2   = 0     ; Timer/Counter2 Overflow Interrupt Enable
  248. .equ    OCIE2A  = 1     ; Timer/Counter2 Output Compare Match Interrupt Enable
  249.  
  250. ; TIFR2 - Timer/Counter2 Interrupt Flag Register
  251. .equ    TOV2    = 0     ; Timer/Counter2 Overflow Flag
  252. .equ    OCF2A   = 1     ; Timer/Counter2 Output Compare Flag 2
  253.  
  254. ; TCCR2A - Timer/Counter2 Control Register
  255. .equ    CS20    = 0     ; Clock Select bit 0
  256. .equ    CS21    = 1     ; Clock Select bit 1
  257. .equ    CS22    = 2     ; Clock Select bit 2
  258. .equ    WGM21   = 3     ; Waveform Generation Mode
  259. .equ    COM2A0  = 4     ; Compare Output Mode bit 0
  260. .equ    COM2A1  = 5     ; Compare Output Mode bit 1
  261. .equ    WGM20   = 6     ; Waveform Generation Mode
  262. .equ    FOC2A   = 7     ; Force Output Compare A
  263.  
  264. ; TCNT2 - Timer/Counter2
  265. .equ    TCNT2_0 = 0     ; Timer/Counter 2 bit 0
  266. .equ    TCNT2_1 = 1     ; Timer/Counter 2 bit 1
  267. .equ    TCNT2_2 = 2     ; Timer/Counter 2 bit 2
  268. .equ    TCNT2_3 = 3     ; Timer/Counter 2 bit 3
  269. .equ    TCNT2_4 = 4     ; Timer/Counter 2 bit 4
  270. .equ    TCNT2_5 = 5     ; Timer/Counter 2 bit 5
  271. .equ    TCNT2_6 = 6     ; Timer/Counter 2 bit 6
  272. .equ    TCNT2_7 = 7     ; Timer/Counter 2 bit 7
  273.  
  274. ; OCR2A - Timer/Counter2 Output Compare Register
  275. .equ    OCR2A0  = 0     ; Timer/Counter2 Output Compare Register Bit 0
  276. .equ    OCR2A1  = 1     ; Timer/Counter2 Output Compare Register Bit 1
  277. .equ    OCR2A2  = 2     ; Timer/Counter2 Output Compare Register Bit 2
  278. .equ    OCR2A3  = 3     ; Timer/Counter2 Output Compare Register Bit 3
  279. .equ    OCR2A4  = 4     ; Timer/Counter2 Output Compare Register Bit 4
  280. .equ    OCR2A5  = 5     ; Timer/Counter2 Output Compare Register Bit 5
  281. .equ    OCR2A6  = 6     ; Timer/Counter2 Output Compare Register Bit 6
  282. .equ    OCR2A7  = 7     ; Timer/Counter2 Output Compare Register Bit 7
  283.  
  284. ; GTCCR - General Timer/Counter Control Register
  285. .equ    PSR2    = 1     ; Prescaler Reset Timer/Counter2
  286.  
  287. ; ASSR - Asynchronous Status Register
  288. .equ    TCR2UB  = 0     ; TCR2UB: Timer/Counter Control Register2 Update Busy
  289. .equ    OCR2UB  = 1     ; Output Compare Register2 Update Busy
  290. .equ    TCN2UB  = 2     ; TCN2UB: Timer/Counter2 Update Busy
  291. .equ    AS2     = 3     ; AS2: Asynchronous Timer/Counter2
  292. .equ    EXCLK   = 4     ; Enable External Clock Interrupt
  293.  
  294.  
  295. ; ***** WATCHDOG *********************
  296. ; WDTCR - Watchdog Timer Control Register
  297. .equ    WDTCSR  = WDTCR ; For compatibility
  298. .equ    WDP0    = 0     ; Watch Dog Timer Prescaler bit 0
  299. .equ    WDP1    = 1     ; Watch Dog Timer Prescaler bit 1
  300. .equ    WDP2    = 2     ; Watch Dog Timer Prescaler bit 2
  301. .equ    WDE     = 3     ; Watch Dog Enable
  302. .equ    WDCE    = 4     ; Watchdog Change Enable
  303. .equ    WDTOE   = WDCE  ; For compatibility
  304.  
  305.  
  306. ; ***** EEPROM ***********************
  307. ; EEDR - EEPROM Data Register
  308. .equ    EEDR0   = 0     ; EEPROM Data Register bit 0
  309. .equ    EEDR1   = 1     ; EEPROM Data Register bit 1
  310. .equ    EEDR2   = 2     ; EEPROM Data Register bit 2
  311. .equ    EEDR3   = 3     ; EEPROM Data Register bit 3
  312. .equ    EEDR4   = 4     ; EEPROM Data Register bit 4
  313. .equ    EEDR5   = 5     ; EEPROM Data Register bit 5
  314. .equ    EEDR6   = 6     ; EEPROM Data Register bit 6
  315. .equ    EEDR7   = 7     ; EEPROM Data Register bit 7
  316.  
  317. ; EECR - EEPROM Control Register
  318. .equ    EERE    = 0     ; EEPROM Read Enable
  319. .equ    EEWE    = 1     ; EEPROM Write Enable
  320. .equ    EEMWE   = 2     ; EEPROM Master Write Enable
  321. .equ    EERIE   = 3     ; EEPROM Ready Interrupt Enable
  322.  
  323.  
  324. ; ***** SPI **************************
  325. ; SPDR - SPI Data Register
  326. .equ    SPDR0   = 0     ; SPI Data Register bit 0
  327. .equ    SPDR1   = 1     ; SPI Data Register bit 1
  328. .equ    SPDR2   = 2     ; SPI Data Register bit 2
  329. .equ    SPDR3   = 3     ; SPI Data Register bit 3
  330. .equ    SPDR4   = 4     ; SPI Data Register bit 4
  331. .equ    SPDR5   = 5     ; SPI Data Register bit 5
  332. .equ    SPDR6   = 6     ; SPI Data Register bit 6
  333. .equ    SPDR7   = 7     ; SPI Data Register bit 7
  334.  
  335. ; SPSR - SPI Status Register
  336. .equ    SPI2X   = 0     ; Double SPI Speed Bit
  337. .equ    WCOL    = 6     ; Write Collision Flag
  338. .equ    SPIF    = 7     ; SPI Interrupt Flag
  339.  
  340. ; SPCR - SPI Control Register
  341. .equ    SPR0    = 0     ; SPI Clock Rate Select 0
  342. .equ    SPR1    = 1     ; SPI Clock Rate Select 1
  343. .equ    CPHA    = 2     ; Clock Phase
  344. .equ    CPOL    = 3     ; Clock polarity
  345. .equ    MSTR    = 4     ; Master/Slave Select
  346. .equ    DORD    = 5     ; Data Order
  347. .equ    SPE     = 6     ; SPI Enable
  348. .equ    SPIE    = 7     ; SPI Interrupt Enable
  349.  
  350.  
  351. ; ***** PORTA ************************
  352. ; PORTA - Port A Data Register
  353. .equ    PORTA0  = 0     ; Port A Data Register bit 0
  354. .equ    PA0     = 0     ; For compatibility
  355. .equ    PORTA1  = 1     ; Port A Data Register bit 1
  356. .equ    PA1     = 1     ; For compatibility
  357. .equ    PORTA2  = 2     ; Port A Data Register bit 2
  358. .equ    PA2     = 2     ; For compatibility
  359. .equ    PORTA3  = 3     ; Port A Data Register bit 3
  360. .equ    PA3     = 3     ; For compatibility
  361. .equ    PORTA4  = 4     ; Port A Data Register bit 4
  362. .equ    PA4     = 4     ; For compatibility
  363. .equ    PORTA5  = 5     ; Port A Data Register bit 5
  364. .equ    PA5     = 5     ; For compatibility
  365. .equ    PORTA6  = 6     ; Port A Data Register bit 6
  366. .equ    PA6     = 6     ; For compatibility
  367. .equ    PORTA7  = 7     ; Port A Data Register bit 7
  368. .equ    PA7     = 7     ; For compatibility
  369.  
  370. ; DDRA - Port A Data Direction Register
  371. .equ    DDA0    = 0     ; Data Direction Register, Port A, bit 0
  372. .equ    DDA1    = 1     ; Data Direction Register, Port A, bit 1
  373. .equ    DDA2    = 2     ; Data Direction Register, Port A, bit 2
  374. .equ    DDA3    = 3     ; Data Direction Register, Port A, bit 3
  375. .equ    DDA4    = 4     ; Data Direction Register, Port A, bit 4
  376. .equ    DDA5    = 5     ; Data Direction Register, Port A, bit 5
  377. .equ    DDA6    = 6     ; Data Direction Register, Port A, bit 6
  378. .equ    DDA7    = 7     ; Data Direction Register, Port A, bit 7
  379.  
  380. ; PINA - Port A Input Pins
  381. .equ    PINA0   = 0     ; Input Pins, Port A bit 0
  382. .equ    PINA1   = 1     ; Input Pins, Port A bit 1
  383. .equ    PINA2   = 2     ; Input Pins, Port A bit 2
  384. .equ    PINA3   = 3     ; Input Pins, Port A bit 3
  385. .equ    PINA4   = 4     ; Input Pins, Port A bit 4
  386. .equ    PINA5   = 5     ; Input Pins, Port A bit 5
  387. .equ    PINA6   = 6     ; Input Pins, Port A bit 6
  388. .equ    PINA7   = 7     ; Input Pins, Port A bit 7
  389.  
  390.  
  391. ; ***** PORTB ************************
  392. ; PORTB - Port B Data Register
  393. .equ    PORTB0  = 0     ; Port B Data Register bit 0
  394. .equ    PB0     = 0     ; For compatibility
  395. .equ    PORTB1  = 1     ; Port B Data Register bit 1
  396. .equ    PB1     = 1     ; For compatibility
  397. .equ    PORTB2  = 2     ; Port B Data Register bit 2
  398. .equ    PB2     = 2     ; For compatibility
  399. .equ    PORTB3  = 3     ; Port B Data Register bit 3
  400. .equ    PB3     = 3     ; For compatibility
  401. .equ    PORTB4  = 4     ; Port B Data Register bit 4
  402. .equ    PB4     = 4     ; For compatibility
  403. .equ    PORTB5  = 5     ; Port B Data Register bit 5
  404. .equ    PB5     = 5     ; For compatibility
  405. .equ    PORTB6  = 6     ; Port B Data Register bit 6
  406. .equ    PB6     = 6     ; For compatibility
  407. .equ    PORTB7  = 7     ; Port B Data Register bit 7
  408. .equ    PB7     = 7     ; For compatibility
  409.  
  410. ; DDRB - Port B Data Direction Register
  411. .equ    DDB0    = 0     ; Port B Data Direction Register bit 0
  412. .equ    DDB1    = 1     ; Port B Data Direction Register bit 1
  413. .equ    DDB2    = 2     ; Port B Data Direction Register bit 2
  414. .equ    DDB3    = 3     ; Port B Data Direction Register bit 3
  415. .equ    DDB4    = 4     ; Port B Data Direction Register bit 4
  416. .equ    DDB5    = 5     ; Port B Data Direction Register bit 5
  417. .equ    DDB6    = 6     ; Port B Data Direction Register bit 6
  418. .equ    DDB7    = 7     ; Port B Data Direction Register bit 7
  419.  
  420. ; PINB - Port B Input Pins
  421. .equ    PINB0   = 0     ; Port B Input Pins bit 0
  422. .equ    PINB1   = 1     ; Port B Input Pins bit 1
  423. .equ    PINB2   = 2     ; Port B Input Pins bit 2
  424. .equ    PINB3   = 3     ; Port B Input Pins bit 3
  425. .equ    PINB4   = 4     ; Port B Input Pins bit 4
  426. .equ    PINB5   = 5     ; Port B Input Pins bit 5
  427. .equ    PINB6   = 6     ; Port B Input Pins bit 6
  428. .equ    PINB7   = 7     ; Port B Input Pins bit 7
  429.  
  430.  
  431. ; ***** PORTC ************************
  432. ; PORTC - Port C Data Register
  433. .equ    PORTC0  = 0     ; Port C Data Register bit 0
  434. .equ    PC0     = 0     ; For compatibility
  435. .equ    PORTC1  = 1     ; Port C Data Register bit 1
  436. .equ    PC1     = 1     ; For compatibility
  437. .equ    PORTC2  = 2     ; Port C Data Register bit 2
  438. .equ    PC2     = 2     ; For compatibility
  439. .equ    PORTC3  = 3     ; Port C Data Register bit 3
  440. .equ    PC3     = 3     ; For compatibility
  441. .equ    PORTC4  = 4     ; Port C Data Register bit 4
  442. .equ    PC4     = 4     ; For compatibility
  443. .equ    PORTC5  = 5     ; Port C Data Register bit 5
  444. .equ    PC5     = 5     ; For compatibility
  445. .equ    PORTC6  = 6     ; Port C Data Register bit 6
  446. .equ    PC6     = 6     ; For compatibility
  447. .equ    PORTC7  = 7     ; Port C Data Register bit 7
  448. .equ    PC7     = 7     ; For compatibility
  449.  
  450. ; DDRC - Port C Data Direction Register
  451. .equ    DDC0    = 0     ; Port C Data Direction Register bit 0
  452. .equ    DDC1    = 1     ; Port C Data Direction Register bit 1
  453. .equ    DDC2    = 2     ; Port C Data Direction Register bit 2
  454. .equ    DDC3    = 3     ; Port C Data Direction Register bit 3
  455. .equ    DDC4    = 4     ; Port C Data Direction Register bit 4
  456. .equ    DDC5    = 5     ; Port C Data Direction Register bit 5
  457. .equ    DDC6    = 6     ; Port C Data Direction Register bit 6
  458. .equ    DDC7    = 7     ; Port C Data Direction Register bit 7
  459.  
  460. ; PINC - Port C Input Pins
  461. .equ    PINC0   = 0     ; Port C Input Pins bit 0
  462. .equ    PINC1   = 1     ; Port C Input Pins bit 1
  463. .equ    PINC2   = 2     ; Port C Input Pins bit 2
  464. .equ    PINC3   = 3     ; Port C Input Pins bit 3
  465. .equ    PINC4   = 4     ; Port C Input Pins bit 4
  466. .equ    PINC5   = 5     ; Port C Input Pins bit 5
  467. .equ    PINC6   = 6     ; Port C Input Pins bit 6
  468. .equ    PINC7   = 7     ; Port C Input Pins bit 7
  469.  
  470.  
  471. ; ***** PORTD ************************
  472. ; PORTD - Port D Data Register
  473. .equ    PORTD0  = 0     ; Port D Data Register bit 0
  474. .equ    PD0     = 0     ; For compatibility
  475. .equ    PORTD1  = 1     ; Port D Data Register bit 1
  476. .equ    PD1     = 1     ; For compatibility
  477. .equ    PORTD2  = 2     ; Port D Data Register bit 2
  478. .equ    PD2     = 2     ; For compatibility
  479. .equ    PORTD3  = 3     ; Port D Data Register bit 3
  480. .equ    PD3     = 3     ; For compatibility
  481. .equ    PORTD4  = 4     ; Port D Data Register bit 4
  482. .equ    PD4     = 4     ; For compatibility
  483. .equ    PORTD5  = 5     ; Port D Data Register bit 5
  484. .equ    PD5     = 5     ; For compatibility
  485. .equ    PORTD6  = 6     ; Port D Data Register bit 6
  486. .equ    PD6     = 6     ; For compatibility
  487. .equ    PORTD7  = 7     ; Port D Data Register bit 7
  488. .equ    PD7     = 7     ; For compatibility
  489.  
  490. ; DDRD - Port D Data Direction Register
  491. .equ    DDD0    = 0     ; Port D Data Direction Register bit 0
  492. .equ    DDD1    = 1     ; Port D Data Direction Register bit 1
  493. .equ    DDD2    = 2     ; Port D Data Direction Register bit 2
  494. .equ    DDD3    = 3     ; Port D Data Direction Register bit 3
  495. .equ    DDD4    = 4     ; Port D Data Direction Register bit 4
  496. .equ    DDD5    = 5     ; Port D Data Direction Register bit 5
  497. .equ    DDD6    = 6     ; Port D Data Direction Register bit 6
  498. .equ    DDD7    = 7     ; Port D Data Direction Register bit 7
  499.  
  500. ; PIND - Port D Input Pins
  501. .equ    PIND0   = 0     ; Port D Input Pins bit 0
  502. .equ    PIND1   = 1     ; Port D Input Pins bit 1
  503. .equ    PIND2   = 2     ; Port D Input Pins bit 2
  504. .equ    PIND3   = 3     ; Port D Input Pins bit 3
  505. .equ    PIND4   = 4     ; Port D Input Pins bit 4
  506. .equ    PIND5   = 5     ; Port D Input Pins bit 5
  507. .equ    PIND6   = 6     ; Port D Input Pins bit 6
  508. .equ    PIND7   = 7     ; Port D Input Pins bit 7
  509.  
  510.  
  511. ; ***** ANALOG_COMPARATOR ************
  512. ; ADCSRB - ADC Control and Status Register B
  513. .equ    ACME    = 6     ; Analog Comparator Multiplexer Enable
  514.  
  515. ; ACSR - Analog Comparator Control And Status Register
  516. .equ    ACIS0   = 0     ; Analog Comparator Interrupt Mode Select bit 0
  517. .equ    ACIS1   = 1     ; Analog Comparator Interrupt Mode Select bit 1
  518. .equ    ACIC    = 2     ; Analog Comparator Input Capture Enable
  519. .equ    ACIE    = 3     ; Analog Comparator Interrupt Enable
  520. .equ    ACI     = 4     ; Analog Comparator Interrupt Flag
  521. .equ    ACO     = 5     ; Analog Compare Output
  522. .equ    ACBG    = 6     ; Analog Comparator Bandgap Select
  523. .equ    ACD     = 7     ; Analog Comparator Disable
  524.  
  525. ; DIDR1 - Digital Input Disable Register 1
  526. .equ    AIN0D   = 0     ; AIN0 Digital Input Disable
  527. .equ    AIN1D   = 1     ; AIN1 Digital Input Disable
  528.  
  529.  
  530. ; ***** PORTE ************************
  531. ; PORTE - Data Register, Port E
  532. .equ    PORTE0  = 0     ;
  533. .equ    PE0     = 0     ; For compatibility
  534. .equ    PORTE1  = 1     ;
  535. .equ    PE1     = 1     ; For compatibility
  536. .equ    PORTE2  = 2     ;
  537. .equ    PE2     = 2     ; For compatibility
  538. .equ    PORTE3  = 3     ;
  539. .equ    PE3     = 3     ; For compatibility
  540. .equ    PORTE4  = 4     ;
  541. .equ    PE4     = 4     ; For compatibility
  542. .equ    PORTE5  = 5     ;
  543. .equ    PE5     = 5     ; For compatibility
  544. .equ    PORTE6  = 6     ;
  545. .equ    PE6     = 6     ; For compatibility
  546. .equ    PORTE7  = 7     ;
  547. .equ    PE7     = 7     ; For compatibility
  548.  
  549. ; DDRE - Data Direction Register, Port E
  550. .equ    DDE0    = 0     ;
  551. .equ    DDE1    = 1     ;
  552. .equ    DDE2    = 2     ;
  553. .equ    DDE3    = 3     ;
  554. .equ    DDE4    = 4     ;
  555. .equ    DDE5    = 5     ;
  556. .equ    DDE6    = 6     ;
  557. .equ    DDE7    = 7     ;
  558.  
  559. ; PINE - Input Pins, Port E
  560. .equ    PINE0   = 0     ;
  561. .equ    PINE1   = 1     ;
  562. .equ    PINE2   = 2     ;
  563. .equ    PINE3   = 3     ;
  564. .equ    PINE4   = 4     ;
  565. .equ    PINE5   = 5     ;
  566. .equ    PINE6   = 6     ;
  567. .equ    PINE7   = 7     ;
  568.  
  569.  
  570. ; ***** PORTF ************************
  571. ; PORTF - Data Register, Port F
  572. .equ    PORTF0  = 0     ;
  573. .equ    PF0     = 0     ; For compatibility
  574. .equ    PORTF1  = 1     ;
  575. .equ    PF1     = 1     ; For compatibility
  576. .equ    PORTF2  = 2     ;
  577. .equ    PF2     = 2     ; For compatibility
  578. .equ    PORTF3  = 3     ;
  579. .equ    PF3     = 3     ; For compatibility
  580. .equ    PORTF4  = 4     ;
  581. .equ    PF4     = 4     ; For compatibility
  582. .equ    PORTF5  = 5     ;
  583. .equ    PF5     = 5     ; For compatibility
  584. .equ    PORTF6  = 6     ;
  585. .equ    PF6     = 6     ; For compatibility
  586. .equ    PORTF7  = 7     ;
  587. .equ    PF7     = 7     ; For compatibility
  588.  
  589. ; DDRF - Data Direction Register, Port F
  590. .equ    DDF0    = 0     ;
  591. .equ    DDF1    = 1     ;
  592. .equ    DDF2    = 2     ;
  593. .equ    DDF3    = 3     ;
  594. .equ    DDF4    = 4     ;
  595. .equ    DDF5    = 5     ;
  596. .equ    DDF6    = 6     ;
  597. .equ    DDF7    = 7     ;
  598.  
  599. ; PINF - Input Pins, Port F
  600. .equ    PINF0   = 0     ;
  601. .equ    PINF1   = 1     ;
  602. .equ    PINF2   = 2     ;
  603. .equ    PINF3   = 3     ;
  604. .equ    PINF4   = 4     ;
  605. .equ    PINF5   = 5     ;
  606. .equ    PINF6   = 6     ;
  607. .equ    PINF7   = 7     ;
  608.  
  609.  
  610. ; ***** PORTG ************************
  611. ; PORTG - Port G Data Register
  612. .equ    PORTG0  = 0     ;
  613. .equ    PG0     = 0     ; For compatibility
  614. .equ    PORTG1  = 1     ;
  615. .equ    PG1     = 1     ; For compatibility
  616. .equ    PORTG2  = 2     ;
  617. .equ    PG2     = 2     ; For compatibility
  618. .equ    PORTG3  = 3     ;
  619. .equ    PG3     = 3     ; For compatibility
  620. .equ    PORTG4  = 4     ;
  621. .equ    PG4     = 4     ; For compatibility
  622.  
  623. ; DDRG - Port G Data Direction Register
  624. .equ    DDG0    = 0     ;
  625. .equ    DDG1    = 1     ;
  626. .equ    DDG2    = 2     ;
  627. .equ    DDG3    = 3     ;
  628. .equ    DDG4    = 4     ;
  629.  
  630. ; PING - Port G Input Pins
  631. .equ    PING0   = 0     ;
  632. .equ    PING1   = 1     ;
  633. .equ    PING2   = 2     ;
  634. .equ    PING3   = 3     ;
  635. .equ    PING4   = 4     ;
  636. .equ    PING5   = 5     ;
  637.  
  638.  
  639. ; ***** JTAG *************************
  640. ; OCDR - On-Chip Debug Related Register in I/O Memory
  641. .equ    OCDR0   = 0     ; On-Chip Debug Register Bit 0
  642. .equ    OCDR1   = 1     ; On-Chip Debug Register Bit 1
  643. .equ    OCDR2   = 2     ; On-Chip Debug Register Bit 2
  644. .equ    OCDR3   = 3     ; On-Chip Debug Register Bit 3
  645. .equ    OCDR4   = 4     ; On-Chip Debug Register Bit 4
  646. .equ    OCDR5   = 5     ; On-Chip Debug Register Bit 5
  647. .equ    OCDR6   = 6     ; On-Chip Debug Register Bit 6
  648. .equ    OCDR7   = 7     ; On-Chip Debug Register Bit 7
  649. .equ    IDRD    = OCDR7 ; For compatibility
  650.  
  651. ; MCUCR - MCU Control Register
  652. .equ    JTD     = 7     ; JTAG Interface Disable
  653.  
  654. ; MCUSR - MCU Status Register
  655. .equ    JTRF    = 4     ; JTAG Reset Flag
  656.  
  657.  
  658. ; ***** EXTERNAL_INTERRUPT ***********
  659. ; EICRA - External Interrupt Control Register A
  660. .equ    ISC00   = 0     ; External Interrupt Sense Control 0 Bit 0
  661. .equ    ISC01   = 1     ; External Interrupt Sense Control 0 Bit 1
  662.  
  663. ; EIMSK - External Interrupt Mask Register
  664. .equ    INT0    = 0     ; External Interrupt Request 0 Enable
  665. .equ    PCIE0   = 4     ; Pin Change Interrupt Enable 0
  666. .equ    PCIE1   = 5     ; Pin Change Interrupt Enable 1
  667. .equ    PCIE2   = 6     ; Pin Change Interrupt Enable 2
  668. .equ    PCIE3   = 7     ; Pin Change Interrupt Enable 3
  669.  
  670. ; EIFR - External Interrupt Flag Register
  671. .equ    INTF0   = 0     ; External Interrupt Flag 0
  672. .equ    PCIF0   = 4     ; Pin Change Interrupt Flag 0
  673. .equ    PCIF1   = 5     ; Pin Change Interrupt Flag 1
  674. .equ    PCIF2   = 6     ; Pin Change Interrupt Flag 2
  675. .equ    PCIF3   = 7     ; Pin Change Interrupt Flag 3
  676.  
  677. ; PCMSK3 - Pin Change Mask Register 3
  678. .equ    PCINT24 = 0     ; Pin Change Enable Mask 24
  679. .equ    PCINT25 = 1     ; Pin Change Enable Mask 25
  680. .equ    PCINT26 = 2     ; Pin Change Enable Mask 26
  681. .equ    PCINT27 = 3     ; Pin Change Enable Mask 27
  682. .equ    PCINT28 = 4     ; Pin Change Enable Mask 28
  683. .equ    PCINT29 = 5     ; Pin Change Enable Mask 29
  684. .equ    PCINT30 = 6     ; Pin Change Enable Mask 30
  685.  
  686. ; PCMSK2 - Pin Change Mask Register 2
  687. .equ    PCINT16 = 0     ; Pin Change Enable Mask 16
  688. .equ    PCINT17 = 1     ; Pin Change Enable Mask 17
  689. .equ    PCINT18 = 2     ; Pin Change Enable Mask 18
  690. .equ    PCINT19 = 3     ; Pin Change Enable Mask 19
  691. .equ    PCINT20 = 4     ; Pin Change Enable Mask 20
  692. .equ    PCINT21 = 5     ; Pin Change Enable Mask 21
  693. .equ    PCINT22 = 6     ; Pin Change Enable Mask 22
  694. .equ    PCINT23 = 7     ; Pin Change Enable Mask 23
  695.  
  696. ; PCMSK1 - Pin Change Mask Register 1
  697. .equ    PCINT8  = 0     ; Pin Change Enable Mask 8
  698. .equ    PCINT9  = 1     ; Pin Change Enable Mask 9
  699. .equ    PCINT10 = 2     ; Pin Change Enable Mask 10
  700. .equ    PCINT11 = 3     ; Pin Change Enable Mask 11
  701. .equ    PCINT12 = 4     ; Pin Change Enable Mask 12
  702. .equ    PCINT13 = 5     ; Pin Change Enable Mask 13
  703. .equ    PCINT14 = 6     ; Pin Change Enable Mask 14
  704. .equ    PCINT15 = 7     ; Pin Change Enable Mask 15
  705.  
  706. ; PCMSK0 - Pin Change Mask Register 0
  707. .equ    PCINT0  = 0     ; Pin Change Enable Mask 0
  708. .equ    PCINT1  = 1     ; Pin Change Enable Mask 1
  709. .equ    PCINT2  = 2     ; Pin Change Enable Mask 2
  710. .equ    PCINT3  = 3     ; Pin Change Enable Mask 3
  711. .equ    PCINT4  = 4     ; Pin Change Enable Mask 4
  712. .equ    PCINT5  = 5     ; Pin Change Enable Mask 5
  713. .equ    PCINT6  = 6     ; Pin Change Enable Mask 6
  714. .equ    PCINT7  = 7     ; Pin Change Enable Mask 7
  715.  
  716.  
  717. ; ***** CPU **************************
  718. ; SREG - Status Register
  719. .equ    SREG_C  = 0     ; Carry Flag
  720. .equ    SREG_Z  = 1     ; Zero Flag
  721. .equ    SREG_N  = 2     ; Negative Flag
  722. .equ    SREG_V  = 3     ; Two's Complement Overflow Flag
  723. .equ    SREG_S  = 4     ; Sign Bit
  724. .equ    SREG_H  = 5     ; Half Carry Flag
  725. .equ    SREG_T  = 6     ; Bit Copy Storage
  726. .equ    SREG_I  = 7     ; Global Interrupt Enable
  727.  
  728. ; MCUCR - MCU Control Register
  729. .equ    IVCE    = 0     ; Interrupt Vector Change Enable
  730. .equ    IVSEL   = 1     ; Interrupt Vector Select
  731. .equ    PUD     = 4     ; Pull-up disable
  732.  
  733. ; MCUSR - MCU Status Register
  734. .equ    PORF    = 0     ; Power-on reset flag
  735. .equ    EXTRF   = 1     ; External Reset Flag
  736. .equ    BORF    = 2     ; Brown-out Reset Flag
  737. .equ    WDRF    = 3     ; Watchdog Reset Flag
  738. ;.equ   JTRF    = 4     ; JTAG Reset Flag
  739.  
  740. ; OSCCAL - Oscillator Calibration Value
  741. .equ    CAL0    = 0     ; Oscillator Calibration Value Bit0
  742. .equ    CAL1    = 1     ; Oscillator Calibration Value Bit1
  743. .equ    CAL2    = 2     ; Oscillator Calibration Value Bit2
  744. .equ    CAL3    = 3     ; Oscillator Calibration Value Bit3
  745. .equ    CAL4    = 4     ; Oscillator Calibration Value Bit4
  746. .equ    CAL5    = 5     ; Oscillator Calibration Value Bit5
  747. .equ    CAL6    = 6     ; Oscillator Calibration Value Bit6
  748. .equ    CAL7    = 7     ; Oscillator Calibration Value Bit7
  749.  
  750. ; CLKPR - Clock Prescale Register
  751. .equ    CLKPS0  = 0     ; Clock Prescaler Select Bit 0
  752. .equ    CLKPS1  = 1     ; Clock Prescaler Select Bit 1
  753. .equ    CLKPS2  = 2     ; Clock Prescaler Select Bit 2
  754. .equ    CLKPS3  = 3     ; Clock Prescaler Select Bit 3
  755. .equ    CLKPCE  = 7     ; Clock Prescaler Change Enable
  756.  
  757. ; PRR - Power Reduction Register
  758. .equ    PRADC   = 0     ; Power Reduction ADC
  759. .equ    PRUSART0        = 1     ; Power Reduction USART
  760. .equ    PRSPI   = 2     ; Power Reduction Serial Peripheral Interface
  761. .equ    PRTIM1  = 3     ; Power Reduction Timer/Counter1
  762. .equ    PRLCD   = 4     ; Power Reduction LCD
  763.  
  764. ; SMCR - Sleep Mode Control Register
  765. .equ    SE      = 0     ; Sleep Enable
  766. .equ    SM0     = 1     ; Sleep Mode Select bit 0
  767. .equ    SM1     = 2     ; Sleep Mode Select bit 1
  768. .equ    SM2     = 3     ; Sleep Mode Select bit 2
  769.  
  770. ; GPIOR2 - General Purpose IO Register 2
  771. .equ    GPIOR20 = 0     ; General Purpose IO Register 2 bit 0
  772. .equ    GPIOR21 = 1     ; General Purpose IO Register 2 bit 1
  773. .equ    GPIOR22 = 2     ; General Purpose IO Register 2 bit 2
  774. .equ    GPIOR23 = 3     ; General Purpose IO Register 2 bit 3
  775. .equ    GPIOR24 = 4     ; General Purpose IO Register 2 bit 4
  776. .equ    GPIOR25 = 5     ; General Purpose IO Register 2 bit 5
  777. .equ    GPIOR26 = 6     ; General Purpose IO Register 2 bit 6
  778. .equ    GPIOR27 = 7     ; General Purpose IO Register 2 bit 7
  779.  
  780. ; GPIOR1 - General Purpose IO Register 1
  781. .equ    GPIOR10 = 0     ; General Purpose IO Register 1 bit 0
  782. .equ    GPIOR11 = 1     ; General Purpose IO Register 1 bit 1
  783. .equ    GPIOR12 = 2     ; General Purpose IO Register 1 bit 2
  784. .equ    GPIOR13 = 3     ; General Purpose IO Register 1 bit 3
  785. .equ    GPIOR14 = 4     ; General Purpose IO Register 1 bit 4
  786. .equ    GPIOR15 = 5     ; General Purpose IO Register 1 bit 5
  787. .equ    GPIOR16 = 6     ; General Purpose IO Register 1 bit 6
  788. .equ    GPIOR17 = 7     ; General Purpose IO Register 1 bit 7
  789.  
  790. ; GPIOR0 - General Purpose IO Register 0
  791. .equ    GPIOR00 = 0     ; General Purpose IO Register 0 bit 0
  792. .equ    GPIOR01 = 1     ; General Purpose IO Register 0 bit 1
  793. .equ    GPIOR02 = 2     ; General Purpose IO Register 0 bit 2
  794. .equ    GPIOR03 = 3     ; General Purpose IO Register 0 bit 3
  795. .equ    GPIOR04 = 4     ; General Purpose IO Register 0 bit 4
  796. .equ    GPIOR05 = 5     ; General Purpose IO Register 0 bit 5
  797. .equ    GPIOR06 = 6     ; General Purpose IO Register 0 bit 6
  798. .equ    GPIOR07 = 7     ; General Purpose IO Register 0 bit 7
  799.  
  800.  
  801. ; ***** USI **************************
  802. ; USIDR - USI Data Register
  803. .equ    USIDR0  = 0     ; USI Data Register bit 0
  804. .equ    USIDR1  = 1     ; USI Data Register bit 1
  805. .equ    USIDR2  = 2     ; USI Data Register bit 2
  806. .equ    USIDR3  = 3     ; USI Data Register bit 3
  807. .equ    USIDR4  = 4     ; USI Data Register bit 4
  808. .equ    USIDR5  = 5     ; USI Data Register bit 5
  809. .equ    USIDR6  = 6     ; USI Data Register bit 6
  810. .equ    USIDR7  = 7     ; USI Data Register bit 7
  811.  
  812. ; USISR - USI Status Register
  813. .equ    USICNT0 = 0     ; USI Counter Value Bit 0
  814. .equ    USICNT1 = 1     ; USI Counter Value Bit 1
  815. .equ    USICNT2 = 2     ; USI Counter Value Bit 2
  816. .equ    USICNT3 = 3     ; USI Counter Value Bit 3
  817. .equ    USIDC   = 4     ; Data Output Collision
  818. .equ    USIPF   = 5     ; Stop Condition Flag
  819. .equ    USIOIF  = 6     ; Counter Overflow Interrupt Flag
  820. .equ    USISIF  = 7     ; Start Condition Interrupt Flag
  821.  
  822. ; USICR - USI Control Register
  823. .equ    USITC   = 0     ; Toggle Clock Port Pin
  824. .equ    USICLK  = 1     ; Clock Strobe
  825. .equ    USICS0  = 2     ; USI Clock Source Select Bit 0
  826. .equ    USICS1  = 3     ; USI Clock Source Select Bit 1
  827. .equ    USIWM0  = 4     ; USI Wire Mode Bit 0
  828. .equ    USIWM1  = 5     ; USI Wire Mode Bit 1
  829. .equ    USIOIE  = 6     ; Counter Overflow Interrupt Enable
  830. .equ    USISIE  = 7     ; Start Condition Interrupt Enable
  831.  
  832.  
  833. ; ***** AD_CONVERTER *****************
  834. ; ADMUX - The ADC multiplexer Selection Register
  835. .equ    MUX0    = 0     ; Analog Channel and Gain Selection Bits
  836. .equ    MUX1    = 1     ; Analog Channel and Gain Selection Bits
  837. .equ    MUX2    = 2     ; Analog Channel and Gain Selection Bits
  838. .equ    MUX3    = 3     ; Analog Channel and Gain Selection Bits
  839. .equ    MUX4    = 4     ; Analog Channel and Gain Selection Bits
  840. .equ    ADLAR   = 5     ; Left Adjust Result
  841. .equ    REFS0   = 6     ; Reference Selection Bit 0
  842. .equ    REFS1   = 7     ; Reference Selection Bit 1
  843.  
  844. ; ADCSRA - The ADC Control and Status register
  845. .equ    ADPS0   = 0     ; ADC  Prescaler Select Bits
  846. .equ    ADPS1   = 1     ; ADC  Prescaler Select Bits
  847. .equ    ADPS2   = 2     ; ADC  Prescaler Select Bits
  848. .equ    ADIE    = 3     ; ADC Interrupt Enable
  849. .equ    ADIF    = 4     ; ADC Interrupt Flag
  850. .equ    ADATE   = 5     ; ADC Auto Trigger Enable
  851. .equ    ADSC    = 6     ; ADC Start Conversion
  852. .equ    ADEN    = 7     ; ADC Enable
  853.  
  854. ; ADCH - ADC Data Register High Byte
  855. .equ    ADCH0   = 0     ; ADC Data Register High Byte Bit 0
  856. .equ    ADCH1   = 1     ; ADC Data Register High Byte Bit 1
  857. .equ    ADCH2   = 2     ; ADC Data Register High Byte Bit 2
  858. .equ    ADCH3   = 3     ; ADC Data Register High Byte Bit 3
  859. .equ    ADCH4   = 4     ; ADC Data Register High Byte Bit 4
  860. .equ    ADCH5   = 5     ; ADC Data Register High Byte Bit 5
  861. .equ    ADCH6   = 6     ; ADC Data Register High Byte Bit 6
  862. .equ    ADCH7   = 7     ; ADC Data Register High Byte Bit 7
  863.  
  864. ; ADCL - ADC Data Register Low Byte
  865. .equ    ADCL0   = 0     ; ADC Data Register Low Byte Bit 0
  866. .equ    ADCL1   = 1     ; ADC Data Register Low Byte Bit 1
  867. .equ    ADCL2   = 2     ; ADC Data Register Low Byte Bit 2
  868. .equ    ADCL3   = 3     ; ADC Data Register Low Byte Bit 3
  869. .equ    ADCL4   = 4     ; ADC Data Register Low Byte Bit 4
  870. .equ    ADCL5   = 5     ; ADC Data Register Low Byte Bit 5
  871. .equ    ADCL6   = 6     ; ADC Data Register Low Byte Bit 6
  872. .equ    ADCL7   = 7     ; ADC Data Register Low Byte Bit 7
  873.  
  874. ; ADCSRB - ADC Control and Status Register B
  875. .equ    ADTS0   = 0     ; ADC Auto Trigger Source 0
  876. .equ    ADTS1   = 1     ; ADC Auto Trigger Source 1
  877. .equ    ADTS2   = 2     ; ADC Auto Trigger Source 2
  878.  
  879. ; DIDR0 - Digital Input Disable Register 0
  880. .equ    ADC0D   = 0     ; ADC0 Digital input Disable
  881. .equ    ADC1D   = 1     ; ADC1 Digital input Disable
  882. .equ    ADC2D   = 2     ; ADC2 Digital input Disable
  883. .equ    ADC3D   = 3     ; ADC3 Digital input Disable
  884. .equ    ADC4D   = 4     ; ADC4 Digital input Disable
  885. .equ    ADC5D   = 5     ; ADC5 Digital input Disable
  886. .equ    ADC6D   = 6     ; ADC6 Digital input Disable
  887. .equ    ADC7D   = 7     ; ADC7 Digital input Disable
  888.  
  889.  
  890. ; ***** BOOT_LOAD ********************
  891. ; SPMCSR - Store Program Memory Control Register
  892. .equ    SPMCR   = SPMCSR        ; For compatibility
  893. .equ    SPMEN   = 0     ; Store Program Memory Enable
  894. .equ    PGERS   = 1     ; Page Erase
  895. .equ    PGWRT   = 2     ; Page Write
  896. .equ    BLBSET  = 3     ; Boot Lock Bit Set
  897. .equ    RWWSRE  = 4     ; Read While Write section read enable
  898. .equ    ASRE    = RWWSRE        ; For compatibility
  899. .equ    RWWSB   = 6     ; Read While Write Section Busy
  900. .equ    ASB     = RWWSB ; For compatibility
  901. .equ    SPMIE   = 7     ; SPM Interrupt Enable
  902.  
  903.  
  904. ; ***** USART0 ***********************
  905. ; UDR - USART I/O Data Register
  906. .equ    UDR0    = UDR   ; For compatibility
  907. .equ    UDR00   = 0     ; USART I/O Data Register bit 0
  908. .equ    UDR01   = 1     ; USART I/O Data Register bit 1
  909. .equ    UDR02   = 2     ; USART I/O Data Register bit 2
  910. .equ    UDR03   = 3     ; USART I/O Data Register bit 3
  911. .equ    UDR04   = 4     ; USART I/O Data Register bit 4
  912. .equ    UDR05   = 5     ; USART I/O Data Register bit 5
  913. .equ    UDR06   = 6     ; USART I/O Data Register bit 6
  914. .equ    UDR07   = 7     ; USART I/O Data Register bit 7
  915.  
  916. ; UCSRA - USART Control and Status Register A
  917. .equ    UCSR0A  = UCSRA ; For compatibility
  918. .equ    USR     = UCSRA ; For compatibility
  919. .equ    MPCM    = 0     ; Multi-processor Communication Mode
  920. .equ    MPCM0   = MPCM  ; For compatibility
  921. .equ    U2X     = 1     ; Double the USART Transmission Speed
  922. .equ    U2X0    = U2X   ; For compatibility
  923. .equ    UPE     = 2     ; USART Parity Error
  924. .equ    UPE0    = UPE   ; For compatibility
  925. .equ    DOR     = 3     ; Data OverRun
  926. .equ    DOR0    = DOR   ; For compatibility
  927. .equ    FE      = 4     ; Framing Error
  928. .equ    FE0     = FE    ; For compatibility
  929. .equ    UDRE    = 5     ; USART Data Register Empty
  930. .equ    UDRE0   = UDRE  ; For compatibility
  931. .equ    TXC     = 6     ; USART Transmit Complete
  932. .equ    TXC0    = TXC   ; For compatibility
  933. .equ    RXC     = 7     ; USART Receive Complete
  934. .equ    RXC0    = RXC   ; For compatibility
  935.  
  936. ; UCSRB - USART Control and Status Register B
  937. .equ    UCSR0B  = UCSRB ; For compatibility
  938. .equ    UCR     = UCSRB ; For compatibility
  939. .equ    TXB8    = 0     ; Transmit Data Bit 8
  940. .equ    TXB80   = TXB8  ; For compatibility
  941. .equ    RXB8    = 1     ; Receive Data Bit 8
  942. .equ    RXB80   = RXB8  ; For compatibility
  943. .equ    UCSZ2   = 2     ; Character Size
  944. .equ    UCSZ02  = UCSZ2 ; For compatibility
  945. .equ    TXEN    = 3     ; Transmitter Enable
  946. .equ    TXEN0   = TXEN  ; For compatibility
  947. .equ    RXEN    = 4     ; Receiver Enable
  948. .equ    RXEN0   = RXEN  ; For compatibility
  949. .equ    UDRIE   = 5     ; USART Data Register Empty Interrupt Enable
  950. .equ    UDRIE0  = UDRIE ; For compatibility
  951. .equ    TXCIE   = 6     ; TX Complete Interrupt Enable
  952. .equ    TXCIE0  = TXCIE ; For compatibility
  953. .equ    RXCIE   = 7     ; RX Complete Interrupt Enable
  954. .equ    RXCIE0  = RXCIE ; For compatibility
  955.  
  956. ; UCSRC - USART Control and Status Register C
  957. .equ    UCSR0C  = UCSRC ; For compatibility
  958. .equ    UCPOL   = 0     ; Clock Polarity
  959. .equ    UCPOL0  = UCPOL ; For compatibility
  960. .equ    UCSZ0   = 1     ; Character Size
  961. .equ    UCSZ00  = UCSZ0 ; For compatibility
  962. .equ    UCSZ1   = 2     ; Character Size
  963. .equ    UCSZ01  = UCSZ1 ; For compatibility
  964. .equ    USBS    = 3     ; Stop Bit Select
  965. .equ    USBS0   = USBS  ; For compatibility
  966. .equ    UPM0    = 4     ; Parity Mode Bit 0
  967. .equ    UPM00   = UPM0  ; For compatibility
  968. .equ    UPM1    = 5     ; Parity Mode Bit 1
  969. .equ    UPM01   = UPM1  ; For compatibility
  970. .equ    UMSEL   = 6     ; USART Mode Select
  971. .equ    UMSEL0  = UMSEL ; For compatibility
  972.  
  973. .equ    UBRR0H  = UBRRH ; For compatibility
  974. .equ    UBRR0L  = UBRRL ; For compatibility
  975. .equ    UBRR0   = UBRRL ; For compatibility
  976. .equ    UBRR    = UBRRL ; For compatibility
  977.  
  978. ; ***** PORTH ************************
  979. ; PORTH - PORT H Data Register
  980. .equ    PORTH0  = 0     ; PORT H Data Register bit 0
  981. .equ    PH0     = 0     ; For compatibility
  982. .equ    PORTH1  = 1     ; PORT H Data Register bit 1
  983. .equ    PH1     = 1     ; For compatibility
  984. .equ    PORTH2  = 2     ; PORT H Data Register bit 2
  985. .equ    PH2     = 2     ; For compatibility
  986. .equ    PORTH3  = 3     ; PORT H Data Register bit 3
  987. .equ    PH3     = 3     ; For compatibility
  988. .equ    PORTH4  = 4     ; PORT H Data Register bit 4
  989. .equ    PH4     = 4     ; For compatibility
  990. .equ    PORTH5  = 5     ; PORT H Data Register bit 5
  991. .equ    PH5     = 5     ; For compatibility
  992. .equ    PORTH6  = 6     ; PORT H Data Register bit 6
  993. .equ    PH6     = 6     ; For compatibility
  994. .equ    PORTH7  = 7     ; PORT H Data Register bit 7
  995. .equ    PH7     = 7     ; For compatibility
  996.  
  997. ; DDRH - PORT H Data Direction Register
  998. .equ    DDH0    = 0     ; PORT H Data Direction Register bit 0
  999. .equ    DDH1    = 1     ; PORT H Data Direction Register bit 1
  1000. .equ    DDH2    = 2     ; PORT H Data Direction Register bit 2
  1001. .equ    DDH3    = 3     ; PORT H Data Direction Register bit 3
  1002. .equ    DDH4    = 4     ; PORT H Data Direction Register bit 4
  1003. .equ    DDH5    = 5     ; PORT H Data Direction Register bit 5
  1004. .equ    DDH6    = 6     ; PORT H Data Direction Register bit 6
  1005. .equ    DDH7    = 7     ; PORT H Data Direction Register bit 7
  1006.  
  1007. ; PINH - PORT H Input Pins
  1008. .equ    PINH0   = 0     ; PORT H Input Pins bit 0
  1009. .equ    PINH1   = 1     ; PORT H Input Pins bit 1
  1010. .equ    PINH2   = 2     ; PORT H Input Pins bit 2
  1011. .equ    PINH3   = 3     ; PORT H Input Pins bit 3
  1012. .equ    PINH4   = 4     ; PORT H Input Pins bit 4
  1013. .equ    PINH5   = 5     ; PORT H Input Pins bit 5
  1014. .equ    PINH6   = 6     ; PORT H Input Pins bit 6
  1015. .equ    PINH7   = 7     ; PORT H Input Pins bit 7
  1016.  
  1017.  
  1018. ; ***** PORTJ ************************
  1019. ; PORTJ - PORT J Data Register
  1020. .equ    PORTJ0  = 0     ; PORT J Data Register bit 0
  1021. .equ    PJ0     = 0     ; For compatibility
  1022. .equ    PORTJ1  = 1     ; PORT J Data Register bit 1
  1023. .equ    PJ1     = 1     ; For compatibility
  1024. .equ    PORTJ2  = 2     ; PORT J Data Register bit 2
  1025. .equ    PJ2     = 2     ; For compatibility
  1026. .equ    PORTJ3  = 3     ; PORT J Data Register bit 3
  1027. .equ    PJ3     = 3     ; For compatibility
  1028. .equ    PORTJ4  = 4     ; PORT J Data Register bit 4
  1029. .equ    PJ4     = 4     ; For compatibility
  1030. .equ    PORTJ5  = 5     ; PORT J Data Register bit 5
  1031. .equ    PJ5     = 5     ; For compatibility
  1032. .equ    PORTJ6  = 6     ; PORT J Data Register bit 6
  1033. .equ    PJ6     = 6     ; For compatibility
  1034.  
  1035. ; DDRJ - PORT J Data Direction Register
  1036. .equ    DDJ0    = 0     ; PORT J Data Direction Register bit 0
  1037. .equ    DDJ1    = 1     ; PORT J Data Direction Register bit 1
  1038. .equ    DDJ2    = 2     ; PORT J Data Direction Register bit 2
  1039. .equ    DDJ3    = 3     ; PORT J Data Direction Register bit 3
  1040. .equ    DDJ4    = 4     ; PORT J Data Direction Register bit 4
  1041. .equ    DDJ5    = 5     ; PORT J Data Direction Register bit 5
  1042. .equ    DDJ6    = 6     ; PORT J Data Direction Register bit 6
  1043.  
  1044. ; PINJ - PORT J Input Pins
  1045. .equ    PINJ0   = 0     ; PORT J Input Pins bit 0
  1046. .equ    PINJ1   = 1     ; PORT J Input Pins bit 1
  1047. .equ    PINJ2   = 2     ; PORT J Input Pins bit 2
  1048. .equ    PINJ3   = 3     ; PORT J Input Pins bit 3
  1049. .equ    PINJ4   = 4     ; PORT J Input Pins bit 4
  1050. .equ    PINJ5   = 5     ; PORT J Input Pins bit 5
  1051. .equ    PINJ6   = 6     ; PORT J Input Pins bit 6
  1052.  
  1053.  
  1054.  
  1055. ; ***** LOCKSBITS ********************************************************
  1056. .equ    LB1     = 0     ; Lock bit
  1057. .equ    LB2     = 1     ; Lock bit
  1058. .equ    BLB01   = 2     ; Boot Lock bit
  1059. .equ    BLB02   = 3     ; Boot Lock bit
  1060. .equ    BLB11   = 4     ; Boot lock bit
  1061. .equ    BLB12   = 5     ; Boot lock bit
  1062.  
  1063.  
  1064. ; ***** FUSES ************************************************************
  1065. ; LOW fuse bits
  1066. .equ    CKSEL0  = 0     ; Select Clock Source
  1067. .equ    CKSEL1  = 1     ; Select Clock Source
  1068. .equ    CKSEL2  = 2     ; Select Clock Source
  1069. .equ    CKSEL3  = 3     ; Select Clock Source
  1070. .equ    SUT0    = 4     ; Select start-up time
  1071. .equ    SUT1    = 5     ; Select start-up time
  1072. .equ    CKOUT   = 6     ; Oscillator options
  1073. .equ    CLKDIV8 = 7     ; Divide clock by 8
  1074.  
  1075. ; HIGH fuse bits
  1076. .equ    BOOTRST = 0     ; Select Reset Vector
  1077. .equ    BOOTSZ0 = 1     ; Select Boot Size
  1078. .equ    BOOTSZ1 = 2     ; Select Boot Size
  1079. .equ    EESAVE  = 3     ; EEPROM memory is preserved through chip erase
  1080. .equ    WDTON   = 4     ; Watchdog timer always on
  1081. .equ    SPIEN   = 5     ; Enable Serial programming and Data Downloading
  1082. .equ    JTAGEN  = 6     ; Enable JTAG
  1083. .equ    OCDEN   = 7     ; Enable OCD
  1084.  
  1085. ; EXTENDED fuse bits
  1086. .equ    RSTDISBL        = 0     ; External Reset Disable
  1087. .equ    BODLEVEL0       = 1     ; Brown-out Detector trigger level
  1088. .equ    BODLEVEL1       = 2     ; Brown-out Detector trigger level
  1089.  
  1090.  
  1091.  
  1092. ; ***** CPU REGISTER DEFINITIONS *****************************************
  1093. .def    XH      = r27
  1094. .def    XL      = r26
  1095. .def    YH      = r29
  1096. .def    YL      = r28
  1097. .def    ZH      = r31
  1098. .def    ZL      = r30
  1099.  
  1100.  
  1101.  
  1102. ; ***** DATA MEMORY DECLARATIONS *****************************************
  1103. .equ    FLASHEND        = 0x3fff        ; Note: Word address
  1104. .equ    IOEND   = 0x00ff
  1105. .equ    SRAM_START      = 0x0100
  1106. .equ    SRAM_SIZE       = 2048
  1107. .equ    RAMEND  = 0x08ff
  1108. .equ    XRAMEND = 0x0000
  1109. .equ    E2END   = 0x03ff
  1110. .equ    EEPROMEND       = 0x03ff
  1111. .equ    EEADRBITS       = 10
  1112. #pragma AVRPART MEMORY PROG_FLASH 32768
  1113. #pragma AVRPART MEMORY EEPROM 1024
  1114. #pragma AVRPART MEMORY INT_SRAM SIZE 2048
  1115. #pragma AVRPART MEMORY INT_SRAM START_ADDR 0x100
  1116.  
  1117.  
  1118.  
  1119. ; ***** BOOTLOADER DECLARATIONS ******************************************
  1120. .equ    NRWW_START_ADDR = 0x3800
  1121. .equ    NRWW_STOP_ADDR  = 0x3fff
  1122. .equ    RWW_START_ADDR  = 0x0
  1123. .equ    RWW_STOP_ADDR   = 0x37ff
  1124. .equ    PAGESIZE        = 64
  1125. .equ    FIRSTBOOTSTART  = 0x3f00
  1126. .equ    SECONDBOOTSTART = 0x3e00
  1127. .equ    THIRDBOOTSTART  = 0x3c00
  1128. .equ    FOURTHBOOTSTART = 0x3800
  1129. .equ    SMALLBOOTSTART  = FIRSTBOOTSTART
  1130. .equ    LARGEBOOTSTART  = FOURTHBOOTSTART
  1131.  
  1132.  
  1133.  
  1134. ; ***** INTERRUPT VECTORS ************************************************
  1135. .equ    INT0addr        = 0x0002        ; External Interrupt Request 0
  1136. .equ    PCI0addr        = 0x0004        ; Pin Change Interrupt Request 0
  1137. .equ    PCI1addr        = 0x0006        ; Pin Change Interrupt Request 1
  1138. .equ    OC2addr = 0x0008        ; Timer/Counter2 Compare Match
  1139. .equ    OVF2addr        = 0x000a        ; Timer/Counter2 Overflow
  1140. .equ    ICP1addr        = 0x000c        ; Timer/Counter1 Capture Event
  1141. .equ    OC1Aaddr        = 0x000e        ; Timer/Counter1 Compare Match A
  1142. .equ    OC1Baddr        = 0x0010        ; Timer/Counter Compare Match B
  1143. .equ    OVF1addr        = 0x0012        ; Timer/Counter1 Overflow
  1144. .equ    OC0addr = 0x0014        ; Timer/Counter0 Compare Match
  1145. .equ    OVF0addr        = 0x0016        ; Timer/Counter0 Overflow
  1146. .equ    SPIaddr = 0x0018        ; SPI Serial Transfer Complete
  1147. .equ    URXCaddr        = 0x001a        ; USART, Rx Complete
  1148. .equ    URXC0addr       = 0x001a        ; For compatibility
  1149. .equ    UDREaddr        = 0x001c        ; USART Data register Empty
  1150. .equ    UDRE0addr       = 0x001c        ; For compatibility
  1151. .equ    UTXC0addr       = 0x001e        ; USART0, Tx Complete
  1152. .equ    UTXCaddr        = 0x001e        ; For compatibility
  1153. .equ    USI_STARTaddr   = 0x0020        ; USI Start Condition
  1154. .equ    USI_OVFaddr     = 0x0022        ; USI Overflow
  1155. .equ    ACIaddr = 0x0024        ; Analog Comparator
  1156. .equ    ADCCaddr        = 0x0026        ; ADC Conversion Complete
  1157. .equ    ERDYaddr        = 0x0028        ; EEPROM Ready
  1158. .equ    SPMRaddr        = 0x002a        ; Store Program Memory Read
  1159. .equ    RESERVEDaddr    = 0x002c        ; RESERVED
  1160. .equ    PCI2addr        = 0x002e        ; Pin Change Interrupt Request 2
  1161. .equ    PCI3addr        = 0x0030        ; Pin Change Interrupt Request 3
  1162.  
  1163. .equ    INT_VECTORS_SIZE        = 50    ; size in words
  1164.  
  1165. #endif  /* _M3250DEF_INC_ */
  1166.  
  1167. ; ***** END OF FILE ******************************************************
  1168.