!MSP430fr5738.pat
-! ----------------------------------------------
-! MSP430FR5738 MEMORY MAP
-! ----------------------------------------------
-! 0000-0FFF = peripherals (4 KB)
-! 1000-17FF = ROM bootstrap loader BSL0..3 (4x512 B)
-! 1800-187F = info B (FRAM 128 B)
-! 1880-18FF = info A (FRAM 128 B)
-! 1900-19FF = N/A (mirrored into info A/B)
-! 1A00-1A7F = TLV device descriptor info (FRAM 128 B)
-! 1A80-1BFF = unused (385 B)
-! 1C00-1FFF = RAM (1 KB)
-! 2000-C1FF = unused (41472 B)
-! C200-FF7F = code memory (FRAM 15743 B)
-! FF80-FFFF = interrupt vectors (FRAM 127 B)
-! ----------------------------------------------
-! ----------------------------------------------
-! FRAM ! INFO B, TLV
-! ----------------------------------------------
-INFO_ORG=\$1800!
-INFO_LEN=\$0100!
-INFOB_ORG=\$1800!
-INFOB_LEN=\$0080!
-INFOA_ORG=\$1880!
-INFOA_LEN=\$0080!
-TLV_ORG=\$1A00! Device Descriptor Info (Tag-Lenght-Value)
-TLV_LEN=\$0080!
-DEVICEID=\$1A04!
-! ----------------------------------------------
-! RAM
-! ----------------------------------------------
-RAM_ORG=\$1C00!
-RAM_LEN=\$0400!
-! ----------------------------------------------
-! FRAM
-! ----------------------------------------------
-MAIN_ORG=\$C200! Code space start
-xdodoes=\$C200! restore rDODOES: MOV #xdodoes,rDODOES
-xdocon=\$C20E! restore rDOCON: MOV #xdocon,rDOCON
-xdovar=\$C220! restore rDOVAR: MOV #xdocon,rDOVAR
-xdocol=\$C22A! restore rDOCOL: MOV #xdocol,rDOCOL only for DTC model = 1
-DODOES=\$1284! CALL rDODOES
-DOCON=\$1285! CALL rDOCON
-DOVAR=\$1286! CALL rDOVAR
-
-! to find DTC value, download \MSP430-FORTH\FastForthSpecs.4th
-! if DTC = 1, restore rDOCOL as this : MOV #xdocol,rDOCOL
-! if DTC = 2, restore rDOCOL as this : MOV #EXIT,rDOCOL
-! if DTC = 3, nothing to do, R7 is free for use.
-! ----------------------------------------------
-! Interrupt Vectors and signatures - MSP430FR5738
-! ----------------------------------------------
-FRAM_FULL=\$FF30! 80 bytes are sufficient considering what can be compiled in one line and WORD use.
-SIGNATURES=\$FF80! JTAG/BSL signatures
-JTAG_SIG1=\$FF80! if 0 (electronic fuse=0) enable JTAG/SBW; must be reset by wipe.
-JTAG_SIG2=\$FF82! if JTAG_SIG1=\$AAAA, length of password string @ JTAG_PASSWORD
-BSL_SIG1=\$FF84!
-BSL_SIG2=\$FF86!
-JTAG_PASSWORD=\$FF88! 256 bits
-BSL_PASSWORD=\$FFE0! 256 bits
-VECT_ORG=\$FFCE! FFCE-FFFF
-VECT_LEN=\$32!
-
-
-RTC_Vec=\$FFCE!
-P4_Vec=\$FFD0!
-P3_Vec=\$FFD2!
-TB2_x_Vec=\$FFD4! All others
-TB2_0_Vec=\$FFD6! only CCIFG0
-P2_Vec=\$FFD8!
-TB1_x_Vec=\$FFDA! All others
-TB1_0_Vec=\$FFDC! only CCIFG0
-P1_Vec=\$FFDE!
-TA1_x_Vec=\$FFE0! All others
-TA1_0_Vec=\$FFE2! only CCIFG0
-DMA_Vec=\$FFE4!
-!eUSCI_A1_Vec=\$FFE6!
-TA0_x_Vec=\$FFE8! All others
-TA0_0_Vec=\$FFEA! only CCIFG0
-ADC10_B_Vec=\$FFEC!
-eUSCI_B0_Vec=\$FFEE!
-eUSCI_A0_Vec=\$FFF0!
-TERM_Vec=\$FFF0!
-WDT_Vec=\$FFF2!
-TB0_x_Vec=\$FFF4! All others
-TB0_0_Vec=\$FFF6! only CCIFG0
-COMP_D_Vec=\$FFF8!
-USER_NMI_Vec=\$FFFA!
-SYS_NMI_Vec=\$FFFC!
-RST_Vec=\$FFFE!
-
-LPM4=\$F8! SR(LPM4+GIE)
-LPM3=\$D8! SR(LPM3+GIE)
-LPM2=\$98! SR(LPM2+GIE)
-LPM1=\$58! SR(LPM1+GIE)
-LPM0=\$18! SR(LPM0+GIE)
-
-
! ============================================
! SR bits :
! ============================================
\#UF10=\#\$400! = SR(10) User Flag 2
\#UF11=\#\$800! = SR(11) User Flag 3
+LPM4=\$F8! SR(LPM4+GIE)
+LPM3=\$D8! SR(LPM3+GIE)
+LPM2=\$98! SR(LPM2+GIE)
+LPM1=\$58! SR(LPM1+GIE)
+LPM0=\$18! SR(LPM0+GIE)
+
! ============================================
! PORTx, Reg bits :
! ============================================
NEXT=MOV \@R13+,R0! \ MOV @IP+,PC
SEMI=MOV \@R1+,R13\nMOV \@R13+,R0!
-! =================================================
-! MSP430FR57xx DEVICES HAVE SPECIFIC RAM ADDRESSES!
-! =================================================
-
-
+! ----------------------------------------------
+! MSP430FR5738 MEMORY MAP
+! ----------------------------------------------
+! 0000-0FFF = peripherals (4 KB)
+! 1000-17FF = ROM bootstrap loader BSL0..3 (4x512 B)
+! 1800-187F = info B (FRAM 128 B)
+! 1880-18FF = info A (FRAM 128 B)
+! 1A00-1A7F = TLV device descriptor info (FRAM 128 B)
+! 1C00-1FFF = RAM (1 KB)
+! C200-FF7F = code memory (FRAM 15743 B)
+! FF80-FFFF = interrupt vectors (FRAM 127 B)
+! ----------------------------------------------
-! You can check the addresses below by comparing their values in DTCforthMSP430FRxxxx.lst
-! those addresses are usable with the symbolic assembler
+! ============================================
+! BSL
+! ============================================
+BSL1=\$1000!
! ============================================
-! FastForth INFO(DCBA) memory map (256 bytes):
+! FRAM INFO
! ============================================
+INFO_ORG=\$1800!
+INFO_LEN=\$0100!
+! You can check the addresses below by comparing their values in DTCforthMSP430FRxxxx.lst
+! those addresses are usable with the symbolic assembler
+! ----------------------------------------------
+! FastForth INFO
+! ----------------------------------------------
INI_THREAD=\$1800! .word THREADS
TERMBRW_RST=\$1802! .word TERMBRW_RST
TERMMCTLW_RST=\$1804! .word TERMMCTLW_RST
HDLW_PrevLEN=24! previous LEN
HDLW_PrevORG=26! previous ORG
-
!OpenedFirstFile ; "openedFile" structure
HandleMax=5!
HandleLenght=28!
SDIB_I2CCNT=\$1CE2!
SDIB_ORG=\$1CE4!
+! ============================================
+! FRAM TLV
+! ============================================
+TLV_ORG=\$1A00! Device Descriptor Info (Tag-Lenght-Value)
+TLV_LEN=\$0080!
+DEVICEID=\$1A04!
! ============================================
-! FORTH RAM areas :
+! RAM
! ============================================
+RAM_ORG=\$1C00!
+RAM_LEN=\$0400!
+
+! ---------------------------------------
+! FORTH RAM areas :
+! ---------------------------------------
LSTACK_SIZE=\#16! words
PSTACK_SIZE=\#48! words
RSTACK_SIZE=\#48! words
TIB_LEN=\#84! bytes
HOLD_SIZE=\#34! bytes
-! ============================================
-! FastForth RAM memory map (= 1k):
-! ============================================
-
+! ---------------------------------------
+! FastForth RAM memory map (= 1k)
+! ---------------------------------------
LEAVEPTR=\$1C00! \ Leave-stack pointer, init by QUIT
LSATCK=\$1C00! \ leave stack, grow up
PSTACK=\$1C80! \ parameter stack, grow down
BASEADR=\$1DDC! numeric base, must be defined before first reset !
LINE=\$1DDE! line in interpretation, activated with NOECHO, desactivated with ECHO
! ---------------------------------------
-!1DE0! 28 RAM bytes free
+!1DE0! 28 RAM bytes free
! ---------------------------------------
! ---------------------------------------
! ============================================
-! Special Fonction Registers (SFR)
+! FRAM MAIN
! ============================================
+MAIN_ORG=\$C200! Code space start
+
+SLEEP=\$C200!
+BODYSLEEP=\$C204! address of SLEEP by default
+INIT_VECT=\$C20E! default init for RST and INT vectors, comprizing default terminal INT
+LIT=\$C224!
+NEXT_ADR=\$C22C!
+XSQUOTE=\$C22E!
+QTBRAN=\$C242!
+BRAN=\$C248!
+QFBRAN=\$C24C!
+SKIPBRAN=\$C252!
+XDO=\$C256!
+XPLOOP=\$C266!
+XLOOP=\$C278!
+MUSMOD=\$C27E! unsigned 32/16 division
+SETIB=\$C2C4! Set Input Buffer with org len values, reset >IN
+REFILL=\$C2D4! accept one line from input and leave org len of input buffer
+CIB_ADR=\$C2E4! contents currently TIB_ORG; may be redirected to SDIB_ORG
+XDODOES=\$C2EC! restore rDODOES: MOV #XDODOES,rDODOES
+XDOCON=\$C2FA! restore rDOCON: MOV #XDOCON,rDOCON
+XDOCOL=\$C306! restore rDOCOL: MOV #XDOCOL,rDOCOL only for DTC model = 1
+
+DODOES=\$1284! CALL rDODOES
+DOCON=\$1285! CALL rDOCON
+DOVAR=\$1286! CALL rDOVAR
+DOCOL=\$1287! CALL rDOCOL only for DTC model = 1, 2
+
+! to find DTC value, download \MSP430-FORTH\FastForthSpecs.4th
+! if DTC = 1, restore rDOCOL as this : MOV #xdocol,rDOCOL
+! if DTC = 2, restore rDOCOL as this : MOV #EXIT,rDOCOL
+! if DTC = 3, nothing to do, R7 is free for use.
+! ----------------------------------------------
+! Interrupt Vectors and signatures - MSP430FR5738
+! ----------------------------------------------
+FRAM_FULL=\$FF30! 80 bytes are sufficient considering what can be compiled in one line and WORD use.
+SIGNATURES=\$FF80! JTAG/BSL signatures
+JTAG_SIG1=\$FF80! if 0 (electronic fuse=0) enable JTAG/SBW; must be reset by wipe.
+JTAG_SIG2=\$FF82! if JTAG_SIG1=\$AAAA, length of password string @ JTAG_PASSWORD
+BSL_SIG1=\$FF84!
+BSL_SIG2=\$FF86!
+JTAG_PASSWORD=\$FF88! 256 bits
+BSL_PASSWORD=\$FFE0! 256 bits
+VECT_ORG=\$FFCE! FFCE-FFFF
+VECT_LEN=\$32!
+RTC_Vec=\$FFCE!
+P4_Vec=\$FFD0!
+P3_Vec=\$FFD2!
+TB2_x_Vec=\$FFD4! All others
+TB2_0_Vec=\$FFD6! only CCIFG0
+P2_Vec=\$FFD8!
+TB1_x_Vec=\$FFDA! All others
+TB1_0_Vec=\$FFDC! only CCIFG0
+P1_Vec=\$FFDE!
+TA1_x_Vec=\$FFE0! All others
+TA1_0_Vec=\$FFE2! only CCIFG0
+DMA_Vec=\$FFE4!
+!eUSCI_A1_Vec=\$FFE6!
+TA0_x_Vec=\$FFE8! All others
+TA0_0_Vec=\$FFEA! only CCIFG0
+ADC10_B_Vec=\$FFEC!
+eUSCI_B0_Vec=\$FFEE!
+eUSCI_A0_Vec=\$FFF0!
+TERM_Vec=\$FFF0!
+WDT_Vec=\$FFF2!
+TB0_x_Vec=\$FFF4! All others
+TB0_0_Vec=\$FFF6! only CCIFG0
+COMP_D_Vec=\$FFF8!
+USER_NMI_Vec=\$FFFA!
+SYS_NMI_Vec=\$FFFC!
+RST_Vec=\$FFFE!
+
+! ============================================
+! Special Fonction Registers (SFR)
+! ============================================
SFRIE1=\$100! \ SFR enable register
SFRIFG1=\$102! \ SFR flag register