2 ; MSP430FR5739 minimal declarations for FastForth usage
3 DEVICE = "MSP430FR5739"
6 ; ----------------------------------------------
7 ; MSP430FR5739 MEMORY MAP
8 ; ----------------------------------------------
9 ; 0000-0FFF = peripherals (4 KB)
10 ; 1000-17FF = ROM bootstrap loader BSL0..3 (4x512 B)
11 ; 1800-187F = info B (FRAM 128 B)
12 ; 1880-18FF = info A (FRAM 128 B)
13 ; 1900-19FF = N/A (mirrored into info A/B)
14 ; 1A00-1A7F = TLV device descriptor info (FRAM 128 B)
15 ; 1A80-1BFF = unused (385 B)
16 ; 1C00-1FFF = RAM (1 KB)
17 ; 2000-C1FF = unused (41472 B)
18 ; C200-FF7F = code memory (FRAM 15743 B)
19 ; FF80-FFFF = interrupt vectors (FRAM 127 B)
20 ; ----------------------------------------------
21 PAGESIZE .equ 512 ; MPU unit
22 ; ----------------------------------------------
23 ; FRAM ; INFO B, A, TLV
24 ; ----------------------------------------------
31 ; ----------------------------------------------
32 TLV_ORG .equ 01A00h ; Device Descriptor Info (Tag-Lenght-Value)
34 ; ----------------------------------------------
36 ; ----------------------------------------------
39 ; ----------------------------------------------
41 ; ----------------------------------------------
42 MAIN_ORG .equ 0C200h ; Code space start
43 SIGNATURES .equ 0FF80h ; JTAG/BSL signatures
44 JTAG_SIG1 .equ 0FF80h ; if 0 (electronic fuse=0) enable JTAG/SBW; must be reset by wipe.
45 JTAG_SIG2 .equ 0FF82h ; if JTAG_SIG1=0xAAAA, length of password string @ JTAG_PASSWORD
46 BSL_SIG1 .equ 0FF84h ;
47 BSL_SIG2 .equ 0FF86h ;
48 JTAG_PASSWORD .equ 0FF88h ; 256 bits
49 VECT_ORG .equ 0FFCEh ; FFCE-FFFF
51 BSL_PASSWORD .equ 0FFE0h ; 256 bits
52 ; ----------------------------------------------
56 ; ----------------------------------------------
57 ; Interrupt Vectors and signatures - MSP430FR57xx
58 ; ----------------------------------------------
61 ;;Start of JTAG and BSL signatures
62 ; .word 0 ; JTAG signature 1
63 ; .word 0 ; JTAG signature 2
64 ; .word 0 ; 5555h ; BSL signature 1 ; disable BSL
65 ; .word 0 ; BSL signature 2
67 ; .org JTAG_PASSWORD ;Start of JTAG PASSWORD
69 ; .org INTVECT ; FFCE-FFFF 24 vectors + reset
70 ; .word reset ; 0FFCEh - RTC_B
71 ; .word reset ; 0FFD0h - I/O Port 4
72 ; .word reset ; 0FFD2h - I/O Port 3
73 ; .word reset ; 0FFD4h - TB2_1
74 ; .word reset ; 0FFD6h - TB2_0
75 ; .word reset ; 0FFD8h - I/O Port 2
76 ; .word reset ; 0FFDAh - TB1_1
77 ; .word reset ; 0FFDCh - TB1_0
78 ; .word reset ; 0FFDEh - I/O Port 1
79 ;; .org BSL_PASSWORD ;Start of BSL PASSWORD
80 ; .word reset ; 0FFE0h - TA1_1
81 ; .word reset ; 0FFE2h - TA1_0
82 ; .word reset ; 0FFE4h - DMA
83 ; .word reset ; 0FFE6h - eUSCI_A1
84 ; .word reset ; 0FFE8h - TA0_1
85 ; .word reset ; 0FFEAh - TA0_0
86 ; .word reset ; 0FFECh - ADC10_B
87 ; .word reset ; 0FFEEh - eUSCI_B0
88 ; .word reset ; 0FFF0h - eUSCI_A0
89 ; .word reset ; 0FFF2h - Watchdog
90 ; .word reset ; 0FFF4h - TB0_1
91 ; .word reset ; 0FFF6h - TB0_0
92 ; .word reset ; 0FFF8h - COMP_D
93 ; .word reset ; 0FFFAh - userNMI
94 ; .word reset ; 0FFFCh - sysNMI
95 ; .word reset ; 0FFFEh - reset
99 ; ----------------------------------------------------------------------
100 ; MSP430FR5739 Peripheral File Map
101 ; ----------------------------------------------------------------------
102 SFR_SFR .equ 0100h ; Special function
103 PMM_SFR .equ 0120h ; PMM
104 FRAM_SFR .equ 0140h ; FRAM control
106 WDT_A_SFR .equ 015Ch ; Watchdog
108 SYS_SFR .equ 0180h ; SYS
109 REF_SFR .equ 01B0h ; REF
110 PA_SFR .equ 0200h ; PORT1/2
111 PB_SFR .equ 0220h ; PORT3/4
112 PJ_SFR .equ 0320h ; PORTJ
120 DMA_CTRL_SFR .equ 0500h
121 DMA_CHN0_SFR .equ 0510h
122 DMA_CHN1_SFR .equ 0520h
123 DMA_CHN2_SFR .equ 0530h
124 MPU_SFR .equ 05A0h ; memory protect unit
125 eUSCI_A0_SFR .equ 05C0h ; eUSCI_A0
126 eUSCI_A1_SFR .equ 05E0h ; eUSCI_A1
127 eUSCI_B0_SFR .equ 0640h ; eUSCI_B0
128 ADC10_B_SFR .equ 0700h
129 COMP_D_SFR .equ 08C0h
131 ; ----------------------------------------------------------------------
132 ; POWER ON RESET AND INITIALIZATION : LOCK I/O as high impedance state
133 ; ----------------------------------------------------------------------
135 SFRIFG1 .equ SFR_SFR + 2
136 SFRRPCR .equ SFR_SFR + 4
141 PM5CTL0 .equ PMM_SFR + 10h ; Power mode 5 control register 0
144 ; ----------------------------------------------------------------------
145 ; POWER ON RESET AND INITIALIZATION : WATCHDOG TIMER A
146 ; ----------------------------------------------------------------------
148 WDTCTL .equ WDT_A_SFR + 00h ; Watchdog Timer Control */
150 ; WDTCTL Control Bits
152 WDTHOLD .equ 0080h ; WDT - Timer hold
153 WDTCNTCL .equ 0008h ; WDT timer counter clear
155 ; ----------------------------------------------------------------------
156 ; POWER ON RESET AND INITIALIZATION : CLOCK SYSTEM
157 ; ----------------------------------------------------------------------
159 CSCTL0 .equ CS_SFR + 00h ; CS Control Register 0
160 CSCTL0_H .equ CS_SFR + 01h ; CS Control Register 0 high byte
161 CSCTL1 .equ CS_SFR + 02h ; CS Control Register 1
162 CSCTL2 .equ CS_SFR + 04h ; CS Control Register 2
163 CSCTL3 .equ CS_SFR + 06h ; CS Control Register 3
165 ; CSCTL0 Control Bits
166 CSKEY .equ 0A5h ; CS Password
167 ; CSCTL1 Control Bits
169 DCOFSEL0 .equ 0002h ; DCO frequency select Bit: 0
170 DCOFSEL1 .equ 0004h ; DCO frequency select Bit: 1
171 ; CSCTL2 Control Bits
172 ; SELA_LFXCLK .equ 0000h ; 0 : ACLK Source Select LFXCLK
173 SELA_LFXCLK .equ 0000h ; 0 : ACLK Source Select LFXCLK
174 SELA_VLOCLK .equ 0100h ; 1 ACLK Source Select VLOCLK 10kHz
175 SELS_DCOCLK .equ 0030h ; 3 SMCLK Source Select DCOCLK
176 SELM_DCOCLK .equ 0003h ; 3 MCLK Source Select DCOCLK
177 ; CSCTL3 Control Bits
178 DIVA_0 .equ 0000h ; ACLK Source Divider 0
179 DIVS_0 .equ 0000h ; SMCLK Source Divider 0
180 DIVM_0 .equ 0000h ; MCLK Source Divider 0
181 DIVA_2 .equ 0100h ; ACLK Source Divider 0
182 DIVS_2 .equ 0010h ; SMCLK Source Divider 0
183 DIVM_2 .equ 0001h ; MCLK Source Divider 0
184 DIVA_4 .equ 0200h ; ACLK Source Divider 0
185 DIVS_4 .equ 0020h ; SMCLK Source Divider 0
186 DIVM_4 .equ 0002h ; MCLK Source Divider 0
187 DIVA_8 .equ 0300h ; ACLK Source Divider 0
188 DIVS_8 .equ 0030h ; SMCLK Source Divider 0
189 DIVM_8 .equ 0003h ; MCLK Source Divider 0
190 DIVA_16 .equ 0400h ; ACLK Source Divider 0
191 DIVS_16 .equ 0040h ; SMCLK Source Divider 0
192 DIVM_16 .equ 0004h ; MCLK Source Divider 0
193 DIVA_32 .equ 0500h ; ACLK Source Divider 0
194 DIVS_32 .equ 0050h ; SMCLK Source Divider 0
195 DIVM_32 .equ 0005h ; MCLK Source Divider 0
197 ; ----------------------------------------------------------------------
198 ; POWER ON RESET AND INITIALIZATION : SYS REGISTERS
199 ; ----------------------------------------------------------------------
201 SYSRSTIV .equ SYS_SFR + 001Eh
204 ; ----------------------------------------------------------------------
205 ; POWER ON RESET AND INITIALIZATION : REF
206 ; ----------------------------------------------------------------------
208 REFCTL .equ REF_SFR + 00h ; REF Shared Reference control register 0
210 ; REFCTL0 Control Bits
211 REFON .equ 0001h ; REF Reference On
212 REFTCOFF .equ 0008h ; REF Temp.Sensor off
214 ; ----------------------------------------------------------------------
215 ; POWER ON RESET AND INITIALIZATION PAIN=PORT2:PORT1
216 ; ----------------------------------------------------------------------
218 PAIN .equ PA_SFR + 00h ; Port A INput
219 PAOUT .equ PA_SFR + 02h ; Port A OUTput
220 PADIR .equ PA_SFR + 04h ; Port A DIRection
221 PAREN .equ PA_SFR + 06h ; Port A Resistor ENable
222 PASEL0 .equ PA_SFR + 0Ah ; Port A SELection 0
223 PASEL1 .equ PA_SFR + 0Ch ; Port A SELection 1
224 PASELC .equ PA_SFR + 16h ; Port A SELection Complement
225 PAIES .equ PA_SFR + 18h ; Port A Interrupt Edge Select
226 PAIE .equ PA_SFR + 1Ah ; Port A Interrupt Enable
227 PAIFG .equ PA_SFR + 1Ch ; Port A Interrupt FlaG
229 P1IN .equ PA_SFR + 00h ; Port 1 INput
230 P1OUT .equ PA_SFR + 02h ; Port 1 OUTput
231 P1DIR .equ PA_SFR + 04h ; Port 1 DIRection
232 P1REN .equ PA_SFR + 06h ; Port 1 Resistor ENable
233 P1SEL0 .equ PA_SFR + 0Ah ; Port 1 SELection 0
234 P1SEL1 .equ PA_SFR + 0Ch ; Port 1 SELection 1
235 P1IV .equ PA_SFR + 0Eh ; Port 1 Interrupt Vector word
236 P1SELC .equ PA_SFR + 16h ; Port 1 SELection Complement
237 P1IES .equ PA_SFR + 18h ; Port 1 Interrupt Edge Select
238 P1IE .equ PA_SFR + 1Ah ; Port 1 Interrupt Enable
239 P1IFG .equ PA_SFR + 1Ch ; Port 1 Interrupt FlaG
241 P2IN .equ PA_SFR + 01h ; Port 2 INput
242 P2OUT .equ PA_SFR + 03h ; Port 2 OUTput
243 P2DIR .equ PA_SFR + 05h ; Port 2 DIRection
244 P2REN .equ PA_SFR + 07h ; Port 2 Resistor ENable
245 P2SEL0 .equ PA_SFR + 0Bh ; Port 2 SELection 0
246 P2SEL1 .equ PA_SFR + 0Dh ; Port 2 SELection 1
247 P2SELC .equ PA_SFR + 17h ; Port 2 SELection Complement
248 P2IES .equ PA_SFR + 19h ; Port 2 Interrupt Edge Select
249 P2IE .equ PA_SFR + 1Bh ; Port 2 Interrupt Enable
250 P2IFG .equ PA_SFR + 1Dh ; Port 2 Interrupt Flag
251 P2IV .equ PA_SFR + 1Eh ; Port 2 Interrupt Vector word
253 ; ----------------------------------------------------------------------
254 ; POWER ON RESET AND INITIALIZATION : PORT3/4
255 ; ----------------------------------------------------------------------
258 PBIN .set PB_SFR + 00h ; Port B Input
259 PBOUT .set PB_SFR + 02h ; Port B Output 1/0 or pullup/pulldown resistor
260 PBDIR .set PB_SFR + 04h ; Port B Direction
261 PBREN .set PB_SFR + 06h ; Port B Resistor Enable
262 PBSEL0 .set PB_SFR + 0Ah ; Port B Selection 0
263 PBSEL1 .set PB_SFR + 0Ch ; Port B Selection 1
264 PBSELC .set PB_SFR + 16h ; Port B Complement Selection
265 PBIES .set PB_SFR + 18h ; Port B Interrupt Edge Select
266 PBIE .set PB_SFR + 1Ah ; Port B Interrupt Enable
267 PBIFG .set PB_SFR + 1Ch ; Port B Interrupt Flag
269 P3IN .set PB_SFR + 00h ; Port 3 Input */
270 P3OUT .set PB_SFR + 02h ; Port 3 Output
271 P3DIR .set PB_SFR + 04h ; Port 3 Direction
272 P3REN .set PB_SFR + 06h ; Port 3 Resistor Enable
273 P3SEL0 .set PB_SFR + 0Ah ; Port 3 Selection 0
274 P3SEL1 .set PB_SFR + 0Ch ; Port 3 Selection 1
275 P3SELC .set PB_SFR + 16h ; Port 3 Complement Selection
276 P3IES .set PB_SFR + 18h ; Port 3 Interrupt Edge Select
277 P3IE .set PB_SFR + 1Ah ; Port 3 Interrupt Enable
278 P3IFG .set PB_SFR + 1Ch ; Port 3 Interrupt Flag
280 P4IN .set PB_SFR + 01h ; Port 4 Input */
281 P4OUT .set PB_SFR + 03h ; Port 4 Output
282 P4DIR .set PB_SFR + 05h ; Port 4 Direction
283 P4REN .set PB_SFR + 07h ; Port 4 Resistor Enable
284 P4SEL0 .set PB_SFR + 0Bh ; Port 4 Selection 0
285 P4SEL1 .set PB_SFR + 0Dh ; Port 4 Selection 1
286 P4SELC .set PB_SFR + 17h ; Port 4 Complement Selection
287 P4IES .set PB_SFR + 19h ; Port 4 Interrupt Edge Select
288 P4IE .set PB_SFR + 1Bh ; Port 4 Interrupt Enable
289 P4IFG .set PB_SFR + 1Dh ; Port 4 Interrupt Flag
291 ; ----------------------------------------------------------------------
292 ; POWER ON RESET AND INITIALIZATION : PORTJ
293 ; ----------------------------------------------------------------------
295 PJIN .set PJ_SFR + 00h ; Port B Input
296 PJOUT .set PJ_SFR + 02h ; Port B Output
297 PJDIR .set PJ_SFR + 04h ; Port B Direction
298 PJREN .set PJ_SFR + 06h ; Port B Resistor Enable
299 PJSEL0 .set PJ_SFR + 0Ah ; Port B Selection 0
300 PJSEL1 .set PJ_SFR + 0Ch ; Port B Selection 1
301 PJSELC .set PJ_SFR + 16h ; Port B Complement Selection
304 ; ----------------------------------------------------------------------
306 ; ----------------------------------------------------------------------
307 RTCCTL01 .equ RTC_B_SFR + 00h
308 RTCCTL0 .equ RTC_B_SFR + 00h
309 RTCCTL1 .equ RTC_B_SFR + 01h
310 RTCCTL23 .equ RTC_B_SFR + 02h
311 RTCPS0CTL .equ RTC_B_SFR + 08h
312 RTCPS1CTL .equ RTC_B_SFR + 0Ah
313 RTCPS .equ RTC_B_SFR + 0Ch
314 RTCIV .equ RTC_B_SFR + 0Eh
315 RTCSEC .equ RTC_B_SFR + 10h
316 RTCMIN .equ RTC_B_SFR + 11h
317 RTCHOUR .equ RTC_B_SFR + 12h
318 RTCDOW .equ RTC_B_SFR + 13h
319 RTCDAY .equ RTC_B_SFR + 14h
320 RTCMON .equ RTC_B_SFR + 15h
321 RTCYEAR .equ RTC_B_SFR + 16h
327 ; ----------------------------------------------------------------------
329 ; ----------------------------------------------------------------------
331 MPY .equ MPY_SFR + 00h ; Multiply16 Unsigned/Operand 1 */
332 MPYS .equ MPY_SFR + 02h ; Multiply16 signed/Operand 1
333 MAC .equ MPY_SFR + 04h ; MultiplyAccumulate16 Unsigned/Operand 1 */
334 MACS .equ MPY_SFR + 06h ; MultiplyAccumulate16 signed/Operand 1
335 OP2 .equ MPY_SFR + 08h ; Operand2_16 */
336 RESLO .equ MPY_SFR + 0Ah ; 16x16-bit result low - least significant word */
337 RESHI .equ MPY_SFR + 0Ch ; 16x16-bit result high */
338 SUMEXT .equ MPY_SFR + 0Eh ; 16x16-bit sum extension register
339 MPY32L .equ MPY_SFR + 10h ; Multiply32 Unsigned/Operand 1
340 MPY32H .equ MPY_SFR + 12h ; Multiply32 Unsigned/Operand 1
341 MPYS32L .equ MPY_SFR + 14h ; Multiply32 signed/Operand 1
342 MPYS32H .equ MPY_SFR + 16h ; Multiply32 signed/Operand 1
343 MAC32L .equ MPY_SFR + 18h ; MultiplyAccumulate32 Unsigned/Operand 1
344 MAC32H .equ MPY_SFR + 1Ah ; MultiplyAccumulate32 Unsigned/Operand 1
345 MACS32L .equ MPY_SFR + 1Ch ; MultiplyAccumulate32 signed/Operand 1
346 MACS32H .equ MPY_SFR + 1Eh ; MultiplyAccumulate32 signed/Operand 1
347 OP2L .equ MPY_SFR + 20h ; Multiply32 Operand 2
348 OP2H .equ MPY_SFR + 22h ; Multiply32 Operand 2
349 RES0 .equ MPY_SFR + 24h ; 32x32-bit result 0 - least significant word */
350 RES1 .equ MPY_SFR + 26h ; 32x32-bit result 1 */
351 RES2 .equ MPY_SFR + 28h ; 32x32-bit result 2 */
352 RES3 .equ MPY_SFR + 2Ah ; 32x32-bit result 3 */
353 MPY32CTL0 .equ MPY_SFR + 2Ch ; MPY32 control register 0
356 MPUCTL0 .equ MPU_SFR + 00h ; MPU control 0
357 MPUCTL1 .equ MPU_SFR + 02h ; MPU control 1
358 MPUSEG .equ MPU_SFR + 04h ; MPU Segmentation Register
359 MPUSAM .equ MPU_SFR + 06h ; MPU access management
363 ; ----------------------------------------------------------------------
365 ; ----------------------------------------------------------------------
366 TERM_CTLW0 .equ eUSCI_A0_SFR + 00h ; eUSCI_A0 Control Word Register 0
367 TERM_BRW .equ eUSCI_A0_SFR + 06h ; eUSCI_A0 Baud Word Rate 0
368 TERM_MCTLW .equ eUSCI_A0_SFR + 08h ; eUSCI_A0 Modulation Control
369 TERM_STATW .equ eUSCI_A0_SFR + 0Ah ; eUSCI_A0 status Word Register
370 TERM_RXBUF .equ eUSCI_A0_SFR + 0Ch ; eUSCI_A0 Receive Buffer
371 TERM_TXBUF .equ eUSCI_A0_SFR + 0Eh ; eUSCI_A0 Transmit Buffer
372 TERM_IE .equ eUSCI_A0_SFR + 1Ah ; eUSCI_A0 Interrupt Enable Register
373 TERM_IFG .equ eUSCI_A0_SFR + 1Ch ; eUSCI_A0 Interrupt Flags Register
375 TERM_VEC .equ 0FFF0h ; interrupt vector for eUSCI_A0
376 WAKE_UP .equ 1 ; UART RX interrupt
383 ; ----------------------------------------------------------------------
385 ; ----------------------------------------------------------------------
386 SD_CTLW0 .equ eUSCI_A1_SFR + 00h ; eUSCI_A1 Control Word Register 0
387 SD_BRW .equ eUSCI_A1_SFR + 06h ; eUSCI_A1 Baud Word Rate 0
388 SD_RXBUF .equ eUSCI_A1_SFR + 0Ch ; eUSCI_A1 Receive Buffer 8
389 SD_TXBUF .equ eUSCI_A1_SFR + 0Eh ; eUSCI_A1 Transmit Buffer 8
390 SD_IFG .equ eUSCI_A1_SFR + 1Ch ; eUSCI_A1 Interrupt Flags Register
396 ; ----------------------------------------------------------------------
397 ; eUSCI_B0 as TERMINAL I2C input
398 ; ----------------------------------------------------------------------
399 TERM_CTLW0 .equ eUSCI_B0_SFR + 00h ; USCI_B0 Control Word Register 0
400 TERM_CTLW1 .equ eUSCI_B0_SFR + 02h ; USCI_B0 Control Word Register 1
401 TERM_BRW .equ eUSCI_B0_SFR + 06h ; USCI_B0 Baud Word Rate 0
402 TERM_STATW .equ eUSCI_B0_SFR + 08h ; USCI_B0 Status Word
403 TERM_RXBUF .equ eUSCI_B0_SFR + 0Ch ; USCI_B0 Receive Buffer 8
404 TERM_TXBUF .equ eUSCI_B0_SFR + 0Eh ; USCI_B0 Transmit Buffer 8
405 TERM_I2COA0 .equ eUSCI_B0_SFR + 14h ; USCI_B0 I2C Own Address 0
406 TERM_ADDRX .equ eUSCI_B0_SFR + 1Ch ; USCI_B0 Received Address Register
407 TERM_I2CSA .equ eUSCI_B0_SFR + 20h ; USCI_B0 I2C Slave Address
408 TERM_IE .equ eUSCI_B0_SFR + 2Ah ; USCI_B0 Interrupt Enable
409 TERM_IFG .equ eUSCI_B0_SFR + 2Ch ; USCI_B0 Interrupt Flags Register
411 TERM_VEC .equ 0FFEEh ; interrupt vector for eUSCI_B0
412 WAKE_UP .equ 4 ; START interrupt
419 ; ----------------------------------------------------------------------
421 ; ----------------------------------------------------------------------
422 SD_CTLW0 .equ eUSCI_B0_SFR + 00h ; USCI_B0 Control Word Register 0
423 SD_BRW .equ eUSCI_B0_SFR + 06h ; USCI_B0 Baud Word Rate 0
424 SD_RXBUF .equ eUSCI_B0_SFR + 0Ch ; USCI_B0 Receive Buffer 8
425 SD_TXBUF .equ eUSCI_B0_SFR + 0Eh ; USCI_B0 Transmit Buffer 8
426 SD_IFG .equ eUSCI_B0_SFR + 2Ch ; USCI_B0 Interrupt Flags Register