OSDN Git Service

v206
[fast-forth/master.git] / MSP430FR4133.inc
1 ; MSP430fr4133.inc
2 ; MSP430FR4133 minimal declarations for FAST FORTH usage
3 DEVICE = "MSP430FR4133"
4
5 ; ----------------------------------------------
6 ; MSP430FR4133 MEMORY MAP
7 ; ----------------------------------------------
8 ; 0000-0FFF = peripherals (4 KB)
9 ; 1000-17FF = ROM bootstrap loader BSL0..3 (4x512 B)
10 ; 1800-19FF = info B (FRAM 512 B)
11 ; 1A00-1A7F = TLV device descriptor info (FRAM 128 B)
12 ; 1A80-1FFF = unused
13 ; 2000-27FF = RAM (2 KB)
14 ; 2800-C3FF = unused
15 ; C400-FF7F = code memory (FRAM 15232 B)
16 ; FF80-FFFF = interrupt vectors (FRAM 128 B)
17 ; ----------------------------------------------
18 PAGESIZE        .equ 512         ; MPU unit
19 ; ----------------------------------------------
20 ; FRAM                          ; INFO B, TLV
21 ; ----------------------------------------------
22 INFOSTART       .equ 01800h
23 INFOBSTART      .equ 01800h
24 INFOBEND        .equ 019FFh
25 INFOEND         .equ 019FFh
26 TLVSTART        .equ 01A00h      ; Device Descriptor Info (Tag-Lenght-Value)
27 TLVEND          .equ 01A7Fh      ;
28 ; ----------------------------------------------
29 ; RAM
30 ; ----------------------------------------------
31 RAMSTART        .equ 02000h
32 RAMEND          .equ 027FFh
33 RAMLEN          .equ 00800h
34 ; ----------------------------------------------
35 ; FRAM
36 ; ----------------------------------------------
37 PROGRAMSTART    .equ 0C400h      ; Code space start
38 SIGNATURES      .equ 0FF80h      ; JTAG/BSL signatures
39 JTAG_SIG1       .equ 0FF80h      ; if 0 (electronic fuse=0) enable JTAG/SBW ; reset by wipe and by S1+<reset>
40 JTAG_SIG2       .equ 0FF82h      ; if JTAG_SIG <> |0xFFFFFFFF, 0x00000000|, SBW and JTAG are locked
41 BSL_SIG1        .equ 0FF84h      ;
42 BSL_SIG2        .equ 0FF86h      ;
43 JTAG_PASSWORD   .equ 0FF88h      ; 256 bits
44 INTVECT         .equ 0FFE2h      ; FFE2-FFFF
45 VECTLEN         .equ 1Eh
46 BSL_PASSWORD    .equ 0FFE0h      ; 256 bits
47
48 ; ----------------------------------------------
49 ; Interrupt Vectors and signatures - MSP430FR4133
50 ; ----------------------------------------------
51
52 ;    .org    SIGNATURES
53 ;;Start of JTAG and BSL signatures
54 ;        .word   0FFFFh      ; JTAG signature 1
55 ;        .word   0FFFFh      ; JTAG signature 2
56 ;        .word   0FFFFh      ; BSL signature 1, 5555h to disable BSL
57 ;        .word   0FFFFh      ; BSL signature 2
58 ;
59 ;    .org    INTVECT         ; FFE2-FFFF 14 vectors + reset
60 ;
61 ;            .word  reset        ; FFE2h - LCD      
62 ;            .word  reset        ; FFE4h - P2       
63 ;            .word  reset        ; FFE6h - P1       
64 ;            .word  reset        ; FFE8h - ADC10    
65 ;            .word  reset        ; FFEAh - eUSCI_B0 
66 ;            .word  reset        ; FFECh - eUSCI_A0 
67 ;            .word  reset        ; FFEEh - WDT      
68 ;            .word  reset        ; FFF0h - RTC      
69 ;            .word  reset        ; FFF2h - TA1_x    
70 ;            .word  reset        ; FFF4h - TA1_0    
71 ;            .word  reset        ; FFF6h - TA0_x    
72 ;            .word  reset        ; FFF8h - TA0_0    
73 ;            .word  reset        ; FFFAh - UserNMI  
74 ;            .word  reset        ; FFFCh - SysNMI   
75 ;            .word  reset        ; FFFEh - Reset    
76
77
78 ; ----------------------------------------------------------------------
79 ; EXP430FR4133 Peripheral File Map
80 ; ----------------------------------------------------------------------
81 SFR_SFR         .set 0100h           ; Special function
82 PMM_SFR         .set 0120h           ; PMM
83 SYS_SFR         .set 0140h           ; SYS
84 CS_SFR          .set 0180h           ; Clock System
85 FRAM_SFR        .set 01A0h           ; FRAM control
86 CRC16_SFR       .set 01C0h
87 WDT_A_SFR       .set 01CCh           ; Watchdog
88 PA_SFR          .set 0200h           ; PORT1/2
89 PB_SFR          .set 0220h           ; PORT3/4
90 PC_SFR          .set 0240h           ; PORT5/6
91 PD_SFR          .set 0260h           ; PORT7/8
92 CTIO0_SFR       .set 02E0h           ; Capacitive Touch IO
93 TA0_SFR         .set 0300h
94 TA1_SFR         .set 0340h
95 RTC_SFR         .set 03C0h
96 eUSCI_A0_SFR    .set 0500h           ; eUSCI_A0
97 eUSCI_B0_SFR    .set 0540h           ; eUSCI_B0
98 LCD_SFR         .set 0600h
99 BACK_MEM_SFR    .set 0660h
100 ADC10_B_SFR     .equ 0700h
101
102
103 ; ----------------------------------------------------------------------
104 ; POWER ON RESET AND INITIALIZATION : LOCK PMM_LOCKLPM5
105 ; ----------------------------------------------------------------------
106 PMMCTL0     .equ PMM_SFR
107 PMMSWBOR    .equ 4
108
109 PM5CTL0     .equ PMM_SFR + 10h    ; Power mode 5 control register 0
110 LOCKLPM5    .equ 1               ; bit position
111
112 ; ----------------------------------------------------------------------
113 ; POWER ON RESET SYS config
114 ; ----------------------------------------------------------------------
115 SYSCTL      .equ SYS_SFR + 00h  ;   System control                      
116 SYSBSLC     .equ SYS_SFR + 02h  ;   Bootstrap loader configuration area 
117 SYSJMBC     .equ SYS_SFR + 06h  ;   JTAG mailbox control                
118 SYSJMBI0    .equ SYS_SFR + 08h  ;   JTAG mailbox input 0                
119 SYSJMBI1    .equ SYS_SFR + 0Ah  ;   JTAG mailbox input 1                
120 SYSJMBO0    .equ SYS_SFR + 0Ch  ;   JTAG mailbox output 0               
121 SYSJMBO1    .equ SYS_SFR + 0Eh  ;   JTAG mailbox output 1               
122 SYSBERRIV   .equ SYS_SFR + 18h  ;   Bus Error vector generator          
123 SYSUNIV     .equ SYS_SFR + 1Ah  ;   User NMI vector generator           
124 SYSSNIV     .equ SYS_SFR + 1Ch  ;   System NMI vector generator         
125 SYSRSTIV    .equ SYS_SFR + 1Eh  ;   Reset vector generator              
126 SYSCFG0     .equ SYS_SFR + 20h  ;   System configuration 0              
127 SYSCFG1     .equ SYS_SFR + 22h  ;   System configuration 1              
128 SYSCFG2     .equ SYS_SFR + 24h  ;   System configuration 2        
129       
130 ; SYS Control Bits
131 ; ...
132 ; ----------------------------------------------------------------------
133 ; POWER ON RESET AND INITIALIZATION : WATCHDOG TIMER A
134 ; ----------------------------------------------------------------------
135
136 WDTCTL      .equ WDT_A_SFR + 00h    ; Watchdog Timer Control */
137
138 ; WDTCTL Control Bits
139 WDTPW       .equ 5A00h
140 WDTHOLD     .equ 0080h  ; WDT - Timer hold
141 WDTCNTCL    .equ 0008h  ; WDT timer counter clear
142
143
144 ; ----------------------------------------------------------------------
145 ; POWER ON RESET AND INITIALIZATION : PORT1/2
146 ; ----------------------------------------------------------------------
147
148 PAIN        .equ PA_SFR + 00h    ; Port A Input
149 PAOUT       .equ PA_SFR + 02h    ; Port A Output
150 PADIR       .equ PA_SFR + 04h    ; Port A Direction
151 PAREN       .equ PA_SFR + 06h    ; Port A Resistor Enable
152 PASEL0      .equ PA_SFR + 0Ah    ; Port A Selection 0
153 PASEL1      .equ PA_SFR + 0Ch    ; Port A Selection 1
154 PAIES       .equ PA_SFR + 18h    ; Port A Interrupt Edge Select
155 PAIE        .equ PA_SFR + 1Ah    ; Port A Interrupt Enable
156 PAIFG       .equ PA_SFR + 1Ch    ; Port A Interrupt Flag
157
158 P1IN        .equ PA_SFR + 00h    ; Port 1 Input
159 P1OUT       .equ PA_SFR + 02h    ; Port 1 Output
160 P1DIR       .equ PA_SFR + 04h    ; Port 1 Direction
161 P1REN       .equ PA_SFR + 06h    ; Port 1 Resistor Enable
162 P1SEL0      .equ PA_SFR + 0Ah    ; Port 1 Selection 0
163 P1SEL1      .equ PA_SFR + 0Ch    ; Port 1 Selection 1
164 P1IV        .equ PA_SFR + 0Eh    ; Port 1 Interrupt Vector word 
165 P1IES       .equ PA_SFR + 18h    ; Port 1 Interrupt Edge Select
166 P1IE        .equ PA_SFR + 1Ah    ; Port 1 Interrupt Enable
167 P1IFG       .equ PA_SFR + 1Ch    ; Port 1 Interrupt Flag
168
169 P2IN        .equ PA_SFR + 01h    ; Port 2 Input
170 P2OUT       .equ PA_SFR + 03h    ; Port 2 Output
171 P2DIR       .equ PA_SFR + 05h    ; Port 2 Direction
172 P2REN       .equ PA_SFR + 07h    ; Port 2 Resistor Enable
173 P2SEL0      .equ PA_SFR + 0Bh    ; Port 2 Selection 0
174 P2SEL1      .equ PA_SFR + 0Dh    ; Port 2 Selection 1
175 P2IES       .equ PA_SFR + 19h    ; Port 2 Interrupt Edge Select
176 P2IE        .equ PA_SFR + 1Bh    ; Port 2 Interrupt Enable
177 P2IFG       .equ PA_SFR + 1Dh    ; Port 2 Interrupt Flag
178 P2IV        .equ PA_SFR + 1Eh    ; Port 2 Interrupt Vector word 
179
180 ; ----------------------------------------------------------------------
181 ; POWER ON RESET AND INITIALIZATION : PORT3/4
182 ; ----------------------------------------------------------------------
183 ; PB = P4:P3
184
185 PBIN        .set PB_SFR + 00h    ; Port B Input
186 PBOUT       .set PB_SFR + 02h    ; Port B Output 1/0 or pullup/pulldown resistor
187 PBDIR       .set PB_SFR + 04h    ; Port B Direction
188 PBREN       .set PB_SFR + 06h    ; Port B Resistor Enable
189 PBSEL0      .set PB_SFR + 0Ah    ; Port B Selection 0
190 PBSEL1      .set PB_SFR + 0Ch    ; Port B Selection 1
191
192 P3IN        .set PB_SFR + 00h    ; Port 3 Input */
193 P3OUT       .set PB_SFR + 02h    ; Port 3 Output
194 P3DIR       .set PB_SFR + 04h    ; Port 3 Direction
195 P3REN       .set PB_SFR + 06h    ; Port 3 Resistor Enable
196 P3SEL0      .set PB_SFR + 0Ah    ; Port 3 Selection 0
197 P3SEL1      .set PB_SFR + 0Ch    ; Port 3 Selection 1
198
199 P4IN        .set PB_SFR + 01h    ; Port 4 Input */
200 P4OUT       .set PB_SFR + 03h    ; Port 4 Output
201 P4DIR       .set PB_SFR + 05h    ; Port 4 Direction
202 P4REN       .set PB_SFR + 07h    ; Port 4 Resistor Enable
203 P4SEL0      .set PB_SFR + 0Bh    ; Port 4 Selection 0
204 P4SEL1      .set PB_SFR + 0Dh    ; Port 4 Selection 1
205
206
207 ; ----------------------------------------------------------------------
208 ; POWER ON RESET AND INITIALIZATION : PORT5/6
209 ; ----------------------------------------------------------------------
210 ; PC = P6:P5
211
212 PCIN        .set PC_SFR + 00h    ; Port C Input
213 PCOUT       .set PC_SFR + 02h    ; Port C Output 1/0 or pullup/pulldown resistor
214 PCDIR       .set PC_SFR + 04h    ; Port C Direction
215 PCREN       .set PC_SFR + 06h    ; Port C Resistor Enable
216 PCSEL0      .set PC_SFR + 0Ah    ; Port C Selection 0
217 PCSEL1      .set PC_SFR + 0Ch    ; Port C Selection 1
218
219 P5IN        .set PC_SFR + 00h    ; Port 5 Input */
220 P5OUT       .set PC_SFR + 02h    ; Port 5 Output
221 P5DIR       .set PC_SFR + 04h    ; Port 5 Direction
222 P5REN       .set PC_SFR + 06h    ; Port 5 Resistor Enable
223 P5SEL0      .set PC_SFR + 0Ah    ; Port 5 Selection 0
224 P5SEL1      .set PC_SFR + 0Ch    ; Port 5 Selection 1
225
226 P6IN        .set PC_SFR + 01h    ; Port 6 Input */
227 P6OUT       .set PC_SFR + 03h    ; Port 6 Output
228 P6DIR       .set PC_SFR + 05h    ; Port 6 Direction
229 P6REN       .set PC_SFR + 07h    ; Port 6 Resistor Enable
230 P6SEL0      .set PC_SFR + 0Bh    ; Port 6 Selection 0
231 P6SEL1      .set PC_SFR + 0Dh    ; Port 6 Selection 1
232
233 ; ----------------------------------------------------------------------
234 ; POWER ON RESET AND INITIALIZATION : PORT7/8
235 ; ----------------------------------------------------------------------
236 ; PD = P8:P7
237
238 PDIN        .set PD_SFR + 00h    ; Port D Input
239 PDOUT       .set PD_SFR + 02h    ; Port D Output 1/0 or pullup/pulldown resistor
240 PDDIR       .set PD_SFR + 04h    ; Port D Direction
241 PDREN       .set PD_SFR + 06h    ; Port D Resistor Enable
242 PDSEL0      .set PD_SFR + 0Ah    ; Port D Selection 0
243 PDSEL1      .set PD_SFR + 0Ch    ; Port D Selection 1
244
245 P7IN        .set PD_SFR + 00h    ; Port 7 Input */
246 P7OUT       .set PD_SFR + 02h    ; Port 7 Output
247 P7DIR       .set PD_SFR + 04h    ; Port 7 Direction
248 P7REN       .set PD_SFR + 06h    ; Port 7 Resistor Enable
249 P7SEL0      .set PD_SFR + 0Ah    ; Port 7 Selection 0
250 P7SEL1      .set PD_SFR + 0Ch    ; Port 7 Selection 1
251
252 P8IN        .set PD_SFR + 01h    ; Port 8 Input */
253 P8OUT       .set PD_SFR + 03h    ; Port 8 Output
254 P8DIR       .set PD_SFR + 05h    ; Port 8 Direction
255 P8REN       .set PD_SFR + 07h    ; Port 8 Resistor Enable
256 P8SEL0      .set PD_SFR + 0Bh    ; Port 8 Selection 0
257 P8SEL1      .set PD_SFR + 0Dh    ; Port 8 Selection 1
258
259 ; ----------------------------------------------------------------------
260 ; FRAM config
261 ; ----------------------------------------------------------------------
262
263 FRCTL0      .equ FRAM_SFR + 00h   ; FRAM Controller Control 0
264 FRCTL0_H    .equ FRAM_SFR + 01h   ; FRAM Controller Control 0 high byte
265
266 ; ----------------------------------------------------------------------
267 ; POWER ON RESET AND INITIALIZATION : CLOCK SYSTEM
268 ; ----------------------------------------------------------------------
269
270 CSCTL0      .equ CS_SFR + 00h   ; Clock System Control Register 0
271 CSCTL1      .equ CS_SFR + 02h   ; Clock System Control Register 1
272 CSCTL2      .equ CS_SFR + 04h   ; Clock System Control Register 2
273 CSCTL3      .equ CS_SFR + 06h   ; Clock System Control Register 3
274 CSCTL4      .equ CS_SFR + 08h   ; Clock System Control Register 4
275 CSCTL5      .equ CS_SFR + 0Ah   ; Clock System Control Register 5
276 CSCTL6      .equ CS_SFR + 0Ch   ; Clock System Control Register 6
277 CSCTL7      .equ CS_SFR + 0Eh   ; Clock System Control Register 7
278 CSCTL8      .equ CS_SFR + 10h   ; Clock System Control Register 8
279
280
281
282 ; ----------------------------------------------------------------------
283 RTC
284 ; ----------------------------------------------------------------------
285 RTCCTL      .equ RTC_SFR + 00h  ; Real-Time Clock Control 
286 RTCIV       .equ RTC_SFR + 04h  ; Real-Time Clock Interrupt Vector 
287 RTCMOD      .equ RTC_SFR + 08h  ; Real-Timer Clock Modulo 
288 RTCCNT      .equ RTC_SFR + 0Ch  ; Real-Time Clock Counter 
289
290
291
292 UCSWRST         .equ 1  ; eUSCI Software Reset
293 UCTXIE          .equ 2  ; eUSCI Transmit Interrupt Enable
294 UCRXIE          .equ 1  ; eUSCI Receive Interrupt Enable
295 UCTXIFG         .equ 2  ; eUSCI Transmit Interrupt Flag
296 UCRXIFG         .equ 1  ; eUSCI Receive Interrupt Flag
297
298 ; ----------------------------------------------------------------------
299 eUSCI_A0
300 ; ----------------------------------------------------------------------
301
302     .IFDEF UCA0_TERM
303 TERMCTLW0       .equ eUSCI_A0_SFR + 00h    ; eUSCI_A0 Control Word Register 0
304 TERMBRW         .equ eUSCI_A0_SFR + 06h    ; eUSCI_A0 Baud Word Rate 0
305 TERMMCTLW       .equ eUSCI_A0_SFR + 08h    ; eUSCI_A0 Modulation Control
306 TERMRXBUF       .equ eUSCI_A0_SFR + 0Ch    ; eUSCI_A0 Receive Buffer
307 TERMTXBUF       .equ eUSCI_A0_SFR + 0Eh    ; eUSCI_A0 Transmit Buffer
308 TERMIE          .equ eUSCI_A0_SFR + 1Ah    ; eUSCI_A0 Interrupt Enable Register
309 TERMIFG         .equ eUSCI_A0_SFR + 1Ch    ; eUSCI_A0 Interrupt Flags Register
310 TERMVEC         .equ 0FFECh      ;  interrupt vector for eUSCI_A0
311     .ENDIF ;UCA0_TERM
312
313 ; ----------------------------------------------------------------------
314 ; eUSCI_B0
315 ; ----------------------------------------------------------------------
316
317     .IFDEF UCB0_SD
318 SD_CTLW0       .equ eUSCI_B0_SFR + 00h    ; USCI_B0 Control Word Register 0
319 SD_BRW         .equ eUSCI_B0_SFR + 06h    ; USCI_B0 Baud Word Rate 0
320 SD_RXBUF       .equ eUSCI_B0_SFR + 0Ch    ; USCI_B0 Receive Buffer 8
321 SD_TXBUF       .equ eUSCI_B0_SFR + 0Eh    ; USCI_B0 Transmit Buffer 8
322 SD_IFG         .equ eUSCI_B0_SFR + 2Ch    ; USCI_B0 Interrupt Flags Register
323     .ENDIF ;UCB0_SD
324
325 UCB0STATW       .equ eUSCI_B0_SFR + 08h     ; eUSCI_B0 Status words
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354