2 ; MSP430FR5738 minimal declarations for FastForth usage
6 DEVICE = "MSP430FR5738"
7 HMPY ; hardware multiplier
8 ; ----------------------------------------------
9 ; MSP430FR5738 MEMORY MAP
10 ; ----------------------------------------------
11 ; 0000-0FFF = peripherals (4 KB)
12 ; 1000-17FF = ROM bootstrap loader BSL0..3 (4x512 B)
13 ; 1800-187F = info B (FRAM 128 B)
14 ; 1880-18FF = info A (FRAM 128 B)
15 ; 1900-19FF = N/A (mirrored into info A/B)
16 ; 1A00-1A7F = TLV device descriptor info (FRAM 128 B)
17 ; 1A80-1BFF = unused (385 B)
18 ; 1C00-1FFF = RAM (1 KB)
19 ; 2000-C1FF = unused (41472 B)
20 ; C200-FF7F = code memory (FRAM 15743 B)
21 ; FF80-FFFF = interrupt vectors (FRAM 127 B)
22 ; ----------------------------------------------
23 PAGESIZE .equ 512 ; MPU unit
24 ; ----------------------------------------------
25 ; FRAM ; INFO B, A, TLV
26 ; ----------------------------------------------
33 ; ----------------------------------------------
34 TLV_ORG .equ 01A00h ; Device Descriptor Info (Tag-Lenght-Value)
36 ; ----------------------------------------------
38 ; ----------------------------------------------
41 ; ----------------------------------------------
43 ; ----------------------------------------------
44 MAIN_ORG .equ 0C200h ; Code space start
45 SIGNATURES .equ 0FF80h ; JTAG/BSL signatures
46 JTAG_SIG1 .equ 0FF80h ; if 0 (electronic fuse=0) enable JTAG/SBW; must be reset by wipe.
47 JTAG_SIG2 .equ 0FF82h ; if JTAG_SIG1=0xAAAA, length of password string @ JTAG_PASSWORD
48 BSL_SIG1 .equ 0FF84h ;
49 BSL_SIG2 .equ 0FF86h ;
50 I2CSLA0 .equ 0FFA2h ; UCBxI2COA0 default value address
51 I2CSLA1 .equ 0FFA4h ; UCBxI2COA1 default value address
52 I2CSLA2 .equ 0FFA6h ; UCBxI2COA2 default value address
53 I2CSLA3 .equ 0FFA8h ; UCBxI2COA3 default value address
54 JTAG_PASSWORD .equ 0FF88h ; 256 bits
55 VECT_ORG .equ 0FFCEh ; FFCE-FFFF
57 BSL_PASSWORD .equ 0FFE0h ; 256 bits
58 ; ----------------------------------------------
60 ; ----------------------------------------------
61 ; Interrupt Vectors and signatures - MSP430FR57xx
62 ; ----------------------------------------------
64 ;;Start of JTAG and BSL signatures
65 ; .word 0 ; JTAG signature 1
66 ; .word 0 ; JTAG signature 2
67 ; .word 0 ; 5555h ; BSL signature 1 ; disable BSL
68 ; .word 0 ; BSL signature 2
70 ; .org JTAG_PASSWORD ;Start of JTAG PASSWORD
72 ; .org VECT_ORG ; FFCE-FFFF 24 vectors + reset
73 ; .word reset ; $FFCE - RTC_B
74 ; .word reset ; $FFD0 - I/O Port 4
75 ; .word reset ; $FFD2 - I/O Port 3
76 ; .word reset ; $FFD4 - TB2_x
77 ; .word reset ; $FFD6 - TB2_0
78 ; .word reset ; $FFD8 - I/O Port 2
79 ; .word reset ; $FFDA - TB1_x
80 ; .word reset ; $FFDC - TB1_0
81 ; .word reset ; $FFDE - I/O Port 1
82 ;; .org BSL_PASSWORD ;Start of BSL PASSWORD
83 ; .word reset ; $FFE0 - TA1_x
84 ; .word reset ; $FFE2 - TA1_0
85 ; .word reset ; $FFE4 - DMA
86 ; .word reset ; $FFE8 - TA0_x
87 ; .word reset ; $FFEA - TA0_0
88 ; .word reset ; $FFEC - ADC10_B
89 ; .word reset ; $FFEE - eUSCI_B0
90 ; .word reset ; $FFF0 - eUSCI_A0
91 ; .word reset ; $FFF2 - Watchdog
92 ; .word reset ; $FFF4 - TB0_x
93 ; .word reset ; $FFF6 - TB0_0
94 ; .word reset ; $FFF8 - COMP_D
95 ; .word reset ; $FFFA - userNMI
96 ; .word reset ; $FFFC - sysNMI
97 ; .word reset ; $FFFE - reset
101 ; ----------------------------------------------------------------------
102 ; MSP430FR5739 Peripheral File Map
103 ; ----------------------------------------------------------------------
104 SFR_SFR .equ 0100h ; Special function
105 PMM_SFR .equ 0120h ; PMM
106 FRAM_SFR .equ 0140h ; FRAM control
108 WDT_A_SFR .equ 015Ch ; Watchdog
110 SYS_SFR .equ 0180h ; SYS
111 REF_SFR .equ 01B0h ; REF
112 PA_SFR .equ 0200h ; PORT1/2
113 PJ_SFR .equ 0320h ; PORTJ
121 DMA_CTRL_SFR .equ 0500h
122 DMA_CHN0_SFR .equ 0510h
123 DMA_CHN1_SFR .equ 0520h
124 DMA_CHN2_SFR .equ 0530h
125 MPU_SFR .equ 05A0h ; memory protect unit
126 eUSCI_A0_SFR .equ 05C0h ; eUSCI_A0
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 ; ----------------------------------------------------------------------
147 WDTCTL .equ WDT_A_SFR + 00h ; Watchdog Timer Control */
149 ; WDTCTL Control Bits
151 WDTHOLD .equ 0080h ; WDT - Timer hold
152 WDTCNTCL .equ 0008h ; WDT timer counter clear
154 ; ----------------------------------------------------------------------
155 ; POWER ON RESET AND INITIALIZATION : CLOCK SYSTEM
156 ; ----------------------------------------------------------------------
157 CSCTL0 .equ CS_SFR + 00h ; CS Control Register 0
158 CSCTL0_H .equ CS_SFR + 01h ; CS Control Register 0 high byte
159 CSCTL1 .equ CS_SFR + 02h ; CS Control Register 1
160 CSCTL2 .equ CS_SFR + 04h ; CS Control Register 2
161 CSCTL3 .equ CS_SFR + 06h ; CS Control Register 3
163 ; CSCTL0 Control Bits
164 CSKEY .equ 0A5h ; CS Password
165 ; CSCTL1 Control Bits
167 DCOFSEL0 .equ 0002h ; DCO frequency select Bit: 0
168 DCOFSEL1 .equ 0004h ; DCO frequency select Bit: 1
169 ; CSCTL2 Control Bits
170 ; SELA_LFXCLK .equ 0000h ; 0 : ACLK Source Select LFXCLK
171 SELA_LFXCLK .equ 0000h ; 0 : ACLK Source Select LFXCLK
172 SELA_VLOCLK .equ 0100h ; 1 ACLK Source Select VLOCLK 10kHz
173 SELS_DCOCLK .equ 0030h ; 3 SMCLK Source Select DCOCLK
174 SELM_DCOCLK .equ 0003h ; 3 MCLK Source Select DCOCLK
175 ; CSCTL3 Control Bits
176 DIVA_0 .equ 0000h ; ACLK Source Divider 0
177 DIVS_0 .equ 0000h ; SMCLK Source Divider 0
178 DIVM_0 .equ 0000h ; MCLK Source Divider 0
179 DIVA_2 .equ 0100h ; ACLK Source Divider 0
180 DIVS_2 .equ 0010h ; SMCLK Source Divider 0
181 DIVM_2 .equ 0001h ; MCLK Source Divider 0
182 DIVA_4 .equ 0200h ; ACLK Source Divider 0
183 DIVS_4 .equ 0020h ; SMCLK Source Divider 0
184 DIVM_4 .equ 0002h ; MCLK Source Divider 0
185 DIVA_8 .equ 0300h ; ACLK Source Divider 0
186 DIVS_8 .equ 0030h ; SMCLK Source Divider 0
187 DIVM_8 .equ 0003h ; MCLK Source Divider 0
188 DIVA_16 .equ 0400h ; ACLK Source Divider 0
189 DIVS_16 .equ 0040h ; SMCLK Source Divider 0
190 DIVM_16 .equ 0004h ; MCLK Source Divider 0
191 DIVA_32 .equ 0500h ; ACLK Source Divider 0
192 DIVS_32 .equ 0050h ; SMCLK Source Divider 0
193 DIVM_32 .equ 0005h ; MCLK Source Divider 0
195 ; ----------------------------------------------------------------------
196 ; POWER ON RESET AND INITIALIZATION : SYS REGISTERS
197 ; ----------------------------------------------------------------------
198 SYSUNIV .equ SYS_SFR + 001Ah
199 SYSSNIV .equ SYS_SFR + 001Ch
200 SYSRSTIV .equ SYS_SFR + 001Eh
202 ; ----------------------------------------------------------------------
203 ; POWER ON RESET AND INITIALIZATION : REF
204 ; ----------------------------------------------------------------------
205 REFCTL .equ REF_SFR + 00h ; REF Shared Reference control register 0
207 ; REFCTL0 Control Bits
208 REFON .equ 0001h ; REF Reference On
209 REFTCOFF .equ 0008h ; REF Temp.Sensor off
211 ; ----------------------------------------------------------------------
212 ; POWER ON RESET AND INITIALIZATION PAIN=PORT2:PORT1
213 ; ----------------------------------------------------------------------
214 PAIN .equ PA_SFR + 00h ; Port A INput
215 PAOUT .equ PA_SFR + 02h ; Port A OUTput
216 PADIR .equ PA_SFR + 04h ; Port A DIRection
217 PAREN .equ PA_SFR + 06h ; Port A Resistor ENable
218 PASEL0 .equ PA_SFR + 0Ah ; Port A SELection 0
219 PASEL1 .equ PA_SFR + 0Ch ; Port A SELection 1
220 PASELC .equ PA_SFR + 16h ; Port A SELection Complement
221 PAIES .equ PA_SFR + 18h ; Port A Interrupt Edge Select
222 PAIE .equ PA_SFR + 1Ah ; Port A Interrupt Enable
223 PAIFG .equ PA_SFR + 1Ch ; Port A Interrupt FlaG
225 P1IN .equ PA_SFR + 00h ; Port 1 INput
226 P1OUT .equ PA_SFR + 02h ; Port 1 OUTput
227 P1DIR .equ PA_SFR + 04h ; Port 1 DIRection
228 P1REN .equ PA_SFR + 06h ; Port 1 Resistor ENable
229 P1SEL0 .equ PA_SFR + 0Ah ; Port 1 SELection 0
230 P1SEL1 .equ PA_SFR + 0Ch ; Port 1 SELection 1
231 P1IV .equ PA_SFR + 0Eh ; Port 1 Interrupt Vector word
232 P1SELC .equ PA_SFR + 16h ; Port 1 SELection Complement
233 P1IES .equ PA_SFR + 18h ; Port 1 Interrupt Edge Select
234 P1IE .equ PA_SFR + 1Ah ; Port 1 Interrupt Enable
235 P1IFG .equ PA_SFR + 1Ch ; Port 1 Interrupt FlaG
237 P2IN .equ PA_SFR + 01h ; Port 2 INput
238 P2OUT .equ PA_SFR + 03h ; Port 2 OUTput
239 P2DIR .equ PA_SFR + 05h ; Port 2 DIRection
240 P2REN .equ PA_SFR + 07h ; Port 2 Resistor ENable
241 P2SEL0 .equ PA_SFR + 0Bh ; Port 2 SELection 0
242 P2SEL1 .equ PA_SFR + 0Dh ; Port 2 SELection 1
243 P2SELC .equ PA_SFR + 17h ; Port 2 SELection Complement
244 P2IES .equ PA_SFR + 19h ; Port 2 Interrupt Edge Select
245 P2IE .equ PA_SFR + 1Bh ; Port 2 Interrupt Enable
246 P2IFG .equ PA_SFR + 1Dh ; Port 2 Interrupt Flag
247 P2IV .equ PA_SFR + 1Eh ; Port 2 Interrupt Vector word
250 SD_SEL .equ PASEL1 ; word access, to configure UCB0
251 SD_REN .equ PAREN ; word access, to configure pullup resistors
252 BUS_SD .equ 04C0h ; pins P2.2 as UCB0CLK, P1.6 as UCB0SIMO & P1.7 as UCB0SOMI
259 SDA .equ 40h ; P1.6 = SDA
260 SCL .equ 80h ; P1.7 = SCL
268 TXD .equ 1 ; P2.0 = TX + FORTH Deep_RST pin
269 RXD .equ 2 ; P2.1 = RX
276 CD_SD .equ 8 ; P2.3 as SD Card Detect
277 CS_SD .equ 10h ; P2.4 as SD Chip Select
279 ; ----------------------------------------------------------------------
280 ; POWER ON RESET AND INITIALIZATION : PORTJ
281 ; ----------------------------------------------------------------------
282 PJIN .set PJ_SFR + 00h ; Port B Input
283 PJOUT .set PJ_SFR + 02h ; Port B Output
284 PJDIR .set PJ_SFR + 04h ; Port B Direction
285 PJREN .set PJ_SFR + 06h ; Port B Resistor Enable
286 PJSEL0 .set PJ_SFR + 0Ah ; Port B Selection 0
287 PJSEL1 .set PJ_SFR + 0Ch ; Port B Selection 1
288 PJSELC .set PJ_SFR + 16h ; Port B Complement Selection
290 ; ----------------------------------------------------------------------
292 ; ----------------------------------------------------------------------
293 RTCCTL01 .equ RTC_B_SFR + 00h
294 RTCCTL0 .equ RTC_B_SFR + 00h
295 RTCCTL1 .equ RTC_B_SFR + 01h
296 RTCCTL23 .equ RTC_B_SFR + 02h
297 RTCPS0CTL .equ RTC_B_SFR + 08h
298 RTCPS1CTL .equ RTC_B_SFR + 0Ah
299 RTCPS .equ RTC_B_SFR + 0Ch
300 RTCIV .equ RTC_B_SFR + 0Eh
301 RTCSEC .equ RTC_B_SFR + 10h
302 RTCMIN .equ RTC_B_SFR + 11h
303 RTCHOUR .equ RTC_B_SFR + 12h
304 RTCDOW .equ RTC_B_SFR + 13h
305 RTCDAY .equ RTC_B_SFR + 14h
306 RTCMON .equ RTC_B_SFR + 15h
307 RTCYEAR .equ RTC_B_SFR + 16h
312 ; ----------------------------------------------------------------------
314 ; ----------------------------------------------------------------------
316 MPY .equ MPY_SFR + 00h ; Multiply16 Unsigned/Operand 1 */
317 MPYS .equ MPY_SFR + 02h ; Multiply16 signed/Operand 1
318 MAC .equ MPY_SFR + 04h ; MultiplyAccumulate16 Unsigned/Operand 1 */
319 MACS .equ MPY_SFR + 06h ; MultiplyAccumulate16 signed/Operand 1
320 OP2 .equ MPY_SFR + 08h ; Operand2_16 */
321 RESLO .equ MPY_SFR + 0Ah ; 16x16-bit result low - least significant word */
322 RESHI .equ MPY_SFR + 0Ch ; 16x16-bit result high */
323 SUMEXT .equ MPY_SFR + 0Eh ; 16x16-bit sum extension register
324 MPY32L .equ MPY_SFR + 10h ; Multiply32 Unsigned/Operand 1
325 MPY32H .equ MPY_SFR + 12h ; Multiply32 Unsigned/Operand 1
326 MPYS32L .equ MPY_SFR + 14h ; Multiply32 signed/Operand 1
327 MPYS32H .equ MPY_SFR + 16h ; Multiply32 signed/Operand 1
328 MAC32L .equ MPY_SFR + 18h ; MultiplyAccumulate32 Unsigned/Operand 1
329 MAC32H .equ MPY_SFR + 1Ah ; MultiplyAccumulate32 Unsigned/Operand 1
330 MACS32L .equ MPY_SFR + 1Ch ; MultiplyAccumulate32 signed/Operand 1
331 MACS32H .equ MPY_SFR + 1Eh ; MultiplyAccumulate32 signed/Operand 1
332 OP2L .equ MPY_SFR + 20h ; Multiply32 Operand 2
333 OP2H .equ MPY_SFR + 22h ; Multiply32 Operand 2
334 RES0 .equ MPY_SFR + 24h ; 32x32-bit result 0 - least significant word */
335 RES1 .equ MPY_SFR + 26h ; 32x32-bit result 1 */
336 RES2 .equ MPY_SFR + 28h ; 32x32-bit result 2 */
337 RES3 .equ MPY_SFR + 2Ah ; 32x32-bit result 3 */
338 MPY32CTL0 .equ MPY_SFR + 2Ch ; MPY32 control register 0
340 MPUCTL0 .equ MPU_SFR + 00h ; MPU control 0
341 MPUCTL1 .equ MPU_SFR + 02h ; MPU control 1
342 MPUSEG .equ MPU_SFR + 04h ; MPU Segmentation Register
343 MPUSAM .equ MPU_SFR + 06h ; MPU access management
346 ; ----------------------------------------------------------------------
348 ; ----------------------------------------------------------------------
349 TERM_CTLW0 .equ eUSCI_A0_SFR + 00h ; eUSCI_A0 Control Word Register 0
350 TERM_BRW .equ eUSCI_A0_SFR + 06h ; eUSCI_A0 Baud Word Rate 0
351 TERM_MCTLW .equ eUSCI_A0_SFR + 08h ; eUSCI_A0 Modulation Control
352 TERM_STATW .equ eUSCI_A0_SFR + 0Ah ; eUSCI_A0 status Word Register
353 TERM_RXBUF .equ eUSCI_A0_SFR + 0Ch ; eUSCI_A0 Receive Buffer
354 TERM_TXBUF .equ eUSCI_A0_SFR + 0Eh ; eUSCI_A0 Transmit Buffer
355 TERM_IE .equ eUSCI_A0_SFR + 1Ah ; eUSCI_A0 Interrupt Enable Register
356 TERM_IFG .equ eUSCI_A0_SFR + 1Ch ; eUSCI_A0 Interrupt Flags Register
358 TERM_VEC .equ 0FFF0h ; interrupt vector for eUSCI_A0
359 WAKE_UP .equ 1 ; UART RX interrupt
366 ; ----------------------------------------------------------------------
367 ; eUSCI_B0 as TERMINAL I2C input
368 ; ----------------------------------------------------------------------
369 TERM_CTLW0 .equ eUSCI_B0_SFR + 00h ; USCI_B0 Control Word Register 0
370 TERM_CTLW1 .equ eUSCI_B0_SFR + 02h ; USCI_B0 Control Word Register 1
371 TERM_BRW .equ eUSCI_B0_SFR + 06h ; USCI_B0 Baud Word Rate 0
372 TERM_STATW .equ eUSCI_B0_SFR + 08h ; USCI_B0 Status Word
373 TERM_RXBUF .equ eUSCI_B0_SFR + 0Ch ; USCI_B0 Receive Buffer 8
374 TERM_TXBUF .equ eUSCI_B0_SFR + 0Eh ; USCI_B0 Transmit Buffer 8
375 TERM_I2COA0 .equ eUSCI_B0_SFR + 14h ; USCI_B0 I2C Own Address 0
376 TERM_ADDRX .equ eUSCI_B0_SFR + 1Ch ; USCI_B0 Received Address Register
377 TERM_I2CSA .equ eUSCI_B0_SFR + 20h ; USCI_B0 I2C Slave Address
378 TERM_IE .equ eUSCI_B0_SFR + 2Ah ; USCI_B0 Interrupt Enable
379 TERM_IFG .equ eUSCI_B0_SFR + 2Ch ; USCI_B0 Interrupt Flags Register
381 TERM_VEC .equ 0FFEEh ; interrupt vector for eUSCI_B0
382 WAKE_UP .equ 4 ; START interrupt
389 ; ----------------------------------------------------------------------
391 ; ----------------------------------------------------------------------
392 SD_CTLW0 .equ eUSCI_B0_SFR + 00h ; USCI_B0 Control Word Register 0
393 SD_BRW .equ eUSCI_B0_SFR + 06h ; USCI_B0 Baud Word Rate 0
394 SD_RXBUF .equ eUSCI_B0_SFR + 0Ch ; USCI_B0 Receive Buffer 8
395 SD_TXBUF .equ eUSCI_B0_SFR + 0Eh ; USCI_B0 Transmit Buffer 8
396 SD_IFG .equ eUSCI_B0_SFR + 2Ch ; USCI_B0 Interrupt Flags Register