You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

976 lines
33 KiB

11 years ago
  1. ;***** THIS IS A MACHINE GENERATED FILE - DO NOT EDIT ********************
  2. ;***** Created: 2011-02-09 12:03 ******* Source: ATmega168PA.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 : "m168PAdef.inc"
  8. ;* Title : Register/Bit Definitions for the ATmega168PA
  9. ;* Date : 2011-02-09
  10. ;* Version : 2.35
  11. ;* Support E-mail : avr@atmel.com
  12. ;* Target MCU : ATmega168PA
  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. #ifndef _M168PADEF_INC_
  40. #define _M168PADEF_INC_
  41. #pragma partinc 0
  42. ; ***** SPECIFY DEVICE ***************************************************
  43. .device ATmega168PA
  44. #pragma AVRPART ADMIN PART_NAME ATmega168PA
  45. .equ SIGNATURE_000 = 0x1e
  46. .equ SIGNATURE_001 = 0x94
  47. .equ SIGNATURE_002 = 0x0b
  48. #pragma AVRPART CORE CORE_VERSION V2E
  49. ; ***** I/O REGISTER DEFINITIONS *****************************************
  50. ; NOTE:
  51. ; Definitions marked "MEMORY MAPPED"are extended I/O ports
  52. ; and cannot be used with IN/OUT instructions
  53. .equ UDR0 = 0xc6 ; MEMORY MAPPED
  54. .equ UBRR0L = 0xc4 ; MEMORY MAPPED
  55. .equ UBRR0H = 0xc5 ; MEMORY MAPPED
  56. .equ UCSR0C = 0xc2 ; MEMORY MAPPED
  57. .equ UCSR0B = 0xc1 ; MEMORY MAPPED
  58. .equ UCSR0A = 0xc0 ; MEMORY MAPPED
  59. .equ TWAMR = 0xbd ; MEMORY MAPPED
  60. .equ TWCR = 0xbc ; MEMORY MAPPED
  61. .equ TWDR = 0xbb ; MEMORY MAPPED
  62. .equ TWAR = 0xba ; MEMORY MAPPED
  63. .equ TWSR = 0xb9 ; MEMORY MAPPED
  64. .equ TWBR = 0xb8 ; MEMORY MAPPED
  65. .equ ASSR = 0xb6 ; MEMORY MAPPED
  66. .equ OCR2B = 0xb4 ; MEMORY MAPPED
  67. .equ OCR2A = 0xb3 ; MEMORY MAPPED
  68. .equ TCNT2 = 0xb2 ; MEMORY MAPPED
  69. .equ TCCR2B = 0xb1 ; MEMORY MAPPED
  70. .equ TCCR2A = 0xb0 ; MEMORY MAPPED
  71. .equ OCR1BL = 0x8a ; MEMORY MAPPED
  72. .equ OCR1BH = 0x8b ; MEMORY MAPPED
  73. .equ OCR1AL = 0x88 ; MEMORY MAPPED
  74. .equ OCR1AH = 0x89 ; MEMORY MAPPED
  75. .equ ICR1L = 0x86 ; MEMORY MAPPED
  76. .equ ICR1H = 0x87 ; MEMORY MAPPED
  77. .equ TCNT1L = 0x84 ; MEMORY MAPPED
  78. .equ TCNT1H = 0x85 ; MEMORY MAPPED
  79. .equ TCCR1C = 0x82 ; MEMORY MAPPED
  80. .equ TCCR1B = 0x81 ; MEMORY MAPPED
  81. .equ TCCR1A = 0x80 ; MEMORY MAPPED
  82. .equ DIDR1 = 0x7f ; MEMORY MAPPED
  83. .equ DIDR0 = 0x7e ; MEMORY MAPPED
  84. .equ ADMUX = 0x7c ; MEMORY MAPPED
  85. .equ ADCSRB = 0x7b ; MEMORY MAPPED
  86. .equ ADCSRA = 0x7a ; MEMORY MAPPED
  87. .equ ADCH = 0x79 ; MEMORY MAPPED
  88. .equ ADCL = 0x78 ; MEMORY MAPPED
  89. .equ TIMSK2 = 0x70 ; MEMORY MAPPED
  90. .equ TIMSK1 = 0x6f ; MEMORY MAPPED
  91. .equ TIMSK0 = 0x6e ; MEMORY MAPPED
  92. .equ PCMSK1 = 0x6c ; MEMORY MAPPED
  93. .equ PCMSK2 = 0x6d ; MEMORY MAPPED
  94. .equ PCMSK0 = 0x6b ; MEMORY MAPPED
  95. .equ EICRA = 0x69 ; MEMORY MAPPED
  96. .equ PCICR = 0x68 ; MEMORY MAPPED
  97. .equ OSCCAL = 0x66 ; MEMORY MAPPED
  98. .equ PRR = 0x64 ; MEMORY MAPPED
  99. .equ CLKPR = 0x61 ; MEMORY MAPPED
  100. .equ WDTCSR = 0x60 ; MEMORY MAPPED
  101. .equ SREG = 0x3f
  102. .equ SPL = 0x3d
  103. .equ SPH = 0x3e
  104. .equ SPMCSR = 0x37
  105. .equ MCUCR = 0x35
  106. .equ MCUSR = 0x34
  107. .equ SMCR = 0x33
  108. .equ ACSR = 0x30
  109. .equ SPDR = 0x2e
  110. .equ SPSR = 0x2d
  111. .equ SPCR = 0x2c
  112. .equ GPIOR2 = 0x2b
  113. .equ GPIOR1 = 0x2a
  114. .equ OCR0B = 0x28
  115. .equ OCR0A = 0x27
  116. .equ TCNT0 = 0x26
  117. .equ TCCR0B = 0x25
  118. .equ TCCR0A = 0x24
  119. .equ GTCCR = 0x23
  120. .equ EEARH = 0x22
  121. .equ EEARL = 0x21
  122. .equ EEDR = 0x20
  123. .equ EECR = 0x1f
  124. .equ GPIOR0 = 0x1e
  125. .equ EIMSK = 0x1d
  126. .equ EIFR = 0x1c
  127. .equ PCIFR = 0x1b
  128. .equ TIFR2 = 0x17
  129. .equ TIFR1 = 0x16
  130. .equ TIFR0 = 0x15
  131. .equ PORTD = 0x0b
  132. .equ DDRD = 0x0a
  133. .equ PIND = 0x09
  134. .equ PORTC = 0x08
  135. .equ DDRC = 0x07
  136. .equ PINC = 0x06
  137. .equ PORTB = 0x05
  138. .equ DDRB = 0x04
  139. .equ PINB = 0x03
  140. ; ***** BIT DEFINITIONS **************************************************
  141. ; ***** USART0 ***********************
  142. ; UDR0 - USART I/O Data Register
  143. .equ UDR0_0 = 0 ; USART I/O Data Register bit 0
  144. .equ UDR0_1 = 1 ; USART I/O Data Register bit 1
  145. .equ UDR0_2 = 2 ; USART I/O Data Register bit 2
  146. .equ UDR0_3 = 3 ; USART I/O Data Register bit 3
  147. .equ UDR0_4 = 4 ; USART I/O Data Register bit 4
  148. .equ UDR0_5 = 5 ; USART I/O Data Register bit 5
  149. .equ UDR0_6 = 6 ; USART I/O Data Register bit 6
  150. .equ UDR0_7 = 7 ; USART I/O Data Register bit 7
  151. ; UCSR0A - USART Control and Status Register A
  152. .equ MPCM0 = 0 ; Multi-processor Communication Mode
  153. .equ U2X0 = 1 ; Double the USART transmission speed
  154. .equ UPE0 = 2 ; Parity Error
  155. .equ DOR0 = 3 ; Data overRun
  156. .equ FE0 = 4 ; Framing Error
  157. .equ UDRE0 = 5 ; USART Data Register Empty
  158. .equ TXC0 = 6 ; USART Transmitt Complete
  159. .equ RXC0 = 7 ; USART Receive Complete
  160. ; UCSR0B - USART Control and Status Register B
  161. .equ TXB80 = 0 ; Transmit Data Bit 8
  162. .equ RXB80 = 1 ; Receive Data Bit 8
  163. .equ UCSZ02 = 2 ; Character Size
  164. .equ TXEN0 = 3 ; Transmitter Enable
  165. .equ RXEN0 = 4 ; Receiver Enable
  166. .equ UDRIE0 = 5 ; USART Data register Empty Interrupt Enable
  167. .equ TXCIE0 = 6 ; TX Complete Interrupt Enable
  168. .equ RXCIE0 = 7 ; RX Complete Interrupt Enable
  169. ; UCSR0C - USART Control and Status Register C
  170. .equ UCPOL0 = 0 ; Clock Polarity
  171. .equ UCSZ00 = 1 ; Character Size
  172. .equ UCPHA0 = UCSZ00 ; For compatibility
  173. .equ UCSZ01 = 2 ; Character Size
  174. .equ UDORD0 = UCSZ01 ; For compatibility
  175. .equ USBS0 = 3 ; Stop Bit Select
  176. .equ UPM00 = 4 ; Parity Mode Bit 0
  177. .equ UPM01 = 5 ; Parity Mode Bit 1
  178. .equ UMSEL00 = 6 ; USART Mode Select
  179. .equ UMSEL0 = UMSEL00 ; For compatibility
  180. .equ UMSEL01 = 7 ; USART Mode Select
  181. .equ UMSEL1 = UMSEL01 ; For compatibility
  182. ; UBRR0H - USART Baud Rate Register High Byte
  183. .equ UBRR8 = 0 ; USART Baud Rate Register bit 8
  184. .equ UBRR9 = 1 ; USART Baud Rate Register bit 9
  185. .equ UBRR10 = 2 ; USART Baud Rate Register bit 10
  186. .equ UBRR11 = 3 ; USART Baud Rate Register bit 11
  187. ; UBRR0L - USART Baud Rate Register Low Byte
  188. .equ _UBRR0 = 0 ; USART Baud Rate Register bit 0
  189. .equ _UBRR1 = 1 ; USART Baud Rate Register bit 1
  190. .equ UBRR2 = 2 ; USART Baud Rate Register bit 2
  191. .equ UBRR3 = 3 ; USART Baud Rate Register bit 3
  192. .equ UBRR4 = 4 ; USART Baud Rate Register bit 4
  193. .equ UBRR5 = 5 ; USART Baud Rate Register bit 5
  194. .equ UBRR6 = 6 ; USART Baud Rate Register bit 6
  195. .equ UBRR7 = 7 ; USART Baud Rate Register bit 7
  196. ; ***** TWI **************************
  197. ; TWAMR - TWI (Slave) Address Mask Register
  198. .equ TWAM0 = 1 ;
  199. .equ TWAMR0 = TWAM0 ; For compatibility
  200. .equ TWAM1 = 2 ;
  201. .equ TWAMR1 = TWAM1 ; For compatibility
  202. .equ TWAM2 = 3 ;
  203. .equ TWAMR2 = TWAM2 ; For compatibility
  204. .equ TWAM3 = 4 ;
  205. .equ TWAMR3 = TWAM3 ; For compatibility
  206. .equ TWAM4 = 5 ;
  207. .equ TWAMR4 = TWAM4 ; For compatibility
  208. .equ TWAM5 = 6 ;
  209. .equ TWAMR5 = TWAM5 ; For compatibility
  210. .equ TWAM6 = 7 ;
  211. .equ TWAMR6 = TWAM6 ; For compatibility
  212. ; TWBR - TWI Bit Rate register
  213. .equ TWBR0 = 0 ;
  214. .equ TWBR1 = 1 ;
  215. .equ TWBR2 = 2 ;
  216. .equ TWBR3 = 3 ;
  217. .equ TWBR4 = 4 ;
  218. .equ TWBR5 = 5 ;
  219. .equ TWBR6 = 6 ;
  220. .equ TWBR7 = 7 ;
  221. ; TWCR - TWI Control Register
  222. .equ TWIE = 0 ; TWI Interrupt Enable
  223. .equ TWEN = 2 ; TWI Enable Bit
  224. .equ TWWC = 3 ; TWI Write Collition Flag
  225. .equ TWSTO = 4 ; TWI Stop Condition Bit
  226. .equ TWSTA = 5 ; TWI Start Condition Bit
  227. .equ TWEA = 6 ; TWI Enable Acknowledge Bit
  228. .equ TWINT = 7 ; TWI Interrupt Flag
  229. ; TWSR - TWI Status Register
  230. .equ TWPS0 = 0 ; TWI Prescaler
  231. .equ TWPS1 = 1 ; TWI Prescaler
  232. .equ TWS3 = 3 ; TWI Status
  233. .equ TWS4 = 4 ; TWI Status
  234. .equ TWS5 = 5 ; TWI Status
  235. .equ TWS6 = 6 ; TWI Status
  236. .equ TWS7 = 7 ; TWI Status
  237. ; TWDR - TWI Data register
  238. .equ TWD0 = 0 ; TWI Data Register Bit 0
  239. .equ TWD1 = 1 ; TWI Data Register Bit 1
  240. .equ TWD2 = 2 ; TWI Data Register Bit 2
  241. .equ TWD3 = 3 ; TWI Data Register Bit 3
  242. .equ TWD4 = 4 ; TWI Data Register Bit 4
  243. .equ TWD5 = 5 ; TWI Data Register Bit 5
  244. .equ TWD6 = 6 ; TWI Data Register Bit 6
  245. .equ TWD7 = 7 ; TWI Data Register Bit 7
  246. ; TWAR - TWI (Slave) Address register
  247. .equ TWGCE = 0 ; TWI General Call Recognition Enable Bit
  248. .equ TWA0 = 1 ; TWI (Slave) Address register Bit 0
  249. .equ TWA1 = 2 ; TWI (Slave) Address register Bit 1
  250. .equ TWA2 = 3 ; TWI (Slave) Address register Bit 2
  251. .equ TWA3 = 4 ; TWI (Slave) Address register Bit 3
  252. .equ TWA4 = 5 ; TWI (Slave) Address register Bit 4
  253. .equ TWA5 = 6 ; TWI (Slave) Address register Bit 5
  254. .equ TWA6 = 7 ; TWI (Slave) Address register Bit 6
  255. ; ***** TIMER_COUNTER_1 **************
  256. ; TIMSK1 - Timer/Counter Interrupt Mask Register
  257. .equ TOIE1 = 0 ; Timer/Counter1 Overflow Interrupt Enable
  258. .equ OCIE1A = 1 ; Timer/Counter1 Output CompareA Match Interrupt Enable
  259. .equ OCIE1B = 2 ; Timer/Counter1 Output CompareB Match Interrupt Enable
  260. .equ ICIE1 = 5 ; Timer/Counter1 Input Capture Interrupt Enable
  261. ; TIFR1 - Timer/Counter Interrupt Flag register
  262. .equ TOV1 = 0 ; Timer/Counter1 Overflow Flag
  263. .equ OCF1A = 1 ; Output Compare Flag 1A
  264. .equ OCF1B = 2 ; Output Compare Flag 1B
  265. .equ ICF1 = 5 ; Input Capture Flag 1
  266. ; TCCR1A - Timer/Counter1 Control Register A
  267. .equ WGM10 = 0 ; Waveform Generation Mode
  268. .equ WGM11 = 1 ; Waveform Generation Mode
  269. .equ COM1B0 = 4 ; Compare Output Mode 1B, bit 0
  270. .equ COM1B1 = 5 ; Compare Output Mode 1B, bit 1
  271. .equ COM1A0 = 6 ; Comparet Ouput Mode 1A, bit 0
  272. .equ COM1A1 = 7 ; Compare Output Mode 1A, bit 1
  273. ; TCCR1B - Timer/Counter1 Control Register B
  274. .equ CS10 = 0 ; Prescaler source of Timer/Counter 1
  275. .equ CS11 = 1 ; Prescaler source of Timer/Counter 1
  276. .equ CS12 = 2 ; Prescaler source of Timer/Counter 1
  277. .equ WGM12 = 3 ; Waveform Generation Mode
  278. .equ WGM13 = 4 ; Waveform Generation Mode
  279. .equ ICES1 = 6 ; Input Capture 1 Edge Select
  280. .equ ICNC1 = 7 ; Input Capture 1 Noise Canceler
  281. ; TCCR1C - Timer/Counter1 Control Register C
  282. .equ FOC1B = 6 ;
  283. .equ FOC1A = 7 ;
  284. ; GTCCR - General Timer/Counter Control Register
  285. .equ PSRSYNC = 0 ; Prescaler Reset Timer/Counter1 and Timer/Counter0
  286. .equ TSM = 7 ; Timer/Counter Synchronization Mode
  287. ; ***** TIMER_COUNTER_2 **************
  288. ; TIMSK2 - Timer/Counter Interrupt Mask register
  289. .equ TOIE2 = 0 ; Timer/Counter2 Overflow Interrupt Enable
  290. .equ TOIE2A = TOIE2 ; For compatibility
  291. .equ OCIE2A = 1 ; Timer/Counter2 Output Compare Match A Interrupt Enable
  292. .equ OCIE2B = 2 ; Timer/Counter2 Output Compare Match B Interrupt Enable
  293. ; TIFR2 - Timer/Counter Interrupt Flag Register
  294. .equ TOV2 = 0 ; Timer/Counter2 Overflow Flag
  295. .equ OCF2A = 1 ; Output Compare Flag 2A
  296. .equ OCF2B = 2 ; Output Compare Flag 2B
  297. ; TCCR2A - Timer/Counter2 Control Register A
  298. .equ WGM20 = 0 ; Waveform Genration Mode
  299. .equ WGM21 = 1 ; Waveform Genration Mode
  300. .equ COM2B0 = 4 ; Compare Output Mode bit 0
  301. .equ COM2B1 = 5 ; Compare Output Mode bit 1
  302. .equ COM2A0 = 6 ; Compare Output Mode bit 1
  303. .equ COM2A1 = 7 ; Compare Output Mode bit 1
  304. ; TCCR2B - Timer/Counter2 Control Register B
  305. .equ CS20 = 0 ; Clock Select bit 0
  306. .equ CS21 = 1 ; Clock Select bit 1
  307. .equ CS22 = 2 ; Clock Select bit 2
  308. .equ WGM22 = 3 ; Waveform Generation Mode
  309. .equ FOC2B = 6 ; Force Output Compare B
  310. .equ FOC2A = 7 ; Force Output Compare A
  311. ; TCNT2 - Timer/Counter2
  312. .equ TCNT2_0 = 0 ; Timer/Counter 2 bit 0
  313. .equ TCNT2_1 = 1 ; Timer/Counter 2 bit 1
  314. .equ TCNT2_2 = 2 ; Timer/Counter 2 bit 2
  315. .equ TCNT2_3 = 3 ; Timer/Counter 2 bit 3
  316. .equ TCNT2_4 = 4 ; Timer/Counter 2 bit 4
  317. .equ TCNT2_5 = 5 ; Timer/Counter 2 bit 5
  318. .equ TCNT2_6 = 6 ; Timer/Counter 2 bit 6
  319. .equ TCNT2_7 = 7 ; Timer/Counter 2 bit 7
  320. ; OCR2A - Timer/Counter2 Output Compare Register A
  321. .equ OCR2A_0 = 0 ; Timer/Counter2 Output Compare Register Bit 0
  322. .equ OCR2A_1 = 1 ; Timer/Counter2 Output Compare Register Bit 1
  323. .equ OCR2A_2 = 2 ; Timer/Counter2 Output Compare Register Bit 2
  324. .equ OCR2A_3 = 3 ; Timer/Counter2 Output Compare Register Bit 3
  325. .equ OCR2A_4 = 4 ; Timer/Counter2 Output Compare Register Bit 4
  326. .equ OCR2A_5 = 5 ; Timer/Counter2 Output Compare Register Bit 5
  327. .equ OCR2A_6 = 6 ; Timer/Counter2 Output Compare Register Bit 6
  328. .equ OCR2A_7 = 7 ; Timer/Counter2 Output Compare Register Bit 7
  329. ; OCR2B - Timer/Counter2 Output Compare Register B
  330. .equ OCR2B_0 = 0 ; Timer/Counter2 Output Compare Register Bit 0
  331. .equ OCR2B_1 = 1 ; Timer/Counter2 Output Compare Register Bit 1
  332. .equ OCR2B_2 = 2 ; Timer/Counter2 Output Compare Register Bit 2
  333. .equ OCR2B_3 = 3 ; Timer/Counter2 Output Compare Register Bit 3
  334. .equ OCR2B_4 = 4 ; Timer/Counter2 Output Compare Register Bit 4
  335. .equ OCR2B_5 = 5 ; Timer/Counter2 Output Compare Register Bit 5
  336. .equ OCR2B_6 = 6 ; Timer/Counter2 Output Compare Register Bit 6
  337. .equ OCR2B_7 = 7 ; Timer/Counter2 Output Compare Register Bit 7
  338. ; ASSR - Asynchronous Status Register
  339. .equ TCR2BUB = 0 ; Timer/Counter Control Register2 Update Busy
  340. .equ TCR2AUB = 1 ; Timer/Counter Control Register2 Update Busy
  341. .equ OCR2BUB = 2 ; Output Compare Register 2 Update Busy
  342. .equ OCR2AUB = 3 ; Output Compare Register2 Update Busy
  343. .equ TCN2UB = 4 ; Timer/Counter2 Update Busy
  344. .equ AS2 = 5 ; Asynchronous Timer/Counter2
  345. .equ EXCLK = 6 ; Enable External Clock Input
  346. ; GTCCR - General Timer Counter Control register
  347. .equ PSRASY = 1 ; Prescaler Reset Timer/Counter2
  348. .equ PSR2 = PSRASY ; For compatibility
  349. ;.equ TSM = 7 ; Timer/Counter Synchronization Mode
  350. ; ***** AD_CONVERTER *****************
  351. ; ADMUX - The ADC multiplexer Selection Register
  352. .equ MUX0 = 0 ; Analog Channel and Gain Selection Bits
  353. .equ MUX1 = 1 ; Analog Channel and Gain Selection Bits
  354. .equ MUX2 = 2 ; Analog Channel and Gain Selection Bits
  355. .equ MUX3 = 3 ; Analog Channel and Gain Selection Bits
  356. .equ ADLAR = 5 ; Left Adjust Result
  357. .equ REFS0 = 6 ; Reference Selection Bit 0
  358. .equ REFS1 = 7 ; Reference Selection Bit 1
  359. ; ADCSRA - The ADC Control and Status register A
  360. .equ ADPS0 = 0 ; ADC Prescaler Select Bits
  361. .equ ADPS1 = 1 ; ADC Prescaler Select Bits
  362. .equ ADPS2 = 2 ; ADC Prescaler Select Bits
  363. .equ ADIE = 3 ; ADC Interrupt Enable
  364. .equ ADIF = 4 ; ADC Interrupt Flag
  365. .equ ADATE = 5 ; ADC Auto Trigger Enable
  366. .equ ADSC = 6 ; ADC Start Conversion
  367. .equ ADEN = 7 ; ADC Enable
  368. ; ADCSRB - The ADC Control and Status register B
  369. .equ ADTS0 = 0 ; ADC Auto Trigger Source bit 0
  370. .equ ADTS1 = 1 ; ADC Auto Trigger Source bit 1
  371. .equ ADTS2 = 2 ; ADC Auto Trigger Source bit 2
  372. .equ ACME = 6 ;
  373. ; ADCH - ADC Data Register High Byte
  374. .equ ADCH0 = 0 ; ADC Data Register High Byte Bit 0
  375. .equ ADCH1 = 1 ; ADC Data Register High Byte Bit 1
  376. .equ ADCH2 = 2 ; ADC Data Register High Byte Bit 2
  377. .equ ADCH3 = 3 ; ADC Data Register High Byte Bit 3
  378. .equ ADCH4 = 4 ; ADC Data Register High Byte Bit 4
  379. .equ ADCH5 = 5 ; ADC Data Register High Byte Bit 5
  380. .equ ADCH6 = 6 ; ADC Data Register High Byte Bit 6
  381. .equ ADCH7 = 7 ; ADC Data Register High Byte Bit 7
  382. ; ADCL - ADC Data Register Low Byte
  383. .equ ADCL0 = 0 ; ADC Data Register Low Byte Bit 0
  384. .equ ADCL1 = 1 ; ADC Data Register Low Byte Bit 1
  385. .equ ADCL2 = 2 ; ADC Data Register Low Byte Bit 2
  386. .equ ADCL3 = 3 ; ADC Data Register Low Byte Bit 3
  387. .equ ADCL4 = 4 ; ADC Data Register Low Byte Bit 4
  388. .equ ADCL5 = 5 ; ADC Data Register Low Byte Bit 5
  389. .equ ADCL6 = 6 ; ADC Data Register Low Byte Bit 6
  390. .equ ADCL7 = 7 ; ADC Data Register Low Byte Bit 7
  391. ; DIDR0 - Digital Input Disable Register
  392. .equ ADC0D = 0 ;
  393. .equ ADC1D = 1 ;
  394. .equ ADC2D = 2 ;
  395. .equ ADC3D = 3 ;
  396. .equ ADC4D = 4 ;
  397. .equ ADC5D = 5 ;
  398. ; ***** ANALOG_COMPARATOR ************
  399. ; ACSR - Analog Comparator Control And Status Register
  400. .equ ACIS0 = 0 ; Analog Comparator Interrupt Mode Select bit 0
  401. .equ ACIS1 = 1 ; Analog Comparator Interrupt Mode Select bit 1
  402. .equ ACIC = 2 ; Analog Comparator Input Capture Enable
  403. .equ ACIE = 3 ; Analog Comparator Interrupt Enable
  404. .equ ACI = 4 ; Analog Comparator Interrupt Flag
  405. .equ ACO = 5 ; Analog Compare Output
  406. .equ ACBG = 6 ; Analog Comparator Bandgap Select
  407. .equ ACD = 7 ; Analog Comparator Disable
  408. ; DIDR1 - Digital Input Disable Register 1
  409. .equ AIN0D = 0 ; AIN0 Digital Input Disable
  410. .equ AIN1D = 1 ; AIN1 Digital Input Disable
  411. ; ***** PORTB ************************
  412. ; PORTB - Port B Data Register
  413. .equ PORTB0 = 0 ; Port B Data Register bit 0
  414. .equ PB0 = 0 ; For compatibility
  415. .equ PORTB1 = 1 ; Port B Data Register bit 1
  416. .equ PB1 = 1 ; For compatibility
  417. .equ PORTB2 = 2 ; Port B Data Register bit 2
  418. .equ PB2 = 2 ; For compatibility
  419. .equ PORTB3 = 3 ; Port B Data Register bit 3
  420. .equ PB3 = 3 ; For compatibility
  421. .equ PORTB4 = 4 ; Port B Data Register bit 4
  422. .equ PB4 = 4 ; For compatibility
  423. .equ PORTB5 = 5 ; Port B Data Register bit 5
  424. .equ PB5 = 5 ; For compatibility
  425. .equ PORTB6 = 6 ; Port B Data Register bit 6
  426. .equ PB6 = 6 ; For compatibility
  427. .equ PORTB7 = 7 ; Port B Data Register bit 7
  428. .equ PB7 = 7 ; For compatibility
  429. ; DDRB - Port B Data Direction Register
  430. .equ DDB0 = 0 ; Port B Data Direction Register bit 0
  431. .equ DDB1 = 1 ; Port B Data Direction Register bit 1
  432. .equ DDB2 = 2 ; Port B Data Direction Register bit 2
  433. .equ DDB3 = 3 ; Port B Data Direction Register bit 3
  434. .equ DDB4 = 4 ; Port B Data Direction Register bit 4
  435. .equ DDB5 = 5 ; Port B Data Direction Register bit 5
  436. .equ DDB6 = 6 ; Port B Data Direction Register bit 6
  437. .equ DDB7 = 7 ; Port B Data Direction Register bit 7
  438. ; PINB - Port B Input Pins
  439. .equ PINB0 = 0 ; Port B Input Pins bit 0
  440. .equ PINB1 = 1 ; Port B Input Pins bit 1
  441. .equ PINB2 = 2 ; Port B Input Pins bit 2
  442. .equ PINB3 = 3 ; Port B Input Pins bit 3
  443. .equ PINB4 = 4 ; Port B Input Pins bit 4
  444. .equ PINB5 = 5 ; Port B Input Pins bit 5
  445. .equ PINB6 = 6 ; Port B Input Pins bit 6
  446. .equ PINB7 = 7 ; Port B Input Pins bit 7
  447. ; ***** PORTC ************************
  448. ; PORTC - Port C Data Register
  449. .equ PORTC0 = 0 ; Port C Data Register bit 0
  450. .equ PC0 = 0 ; For compatibility
  451. .equ PORTC1 = 1 ; Port C Data Register bit 1
  452. .equ PC1 = 1 ; For compatibility
  453. .equ PORTC2 = 2 ; Port C Data Register bit 2
  454. .equ PC2 = 2 ; For compatibility
  455. .equ PORTC3 = 3 ; Port C Data Register bit 3
  456. .equ PC3 = 3 ; For compatibility
  457. .equ PORTC4 = 4 ; Port C Data Register bit 4
  458. .equ PC4 = 4 ; For compatibility
  459. .equ PORTC5 = 5 ; Port C Data Register bit 5
  460. .equ PC5 = 5 ; For compatibility
  461. .equ PORTC6 = 6 ; Port C Data Register bit 6
  462. .equ PC6 = 6 ; For compatibility
  463. ; DDRC - Port C Data Direction Register
  464. .equ DDC0 = 0 ; Port C Data Direction Register bit 0
  465. .equ DDC1 = 1 ; Port C Data Direction Register bit 1
  466. .equ DDC2 = 2 ; Port C Data Direction Register bit 2
  467. .equ DDC3 = 3 ; Port C Data Direction Register bit 3
  468. .equ DDC4 = 4 ; Port C Data Direction Register bit 4
  469. .equ DDC5 = 5 ; Port C Data Direction Register bit 5
  470. .equ DDC6 = 6 ; Port C Data Direction Register bit 6
  471. ; PINC - Port C Input Pins
  472. .equ PINC0 = 0 ; Port C Input Pins bit 0
  473. .equ PINC1 = 1 ; Port C Input Pins bit 1
  474. .equ PINC2 = 2 ; Port C Input Pins bit 2
  475. .equ PINC3 = 3 ; Port C Input Pins bit 3
  476. .equ PINC4 = 4 ; Port C Input Pins bit 4
  477. .equ PINC5 = 5 ; Port C Input Pins bit 5
  478. .equ PINC6 = 6 ; Port C Input Pins bit 6
  479. ; ***** PORTD ************************
  480. ; PORTD - Port D Data Register
  481. .equ PORTD0 = 0 ; Port D Data Register bit 0
  482. .equ PD0 = 0 ; For compatibility
  483. .equ PORTD1 = 1 ; Port D Data Register bit 1
  484. .equ PD1 = 1 ; For compatibility
  485. .equ PORTD2 = 2 ; Port D Data Register bit 2
  486. .equ PD2 = 2 ; For compatibility
  487. .equ PORTD3 = 3 ; Port D Data Register bit 3
  488. .equ PD3 = 3 ; For compatibility
  489. .equ PORTD4 = 4 ; Port D Data Register bit 4
  490. .equ PD4 = 4 ; For compatibility
  491. .equ PORTD5 = 5 ; Port D Data Register bit 5
  492. .equ PD5 = 5 ; For compatibility
  493. .equ PORTD6 = 6 ; Port D Data Register bit 6
  494. .equ PD6 = 6 ; For compatibility
  495. .equ PORTD7 = 7 ; Port D Data Register bit 7
  496. .equ PD7 = 7 ; For compatibility
  497. ; DDRD - Port D Data Direction Register
  498. .equ DDD0 = 0 ; Port D Data Direction Register bit 0
  499. .equ DDD1 = 1 ; Port D Data Direction Register bit 1
  500. .equ DDD2 = 2 ; Port D Data Direction Register bit 2
  501. .equ DDD3 = 3 ; Port D Data Direction Register bit 3
  502. .equ DDD4 = 4 ; Port D Data Direction Register bit 4
  503. .equ DDD5 = 5 ; Port D Data Direction Register bit 5
  504. .equ DDD6 = 6 ; Port D Data Direction Register bit 6
  505. .equ DDD7 = 7 ; Port D Data Direction Register bit 7
  506. ; PIND - Port D Input Pins
  507. .equ PIND0 = 0 ; Port D Input Pins bit 0
  508. .equ PIND1 = 1 ; Port D Input Pins bit 1
  509. .equ PIND2 = 2 ; Port D Input Pins bit 2
  510. .equ PIND3 = 3 ; Port D Input Pins bit 3
  511. .equ PIND4 = 4 ; Port D Input Pins bit 4
  512. .equ PIND5 = 5 ; Port D Input Pins bit 5
  513. .equ PIND6 = 6 ; Port D Input Pins bit 6
  514. .equ PIND7 = 7 ; Port D Input Pins bit 7
  515. ; ***** TIMER_COUNTER_0 **************
  516. ; TIMSK0 - Timer/Counter0 Interrupt Mask Register
  517. .equ TOIE0 = 0 ; Timer/Counter0 Overflow Interrupt Enable
  518. .equ OCIE0A = 1 ; Timer/Counter0 Output Compare Match A Interrupt Enable
  519. .equ OCIE0B = 2 ; Timer/Counter0 Output Compare Match B Interrupt Enable
  520. ; TIFR0 - Timer/Counter0 Interrupt Flag register
  521. .equ TOV0 = 0 ; Timer/Counter0 Overflow Flag
  522. .equ OCF0A = 1 ; Timer/Counter0 Output Compare Flag 0A
  523. .equ OCF0B = 2 ; Timer/Counter0 Output Compare Flag 0B
  524. ; TCCR0A - Timer/Counter Control Register A
  525. .equ WGM00 = 0 ; Waveform Generation Mode
  526. .equ WGM01 = 1 ; Waveform Generation Mode
  527. .equ COM0B0 = 4 ; Compare Output Mode, Fast PWm
  528. .equ COM0B1 = 5 ; Compare Output Mode, Fast PWm
  529. .equ COM0A0 = 6 ; Compare Output Mode, Phase Correct PWM Mode
  530. .equ COM0A1 = 7 ; Compare Output Mode, Phase Correct PWM Mode
  531. ; TCCR0B - Timer/Counter Control Register B
  532. .equ CS00 = 0 ; Clock Select
  533. .equ CS01 = 1 ; Clock Select
  534. .equ CS02 = 2 ; Clock Select
  535. .equ WGM02 = 3 ;
  536. .equ FOC0B = 6 ; Force Output Compare B
  537. .equ FOC0A = 7 ; Force Output Compare A
  538. ; TCNT0 - Timer/Counter0
  539. .equ TCNT0_0 = 0 ;
  540. .equ TCNT0_1 = 1 ;
  541. .equ TCNT0_2 = 2 ;
  542. .equ TCNT0_3 = 3 ;
  543. .equ TCNT0_4 = 4 ;
  544. .equ TCNT0_5 = 5 ;
  545. .equ TCNT0_6 = 6 ;
  546. .equ TCNT0_7 = 7 ;
  547. ; OCR0A - Timer/Counter0 Output Compare Register
  548. .equ OCR0A_0 = 0 ;
  549. .equ OCR0A_1 = 1 ;
  550. .equ OCR0A_2 = 2 ;
  551. .equ OCR0A_3 = 3 ;
  552. .equ OCR0A_4 = 4 ;
  553. .equ OCR0A_5 = 5 ;
  554. .equ OCR0A_6 = 6 ;
  555. .equ OCR0A_7 = 7 ;
  556. ; OCR0B - Timer/Counter0 Output Compare Register
  557. .equ OCR0B_0 = 0 ;
  558. .equ OCR0B_1 = 1 ;
  559. .equ OCR0B_2 = 2 ;
  560. .equ OCR0B_3 = 3 ;
  561. .equ OCR0B_4 = 4 ;
  562. .equ OCR0B_5 = 5 ;
  563. .equ OCR0B_6 = 6 ;
  564. .equ OCR0B_7 = 7 ;
  565. ; GTCCR - General Timer/Counter Control Register
  566. ;.equ PSRSYNC = 0 ; Prescaler Reset Timer/Counter1 and Timer/Counter0
  567. .equ PSR10 = PSRSYNC ; For compatibility
  568. ;.equ TSM = 7 ; Timer/Counter Synchronization Mode
  569. ; ***** EXTERNAL_INTERRUPT ***********
  570. ; EICRA - External Interrupt Control Register
  571. .equ ISC00 = 0 ; External Interrupt Sense Control 0 Bit 0
  572. .equ ISC01 = 1 ; External Interrupt Sense Control 0 Bit 1
  573. .equ ISC10 = 2 ; External Interrupt Sense Control 1 Bit 0
  574. .equ ISC11 = 3 ; External Interrupt Sense Control 1 Bit 1
  575. ; EIMSK - External Interrupt Mask Register
  576. .equ INT0 = 0 ; External Interrupt Request 0 Enable
  577. .equ INT1 = 1 ; External Interrupt Request 1 Enable
  578. ; EIFR - External Interrupt Flag Register
  579. .equ INTF0 = 0 ; External Interrupt Flag 0
  580. .equ INTF1 = 1 ; External Interrupt Flag 1
  581. ; PCICR - Pin Change Interrupt Control Register
  582. .equ PCIE0 = 0 ; Pin Change Interrupt Enable 0
  583. .equ PCIE1 = 1 ; Pin Change Interrupt Enable 1
  584. .equ PCIE2 = 2 ; Pin Change Interrupt Enable 2
  585. ; PCMSK2 - Pin Change Mask Register 2
  586. .equ PCINT16 = 0 ; Pin Change Enable Mask 16
  587. .equ PCINT17 = 1 ; Pin Change Enable Mask 17
  588. .equ PCINT18 = 2 ; Pin Change Enable Mask 18
  589. .equ PCINT19 = 3 ; Pin Change Enable Mask 19
  590. .equ PCINT20 = 4 ; Pin Change Enable Mask 20
  591. .equ PCINT21 = 5 ; Pin Change Enable Mask 21
  592. .equ PCINT22 = 6 ; Pin Change Enable Mask 22
  593. .equ PCINT23 = 7 ; Pin Change Enable Mask 23
  594. ; PCMSK1 - Pin Change Mask Register 1
  595. .equ PCINT8 = 0 ; Pin Change Enable Mask 8
  596. .equ PCINT9 = 1 ; Pin Change Enable Mask 9
  597. .equ PCINT10 = 2 ; Pin Change Enable Mask 10
  598. .equ PCINT11 = 3 ; Pin Change Enable Mask 11
  599. .equ PCINT12 = 4 ; Pin Change Enable Mask 12
  600. .equ PCINT13 = 5 ; Pin Change Enable Mask 13
  601. .equ PCINT14 = 6 ; Pin Change Enable Mask 14
  602. ; PCMSK0 - Pin Change Mask Register 0
  603. .equ PCINT0 = 0 ; Pin Change Enable Mask 0
  604. .equ PCINT1 = 1 ; Pin Change Enable Mask 1
  605. .equ PCINT2 = 2 ; Pin Change Enable Mask 2
  606. .equ PCINT3 = 3 ; Pin Change Enable Mask 3
  607. .equ PCINT4 = 4 ; Pin Change Enable Mask 4
  608. .equ PCINT5 = 5 ; Pin Change Enable Mask 5
  609. .equ PCINT6 = 6 ; Pin Change Enable Mask 6
  610. .equ PCINT7 = 7 ; Pin Change Enable Mask 7
  611. ; PCIFR - Pin Change Interrupt Flag Register
  612. .equ PCIF0 = 0 ; Pin Change Interrupt Flag 0
  613. .equ PCIF1 = 1 ; Pin Change Interrupt Flag 1
  614. .equ PCIF2 = 2 ; Pin Change Interrupt Flag 2
  615. ; ***** SPI **************************
  616. ; SPDR - SPI Data Register
  617. .equ SPDR0 = 0 ; SPI Data Register bit 0
  618. .equ SPDR1 = 1 ; SPI Data Register bit 1
  619. .equ SPDR2 = 2 ; SPI Data Register bit 2
  620. .equ SPDR3 = 3 ; SPI Data Register bit 3
  621. .equ SPDR4 = 4 ; SPI Data Register bit 4
  622. .equ SPDR5 = 5 ; SPI Data Register bit 5
  623. .equ SPDR6 = 6 ; SPI Data Register bit 6
  624. .equ SPDR7 = 7 ; SPI Data Register bit 7
  625. ; SPSR - SPI Status Register
  626. .equ SPI2X = 0 ; Double SPI Speed Bit
  627. .equ WCOL = 6 ; Write Collision Flag
  628. .equ SPIF = 7 ; SPI Interrupt Flag
  629. ; SPCR - SPI Control Register
  630. .equ SPR0 = 0 ; SPI Clock Rate Select 0
  631. .equ SPR1 = 1 ; SPI Clock Rate Select 1
  632. .equ CPHA = 2 ; Clock Phase
  633. .equ CPOL = 3 ; Clock polarity
  634. .equ MSTR = 4 ; Master/Slave Select
  635. .equ DORD = 5 ; Data Order
  636. .equ SPE = 6 ; SPI Enable
  637. .equ SPIE = 7 ; SPI Interrupt Enable
  638. ; ***** WATCHDOG *********************
  639. ; WDTCSR - Watchdog Timer Control Register
  640. .equ WDP0 = 0 ; Watch Dog Timer Prescaler bit 0
  641. .equ WDP1 = 1 ; Watch Dog Timer Prescaler bit 1
  642. .equ WDP2 = 2 ; Watch Dog Timer Prescaler bit 2
  643. .equ WDE = 3 ; Watch Dog Enable
  644. .equ WDCE = 4 ; Watchdog Change Enable
  645. .equ WDP3 = 5 ; Watchdog Timer Prescaler Bit 3
  646. .equ WDIE = 6 ; Watchdog Timeout Interrupt Enable
  647. .equ WDIF = 7 ; Watchdog Timeout Interrupt Flag
  648. ; ***** EEPROM ***********************
  649. ; EEARL - EEPROM Address Register Low Byte
  650. .equ EEAR0 = 0 ; EEPROM Read/Write Access Bit 0
  651. .equ EEAR1 = 1 ; EEPROM Read/Write Access Bit 1
  652. .equ EEAR2 = 2 ; EEPROM Read/Write Access Bit 2
  653. .equ EEAR3 = 3 ; EEPROM Read/Write Access Bit 3
  654. .equ EEAR4 = 4 ; EEPROM Read/Write Access Bit 4
  655. .equ EEAR5 = 5 ; EEPROM Read/Write Access Bit 5
  656. .equ EEAR6 = 6 ; EEPROM Read/Write Access Bit 6
  657. .equ EEAR7 = 7 ; EEPROM Read/Write Access Bit 7
  658. ; EEARH - EEPROM Address Register High Byte
  659. .equ EEAR8 = 0 ; EEPROM Read/Write Access Bit 0
  660. ; EEDR - EEPROM Data Register
  661. .equ EEDR0 = 0 ; EEPROM Data Register bit 0
  662. .equ EEDR1 = 1 ; EEPROM Data Register bit 1
  663. .equ EEDR2 = 2 ; EEPROM Data Register bit 2
  664. .equ EEDR3 = 3 ; EEPROM Data Register bit 3
  665. .equ EEDR4 = 4 ; EEPROM Data Register bit 4
  666. .equ EEDR5 = 5 ; EEPROM Data Register bit 5
  667. .equ EEDR6 = 6 ; EEPROM Data Register bit 6
  668. .equ EEDR7 = 7 ; EEPROM Data Register bit 7
  669. ; EECR - EEPROM Control Register
  670. .equ EERE = 0 ; EEPROM Read Enable
  671. .equ EEPE = 1 ; EEPROM Write Enable
  672. .equ EEMPE = 2 ; EEPROM Master Write Enable
  673. .equ EERIE = 3 ; EEPROM Ready Interrupt Enable
  674. .equ EEPM0 = 4 ; EEPROM Programming Mode Bit 0
  675. .equ EEPM1 = 5 ; EEPROM Programming Mode Bit 1
  676. ; ***** CPU **************************
  677. ; SREG - Status Register
  678. .equ SREG_C = 0 ; Carry Flag
  679. .equ SREG_Z = 1 ; Zero Flag
  680. .equ SREG_N = 2 ; Negative Flag
  681. .equ SREG_V = 3 ; Two's Complement Overflow Flag
  682. .equ SREG_S = 4 ; Sign Bit
  683. .equ SREG_H = 5 ; Half Carry Flag
  684. .equ SREG_T = 6 ; Bit Copy Storage
  685. .equ SREG_I = 7 ; Global Interrupt Enable
  686. ; OSCCAL - Oscillator Calibration Value
  687. .equ CAL0 = 0 ; Oscillator Calibration Value Bit0
  688. .equ CAL1 = 1 ; Oscillator Calibration Value Bit1
  689. .equ CAL2 = 2 ; Oscillator Calibration Value Bit2
  690. .equ CAL3 = 3 ; Oscillator Calibration Value Bit3
  691. .equ CAL4 = 4 ; Oscillator Calibration Value Bit4
  692. .equ CAL5 = 5 ; Oscillator Calibration Value Bit5
  693. .equ CAL6 = 6 ; Oscillator Calibration Value Bit6
  694. .equ CAL7 = 7 ; Oscillator Calibration Value Bit7
  695. ; CLKPR - Clock Prescale Register
  696. .equ CLKPS0 = 0 ; Clock Prescaler Select Bit 0
  697. .equ CLKPS1 = 1 ; Clock Prescaler Select Bit 1
  698. .equ CLKPS2 = 2 ; Clock Prescaler Select Bit 2
  699. .equ CLKPS3 = 3 ; Clock Prescaler Select Bit 3
  700. .equ CLKPCE = 7 ; Clock Prescaler Change Enable
  701. ; SPMCSR - Store Program Memory Control and Status Register
  702. .equ SELFPRGEN = 0 ; Self Programming Enable
  703. .equ PGERS = 1 ; Page Erase
  704. .equ PGWRT = 2 ; Page Write
  705. .equ BLBSET = 3 ; Boot Lock Bit Set
  706. .equ RWWSRE = 4 ; Read-While-Write section read enable
  707. .equ RWWSB = 6 ; Read-While-Write Section Busy
  708. .equ SPMIE = 7 ; SPM Interrupt Enable
  709. ; MCUCR - MCU Control Register
  710. .equ IVCE = 0 ;
  711. .equ IVSEL = 1 ;
  712. .equ PUD = 4 ;
  713. .equ BODSE = 5 ; BOD Sleep Enable
  714. .equ BODS = 6 ; BOD Sleep
  715. ; MCUSR - MCU Status Register
  716. .equ PORF = 0 ; Power-on reset flag
  717. .equ EXTRF = 1 ; External Reset Flag
  718. .equ EXTREF = EXTRF ; For compatibility
  719. .equ BORF = 2 ; Brown-out Reset Flag
  720. .equ WDRF = 3 ; Watchdog Reset Flag
  721. ; SMCR - Sleep Mode Control Register
  722. .equ SE = 0 ; Sleep Enable
  723. .equ SM0 = 1 ; Sleep Mode Select Bit 0
  724. .equ SM1 = 2 ; Sleep Mode Select Bit 1
  725. .equ SM2 = 3 ; Sleep Mode Select Bit 2
  726. ; GPIOR2 - General Purpose I/O Register 2
  727. .equ GPIOR20 = 0 ;
  728. .equ GPIOR21 = 1 ;
  729. .equ GPIOR22 = 2 ;
  730. .equ GPIOR23 = 3 ;
  731. .equ GPIOR24 = 4 ;
  732. .equ GPIOR25 = 5 ;
  733. .equ GPIOR26 = 6 ;
  734. .equ GPIOR27 = 7 ;
  735. ; GPIOR1 - General Purpose I/O Register 1
  736. .equ GPIOR10 = 0 ;
  737. .equ GPIOR11 = 1 ;
  738. .equ GPIOR12 = 2 ;
  739. .equ GPIOR13 = 3 ;
  740. .equ GPIOR14 = 4 ;
  741. .equ GPIOR15 = 5 ;
  742. .equ GPIOR16 = 6 ;
  743. .equ GPIOR17 = 7 ;
  744. ; GPIOR0 - General Purpose I/O Register 0
  745. .equ GPIOR00 = 0 ;
  746. .equ GPIOR01 = 1 ;
  747. .equ GPIOR02 = 2 ;
  748. .equ GPIOR03 = 3 ;
  749. .equ GPIOR04 = 4 ;
  750. .equ GPIOR05 = 5 ;
  751. .equ GPIOR06 = 6 ;
  752. .equ GPIOR07 = 7 ;
  753. ; PRR - Power Reduction Register
  754. .equ PRADC = 0 ; Power Reduction ADC
  755. .equ PRUSART0 = 1 ; Power Reduction USART
  756. .equ PRSPI = 2 ; Power Reduction Serial Peripheral Interface
  757. .equ PRTIM1 = 3 ; Power Reduction Timer/Counter1
  758. .equ PRTIM0 = 5 ; Power Reduction Timer/Counter0
  759. .equ PRTIM2 = 6 ; Power Reduction Timer/Counter2
  760. .equ PRTWI = 7 ; Power Reduction TWI
  761. ; ***** LOCKSBITS ********************************************************
  762. .equ LB1 = 0 ; Lock bit
  763. .equ LB2 = 1 ; Lock bit
  764. .equ BLB01 = 2 ; Boot Lock bit
  765. .equ BLB02 = 3 ; Boot Lock bit
  766. .equ BLB11 = 4 ; Boot lock bit
  767. .equ BLB12 = 5 ; Boot lock bit
  768. ; ***** FUSES ************************************************************
  769. ; LOW fuse bits
  770. .equ CKSEL0 = 0 ; Select Clock Source
  771. .equ CKSEL1 = 1 ; Select Clock Source
  772. .equ CKSEL2 = 2 ; Select Clock Source
  773. .equ CKSEL3 = 3 ; Select Clock Source
  774. .equ SUT0 = 4 ; Select start-up time
  775. .equ SUT1 = 5 ; Select start-up time
  776. .equ CKOUT = 6 ; Clock output
  777. .equ CKDIV8 = 7 ; Divide clock by 8
  778. ; HIGH fuse bits
  779. .equ BODLEVEL0 = 0 ; Brown-out Detector trigger level
  780. .equ BODLEVEL1 = 1 ; Brown-out Detector trigger level
  781. .equ BODLEVEL2 = 2 ; Brown-out Detector trigger level
  782. .equ EESAVE = 3 ; EEPROM memory is preserved through chip erase
  783. .equ WDTON = 4 ; Watchdog Timer Always On
  784. .equ SPIEN = 5 ; Enable Serial programming and Data Downloading
  785. .equ DWEN = 6 ; debugWIRE Enable
  786. .equ RSTDISBL = 7 ; External reset disable
  787. ; EXTENDED fuse bits
  788. .equ BOOTRST = 0 ; Select reset vector
  789. .equ BOOTSZ0 = 1 ; Select boot size
  790. .equ BOOTSZ1 = 2 ; Select boot size
  791. ; ***** CPU REGISTER DEFINITIONS *****************************************
  792. .def XH = r27
  793. .def XL = r26
  794. .def YH = r29
  795. .def YL = r28
  796. .def ZH = r31
  797. .def ZL = r30
  798. ; ***** DATA MEMORY DECLARATIONS *****************************************
  799. .equ FLASHEND = 0x1fff ; Note: Word address
  800. .equ IOEND = 0x00ff
  801. .equ SRAM_START = 0x0100
  802. .equ SRAM_SIZE = 1024
  803. .equ RAMEND = 0x04ff
  804. .equ XRAMEND = 0x0000
  805. .equ E2END = 0x01ff
  806. .equ EEPROMEND = 0x01ff
  807. .equ EEADRBITS = 9
  808. #pragma AVRPART MEMORY PROG_FLASH 16384
  809. #pragma AVRPART MEMORY EEPROM 512
  810. #pragma AVRPART MEMORY INT_SRAM SIZE 1024
  811. #pragma AVRPART MEMORY INT_SRAM START_ADDR 0x100
  812. ; ***** BOOTLOADER DECLARATIONS ******************************************
  813. .equ NRWW_START_ADDR = 0x1c00
  814. .equ NRWW_STOP_ADDR = 0x1fff
  815. .equ RWW_START_ADDR = 0x0
  816. .equ RWW_STOP_ADDR = 0x1bff
  817. .equ PAGESIZE = 64
  818. .equ FIRSTBOOTSTART = 0x1f80
  819. .equ SECONDBOOTSTART = 0x1f00
  820. .equ THIRDBOOTSTART = 0x1e00
  821. .equ FOURTHBOOTSTART = 0x1c00
  822. .equ SMALLBOOTSTART = FIRSTBOOTSTART
  823. .equ LARGEBOOTSTART = FOURTHBOOTSTART
  824. ; ***** INTERRUPT VECTORS ************************************************
  825. .equ INT0addr = 0x0002 ; External Interrupt Request 0
  826. .equ INT1addr = 0x0004 ; External Interrupt Request 1
  827. .equ PCI0addr = 0x0006 ; Pin Change Interrupt Request 0
  828. .equ PCI1addr = 0x0008 ; Pin Change Interrupt Request 0
  829. .equ PCI2addr = 0x000a ; Pin Change Interrupt Request 1
  830. .equ WDTaddr = 0x000c ; Watchdog Time-out Interrupt
  831. .equ OC2Aaddr = 0x000e ; Timer/Counter2 Compare Match A
  832. .equ OC2Baddr = 0x0010 ; Timer/Counter2 Compare Match A
  833. .equ OVF2addr = 0x0012 ; Timer/Counter2 Overflow
  834. .equ ICP1addr = 0x0014 ; Timer/Counter1 Capture Event
  835. .equ OC1Aaddr = 0x0016 ; Timer/Counter1 Compare Match A
  836. .equ OC1Baddr = 0x0018 ; Timer/Counter1 Compare Match B
  837. .equ OVF1addr = 0x001a ; Timer/Counter1 Overflow
  838. .equ OC0Aaddr = 0x001c ; TimerCounter0 Compare Match A
  839. .equ OC0Baddr = 0x001e ; TimerCounter0 Compare Match B
  840. .equ OVF0addr = 0x0020 ; Timer/Couner0 Overflow
  841. .equ SPIaddr = 0x0022 ; SPI Serial Transfer Complete
  842. .equ URXCaddr = 0x0024 ; USART Rx Complete
  843. .equ UDREaddr = 0x0026 ; USART, Data Register Empty
  844. .equ UTXCaddr = 0x0028 ; USART Tx Complete
  845. .equ ADCCaddr = 0x002a ; ADC Conversion Complete
  846. .equ ERDYaddr = 0x002c ; EEPROM Ready
  847. .equ ACIaddr = 0x002e ; Analog Comparator
  848. .equ TWIaddr = 0x0030 ; Two-wire Serial Interface
  849. .equ SPMRaddr = 0x0032 ; Store Program Memory Read
  850. .equ INT_VECTORS_SIZE = 52 ; size in words
  851. #endif /* _M168PADEF_INC_ */
  852. ; ***** END OF FILE ******************************************************