TERM_REN .equ P1REN
- .IFDEF TERMINALCTSRTS
+ .IFDEF TERMINAL4WIRES
; 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
-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
- 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
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
; 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
; 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