Datasheet
5–8
; receive to get back to monitor
; with ESC
MOV #00h,&03DEh ; prepare software UART only for
; use in the ROM-Monitor
(&05DEh on the MSP430X33
ENDL JMP ENDL
UART BR &INT_RXTX
.sect “Int_Vect”,03E0h ; 05E0h 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
5.6 Receiving a Character
A character received using the RS232 interface is written from the INT_RXTX interrupt routine into memory
location 210h. After performing a reset, this memory location contains zeros. Each byte (not equal to zero)
received is stored in memory location 210h.
The content of memory location 210h is checked to determine whether or not a byte has been received. After
reading the byte, this location must be cleared. The next-received character will overwrite memory location
210h with a new byte.
The following code is an example of receiving a character and transmitting the same character back.
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
.text 0240h
RESET MOV #03DEh,SP ; #05DEh on the MSP430X33x
MOV #(WDTHold+WDT_wrkey),&WDTCTL ; stop Watchdog Timer
EINT ; enable interrupt
RX MOV #0AA55h,&03DEh ; select user interrupt vector
; table (&05DEh on MSP430X33x)
CALL &PREPRX ; prepare software UART for