Datasheet
5–9
; receive to get back to monitor
; with ESC
WAIT TST.B &RXBUF ; char. in rxbuf ?
JEQ WAIT ; no, then wait
TX MOV.B &RXBUF,&TXDATA ; put char to TXDATA
CLR.B &RXBUF
; BIC #01h,&200h ; use only if no special
; treatment of ESC is wanted
CALL &TXCHAR ; call transmit sub-routine in
; monitor
CALL &PREPRX ; prepare software UART for
; receive to get back to monitor
; with ESC
JMP WAIT
UART BR &INT_RXTX
.sect “Int_Vect”,03E0h ; 050Eh on the MSP430X33x
.word RESET ; Reset
.word RESET ; Reset
.word RESET ; Reset
.word RESET ; Reset
.word RESET ; Reset
.word RESET ; Reset
.word RESET ; Reset
.word RESET ; Reset
.word RESET ; Reset
.word RESET ; Reset
.word RESET ; Reset
.word RESET ; Reset
.word UART ; UART Routine
.word RESET ; Reset
.word RESET ; Reset
.word RESET ; Reset
.end
The next example receives a string with a maximum of 100 (100=64h) characters, stores them, and then
transmits them after the <ENTER> key is pressed.
WDTCTL .equ 0120h
WDTHold .equ 80h
WDT_wrkey .equ 05a00h
TXCHAR .equ 0FFD2h
TXTABLE .equ 0FFD4h
PREPRX .equ 0FFD6h
PREPTX .equ 0FFD8h
INT_RXTX .equ 0FFDAh
TXDATA .equ 020Eh
RXBUF .equ 0210h
cr .equ 0dh
.data 0300h
STRING: .space 0064h ; reserves receive buffer
.text 00240H
RESET: MOV #03DEh,SP ; #05DEh on the MSP430X33x
MOV #(WDTHold+WDT_wrkey),&WDTCTL ; stop Watchdog Timer