Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1186 | savelij | 1 | ifndef __reg72521inc ; avoid multiple inclusion |
2 | __reg72521inc equ 1 |
||
3 | |||
4 | save |
||
5 | listing off ; no listing over this file |
||
6 | |||
7 | ;**************************************************************************** |
||
8 | ;* * |
||
9 | ;* AS 1.42 - File REG72521.INC * |
||
10 | ;* * |
||
11 | ;* contains SFR and Bit Definitions for ST72521 * |
||
12 | ;* * |
||
13 | ;* Source: ST72521 Data Sheet, Rev. 5, May 2005 * |
||
14 | ;* * |
||
15 | ;**************************************************************************** |
||
16 | |||
17 | ;---------------------------------------------------------------------------- |
||
18 | ; Memory Addresses |
||
19 | |||
20 | RAMSTART label $0080 ; start address internal RAM |
||
21 | switch substr(MOMCPUNAME,9,1) |
||
22 | case "6" |
||
23 | RAMEND label $047f ; end " " " |
||
24 | case "9" |
||
25 | RAMEND label $087f ; end " " " |
||
26 | elsecase |
||
27 | fatal "cannot deduce RAM size" |
||
28 | endcase |
||
29 | |||
30 | ;---------------------------------------------------------------------------- |
||
31 | ; Interrupt Vectors |
||
32 | |||
33 | PWM_ART_vect label $ffe0 ; PWM ART interrupt |
||
34 | I2C_vect label $ffe2 ; I2C Peripheral interrupts |
||
35 | AVD_vect label $ffe4 ; Auxiliary Voltage detector interrupt |
||
36 | SCI_vect label $ffe6 ; SCI Interrupt Vector |
||
37 | TIMB_vect label $ffe8 ; TIMER B Interrupt Vector |
||
38 | TIMA_vect label $ffea ; TIMER A Interrupt Vector |
||
39 | SPI_vect label $ffec ; SPI Interrupt Vector |
||
40 | CAN_vect label $ffee ; CAN Interrupt Vector |
||
41 | EI3_vect label $fff0 ; External Interrupt Vector B7..4 |
||
42 | EI2_vect label $fff2 ; External Interrupt Vector B3..0 |
||
43 | EI1_vect label $fff4 ; External Interrupt Vector F2..0 |
||
44 | EI0_vect label $fff6 ; External Interrupt Vector A3..0 |
||
45 | MCC_RTC_vect label $fff8 ; Main clock controller time base interrupt |
||
46 | TLI_vect label $fffa ; External top level interrupt |
||
47 | TRAP_vect label $fffc ; TRAP (software) Interrupt Vector |
||
48 | RESET_vect label $fffe ; RESET Vector |
||
49 | |||
50 | ;---------------------------------------------------------------------------- |
||
51 | ; GPIO |
||
52 | |||
53 | include "gpio.inc" |
||
54 | __defgpio "PA",$0000 |
||
55 | __defgpio "PB",$0003 |
||
56 | __defgpio "PC",$0006 |
||
57 | __defgpio "PD",$0009 |
||
58 | __defgpio "PE",$000c |
||
59 | __defgpio "PF",$000f |
||
60 | __defgpio "PG",$0012 |
||
61 | __defgpio "PH",$0015 |
||
62 | |||
63 | ;---------------------------------------------------------------------------- |
||
64 | ; Miscellaneous |
||
65 | |||
66 | ;---------------------------------------------------------------------------- |
||
67 | ; I2C |
||
68 | |||
69 | include "i2c.inc" |
||
70 | __defi2c $0018 |
||
71 | |||
72 | ;---------------------------------------------------------------------------- |
||
73 | ; SPI |
||
74 | |||
75 | include "spi2.inc" |
||
76 | __defspi $0021 |
||
77 | |||
78 | ;---------------------------------------------------------------------------- |
||
79 | ; ITC |
||
80 | |||
81 | ISPR0 label $0024 ; Interrupt Software Priority Register 0 |
||
82 | I0_0 bit ISPR0,0 ; TLI |
||
83 | I1_0 bit ISPR0,1 |
||
84 | I0_1 bit ISPR0,2 ; MCC+SI |
||
85 | I1_1 bit ISPR0,3 |
||
86 | I0_2 bit ISPR0,4 ; EI0 |
||
87 | I1_2 bit ISPR0,5 |
||
88 | I0_3 bit ISPR0,6 ; EI1 |
||
89 | I1_3 bit ISPR0,7 |
||
90 | ISPR1 label $0025 ; Interrupt Software Priority Register 1 |
||
91 | I0_4 bit ISPR1,0 ; EI2 |
||
92 | I1_4 bit ISPR1,1 |
||
93 | I0_5 bit ISPR1,2 ; EI3 |
||
94 | I1_5 bit ISPR1,3 |
||
95 | I0_6 bit ISPR1,4 |
||
96 | I1_6 bit ISPR1,5 |
||
97 | I0_7 bit ISPR1,6 ; SPI |
||
98 | I1_7 bit ISPR1,7 |
||
99 | ISPR2 label $0026 ; Interrupt Software Priority Register 2 |
||
100 | I0_8 bit ISPR2,0 ; Timer A |
||
101 | I1_8 bit ISPR2,1 |
||
102 | I0_9 bit ISPR2,2 ; Timer B |
||
103 | I1_9 bit ISPR2,3 |
||
104 | I0_10 bit ISPR2,4 ; SCI |
||
105 | I1_10 bit ISPR2,5 |
||
106 | I0_11 bit ISPR2,6 ; AVD |
||
107 | I1_11 bit ISPR2,7 |
||
108 | ISPR3 label $0027 ; Interrupt Software Priority Register 3 |
||
109 | I0_12 bit ISPR3,0 ; I2C |
||
110 | I1_12 bit ISPR3,1 |
||
111 | I0_13 bit ISPR3,2 ; PWMART |
||
112 | I1_13 bit ISPR3,3 |
||
113 | EICR label $0028 ; External Interrupt Control Register |
||
114 | IS1 bfield EICR,6,2 ; ei2 and ei3 sensitivity |
||
115 | IPB bit EICR,5 ; Interrupt polarity for port B |
||
116 | IS2 bfield EICR,3,2 ; ei0 and ei1 sensitivity |
||
117 | IPA bit EICR,2 ; Interrupt polarity for port A |
||
118 | TLIS bit EICR,1 ; TLI sensitivity |
||
119 | TLIE bit EICR,0 ; TLI enable |
||
120 | |||
121 | ;---------------------------------------------------------------------------- |
||
122 | ; Flash |
||
123 | |||
124 | FCSR label $0029 ; Flash Control/Status Register |
||
125 | |||
126 | ;---------------------------------------------------------------------------- |
||
127 | ; Watchdog |
||
128 | |||
129 | WDGCR label $002a ; Watchdog Control Register |
||
130 | WDGA bit WDGCR,7 ; Activation bit |
||
131 | |||
132 | ;---------------------------------------------------------------------------- |
||
133 | |||
134 | SICSR label $002b ; System Integrity Control/Status Register |
||
135 | AVDS bit SICSR,7 ; Voltage Detection selection |
||
136 | AVDIE bit SICSR,6 ; Voltage Detector interrupt enable |
||
137 | AVDF bit SICSR,5 ; Voltage Detector flag |
||
138 | LVDRF bit SICSR,4 ; LVD reset flag |
||
139 | WDGRF bit SICSR,0 ; Watchdog reset flag |
||
140 | |||
141 | ;---------------------------------------------------------------------------- |
||
142 | ; MCC |
||
143 | |||
144 | MCCSR label $002c ; Main Clock Control / Status Register |
||
145 | MCO bit MCCSR,7 ; Main clock out selection |
||
146 | CP bfield MCCSR,5,2 ; CPU clock prescaler |
||
147 | SMS bit MCCSR,4 ; Slow mode select |
||
148 | TB bfield MCCSR,2,2 ; Time base control |
||
149 | OIE bit MCCSR,1 ; Oscillator interrupt enable |
||
150 | OIF bit MCCSR,0 ; Oscillator interrupt flag |
||
151 | MCCBCR label $002d ; Main Clock Controller: Beep Control Register |
||
152 | BC bfield MCCBCR,0,2 ; Beep control |
||
153 | |||
154 | ;---------------------------------------------------------------------------- |
||
155 | ; Timer A/B |
||
156 | |||
157 | include "timer.inc" |
||
158 | __deftimer "TA",$0030 |
||
159 | __deftimer "TB",$0040 |
||
160 | |||
161 | ;---------------------------------------------------------------------------- |
||
162 | ; Serial Communications Interface |
||
163 | |||
164 | include "sci2.inc" |
||
165 | __defsci2 $0050,5 |
||
166 | |||
167 | ;---------------------------------------------------------------------------- |
||
168 | ; CAN |
||
169 | |||
170 | CANISR label $005a ; CAN Interrupt Status Register |
||
171 | RXIF3 bit CANISR,7 ; Receive Interrupt Flag for Buffer 3 |
||
172 | RXIF2 bit CANISR,6 ; Receive Interrupt Flag for Buffer 2 |
||
173 | RXIF1 bit CANISR,5 ; Receive Interrupt Flag for Buffer 1 |
||
174 | TXIF bit CANISR,4 ; Transmit Interrupt Flag |
||
175 | SCIF bit CANISR,3 ; Status Change Interrupt Flag |
||
176 | ORIF bit CANISR,2 ; Overrun Interrupt Flag |
||
177 | TEIF bit CANISR,1 ; Transmit Error Interrupt Flag |
||
178 | EPND bit CANISR,0 ; Error Interrupt Pending |
||
179 | CANICR label $005b ; CAN Interrupt Control Register |
||
180 | ESCI bit CANICR,6 ; Extended Status Change Interrupt |
||
181 | RXIE bit CANICR,5 ; Receive Interrupt Enable |
||
182 | TXIE bit CANICR,4 ; Transmit Interrupt Enable |
||
183 | SCIE bit CANICR,3 ; Status Change Interrupt Enable |
||
184 | ORIE bit CANICR,2 ; Overrun Interrupt Enable |
||
185 | TEIE bit CANICR,1 ; Transmit Error Interrupt Enable |
||
186 | CANCSR label $005c ; CAN Control / Status Register |
||
187 | BOFF bit CANCSR,6 ; Bus-Off State |
||
188 | EPSV bit CANCSR,5 ; Error Passive State |
||
189 | SRTE bit CANCSR,4 ; Simultaneous Receive/Transmit Enable |
||
190 | NRTX bit CANCSR,3 ; No Retransmission |
||
191 | FSYN bit CANCSR,2 ; Fast Synchronization |
||
192 | WKPS bit CANCSR,1 ; Wake-up Pulse |
||
193 | RUN bit CANCSR,0 ; CAN Enable |
||
194 | CANBRPR label $005d ; CAN Baud Rate Prescaler Register |
||
195 | RJW bfield CANBRPR,6,2 ; maximum number of time quanta by which a bit period may be shortened or lengthened to achieve resynchronization |
||
196 | BRP bfield CANBRPR,0,6 ; CAN system clock cycle |
||
197 | CANBTR label $005e ; CAN Bit Timing Register |
||
198 | BS2 bfield CANBTR,4,3 ; length of Bit Segment 2 |
||
199 | BS1 bfield CANBTR,0,4 ; length of Bit Segment 1 |
||
200 | CANPSR label $005f ; CAN Page Selection Register |
||
201 | CAN_P0 label $0060 ; Paged Registers |
||
202 | CAN_P1 label $0061 |
||
203 | CAN_P2 label $0062 |
||
204 | CAN_P3 label $0063 |
||
205 | CAN_P4 label $0064 |
||
206 | CAN_P5 label $0065 |
||
207 | CAN_P6 label $0066 |
||
208 | CAN_P7 label $0067 |
||
209 | CAN_P8 label $0068 |
||
210 | CAN_P9 label $0069 |
||
211 | CAN_P10 label $006a |
||
212 | CAN_P11 label $006b |
||
213 | CAN_P12 label $006c |
||
214 | CAN_P13 label $006d |
||
215 | CAN_P14 label $006e |
||
216 | CAN_P15 label $006f |
||
217 | CAN_LIDHR label CAN_P0 ; [Page 0] Last Identifier High Register |
||
218 | CAN_LIDLR label CAN_P1 ; [Page 0] Last Identifier Low Register |
||
219 | CAN_TECR label CAN_P14 ; [Page 0] Transmit Error Counter Register |
||
220 | CAN_RECR label CAN_P15 ; [Page 0] Receive Error Counter Register |
||
221 | __N set 1 |
||
222 | rept 3 |
||
223 | __NS set "\{__N}" |
||
224 | CAN_IDHR{__NS} label CAN_P0 ; [Page 1..3] Identifier High Register |
||
225 | CAN_IDLR{__NS} label CAN_P1 ; [Page 1..3] Identifier Low Register |
||
226 | CAN_DATA0{__NS} label CAN_P2 ; [Page 1..3] Data Registers |
||
227 | CAN_DATA1{__NS} label CAN_P3 ; [Page 1..3] |
||
228 | CAN_DATA2{__NS} label CAN_P4 ; [Page 1..3] |
||
229 | CAN_DATA3{__NS} label CAN_P5 ; [Page 1..3] |
||
230 | CAN_DATA4{__NS} label CAN_P6 ; [Page 1..3] |
||
231 | CAN_DATA5{__NS} label CAN_P7 ; [Page 1..3] |
||
232 | CAN_DATA6{__NS} label CAN_P8 ; [Page 1..3] |
||
233 | CAN_DATA7{__NS} label CAN_P9 ; [Page 1..3] |
||
234 | CAN_BCSR{__NS} label CAN_P15 ; [Page 1..3] Buffer Control/Status Register |
||
235 | CAN_ACC{__NS} bit CAN_BCSR{__NS},3; Acceptance Code |
||
236 | CAN_RDY{__NS} bit CAN_BCSR{__NS},2; Message Ready |
||
237 | CAN_BUSY{__NS} bit CAN_BCSR{__NS},1; Busy Buffer |
||
238 | CAN_LOCK{__NS} bit CAN_BCSR{__NS},0; Lock Buffer |
||
239 | __N set __N+1 |
||
240 | endm |
||
241 | CAN_FHR0 label CAN_P0 ; [Page 4] Filter High Register 0 |
||
242 | CAN_FLR0 label CAN_P1 ; [Page 4] Filter Low Register 0 |
||
243 | CAN_MHR0 label CAN_P2 ; [Page 4] Mask High Register 0 |
||
244 | CAN_MLR0 label CAN_P3 ; [Page 4] Mask Low Register 0 |
||
245 | CAN_FHR1 label CAN_P4 ; [Page 4] Filter High Register 1 |
||
246 | CAN_FLR1 label CAN_P5 ; [Page 4] Filter Low Register 1 |
||
247 | CAN_MHR1 label CAN_P6 ; [Page 4] Mask High Register 1 |
||
248 | CAN_MLR1 label CAN_P7 ; [Page 4] Mask Low Register 1 |
||
249 | |||
250 | ;---------------------------------------------------------------------------- |
||
251 | ; Analog/Digital Converter |
||
252 | |||
253 | include "adc10.inc" |
||
254 | __defadc10 $0070 |
||
255 | |||
256 | ;---------------------------------------------------------------------------- |
||
257 | ; PWM ART |
||
258 | |||
259 | include "pwm_art.inc" |
||
260 | __defpwmart $0073 |
||
261 | |||
262 | restore |
||
263 | endif ; __reg72521inc |