221
CHAPTER 10 UART
●
Coding example
PDR4 EQU 000EH ; Address of the port data register
DDR4 EQU 000FH ; Address of the port direction register
SMC1 EQU 0020H ; Address of the serial mode control register 1
SRC EQU 0021H ; Address of the serial rate control register
SSD EQU 0022H ; Address of the serial status and data register
SIDR EQU 0023H ; Address of the serial input data register
SODR EQU 0023H ; Address of the serial output data register
SMC2 EQU 0024H ; Address of the serial mode control register 2
PSEN EQU SMC2:5 ; Define the baud rate generator operation
; start/stop bit
ILR2 EQU 007DH ; Address of the interrupt level setting register
INT_V DSEG ABS ; [DATA SEGMENT]
ORG 0FFF2H
IRQ4 DW WARI ; Set interrupt vector.
INT_V ENDS
;----------Main program-----------------------------------------------------------
CSEG ; [CODE SEGMENT]
:
CLRI ; Disable interrupts.
MOV ILR2,#11111101B ; Set interrupt level (level 1).
MOV SMC1,#01011011B ; Non-parity, 1 stop bit, operating mode 1,
asynchronous, clock output enabled, serial data
output enabled.
MOV SRC,#00010100B ; Proprietary baud rate generator selected.
Set the baud rate at 150 baud.
MOV SSD,#00101000B ; Disable transmit interrupt request, enable
receive interrupt request.
MOV SMC2,#00000011B ; Stop UART operation, select UART function and
select the input clock divider of 1/65.
MOV SODR,#13H ; Write transmit data (13H).
SETB PSEN ; Start UART operation.
SETI ; Enable interrupts.
:
;----------Interrupt processing routine-------------------------------------------
WARI PUSHW A ; Save A and T.
XCHW A,T
PUSHW A
:
User processing
:
POPW A ; Restore A and T.
XCHW A,T
POPW A
RETI
ENDS
;---------------------------------------------------------------------------------
END
Summary of Contents for MB89950 Series
Page 2: ......
Page 3: ...FUJITSU LIMITED F2MC 8L 8 BIT MICROCONTROLLER MB89950 950A Series HARDWARE MANUAL ...
Page 4: ......
Page 10: ...vi ...
Page 34: ...20 CHAPTER 2 HANDLING DEVICES ...
Page 134: ...120 CHAPTER 6 WATCHDOG TIMER ...
Page 236: ...222 CHAPTER 10 UART ...
Page 276: ...262 CHAPTER 12 LCD CONTROLLER DRIVER ...
Page 310: ...296 APPENDIX ...
Page 311: ...297 INDEX INDEX The index follows on the next page This is listed in alphabetic order ...
Page 316: ...302 INDEX ...
Page 318: ......