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