OSDN Git Service

added the line number when an error occurs
[fast-forth/master.git] / MSP_EXP430FR4133.asm
index 26d6f55..ef5b42c 100644 (file)
@@ -197,20 +197,30 @@ TERM_SEL    .equ P1SEL0
 TERM_REN    .equ P1REN
 
 
 TERM_REN    .equ P1REN
 
 
-    .IFDEF TERMINALCTSRTS
+    .IFDEF TERMINAL4WIRES
 
 ; RTS output is wired to the CTS input of UART2USB bridge 
 
 ; RTS output is wired to the CTS input of UART2USB bridge 
-; CTS is not used by FORTH terminal
 ; configure RTS as output high to disable RX TERM during start FORTH
 
 HANDSHAKOUT .set    P2OUT
 HANDSHAKIN  .set    P2IN
 ; configure RTS as output high to disable RX TERM during start FORTH
 
 HANDSHAKOUT .set    P2OUT
 HANDSHAKIN  .set    P2IN
-RTS         .set    8       ; P2.3 bit position
-;CTS         .set    10h     ; P2.4 bit position
+
+RTS         .set    8           ; P2.3 bit position
 
             BIS #00800h,&PADIR  ; all pins as input else RTS P2.3
             BIS #-1,&PAREN      ; all input pins with resistor
 
             BIS #00800h,&PADIR  ; all pins as input else RTS P2.3
             BIS #-1,&PAREN      ; all input pins with resistor
-            MOV #-1,&PAOUT      ; that acts as pull up, and P2.3 as output HIGH
+
+        .IFDEF TERMINAL5WIRES
+
+CTS         .set    10h         ; P2.4 bit position
+
+            MOV #0EFFFh,&PAOUT  ; P2.3 (RTS) as output HIGH, P2.4 (CTS) I pull down, others I pull up, 
+
+        .ELSEIF
+
+            MOV #-1,&PAOUT      ; that acts as pull up resistor, and P2.3 (RTS) as output HIGH
+
+        .ENDIF  ; TERMINAL5WIRES
 
     .ELSEIF
 
 
     .ELSEIF
 
@@ -219,7 +229,7 @@ RTS         .set    8       ; P2.3 bit position
             MOV #-1,&PAOUT  ; OUT1 for all pins
             BIS #-1,&PAREN  ; all pins with pullup resistors
 
             MOV #-1,&PAOUT  ; OUT1 for all pins
             BIS #-1,&PAREN  ; all pins with pullup resistors
 
-    .ENDIF
+    .ENDIF  ; TERMINAL4WIRES
 
 ; ----------------------------------------------------------------------
 ; POWER ON RESET AND INITIALIZATION : PORT3/4
 
 ; ----------------------------------------------------------------------
 ; POWER ON RESET AND INITIALIZATION : PORT3/4
@@ -246,6 +256,11 @@ RTS         .set    8       ; P2.3 bit position
 
 ; reset state : Px{DIR,REN,SEL0,SEL1,SELC,IE,IFG,IV} = 0 ; Px{IN,OUT,IES} = ?
 
 
 ; reset state : Px{DIR,REN,SEL0,SEL1,SELC,IE,IFG,IV} = 0 ; Px{IN,OUT,IES} = ?
 
+; PORTC usage
+SD_SEL      .equ PCSEL0 ; to configure UCB0
+SD_REN      .equ PCREN  ; to configure pullup resistors
+SD_BUS      .equ 000Eh  ; pins P5.1 as UCB0CLK, P5.2 as UCB0SIMO & P5.3 as UCB0SOMI
+
 ; PORTx default wanted state : pins as input with pullup resistor
 
             MOV     #-1,&PCOUT    ; all pins OUT1
 ; PORTx default wanted state : pins as input with pullup resistor
 
             MOV     #-1,&PCOUT    ; all pins OUT1
@@ -255,6 +270,12 @@ RTS         .set    8       ; P2.3 bit position
 ; POWER ON RESET AND INITIALIZATION : PORT7/8
 ; ----------------------------------------------------------------------
 
 ; POWER ON RESET AND INITIALIZATION : PORT7/8
 ; ----------------------------------------------------------------------
 
+SD_CS       .equ 2        ; P8.1 as SD_CS     
+SD_CD       .equ 1        ; P8.0 as SD_CD
+SD_CDIN     .equ P8IN
+SD_CSOUT    .equ P8OUT
+SD_CSDIR    .equ P8DIR
+
 ; reset state : Px{DIR,REN,SEL0,SEL1,SELC,IE,IFG,IV} = 0 ; Px{IN,OUT,IES} = ?
 
 ; PORTx default wanted state : pins as input with pullup resistor
 ; reset state : Px{DIR,REN,SEL0,SEL1,SELC,IE,IFG,IV} = 0 ; Px{IN,OUT,IES} = ?
 
 ; PORTx default wanted state : pins as input with pullup resistor