tn2313def.inc 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646
  1. ;***** THIS IS A MACHINE GENERATED FILE - DO NOT EDIT ********************
  2. ;***** Created: 2006-07-05 11:07 ******* Source: ATtiny2313.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 : "tn2313def.inc"
  8. ;* Title : Register/Bit Definitions for the ATtiny2313
  9. ;* Date : 2006-07-05
  10. ;* Version : 2.23
  11. ;* Support E-mail : avr@atmel.com
  12. ;* Target MCU : ATtiny2313
  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. ; ***** SPECIFY DEVICE ***************************************************
  40. .device attiny2313
  41. .equ SIGNATURE_000 = 0x1e
  42. .equ SIGNATURE_001 = 0x91
  43. .equ SIGNATURE_002 = 0x0a
  44. ; ***** I/O REGISTER DEFINITIONS *****************************************
  45. ; NOTE:
  46. ; Definitions marked "MEMORY MAPPED"are extended I/O ports
  47. ; and cannot be used with IN/OUT instructions
  48. .equ SREG = 0x3f
  49. .equ SPL = 0x3d
  50. .equ OCR0B = 0x3c
  51. .equ GIMSK = 0x3b
  52. .equ EIFR = 0x3a
  53. .equ TIMSK = 0x39
  54. .equ TIFR = 0x38
  55. .equ SPMCSR = 0x37
  56. .equ OCR0A = 0x36
  57. .equ MCUCR = 0x35
  58. .equ MCUSR = 0x34
  59. .equ TCCR0B = 0x33
  60. .equ TCNT0 = 0x32
  61. .equ OSCCAL = 0x31
  62. .equ TCCR0A = 0x30
  63. .equ TCCR1A = 0x2f
  64. .equ TCCR1B = 0x2e
  65. .equ TCNT1L = 0x2c
  66. .equ TCNT1H = 0x2d
  67. .equ OCR1AL = 0x2a
  68. .equ OCR1AH = 0x2b
  69. .equ OCR1BL = 0x28
  70. .equ OCR1BH = 0x29
  71. .equ CLKPR = 0x26
  72. .equ ICR1L = 0x24
  73. .equ ICR1H = 0x25
  74. .equ GTCCR = 0x23
  75. .equ TCCR1C = 0x22
  76. .equ WDTCR = 0x21
  77. .equ PCMSK = 0x20
  78. .equ EEAR = 0x1e
  79. .equ EEDR = 0x1d
  80. .equ EECR = 0x1c
  81. .equ PORTA = 0x1b
  82. .equ DDRA = 0x1a
  83. .equ PINA = 0x19
  84. .equ PORTB = 0x18
  85. .equ DDRB = 0x17
  86. .equ PINB = 0x16
  87. .equ GPIOR2 = 0x15
  88. .equ GPIOR1 = 0x14
  89. .equ GPIOR0 = 0x13
  90. .equ PORTD = 0x12
  91. .equ DDRD = 0x11
  92. .equ PIND = 0x10
  93. .equ USIDR = 0x0f
  94. .equ USISR = 0x0e
  95. .equ USICR = 0x0d
  96. .equ UDR = 0x0c
  97. .equ UCSRA = 0x0b
  98. .equ UCSRB = 0x0a
  99. .equ UBRRL = 0x09
  100. .equ ACSR = 0x08
  101. .equ UCSRC = 0x03
  102. .equ UBRRH = 0x02
  103. .equ DIDR = 0x01
  104. ; ***** BIT DEFINITIONS **************************************************
  105. ; ***** PORTB ************************
  106. ; PORTB - Port B Data Register
  107. .equ PORTB0 = 0 ; Port B Data Register bit 0
  108. .equ PB0 = 0 ; For compatibility
  109. .equ PORTB1 = 1 ; Port B Data Register bit 1
  110. .equ PB1 = 1 ; For compatibility
  111. .equ PORTB2 = 2 ; Port B Data Register bit 2
  112. .equ PB2 = 2 ; For compatibility
  113. .equ PORTB3 = 3 ; Port B Data Register bit 3
  114. .equ PB3 = 3 ; For compatibility
  115. .equ PORTB4 = 4 ; Port B Data Register bit 4
  116. .equ PB4 = 4 ; For compatibility
  117. .equ PORTB5 = 5 ; Port B Data Register bit 5
  118. .equ PB5 = 5 ; For compatibility
  119. .equ PORTB6 = 6 ; Port B Data Register bit 6
  120. .equ PB6 = 6 ; For compatibility
  121. .equ PORTB7 = 7 ; Port B Data Register bit 7
  122. .equ PB7 = 7 ; For compatibility
  123. ; DDRB - Port B Data Direction Register
  124. .equ DDB0 = 0 ; Port B Data Direction Register bit 0
  125. .equ DDB1 = 1 ; Port B Data Direction Register bit 1
  126. .equ DDB2 = 2 ; Port B Data Direction Register bit 2
  127. .equ DDB3 = 3 ; Port B Data Direction Register bit 3
  128. .equ DDB4 = 4 ; Port B Data Direction Register bit 4
  129. .equ DDB5 = 5 ; Port B Data Direction Register bit 5
  130. .equ DDB6 = 6 ; Port B Data Direction Register bit 6
  131. .equ DDB7 = 7 ; Port B Data Direction Register bit 7
  132. ; PINB - Port B Input Pins
  133. .equ PINB0 = 0 ; Port B Input Pins bit 0
  134. .equ PINB1 = 1 ; Port B Input Pins bit 1
  135. .equ PINB2 = 2 ; Port B Input Pins bit 2
  136. .equ PINB3 = 3 ; Port B Input Pins bit 3
  137. .equ PINB4 = 4 ; Port B Input Pins bit 4
  138. .equ PINB5 = 5 ; Port B Input Pins bit 5
  139. .equ PINB6 = 6 ; Port B Input Pins bit 6
  140. .equ PINB7 = 7 ; Port B Input Pins bit 7
  141. ; ***** TIMER_COUNTER_0 **************
  142. ; TIMSK - Timer/Counter Interrupt Mask Register
  143. .equ OCIE0A = 0 ; Timer/Counter0 Output Compare Match A Interrupt Enable
  144. .equ TOIE0 = 1 ; Timer/Counter0 Overflow Interrupt Enable
  145. .equ OCIE0B = 2 ; Timer/Counter0 Output Compare Match B Interrupt Enable
  146. ; TIFR - Timer/Counter Interrupt Flag register
  147. .equ OCF0A = 0 ; Timer/Counter0 Output Compare Flag 0A
  148. .equ TOV0 = 1 ; Timer/Counter0 Overflow Flag
  149. .equ OCF0B = 2 ; Timer/Counter0 Output Compare Flag 0B
  150. ; OCR0B - Timer/Counter0 Output Compare Register
  151. .equ OCR0_0 = 0 ;
  152. .equ OCR0_1 = 1 ;
  153. .equ OCR0_2 = 2 ;
  154. .equ OCR0_3 = 3 ;
  155. .equ OCR0_4 = 4 ;
  156. .equ OCR0_5 = 5 ;
  157. .equ OCR0_6 = 6 ;
  158. .equ OCR0_7 = 7 ;
  159. ; OCR0A - Timer/Counter0 Output Compare Register
  160. ;.equ OCR0_0 = 0 ;
  161. ;.equ OCR0_1 = 1 ;
  162. ;.equ OCR0_2 = 2 ;
  163. ;.equ OCR0_3 = 3 ;
  164. ;.equ OCR0_4 = 4 ;
  165. ;.equ OCR0_5 = 5 ;
  166. ;.equ OCR0_6 = 6 ;
  167. ;.equ OCR0_7 = 7 ;
  168. ; TCCR0A - Timer/Counter Control Register A
  169. .equ WGM00 = 0 ; Waveform Generation Mode
  170. .equ WGM01 = 1 ; Waveform Generation Mode
  171. .equ COM0B0 = 4 ; Compare Match Output B Mode
  172. .equ COM0B1 = 5 ; Compare Match Output B Mode
  173. .equ COM0A0 = 6 ; Compare Match Output A Mode
  174. .equ COM0A1 = 7 ; Compare Match Output A Mode
  175. ; TCNT0 - Timer/Counter0
  176. .equ TCNT0_0 = 0 ;
  177. .equ TCNT0_1 = 1 ;
  178. .equ TCNT0_2 = 2 ;
  179. .equ TCNT0_3 = 3 ;
  180. .equ TCNT0_4 = 4 ;
  181. .equ TCNT0_5 = 5 ;
  182. .equ TCNT0_6 = 6 ;
  183. .equ TCNT0_7 = 7 ;
  184. ; TCCR0B - Timer/Counter Control Register B
  185. .equ TCCR0 = TCCR0B ; For compatibility
  186. .equ CS00 = 0 ; Clock Select
  187. .equ CS01 = 1 ; Clock Select
  188. .equ CS02 = 2 ; Clock Select
  189. .equ WGM02 = 3 ;
  190. .equ FOC0B = 6 ; Force Output Compare B
  191. .equ FOC0A = 7 ; Force Output Compare B
  192. ; ***** TIMER_COUNTER_1 **************
  193. ; TIMSK - Timer/Counter Interrupt Mask Register
  194. .equ ICIE1 = 3 ; Timer/Counter1 Input Capture Interrupt Enable
  195. .equ TICIE = ICIE1 ; For compatibility
  196. .equ OCIE1B = 5 ; Timer/Counter1 Output CompareB Match Interrupt Enable
  197. .equ OCIE1A = 6 ; Timer/Counter1 Output CompareA Match Interrupt Enable
  198. .equ TOIE1 = 7 ; Timer/Counter1 Overflow Interrupt Enable
  199. ; TIFR - Timer/Counter Interrupt Flag register
  200. .equ ICF1 = 3 ; Input Capture Flag 1
  201. .equ OCF1B = 5 ; Output Compare Flag 1B
  202. .equ OCF1A = 6 ; Output Compare Flag 1A
  203. .equ TOV1 = 7 ; Timer/Counter1 Overflow Flag
  204. ; TCCR1A - Timer/Counter1 Control Register A
  205. .equ WGM10 = 0 ; Pulse Width Modulator Select Bit 0
  206. .equ PWM10 = WGM10 ; For compatibility
  207. .equ WGM11 = 1 ; Pulse Width Modulator Select Bit 1
  208. .equ PWM11 = WGM11 ; For compatibility
  209. .equ COM1B0 = 4 ; Comparet Ouput Mode 1B, bit 0
  210. .equ COM1B1 = 5 ; Compare Output Mode 1B, bit 1
  211. .equ COM1A0 = 6 ; Comparet Ouput Mode 1A, bit 0
  212. .equ COM1A1 = 7 ; Compare Output Mode 1A, bit 1
  213. ; TCCR1B - Timer/Counter1 Control Register B
  214. .equ CS10 = 0 ; Clock Select bit 0
  215. .equ CS11 = 1 ; Clock Select 1 bit 1
  216. .equ CS12 = 2 ; Clock Select1 bit 2
  217. .equ WGM12 = 3 ; Waveform Generation Mode Bit 2
  218. .equ CTC1 = WGM12 ; For compatibility
  219. .equ WGM13 = 4 ; Waveform Generation Mode Bit 3
  220. .equ ICES1 = 6 ; Input Capture 1 Edge Select
  221. .equ ICNC1 = 7 ; Input Capture 1 Noise Canceler
  222. ; TCCR1C - Timer/Counter1 Control Register C
  223. .equ FOC1B = 6 ; Force Output Compare for Channel B
  224. .equ FOC1A = 7 ; Force Output Compare for Channel A
  225. ; ***** WATCHDOG *********************
  226. ; WDTCR - Watchdog Timer Control Register
  227. .equ WDTCSR = WDTCR ; For compatibility
  228. .equ WDP0 = 0 ; Watch Dog Timer Prescaler bit 0
  229. .equ WDP1 = 1 ; Watch Dog Timer Prescaler bit 1
  230. .equ WDP2 = 2 ; Watch Dog Timer Prescaler bit 2
  231. .equ WDE = 3 ; Watch Dog Enable
  232. .equ WDCE = 4 ; Watchdog Change Enable
  233. .equ WDTOE = WDCE ; For compatibility
  234. .equ WDP3 = 5 ; Watchdog Timer Prescaler Bit 3
  235. .equ WDIE = 6 ; Watchdog Timeout Interrupt Enable
  236. .equ WDIF = 7 ; Watchdog Timeout Interrupt Flag
  237. ; ***** EXTERNAL_INTERRUPT ***********
  238. ; GIMSK - General Interrupt Mask Register
  239. .equ PCIE = 5 ;
  240. .equ INT0 = 6 ; External Interrupt Request 0 Enable
  241. .equ INT1 = 7 ; External Interrupt Request 1 Enable
  242. ; EIFR - Extended Interrupt Flag Register
  243. .equ GIFR = EIFR ; For compatibility
  244. .equ PCIF = 5 ;
  245. .equ INTF0 = 6 ; External Interrupt Flag 0
  246. .equ INTF1 = 7 ; External Interrupt Flag 1
  247. ; ***** USART ************************
  248. ; UDR - USART I/O Data Register
  249. .equ UDR0 = 0 ; USART I/O Data Register bit 0
  250. .equ UDR1 = 1 ; USART I/O Data Register bit 1
  251. .equ UDR2 = 2 ; USART I/O Data Register bit 2
  252. .equ UDR3 = 3 ; USART I/O Data Register bit 3
  253. .equ UDR4 = 4 ; USART I/O Data Register bit 4
  254. .equ UDR5 = 5 ; USART I/O Data Register bit 5
  255. .equ UDR6 = 6 ; USART I/O Data Register bit 6
  256. .equ UDR7 = 7 ; USART I/O Data Register bit 7
  257. ; UCSRA - USART Control and Status Register A
  258. .equ USR = UCSRA ; For compatibility
  259. .equ MPCM = 0 ; Multi-processor Communication Mode
  260. .equ U2X = 1 ; Double the USART Transmission Speed
  261. .equ UPE = 2 ; USART Parity Error
  262. .equ PE = UPE ; For compatibility
  263. .equ DOR = 3 ; Data overRun
  264. .equ FE = 4 ; Framing Error
  265. .equ UDRE = 5 ; USART Data Register Empty
  266. .equ TXC = 6 ; USART Transmitt Complete
  267. .equ RXC = 7 ; USART Receive Complete
  268. ; UCSRB - USART Control and Status Register B
  269. .equ UCR = UCSRB ; For compatibility
  270. .equ TXB8 = 0 ; Transmit Data Bit 8
  271. .equ RXB8 = 1 ; Receive Data Bit 8
  272. .equ UCSZ2 = 2 ; Character Size
  273. .equ CHR9 = UCSZ2 ; For compatibility
  274. .equ TXEN = 3 ; Transmitter Enable
  275. .equ RXEN = 4 ; Receiver Enable
  276. .equ UDRIE = 5 ; USART Data register Empty Interrupt Enable
  277. .equ TXCIE = 6 ; TX Complete Interrupt Enable
  278. .equ RXCIE = 7 ; RX Complete Interrupt Enable
  279. ; UCSRC - USART Control and Status Register C
  280. .equ UCPOL = 0 ; Clock Polarity
  281. .equ UCSZ0 = 1 ; Character Size Bit 0
  282. .equ UCSZ1 = 2 ; Character Size Bit 1
  283. .equ USBS = 3 ; Stop Bit Select
  284. .equ UPM0 = 4 ; Parity Mode Bit 0
  285. .equ UPM1 = 5 ; Parity Mode Bit 1
  286. .equ UMSEL = 6 ; USART Mode Select
  287. .equ UBRR = UBRRL ; For compatibility
  288. ; ***** ANALOG_COMPARATOR ************
  289. ; ACSR - Analog Comparator Control And Status Register
  290. .equ ACIS0 = 0 ; Analog Comparator Interrupt Mode Select bit 0
  291. .equ ACIS1 = 1 ; Analog Comparator Interrupt Mode Select bit 1
  292. .equ ACIC = 2 ;
  293. .equ ACIE = 3 ; Analog Comparator Interrupt Enable
  294. .equ ACI = 4 ; Analog Comparator Interrupt Flag
  295. .equ ACO = 5 ; Analog Compare Output
  296. .equ ACBG = 6 ; Analog Comparator Bandgap Select
  297. .equ ACD = 7 ; Analog Comparator Disable
  298. ; DIDR - Digital Input Disable Register 1
  299. .equ AIN0D = 0 ; AIN0 Digital Input Disable
  300. .equ AIN1D = 1 ; AIN1 Digital Input Disable
  301. ; ***** PORTD ************************
  302. ; PORTD - Data Register, Port D
  303. .equ PORTD0 = 0 ;
  304. .equ PD0 = 0 ; For compatibility
  305. .equ PORTD1 = 1 ;
  306. .equ PD1 = 1 ; For compatibility
  307. .equ PORTD2 = 2 ;
  308. .equ PD2 = 2 ; For compatibility
  309. .equ PORTD3 = 3 ;
  310. .equ PD3 = 3 ; For compatibility
  311. .equ PORTD4 = 4 ;
  312. .equ PD4 = 4 ; For compatibility
  313. .equ PORTD5 = 5 ;
  314. .equ PD5 = 5 ; For compatibility
  315. .equ PORTD6 = 6 ;
  316. .equ PD6 = 6 ; For compatibility
  317. ; DDRD
  318. .equ DDD0 = 0 ;
  319. .equ DDD1 = 1 ;
  320. .equ DDD2 = 2 ;
  321. .equ DDD3 = 3 ;
  322. .equ DDD4 = 4 ;
  323. .equ DDD5 = 5 ;
  324. .equ DDD6 = 6 ;
  325. ; PIND - Input Pins, Port D
  326. .equ PIND0 = 0 ;
  327. .equ PIND1 = 1 ;
  328. .equ PIND2 = 2 ;
  329. .equ PIND3 = 3 ;
  330. .equ PIND4 = 4 ;
  331. .equ PIND5 = 5 ;
  332. .equ PIND6 = 6 ;
  333. ; ***** EEPROM ***********************
  334. ; EEAR - EEPROM Read/Write Access
  335. .equ EEARL = EEAR ; For compatibility
  336. .equ EEAR0 = 0 ; EEPROM Read/Write Access bit 0
  337. .equ EEAR1 = 1 ; EEPROM Read/Write Access bit 1
  338. .equ EEAR2 = 2 ; EEPROM Read/Write Access bit 2
  339. .equ EEAR3 = 3 ; EEPROM Read/Write Access bit 3
  340. .equ EEAR4 = 4 ; EEPROM Read/Write Access bit 4
  341. .equ EEAR5 = 5 ; EEPROM Read/Write Access bit 5
  342. .equ EEAR6 = 6 ; EEPROM Read/Write Access bit 6
  343. ; EEDR - EEPROM Data Register
  344. .equ EEDR0 = 0 ; EEPROM Data Register bit 0
  345. .equ EEDR1 = 1 ; EEPROM Data Register bit 1
  346. .equ EEDR2 = 2 ; EEPROM Data Register bit 2
  347. .equ EEDR3 = 3 ; EEPROM Data Register bit 3
  348. .equ EEDR4 = 4 ; EEPROM Data Register bit 4
  349. .equ EEDR5 = 5 ; EEPROM Data Register bit 5
  350. .equ EEDR6 = 6 ; EEPROM Data Register bit 6
  351. .equ EEDR7 = 7 ; EEPROM Data Register bit 7
  352. ; EECR - EEPROM Control Register
  353. .equ EERE = 0 ; EEPROM Read Enable
  354. .equ EEPE = 1 ; EEPROM Write Enable
  355. .equ EEWE = EEPE ; For compatibility
  356. .equ EEMPE = 2 ; EEPROM Master Write Enable
  357. .equ EEMWE = EEMPE ; For compatibility
  358. .equ EERIE = 3 ; EEProm Ready Interrupt Enable
  359. .equ EEPM0 = 4 ;
  360. .equ EEPM1 = 5 ;
  361. ; ***** PORTA ************************
  362. ; PORTA - Port A Data Register
  363. .equ PORTA0 = 0 ; Port A Data Register bit 0
  364. .equ PA0 = 0 ; For compatibility
  365. .equ PORTA1 = 1 ; Port A Data Register bit 1
  366. .equ PA1 = 1 ; For compatibility
  367. .equ PORTA2 = 2 ; Port A Data Register bit 2
  368. .equ PA2 = 2 ; For compatibility
  369. ; DDRA - Port A Data Direction Register
  370. .equ DDA0 = 0 ; Data Direction Register, Port A, bit 0
  371. .equ DDA1 = 1 ; Data Direction Register, Port A, bit 1
  372. .equ DDA2 = 2 ; Data Direction Register, Port A, bit 2
  373. ; PINA - Port A Input Pins
  374. .equ PINA0 = 0 ; Input Pins, Port A bit 0
  375. .equ PINA1 = 1 ; Input Pins, Port A bit 1
  376. .equ PINA2 = 2 ; Input Pins, Port A bit 2
  377. ; ***** CPU **************************
  378. ; SREG - Status Register
  379. .equ SREG_C = 0 ; Carry Flag
  380. .equ SREG_Z = 1 ; Zero Flag
  381. .equ SREG_N = 2 ; Negative Flag
  382. .equ SREG_V = 3 ; Two's Complement Overflow Flag
  383. .equ SREG_S = 4 ; Sign Bit
  384. .equ SREG_H = 5 ; Half Carry Flag
  385. .equ SREG_T = 6 ; Bit Copy Storage
  386. .equ SREG_I = 7 ; Global Interrupt Enable
  387. ; SPMCSR - Store Program Memory Control and Status register
  388. .equ SPMEN = 0 ; Store Program Memory Enable
  389. .equ PGERS = 1 ; Page Erase
  390. .equ PGWRT = 2 ; Page Write
  391. .equ RFLB = 3 ; Read Fuse and Lock Bits
  392. .equ CTPB = 4
  393. ; MCUCR - MCU Control Register
  394. .equ ISC00 = 0 ; Interrupt Sense Control 0 bit 0
  395. .equ ISC01 = 1 ; Interrupt Sense Control 0 bit 1
  396. .equ ISC10 = 2 ; Interrupt Sense Control 1 bit 0
  397. .equ ISC11 = 3 ; Interrupt Sense Control 1 bit 1
  398. .equ SM0 = 4 ; Sleep Mode Select Bit 0
  399. .equ SM = SM0 ; For compatibility
  400. .equ SE = 5 ; Sleep Enable
  401. .equ SM1 = 6 ; Sleep Mode Select Bit 1
  402. .equ PUD = 7 ; Pull-up Disable
  403. ; CLKPR - Clock Prescale Register
  404. .equ CLKPS0 = 0 ; Clock Prescaler Select Bit 0
  405. .equ CLKPS1 = 1 ; Clock Prescaler Select Bit 1
  406. .equ CLKPS2 = 2 ; Clock Prescaler Select Bit 2
  407. .equ CLKPS3 = 3 ; Clock Prescaler Select Bit 3
  408. .equ CLKPCE = 7 ; Clock Prescaler Change Enable
  409. ; MCUSR - MCU Status register
  410. .equ PORF = 0 ; Power-On Reset Flag
  411. .equ EXTRF = 1 ; External Reset Flag
  412. .equ BORF = 2 ; Brown-out Reset Flag
  413. .equ WDRF = 3 ; Watchdog Reset Flag
  414. ; OSCCAL - Oscillator Calibration Register
  415. .equ CAL0 = 0 ; Oscillatro Calibration Value Bit 0
  416. .equ CAL1 = 1 ; Oscillatro Calibration Value Bit 1
  417. .equ CAL2 = 2 ; Oscillatro Calibration Value Bit 2
  418. .equ CAL3 = 3 ; Oscillatro Calibration Value Bit 3
  419. .equ CAL4 = 4 ; Oscillatro Calibration Value Bit 4
  420. .equ CAL5 = 5 ; Oscillatro Calibration Value Bit 5
  421. .equ CAL6 = 6 ; Oscillatro Calibration Value Bit 6
  422. ; GTCCR - General Timer Counter Control Register
  423. .equ SFIOR = GTCCR ; For compatibility
  424. .equ PSR10 = 0 ;
  425. ; PCMSK - Pin-Change Mask register
  426. .equ PCINT0 = 0 ; Pin-Change Interrupt 0
  427. .equ PCINT1 = 1 ; Pin-Change Interrupt 1
  428. .equ PCINT2 = 2 ; Pin-Change Interrupt 2
  429. .equ PCINT3 = 3 ; Pin-Change Interrupt 3
  430. .equ PCINT4 = 4 ; Pin-Change Interrupt 4
  431. .equ PCINT5 = 5 ; Pin-Change Interrupt 5
  432. .equ PCINT6 = 6 ; Pin-Change Interrupt 6
  433. .equ PCINT7 = 7 ; Pin-Change Interrupt 7
  434. ; GPIOR2 - General Purpose I/O Register 2
  435. .equ GPIOR20 = 0 ; General Purpose I/O Register 2 bit 0
  436. .equ GPIOR21 = 1 ; General Purpose I/O Register 2 bit 1
  437. .equ GPIOR22 = 2 ; General Purpose I/O Register 2 bit 2
  438. .equ GPIOR23 = 3 ; General Purpose I/O Register 2 bit 3
  439. .equ GPIOR24 = 4 ; General Purpose I/O Register 2 bit 4
  440. .equ GPIOR25 = 5 ; General Purpose I/O Register 2 bit 5
  441. .equ GPIOR26 = 6 ; General Purpose I/O Register 2 bit 6
  442. .equ GPIOR27 = 7 ; General Purpose I/O Register 2 bit 7
  443. ; GPIOR1 - General Purpose I/O Register 1
  444. .equ GPIOR10 = 0 ; General Purpose I/O Register 1 bit 0
  445. .equ GPIOR11 = 1 ; General Purpose I/O Register 1 bit 1
  446. .equ GPIOR12 = 2 ; General Purpose I/O Register 1 bit 2
  447. .equ GPIOR13 = 3 ; General Purpose I/O Register 1 bit 3
  448. .equ GPIOR14 = 4 ; General Purpose I/O Register 1 bit 4
  449. .equ GPIOR15 = 5 ; General Purpose I/O Register 1 bit 5
  450. .equ GPIOR16 = 6 ; General Purpose I/O Register 1 bit 6
  451. .equ GPIOR17 = 7 ; General Purpose I/O Register 1 bit 7
  452. ; GPIOR0 - General Purpose I/O Register 0
  453. .equ GPIOR00 = 0 ; General Purpose I/O Register 0 bit 0
  454. .equ GPIOR01 = 1 ; General Purpose I/O Register 0 bit 1
  455. .equ GPIOR02 = 2 ; General Purpose I/O Register 0 bit 2
  456. .equ GPIOR03 = 3 ; General Purpose I/O Register 0 bit 3
  457. .equ GPIOR04 = 4 ; General Purpose I/O Register 0 bit 4
  458. .equ GPIOR05 = 5 ; General Purpose I/O Register 0 bit 5
  459. .equ GPIOR06 = 6 ; General Purpose I/O Register 0 bit 6
  460. .equ GPIOR07 = 7 ; General Purpose I/O Register 0 bit 7
  461. ; ***** USI **************************
  462. ; USIDR - USI Data Register
  463. .equ USIDR0 = 0 ; USI Data Register bit 0
  464. .equ USIDR1 = 1 ; USI Data Register bit 1
  465. .equ USIDR2 = 2 ; USI Data Register bit 2
  466. .equ USIDR3 = 3 ; USI Data Register bit 3
  467. .equ USIDR4 = 4 ; USI Data Register bit 4
  468. .equ USIDR5 = 5 ; USI Data Register bit 5
  469. .equ USIDR6 = 6 ; USI Data Register bit 6
  470. .equ USIDR7 = 7 ; USI Data Register bit 7
  471. ; USISR - USI Status Register
  472. .equ USICNT0 = 0 ; USI Counter Value Bit 0
  473. .equ USICNT1 = 1 ; USI Counter Value Bit 1
  474. .equ USICNT2 = 2 ; USI Counter Value Bit 2
  475. .equ USICNT3 = 3 ; USI Counter Value Bit 3
  476. .equ USIDC = 4 ; Data Output Collision
  477. .equ USIPF = 5 ; Stop Condition Flag
  478. .equ USIOIF = 6 ; Counter Overflow Interrupt Flag
  479. .equ USISIF = 7 ; Start Condition Interrupt Flag
  480. ; USICR - USI Control Register
  481. .equ USITC = 0 ; Toggle Clock Port Pin
  482. .equ USICLK = 1 ; Clock Strobe
  483. .equ USICS0 = 2 ; USI Clock Source Select Bit 0
  484. .equ USICS1 = 3 ; USI Clock Source Select Bit 1
  485. .equ USIWM0 = 4 ; USI Wire Mode Bit 0
  486. .equ USIWM1 = 5 ; USI Wire Mode Bit 1
  487. .equ USIOIE = 6 ; Counter Overflow Interrupt Enable
  488. .equ USISIE = 7 ; Start Condition Interrupt Enable
  489. ; ***** LOCKSBITS ********************************************************
  490. .equ LB1 = 0 ; Lockbit
  491. .equ LB2 = 1 ; Lockbit
  492. ; ***** FUSES ************************************************************
  493. ; LOW fuse bits
  494. .equ CKSEL0 = 0 ; Select Clock Source
  495. .equ CKSEL1 = 1 ; Select Clock Source
  496. .equ CKSEL2 = 2 ; Select Clock Source
  497. .equ CKSEL3 = 3 ; Select Clock Source
  498. .equ SUT0 = 4 ; Select start-up time
  499. .equ SUT1 = 5 ; Select start-up time
  500. .equ CKOUT = 6 ; Clock output
  501. .equ CKDIV8 = 7 ; Divide clock by 8
  502. ; HIGH fuse bits
  503. .equ BODLEVEL0 = 0 ; Brown-out Detector trigger level
  504. .equ BODLEVEL1 = 1 ; Brown-out Detector trigger level
  505. .equ BODLEVEL2 = 2 ; Brown-out Detector trigger level
  506. .equ EESAVE = 3 ; EEPROM memory is preserved through chip erase
  507. .equ WDTON = 4 ; Watchdog Timer Always On
  508. .equ SPIEN = 5 ; Enable Serial programming and Data Downloading
  509. .equ DWEN = 6 ; debugWIRE Enable
  510. .equ RSTDISBL = 7 ; External reset disable
  511. ; EXTENDED fuse bits
  512. .equ SELFPRGEN = 0 ; Self Programming Enable
  513. ; ***** CPU REGISTER DEFINITIONS *****************************************
  514. .def XH = r27
  515. .def XL = r26
  516. .def YH = r29
  517. .def YL = r28
  518. .def ZH = r31
  519. .def ZL = r30
  520. ; ***** DATA MEMORY DECLARATIONS *****************************************
  521. .equ FLASHEND = 0x03ff ; Note: Word address
  522. .equ IOEND = 0x003f
  523. .equ SRAM_START = 0x0060
  524. .equ SRAM_SIZE = 128
  525. .equ RAMEND = 0x00df
  526. .equ XRAMEND = 0x0000
  527. .equ E2END = 0x007f
  528. .equ EEPROMEND = 0x007f
  529. .equ EEADRBITS = 7
  530. ; ***** BOOTLOADER DECLARATIONS ******************************************
  531. .equ NRWW_START_ADDR = 0x0
  532. .equ NRWW_STOP_ADDR = 0x3ff
  533. .equ RWW_START_ADDR = 0x0
  534. .equ RWW_STOP_ADDR = 0x0
  535. .equ PAGESIZE = 16
  536. ; ***** INTERRUPT VECTORS ************************************************
  537. .equ INT0addr = 0x0001 ; External Interrupt Request 0
  538. .equ INT1addr = 0x0002 ; External Interrupt Request 1
  539. .equ ICP1addr = 0x0003 ; Timer/Counter1 Capture Event
  540. .equ OC1Aaddr = 0x0004 ; Timer/Counter1 Compare Match A
  541. .equ OC1addr = 0x0004 ; For compatibility
  542. .equ OVF1addr = 0x0005 ; Timer/Counter1 Overflow
  543. .equ OVF0addr = 0x0006 ; Timer/Counter0 Overflow
  544. .equ URXCaddr = 0x0007 ; USART, Rx Complete
  545. .equ URXC0addr = 0x0007 ; For compatibility
  546. .equ UDREaddr = 0x0008 ; USART Data Register Empty
  547. .equ UDRE0addr = 0x0008 ; For compatibility
  548. .equ UTXCaddr = 0x0009 ; USART, Tx Complete
  549. .equ UTXC0addr = 0x0009 ; For compatibility
  550. .equ ACIaddr = 0x000a ; Analog Comparator
  551. .equ PCIaddr = 0x000b ;
  552. .equ OC1Baddr = 0x000c ;
  553. .equ OC0Aaddr = 0x000d ;
  554. .equ OC0Baddr = 0x000e ;
  555. .equ USI_STARTaddr = 0x000f ; USI Start Condition
  556. .equ USI_OVFaddr = 0x0010 ; USI Overflow
  557. .equ ERDYaddr = 0x0011 ;
  558. .equ WDTaddr = 0x0012 ; Watchdog Timer Overflow
  559. .equ INT_VECTORS_SIZE = 19 ; size in words
  560. ; ***** END OF FILE ******************************************************