Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  1. ;***************************************************************************
  2. ;* 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
  3. ;*
  4. ;* Number               :AVR000
  5. ;* File Name            :"tn28def.inc"
  6. ;* Title                :Register/Bit Definitions for the ATtiny28
  7. ;* Date                 :99.01.28
  8. ;* Version              :1.30
  9. ;* Support E-mail       :avr@atmel.com
  10. ;* Target MCU           :ATtiny28
  11. ;*
  12. ;* DESCRIPTION
  13. ;* When including this file in the assembly program file, all I/O register
  14. ;* names and I/O register bit names appearing in the data book can be used.
  15. ;* In addition, the two registers forming the data pointers Z have been
  16. ;* assigned names ZL - ZH.
  17. ;*
  18. ;*
  19. ;* The Register names are represented by their hexadecimal address.
  20. ;*
  21. ;* The Register Bit names are represented by their bit number (0-7).
  22. ;*
  23. ;* Please observe the difference in using the bit names with instructions
  24. ;* such as "sbr"/"cbr" (set/clear bit in register) and "sbrs"/"sbrc"
  25. ;* (skip if bit in register set/cleared). The following example illustrates
  26. ;* this:
  27. ;*
  28. ;* in   r16,PORTB               ;read PORTB latch
  29. ;* sbr  r16,(1<<PB6)+(1<<PB5)   ;set PB6 and PB5 (use masks, not bit#)
  30. ;* out  PORTB,r16               ;output to PORTB
  31. ;*
  32. ;* in   r16,TIFR                ;read the Timer Interrupt Flag Register
  33. ;* sbrc r16,TOV0                ;test the overflow flag (use bit#)
  34. ;* rjmp TOV0_is_set             ;jump if set
  35. ;* ...                          ;otherwise do something else
  36. ;***************************************************************************
  37.  
  38. ;***** Specify Device
  39. .device ATtiny28
  40.  
  41. ;***** I/O Register Definitions
  42. .equ    SREG    =$3f
  43. .equ    PORTA   =$1b
  44. .equ    PACR    =$1a
  45. .equ    PINA    =$19
  46. .equ    PINB    =$16
  47. .equ    PORTD   =$12
  48. .equ    DDRD    =$11
  49. .equ    PIND    =$10
  50. .equ    ACSR    =$08
  51. .equ    MCUCS   =$07
  52. .equ    ICR     =$06
  53. .equ    IFR     =$05
  54. .equ    TCCR0   =$04
  55. .equ    TCNT0   =$03
  56. .equ    MODCR   =$02
  57. .equ    WDTCR   =$01
  58. .equ    OSCCAL  =$00
  59.  
  60.  
  61. ;***** Bit Definitions
  62. .equ    PA3             =3
  63. .equ    PA2             =2
  64. .equ    PA1             =1
  65. .equ    PA0             =0
  66.  
  67. .equ    DDA3    =3
  68. .equ    PA2HC   =2
  69. .equ    DDA1    =1
  70. .equ    DDA0    =0
  71.  
  72. .equ    PINA3   =3
  73. .equ    PINA1   =1
  74. .equ    PINA0   =0
  75.  
  76. .equ    PINB7   =7
  77. .equ    PINB6   =6
  78. .equ    PINB5   =5
  79. .equ    PINB4   =4
  80. .equ    PINB3   =3
  81. .equ    PINB2   =2
  82. .equ    PINB1   =1
  83. .equ    PINB0   =0
  84.  
  85. .equ    PD7     =7
  86. .equ    PD6     =6
  87. .equ    PD5     =5
  88. .equ    PD4     =4
  89. .equ    PD3     =3
  90. .equ    PD2     =2
  91. .equ    PD1     =1
  92. .equ    PD0     =0
  93.  
  94. .equ    DDD7    =7
  95. .equ    DDD6    =6
  96. .equ    DDD5    =5
  97. .equ    DDD4    =4
  98. .equ    DDD3    =3
  99. .equ    DDD2    =2
  100. .equ    DDD1    =1
  101. .equ    DDD0    =0
  102.  
  103. .equ    PIND7   =7
  104. .equ    PIND6   =6
  105. .equ    PIND5   =5
  106. .equ    PIND4   =4
  107. .equ    PIND3   =3
  108. .equ    PIND2   =2
  109. .equ    PIND1   =1
  110. .equ    PIND0   =0
  111.  
  112. .equ    ACD     =7
  113. .equ    ACO     =5
  114. .equ    ACI     =4
  115. .equ    ACIE    =3
  116. .equ    ACIS1   =1
  117. .equ    ACIS0   =0
  118.  
  119. .equ    PLUPB   =7
  120. .equ    SE      =5
  121. .equ    SM      =4
  122. .equ    WDRF    =3
  123. .equ    EXTRF   =1
  124. .equ    PORF    =0
  125.  
  126. .equ    INT1    =7
  127. .equ    INT0    =6
  128. .equ    LLIE    =5
  129. .equ    TOIE0   =4
  130. .equ    ISC11   =3
  131. .equ    ISC10   =2
  132. .equ    ISC01   =1
  133. .equ    ISC00   =0
  134.  
  135. .equ    INTF1   =7
  136. .equ    INTF0   =6
  137. .equ    TOV0    =4
  138.  
  139. .equ    FOV0    =7
  140. .equ    OOM01   =4
  141. .equ    OOM00   =3
  142. .equ    CS02    =2
  143. .equ    CS01    =1
  144. .equ    CS00    =0
  145.  
  146. .equ    WDTOE   =4
  147. .equ    WDE     =3
  148. .equ    WDP2    =2
  149. .equ    WDP1    =1
  150. .equ    WDP0    =0
  151.  
  152. .equ    ONTIM4  =7
  153. .equ    ONTIM3  =6
  154. .equ    ONTIM2  =5
  155. .equ    ONTIM1  =4
  156. .equ    ONTIM0  =3
  157. .equ    MCONF2  =2
  158. .equ    MCONF1  =1
  159. .equ    MCONF0  =0
  160.  
  161. .equ    CAL7    =7
  162. .equ    CAL6    =6
  163. .equ    CAL5    =5
  164. .equ    CAL4    =4
  165. .equ    CAL3    =3
  166. .equ    CAL2    =2
  167. .equ    CAL1    =1
  168. .equ    CAL0    =0
  169.  
  170. .def    ZL      =r30
  171. .def    ZH      =r31
  172.  
  173.  
  174. .equ    FLASHEND = 0x07FF
  175. .equ    RAMEND   = 0x03FF
  176.  
  177. .equ    INT0addr =$001  ;External Interrupt0 Vector Address
  178. .equ    INT1addr =$002  ;External Interrupt1 Vector Address
  179. .equ    LLINTaddr=$003  ;Low level Interrupt Vector Address
  180. .equ    OVF0addr =$004  ;Overflow0 Interrupt Vector Address
  181. .equ    ACIaddr  =$005  ;Analog Comparator Interrupt Vector Address
  182.  
  183. #pragma AVRPART ADMIN PART_NAME ATtiny28
  184. #pragma AVRPART CORE CORE_VERSION V0E
  185. #pragma AVRPART MEMORY PROG_FLASH 2048
  186. #pragma AVRPART MEMORY EEPROM 0
  187. #pragma AVRPART MEMORY INT_SRAM START_ADDR 0x60
  188. #pragma AVRPART MEMORY INT_SRAM SIZE  0
  189.