OSDN Git Service

V4.0, the last, bis...
[fast-forth/master.git] / inc / MSP430FR5994.inc
1 ; MSP430FR5994.inc
2 ; MSP430FR5994  minimal declarations for FastForth usage
3     .save
4     .listing off
5
6 DEVICE = "MSP430FR5994"
7 HMPY    ; hardware multiplier
8
9 ; ----------------------------------------------
10 ; MSP430FR5994 MEMORY MAP
11 ; ----------------------------------------------
12 ; 000A-001F = tiny RAM
13 ; 0020-0FFF = peripherals (4 KB)
14 ; 1000-17FF = ROM bootstrap loader BSL0..3 (4x512 B)
15 ; 1800-187F = FRAM info D (128 B)
16 ; 1880-18FF = FRAM info C (128 B)
17 ; 1900-197F = FRAM info B (128 B)
18 ; 1980-19FF = FRAM info A (128 B)
19 ; 1A00-1AFF = FRAM TLV device descriptor info (256 B)
20 ; 1B00-1BFF = unused (256 B)
21 ; 1C00-2BFF = RAM (4KB)
22 ; 2C00-3BFF = sharedRAM (4kB)
23 ; 4400-FF7F = FRAM code memory (FRAM) (MSP430FR59x8/9)
24 ; 8000-FF7F = FRAM code memory (FRAM) (MSP430FR59x7/8/9)
25 ; FF80-FFFF = FRAM interrupt vectors and signatures (FRAM)
26
27 ; ----------------------------------------------
28 PAGESIZE        .equ 512         ; MPU unit
29 ; ----------------------------------------------
30 ; BSL                         
31 ; ----------------------------------------------
32 BSL             .equ 1000h
33 ; ----------------------------------------------
34 ; FRAM                          ; INFO B, A, TLV
35 ; ----------------------------------------------
36 INFO_ORG        .equ 01800h
37 INFO_LEN        .equ 00200h
38 INFOD_ORG       .equ 01800h
39 INFOD_LEN       .equ 00080h
40 INFOC_ORG       .equ 01880h
41 INFOC_LEN       .equ 00080h
42 INFOB_ORG       .equ 01900h
43 INFOB_LEN       .equ 00080h
44 INFOA_ORG       .equ 01980h
45 INFOA_LEN       .equ 00080h
46 TLV_ORG         .equ 01A00h      ; Device Descriptor Info (Tag-Lenght-Value)
47 TLV_LEN         .equ 00100h      ;
48 ; ----------------------------------------------
49 ; RAM
50 ; ----------------------------------------------
51 TinyRAM_ORG     .equ 00Ah
52 TinyRAM_LEN     .equ 016h
53 RAM_ORG         .equ 01C00h
54 RAM_LEN         .equ 01000h
55 SharedRAM_ORG   .equ 02C00h
56 SharedRAM_LEN   .equ 01000h
57 ; ----------------------------------------------
58 ; FRAM
59 ; ----------------------------------------------
60 MAIN_ORG        .equ 04000h      ; Code space start
61 MAIN_LEN        .equ 40000h      ; 256 k FRAM
62 ; ----------------------------------------------
63 ; Interrupt Vectors and signatures
64 ; ----------------------------------------------
65 SIGNATURES      .equ 0FF80h      ; JTAG/BSL signatures
66 JTAG_SIG1       .equ 0FF80h      ; if 0, enable JTAG/SBW
67 JTAG_SIG2       .equ 0FF82h      ; if JTAG_SIG1=0xAAAA, length of password string @ JTAG_PASSWORD
68 BSL_SIG1        .equ 0FF84h      ;
69 BSL_SIG2        .equ 0FF86h      ;
70 JTAG_PASSWORD   .equ 0FF88h      ; 256 bits max
71 IPE_SIG_VALID   .equ 0FF88h      ; one word
72 IPE_STR_PTR_SRC .equ 0FF8Ah      ; one word
73 I2CSLA0         .equ 0FFA2h      ; UCBxI2COA0 default value address 
74 I2CSLA1         .equ 0FFA4h      ; UCBxI2COA1 default value address
75 I2CSLA2         .equ 0FFA6h      ; UCBxI2COA2 default value address
76 I2CSLA3         .equ 0FFA8h      ; UCBxI2COA3 default value address
77 VECT_ORG        .equ 0FFB4h      ; FFB4-FFFF
78 VECT_LEN        .equ 4Ch
79 BSL_PASSWORD    .equ 0FFE0h      ; 256 bits
80 ; ----------------------------------------------
81 ;    .org    SIGNATURES
82 ;;Start of JTAG and BSL signatures
83 ;        .word   0FFFFh      ; JTAG signature 1
84 ;        .word   0FFFFh      ; JTAG signature 2
85 ;        .word   0FFFFh      ; BSL signature 1, 5555h to disable BSL
86 ;        .word   0FFFFh      ; BSL signature 2
87
88 ;    .org JTAG_PASSWORD     ;Start of JTAG PASSWORD
89 ;
90 ;    .org    INTVECT         ; FFB4-FFFF 37 vectors + reset
91 ;        .word reset-4       ; 0FFB4h - LEA_Vec        
92 ;        .word reset-4       ; 0FFB6h - P8_Vec         
93 ;        .word reset-4       ; 0FFB8h - P7_Vec         
94 ;        .word reset-4       ; 0FFBAh - eUSCI_B3_Vec   
95 ;        .word reset-4       ; 0FFBCh - eUSCI_B2_Vec   
96 ;        .word reset-4       ; 0FFBEh - eUSCI_B1_Vec   
97 ;        .word reset-4       ; 0FFC0h - eUSCI_A3_Vec   
98 ;        .word reset-4       ; 0FFC2h - eUSCI_A2_Vec   
99 ;        .word reset-4       ; 0FFC4h - P6_Vec         
100 ;        .word reset-4       ; 0FFC6h - P5_Vec         
101 ;        .word reset-4       ; 0FFC8h - TA4_x_Vec      
102 ;        .word reset-4       ; 0FFCAh - TA4_0_Vec      
103 ;        .word reset-4       ; 0FFCCh - AES_Vec        
104 ;        .word reset-4       ; 0FFCEh - RTC_C_Vec      
105 ;        .word reset-4       ; 0FFD0h - P4_Vec=        
106 ;        .word reset-4       ; 0FFD2h - P3_Vec=        
107 ;        .word reset-4       ; 0FFD4h - TA3_x_Vec      
108 ;        .word reset-4       ; 0FFD6h - TA3_0_Vec      
109 ;        .word reset-4       ; 0FFD8h - P2_Vec         
110 ;        .word reset-4       ; 0FFDAh - TA2_x_Vec      
111 ;        .word reset-4       ; 0FFDCh - TA2_0_Vec      
112 ;        .word reset-4       ; 0FFDEh - P1_Vec=        
113 ;;    .org BSL_PASSWORD      ;Start of BSL PASSWORD
114 ;        .word reset-4       ; 0FFE0h - TA1_x_Vec      
115 ;        .word reset-4       ; 0FFE2h - TA1_0_Vec      
116 ;        .word reset-4       ; 0FFE4h - DMA_Vec        
117 ;        .word reset-4       ; 0FFE6h - eUSCI_A1_Vec   
118 ;        .word reset-4       ; 0FFE8h - TA0_x_Vec      
119 ;        .word reset-4       ; 0FFEAh - TA0_0_Vec      
120 ;        .word reset-4       ; 0FFECh - ADC12_B_Vec    
121 ;        .word reset-4       ; 0FFEEh - eUSCI_B0_Vec   
122 ;        .word reset-4       ; 0FFF0h - eUSCI_A0_Vec   
123 ;        .word reset-4       ; 0FFF2h - WDT_Vec        
124 ;        .word reset-4       ; 0FFF4h - TB0_x_Vec      
125 ;        .word reset-4       ; 0FFF6h - TB0_0_Vec      
126 ;        .word reset-4       ; 0FFF8h - COMP_E_Vec     
127 ;        .word reset-4       ; 0FFFAh - U_NMI_Vec      
128 ;        .word reset-4       ; 0FFFCh - S_NMI_Vec      
129 ;        .word reset         ; 0FFFEh - RST_Vec        
130
131
132 ; ----------------------------------------------------------------------
133 ; MSP430FR5994 Peripheral File Map
134 ; ----------------------------------------------------------------------
135 SFR_SFR         .equ 0100h           ; Special function
136 PMM_SFR         .equ 0120h           ; PMM
137 FRAM_SFR        .equ 0140h           ; FRAM control
138 CRC16_SFR       .equ 0150h
139 RAM_SFR         .equ 0158h
140 WDT_A_SFR       .equ 015Ch           ; Watchdog
141 CS_SFR          .equ 0160h           ; Clock System
142 SYS_SFR         .equ 0180h           ; SYS
143 REF_SFR         .equ 01B0h           ; REF
144 PA_SFR          .equ 0200h           ; PORT1/2
145 PB_SFR          .equ 0220h           ; PORT3/4
146 PC_SFR          .equ 0240h           ; PORT3/4
147 PD_SFR          .equ 0260h           ; PORT3/4
148 PJ_SFR          .equ 0320h           ; PORTJ
149 TA0_SFR         .equ 0340h
150 TA1_SFR         .equ 0380h
151 TB0_SFR         .equ 03C0h
152 TA2_SFR         .equ 0400h
153 CTIO0_SFR       .equ 0430h           ; Capacitive Touch IO
154 TA3_SFR         .equ 0440h
155 CTIO1_SFR       .equ 0470h           ; Capacitive Touch IO
156 RTC_C_SFR       .equ 04A0h
157 MPY_SFR         .equ 04C0h
158 DMA_CTRL_SFR    .equ 0500h
159 DMA_CHN0_SFR    .equ 0510h
160 DMA_CHN1_SFR    .equ 0520h
161 DMA_CHN2_SFR    .equ 0530h
162 DMA_CHN3_SFR    .equ 0540h
163 DMA_CHN4_SFR    .equ 0550h
164 DMA_CHN5_SFR    .equ 0560h
165 MPU_SFR         .equ 05A0h           ; memory protect unit
166 eUSCI_A0_SFR    .equ 05C0h           ; eUSCI_A0
167 eUSCI_A1_SFR    .equ 05E0h           ; eUSCI_A1
168 eUSCI_A2_SFR    .equ 0600h           ; eUSCI_A1
169 eUSCI_A3_SFR    .equ 0620h           ; eUSCI_A1
170 eUSCI_B0_SFR    .equ 0640h           ; eUSCI_B0
171 eUSCI_B1_SFR    .equ 0680h           ; eUSCI_B1
172 eUSCI_B2_SFR    .equ 06C0h           ; eUSCI_B2
173 eUSCI_B3_SFR    .equ 0700h           ; eUSCI_B3
174 TA4_SFR         .equ 07C0h
175 ADC12_B_SFR     .equ 0800h
176 COMP_E_SFR      .equ 08C0h
177 CRC32_SFR       .equ 0980h
178 AES_SFR         .equ 09C0h
179 LEA_SFR         .equ 0A80h
180
181 ; ----------------------------------------------------------------------
182 ; POWER ON RESET AND INITIALIZATION : LOCK PMM_LOCKLPM5
183 ; ----------------------------------------------------------------------
184 SFRIE1      .equ SFR_SFR
185 SFRIFG1     .equ SFR_SFR + 2
186 SFRRPCR     .equ SFR_SFR + 4
187
188 PMMCTL0     .equ PMM_SFR
189 PMMSWBOR    .equ 4
190
191 PM5CTL0     .equ PMM_SFR + 10h    ; Power mode 5 control register 0
192 LOCKLPM5    .equ 1
193
194 ; ----------------------------------------------------------------------
195 ; FRAM config
196 ; ----------------------------------------------------------------------
197 FRCTL0      .equ FRAM_SFR + 00h ; FRAM Controller Control 0
198 FRCTL0_H    .equ FRAM_SFR + 01h ; FRAM Controller Control 0 high byte
199
200 ; ----------------------------------------------------------------------
201 ; POWER ON RESET AND INITIALIZATION : WATCHDOG TIMER A
202 ; ----------------------------------------------------------------------
203
204 WDTCTL      .equ WDT_A_SFR + 00h    ; Watchdog Timer Control */
205
206 ; WDTCTL Control Bits
207 WDTPW       .equ 5A00h
208 WDTHOLD     .equ 0080h  ; WDT - Timer hold
209 WDTCNTCL    .equ 0008h  ; WDT timer counter clear
210
211
212 ; ----------------------------------------------------------------------
213 ; POWER ON RESET AND INITIALIZATION : CLOCK SYSTEM
214 ; ----------------------------------------------------------------------
215
216 CSCTL0      .equ CS_SFR + 00h   ; CS Control Register 0
217 CSCTL0_H    .equ CS_SFR + 01h   ; CS Control Register 0 high byte
218 CSCTL1      .equ CS_SFR + 02h   ; CS Control Register 1
219 CSCTL2      .equ CS_SFR + 04h   ; CS Control Register 2
220 CSCTL3      .equ CS_SFR + 06h   ; CS Control Register 3
221
222 ; CSCTL0 Control Bits
223 CSKEY           .equ 0A5h           ; CS Password
224 ; CSCTL1 Control Bits
225 DCORSEL     .equ 0040h
226 DCOFSEL0    .equ 0002h          ; DCO frequency select Bit: 0
227 DCOFSEL1    .equ 0004h          ; DCO frequency select Bit: 1
228 DCOFSEL2    .equ 0008h          ; DCO frequency select Bit: 2
229 DCOFSEL3    .equ 000Ch          ; DCO frequency select Bit: 21
230 ; CSCTL2 Control Bits
231 SELA_LFXCLK .equ 0000h           ; 0 : ACLK Source Select LFXCLK
232 SELA_VLOCLK .equ 0100h           ; 1 ACLK Source Select VLOCLK 10kHz
233 SELS_DCOCLK .equ 0030h           ; 3 : SMCLK Source Select DCOCLK
234 SELM_DCOCLK .equ 0003h           ; 3 : MCLK Source Select DCOCLK
235 ; CSCTL3 Control Bits
236 DIVA_0      .equ 0000h           ; ACLK Source Divider 0
237 DIVS_0      .equ 0000h           ; SMCLK Source Divider 0
238 DIVM_0      .equ 0000h           ; MCLK Source Divider 0
239 DIVA_2      .equ 0100h           ; ACLK Source Divider 0
240 DIVS_2      .equ 0010h           ; SMCLK Source Divider 0
241 DIVM_2      .equ 0001h           ; MCLK Source Divider 0
242 DIVA_4      .equ 0200h           ; ACLK Source Divider 0
243 DIVS_4      .equ 0020h           ; SMCLK Source Divider 0
244 DIVM_4      .equ 0002h           ; MCLK Source Divider 0
245 DIVA_8      .equ 0300h           ; ACLK Source Divider 0
246 DIVS_8      .equ 0030h           ; SMCLK Source Divider 0
247 DIVM_8      .equ 0003h           ; MCLK Source Divider 0
248 DIVA_16     .equ 0400h           ; ACLK Source Divider 0
249 DIVS_16     .equ 0040h           ; SMCLK Source Divider 0
250 DIVM_16     .equ 0004h           ; MCLK Source Divider 0
251 DIVA_32     .equ 0500h           ; ACLK Source Divider 0
252 DIVS_32     .equ 0050h           ; SMCLK Source Divider 0
253 DIVM_32     .equ 0005h           ; MCLK Source Divider 0
254
255 ; ----------------------------------------------------------------------
256 ; POWER ON RESET AND INITIALIZATION : SYS REGISTERS
257 ; ----------------------------------------------------------------------
258
259 SYSUNIV     .equ SYS_SFR + 001Ah
260 SYSSNIV     .equ SYS_SFR + 001Ch
261 SYSRSTIV    .equ SYS_SFR + 001Eh
262
263 ; SYS Control Bits
264 ; ...
265 ; ----------------------------------------------------------------------
266 ; POWER ON RESET AND INITIALIZATION : REF
267 ; ----------------------------------------------------------------------
268
269 REFCTL      .equ REF_SFR + 00h       ; REF Shared Reference control register 0
270
271 ; REFCTL0 Control Bits
272 REFON       .equ 0001h               ; REF Reference On
273 REFTCOFF    .equ 0008h               ; REF Temp.Sensor off
274
275 ; ----------------------------------------------------------------------
276 ; POWER ON RESET AND INITIALIZATION : PORT1/2
277 ; ----------------------------------------------------------------------
278
279 PAIN        .equ PA_SFR + 00h    ; Port A INput
280 PAOUT       .equ PA_SFR + 02h    ; Port A OUTput
281 PADIR       .equ PA_SFR + 04h    ; Port A DIRection
282 PAREN       .equ PA_SFR + 06h    ; Port A Resistor ENable
283 PASEL0      .equ PA_SFR + 0Ah    ; Port A SELection 0
284 PASEL1      .equ PA_SFR + 0Ch    ; Port A SELection 1
285 PASELC      .equ PA_SFR + 16h    ; Port A SELection Complement
286 PAIES       .equ PA_SFR + 18h    ; Port A Interrupt Edge Select
287 PAIE        .equ PA_SFR + 1Ah    ; Port A Interrupt Enable
288 PAIFG       .equ PA_SFR + 1Ch    ; Port A Interrupt FlaG
289
290 P1IN        .equ PA_SFR + 00h    ; Port 1 INput
291 P1OUT       .equ PA_SFR + 02h    ; Port 1 OUTput
292 P1DIR       .equ PA_SFR + 04h    ; Port 1 DIRection
293 P1REN       .equ PA_SFR + 06h    ; Port 1 Resistor ENable
294 P1SEL0      .equ PA_SFR + 0Ah    ; Port 1 SELection 0
295 P1SEL1      .equ PA_SFR + 0Ch    ; Port 1 SELection 1
296 P1SELC      .equ PA_SFR + 16h    ; Port 1 SELection Complement
297 P1IES       .equ PA_SFR + 18h    ; Port 1 Interrupt Edge Select
298 P1IE        .equ PA_SFR + 1Ah    ; Port 1 Interrupt Enable
299 P1IFG       .equ PA_SFR + 1Ch    ; Port 1 Interrupt FlaG
300 P1IV        .equ PA_SFR + 0Eh    ; Port 1 Interrupt Vector word 
301
302 P2IN        .equ PA_SFR + 01h    ; Port 2 INput
303 P2OUT       .equ PA_SFR + 03h    ; Port 2 OUTput
304 P2DIR       .equ PA_SFR + 05h    ; Port 2 DIRection
305 P2REN       .equ PA_SFR + 07h    ; Port 2 Resistor ENable
306 P2SEL0      .equ PA_SFR + 0Bh    ; Port 2 SELection 0
307 P2SEL1      .equ PA_SFR + 0Dh    ; Port 2 SELection 1
308 P2SELC      .equ PA_SFR + 17h    ; Port 2 SELection Complement
309 P2IES       .equ PA_SFR + 19h    ; Port 2 Interrupt Edge Select
310 P2IE        .equ PA_SFR + 1Bh    ; Port 2 Interrupt Enable
311 P2IFG       .equ PA_SFR + 1Dh    ; Port 2 Interrupt FlaG
312 P2IV        .equ PA_SFR + 1Eh    ; Port 2 Interrupt Vector word 
313
314 ; ----------------------------------------------------------------------
315 ; POWER ON RESET AND INITIALIZATION : PORT3/4
316 ; ----------------------------------------------------------------------
317
318 PBIN        .equ PB_SFR + 00h    ; Port B Input
319 PBOUT       .equ PB_SFR + 02h    ; Port B Output 1/0 or pullup/pulldown resistor
320 PBDIR       .equ PB_SFR + 04h    ; Port B Direction
321 PBREN       .equ PB_SFR + 06h    ; Port B Resistor Enable
322 PBSEL0      .equ PB_SFR + 0Ah    ; Port B Selection 0
323 PBSEL1      .equ PB_SFR + 0Ch    ; Port B Selection 1
324 PBSELC      .equ PB_SFR + 16h    ; Port B Complement Selection
325 PBIES       .equ PB_SFR + 18h    ; Port B Interrupt Edge Select
326 PBIE        .equ PB_SFR + 1Ah    ; Port B Interrupt Enable
327 PBIFG       .equ PB_SFR + 1Ch    ; Port B Interrupt Flag
328
329 P3IN        .equ PB_SFR + 00h    ; Port 3 Input */
330 P3OUT       .equ PB_SFR + 02h    ; Port 3 Output
331 P3DIR       .equ PB_SFR + 04h    ; Port 3 Direction
332 P3REN       .equ PB_SFR + 06h    ; Port 3 Resistor Enable
333 P3SEL0      .equ PB_SFR + 0Ah    ; Port 3 Selection 0
334 P3SEL1      .equ PB_SFR + 0Ch    ; Port 3 Selection 1
335 P3SELC      .equ PB_SFR + 16h    ; Port 3 Complement Selection
336 P3IES       .equ PB_SFR + 18h    ; Port 3 Interrupt Edge Select
337 P3IE        .equ PB_SFR + 1Ah    ; Port 3 Interrupt Enable
338 P3IFG       .equ PB_SFR + 1Ch    ; Port 3 Interrupt Flag
339 P3IV        .equ PB_SFR + 0Eh    ; Port 3 Interrupt Vector word 
340
341 P4IN        .equ PB_SFR + 01h    ; Port 4 Input */
342 P4OUT       .equ PB_SFR + 03h    ; Port 4 Output
343 P4DIR       .equ PB_SFR + 05h    ; Port 4 Direction
344 P4REN       .equ PB_SFR + 07h    ; Port 4 Resistor Enable
345 P4SEL0      .equ PB_SFR + 0Bh    ; Port 4 Selection 0
346 P4SEL1      .equ PB_SFR + 0Dh    ; Port 4 Selection 1
347 P4SELC      .equ PB_SFR + 17h    ; Port 4 Complement Selection
348 P4IES       .equ PB_SFR + 19h    ; Port 4 Interrupt Edge Select
349 P4IE        .equ PB_SFR + 1Bh    ; Port 4 Interrupt Enable
350 P4IFG       .equ PB_SFR + 1Dh    ; Port 4 Interrupt Flag
351 P4IV        .equ PB_SFR + 1Eh    ; Port 4 Interrupt Vector word 
352
353 ; ----------------------------------------------------------------------
354 ; POWER ON RESET AND INITIALIZATION : PORT5/6
355 ; ----------------------------------------------------------------------
356
357 PCIN        .equ PC_SFR + 00h    ; Port C Input
358 PCOUT       .equ PC_SFR + 02h    ; Port C Output
359 PCDIR       .equ PC_SFR + 04h    ; Port C Direction
360 PCREN       .equ PC_SFR + 06h    ; Port C Resistor Enable
361 PCSEL0      .equ PC_SFR + 0Ah    ; Port C Selection 0
362 PCSEL1      .equ PC_SFR + 0Ch    ; Port C Selection 1
363 PCSELC      .equ PC_SFR + 16h    ; Port C Complement Selection
364 PCIES       .equ PC_SFR + 18h    ; Port C Interrupt Edge Select
365 PCIE        .equ PC_SFR + 1Ah    ; Port C Interrupt Enable
366 PCIFG       .equ PC_SFR + 1Ch    ; Port C Interrupt Flag
367
368 P5IN        .equ PC_SFR + 00h    ; Port 5 Input
369 P5OUT       .equ PC_SFR + 02h    ; Port 5 Output
370 P5DIR       .equ PC_SFR + 04h    ; Port 5 Direction
371 P5REN       .equ PC_SFR + 06h    ; Port 5 Resistor Enable
372 P5SEL0      .equ PC_SFR + 0Ah    ; Port 5 Selection 0
373 P5SEL1      .equ PC_SFR + 0Ch    ; Port 5 Selection 1
374 P5IV        .equ PC_SFR + 0Eh    ; Port 5 Interrupt Vector word 
375 P5SELC      .equ PC_SFR + 16h    ; Port 5 Complement Selection
376 P5IES       .equ PC_SFR + 18h    ; Port 5 Interrupt Edge Select
377 P5IE        .equ PC_SFR + 1Ah    ; Port 5 Interrupt Enable
378 P5IFG       .equ PC_SFR + 1Ch    ; Port 5 Interrupt Flag
379
380 P6IN        .equ PC_SFR + 01h    ; Port 6 Input
381 P6OUT       .equ PC_SFR + 03h    ; Port 6 Output
382 P6DIR       .equ PC_SFR + 05h    ; Port 6 Direction
383 P6REN       .equ PC_SFR + 07h    ; Port 6 Resistor Enable
384 P6SEL0      .equ PC_SFR + 0Bh    ; Port 6 Selection 0
385 P6SEL1      .equ PC_SFR + 0Dh    ; Port 6 Selection 1
386 P6SELC      .equ PC_SFR + 17h    ; Port 6 Complement Selection
387 P6IES       .equ PC_SFR + 19h    ; Port 6 Interrupt Edge Select
388 P6IE        .equ PC_SFR + 1Bh    ; Port 6 Interrupt Enable
389 P6IFG       .equ PC_SFR + 1Dh    ; Port 6 Interrupt Flag
390 P6IV        .equ PC_SFR + 1Eh    ; Port 6 Interrupt Vector word 
391
392 ; ----------------------------------------------------------------------
393 ; POWER ON RESET AND INITIALIZATION : PORT7/8
394 ; ----------------------------------------------------------------------
395
396 PDIN        .equ PD_SFR + 00h    ; Port D Input
397 PDOUT       .equ PD_SFR + 02h    ; Port D Output
398 PDDIR       .equ PD_SFR + 04h    ; Port D Direction
399 PDREN       .equ PD_SFR + 06h    ; Port D Resistor Enable
400 PDSEL0      .equ PD_SFR + 0Ah    ; Port D Selection 0
401 PDSEL1      .equ PD_SFR + 0Ch    ; Port D Selection 1
402 PDSELC      .equ PD_SFR + 16h    ; Port D Complement Selection
403 PDIES       .equ PD_SFR + 18h    ; Port D Interrupt Edge Select
404 PDIE        .equ PD_SFR + 1Ah    ; Port D Interrupt Enable
405 PDIFG       .equ PD_SFR + 1Ch    ; Port D Interrupt Flag
406
407 P7IN        .equ PD_SFR + 00h    ; Port 7 Input
408 P7OUT       .equ PD_SFR + 02h    ; Port 7 Output
409 P7DIR       .equ PD_SFR + 04h    ; Port 7 Direction
410 P7REN       .equ PD_SFR + 06h    ; Port 7 Resistor Enable
411 P7SEL0      .equ PD_SFR + 0Ah    ; Port 7 Selection 0
412 P7SEL1      .equ PD_SFR + 0Ch    ; Port 7 Selection 1
413 P7IV        .equ PD_SFR + 0Eh    ; Port 7 Interrupt Vector word 
414 P7SELC      .equ PD_SFR + 16h    ; Port 7 Complement Selection
415 P7IES       .equ PD_SFR + 18h    ; Port 7 Interrupt Edge Select
416 P7IE        .equ PD_SFR + 1Ah    ; Port 7 Interrupt Enable
417 P7IFG       .equ PD_SFR + 1Ch    ; Port 7 Interrupt Flag
418
419 P8IN        .equ PD_SFR + 01h    ; Port 8 Input
420 P8OUT       .equ PD_SFR + 03h    ; Port 8 Output
421 P8DIR       .equ PD_SFR + 05h    ; Port 8 Direction
422 P8REN       .equ PD_SFR + 07h    ; Port 8 Resistor Enable
423 P8SEL0      .equ PD_SFR + 0Bh    ; Port 8 Selection 0
424 P8SEL1      .equ PD_SFR + 0Dh    ; Port 8 Selection 1
425 P8SELC      .equ PD_SFR + 16h    ; Port 8 Complement Selection
426 P8IES       .equ PD_SFR + 19h    ; Port 8 Interrupt Edge Select
427 P8IE        .equ PD_SFR + 1Bh    ; Port 8 Interrupt Enable
428 P8IFG       .equ PD_SFR + 1Dh    ; Port 8 Interrupt Flag
429 P8IV        .equ PD_SFR + 1Eh    ; Port 8 Interrupt Vector word 
430
431
432 ; ----------------------------------------------------------------------
433 ; POWER ON RESET AND INITIALIZATION : PORTJ
434 ; ----------------------------------------------------------------------
435
436 PJIN        .equ PJ_SFR + 00h   ; Port J INput
437 PJOUT       .equ PJ_SFR + 02h   ; Port J OUTput
438 PJDIR       .equ PJ_SFR + 04h   ; Port J DIRection
439 PJREN       .equ PJ_SFR + 06h   ; Port J Resistor ENable
440 PJSEL0      .equ PJ_SFR + 0Ah   ; Port 2 SELection 0
441 PJSEL1      .equ PJ_SFR + 0Ch   ; Port 2 SELection 1
442 PJSELC      .equ PJ_SFR + 16h   ; Port 2 SELection Complement; PJ 5-0 usage
443
444
445 ; ----------------------------------------------------------------------
446 RTC_C
447 ; ----------------------------------------------------------------------
448 RTCCTL0_L   .equ RTC_C_SFR + 00h
449 RTCCTL0_H   .equ RTC_C_SFR + 01h
450 RTCCTL1     .equ RTC_C_SFR + 02h
451 RTCCTL3     .equ RTC_C_SFR + 03h
452 RTCOCAL     .equ RTC_C_SFR + 04h
453 RTCTCMP     .equ RTC_C_SFR + 06h
454 RTCPS0CTL   .equ RTC_C_SFR + 08h
455 RTCPS1CTL   .equ RTC_C_SFR + 0Ah
456 RTCPS       .equ RTC_C_SFR + 0Ch ; = RT1PS:RT0PS
457 RTCIV       .equ RTC_C_SFR + 0Eh
458 RTCSEC      .equ RTC_C_SFR + 10h
459 RTCCNT1     .equ RTC_C_SFR + 10h     
460 RTCMIN      .equ RTC_C_SFR + 11h
461 RTCCNT2     .equ RTC_C_SFR + 11h
462 RTCHOUR     .equ RTC_C_SFR + 12h
463 RTCCNT3     .equ RTC_C_SFR + 12h
464 RTCDOW      .equ RTC_C_SFR + 13h
465 RTCCNT4     .equ RTC_C_SFR + 13h
466 RTCDAY      .equ RTC_C_SFR + 14h
467 RTCMON      .equ RTC_C_SFR + 15h
468 RTCYEAR     .equ RTC_C_SFR + 16h
469
470 RTCHOLD     .equ 40h
471 RTCRDY      .equ 10h
472
473 ; ----------------------------------------------------------------------
474 MPY_32
475 ; ----------------------------------------------------------------------
476
477 MPY         .equ MPY_SFR + 00h  ; Multiply16 Unsigned/Operand 1 */
478 MPYS        .equ MPY_SFR + 02h  ; Multiply16 signed/Operand 1
479 MAC         .equ MPY_SFR + 04h  ; MultiplyAccumulate16 Unsigned/Operand 1 */
480 MACS        .equ MPY_SFR + 06h  ; MultiplyAccumulate16 signed/Operand 1
481 OP2         .equ MPY_SFR + 08h  ; Operand2_16 */
482 RESLO       .equ MPY_SFR + 0Ah  ; 16x16-bit result low - least significant word */
483 RESHI       .equ MPY_SFR + 0Ch  ; 16x16-bit result high */
484 SUMEXT      .equ MPY_SFR + 0Eh  ; 16x16-bit sum extension register
485 MPY32L      .equ MPY_SFR + 10h  ; Multiply32 Unsigned/Operand 1
486 MPY32H      .equ MPY_SFR + 12h  ; Multiply32 Unsigned/Operand 1
487 MPYS32L     .equ MPY_SFR + 14h  ; Multiply32 signed/Operand 1
488 MPYS32H     .equ MPY_SFR + 16h  ; Multiply32 signed/Operand 1
489 MAC32L      .equ MPY_SFR + 18h  ; MultiplyAccumulate32 Unsigned/Operand 1
490 MAC32H      .equ MPY_SFR + 1Ah  ; MultiplyAccumulate32 Unsigned/Operand 1
491 MACS32L     .equ MPY_SFR + 1Ch  ; MultiplyAccumulate32 signed/Operand 1
492 MACS32H     .equ MPY_SFR + 1Eh  ; MultiplyAccumulate32 signed/Operand 1
493 OP2L        .equ MPY_SFR + 20h  ; Multiply32 Operand 2
494 OP2H        .equ MPY_SFR + 22h  ; Multiply32 Operand 2
495 RES0        .equ MPY_SFR + 24h  ; 32x32-bit result 0 - least significant word */
496 RES1        .equ MPY_SFR + 26h  ; 32x32-bit result 1 */
497 RES2        .equ MPY_SFR + 28h  ; 32x32-bit result 2 */
498 RES3        .equ MPY_SFR + 2Ah  ; 32x32-bit result 3 */
499 MPY32CTL0   .equ MPY_SFR + 2Ch  ; MPY32 control register 0
500
501 MPUCTL0     .equ MPU_SFR + 00h  ; MPU control 0             
502 MPUCTL1     .equ MPU_SFR + 02h  ; MPU control 1             
503 MPUSEGB2    .equ MPU_SFR + 04h  ; MPU Segmentation Border 2 
504 MPUSEGB1    .equ MPU_SFR + 06h  ; MPU Segmentation Border 1 
505 MPUSAM      .equ MPU_SFR + 08h  ; MPU access management     
506 MPUIPC0     .equ MPU_SFR + 0Ah  ; MPU IP control 0                      
507 MPUIPSEGB2  .equ MPU_SFR + 0Ch  ; MPU IP Encapsulation Segment Border 2 
508 MPUIPSEGB1  .equ MPU_SFR + 0Eh  ; MPU IP Encapsulation Segment Border 1 
509
510     .IFDEF UCA0_TERM
511 ; ----------------------------------------------------------------------
512 ; eUSCI_A0
513 ; ----------------------------------------------------------------------
514 TERM_CTLW0  .equ eUSCI_A0_SFR + 00h ; eUSCI_A0 Control Word Register 0
515 TERM_BRW    .equ eUSCI_A0_SFR + 06h ; eUSCI_A0 Baud Word Rate 0
516 TERM_MCTLW  .equ eUSCI_A0_SFR + 08h ; eUSCI_A0 Modulation Control
517 TERM_STATW  .equ eUSCI_A0_SFR + 0Ah ; eUSCI_A0 status Word Register
518 TERM_RXBUF  .equ eUSCI_A0_SFR + 0Ch ; eUSCI_A0 Receive Buffer
519 TERM_TXBUF  .equ eUSCI_A0_SFR + 0Eh ; eUSCI_A0 Transmit Buffer
520 TERM_IE     .equ eUSCI_A0_SFR + 1Ah ; eUSCI_A0 Interrupt Enable Register
521 TERM_IFG    .equ eUSCI_A0_SFR + 1Ch ; eUSCI_A0 Interrupt Flags Register
522
523 TERM_VEC    .equ 0FFF0h ; interrupt vector for  eUSCI_A0
524 WAKE_UP     .equ 1      ; UART RX interrupt
525
526 RX_TERM     .equ 1
527 TX_TERM     .equ 2
528
529     .ENDIF ;UCA0_TERM
530
531     .IFDEF UCB0_SD
532 ; ----------------------------------------------------------------------
533 ; eUSCI_B0
534 ; ----------------------------------------------------------------------
535 SD_CTLW0    .equ eUSCI_B0_SFR + 00h ; eUSCI_B0 Control Word Register 0
536 SD_BRW      .equ eUSCI_B0_SFR + 06h ; eUSCI_B0 Baud Word Rate 0
537 SD_RXBUF    .equ eUSCI_B0_SFR + 0Ch ; eUSCI_B0 Receive Buffer 8
538 SD_TXBUF    .equ eUSCI_B0_SFR + 0Eh ; eUSCI_B0 Transmit Buffer 8
539 SD_IFG      .equ eUSCI_B0_SFR + 2Ch ; eUSCI_B0 Interrupt Flags Register
540 RX_SD       .equ 1
541 TX_SD       .equ 2
542
543     .ENDIF ;UCB0_SD
544
545
546     .IFDEF UCB2_TERM
547 ; ----------------------------------------------------------------------
548 ; eUSCI_B2
549 ; ----------------------------------------------------------------------
550 TERM_CTLW0  .equ eUSCI_B2_SFR + 00h ; USCI_B2 Control Word Register 0
551 TERM_CTLW1  .equ eUSCI_B2_SFR + 02h ; USCI_B2 Control Word Register 1
552 TERM_BRW    .equ eUSCI_B2_SFR + 06h ; USCI_B2 Baud Word Rate 0
553 TERM_STATW  .equ eUSCI_B2_SFR + 08h ; USCI_B2 Status Word
554 TERM_RXBUF  .equ eUSCI_B2_SFR + 0Ch ; USCI_B2 Receive Buffer 8
555 TERM_TXBUF  .equ eUSCI_B2_SFR + 0Eh ; USCI_B2 Transmit Buffer 8
556 TERM_I2COA0 .equ eUSCI_B2_SFR + 14h ; USCI_B2 I2C Own Address 0
557 TERM_ADDRX  .equ eUSCI_B2_SFR + 1Ch ; USCI_B2  Received Address Register 
558 TERM_I2CSA  .equ eUSCI_B2_SFR + 20h ; USCI_B2 I2C Slave Address
559 TERM_IE     .equ eUSCI_B2_SFR + 2Ah ; USCI_B2 Interrupt Enable
560 TERM_IFG    .equ eUSCI_B2_SFR + 2Ch ; USCI_B2 Interrupt Flags Register
561
562 TERM_VEC    .equ 0FFBCh ; interrupt vector for eUSCI_B2
563 WAKE_UP     .equ 4      ; START interrupt
564
565 RX_TERM     .equ 1
566 TX_TERM     .equ 2
567
568     .ENDIF ;UCB0_TERM
569