Example Of Creating A Standard I/O Driver - Fujitsu F2MC-16L User Manual

Hide thumbs Also See for F2MC-16L:
Table of Contents

Advertisement

3.3

Example of Creating a Standard I/O Driver

Figure 3.3 shows an example of how to incorporate a standard I/O driver.
I Example of creating a standard I/O driver
IO
RS_DATA
RS_CTRL
RS_BOUD
RS_CTRL1
CSEG
;----------------------------------------
;
Define entry
;----------------------------------------
_stdout
_stdin
;---------------------------------------------------
; Serial data transmitter/receiver_iSDTR_FMB89371)
RCLR
RMODE
RMODE1
RBOUD
RCOMM
RSERR
RXRDY
TXRDY
UsartAccessDelayTime .equ10
;---------------------------------------------------
;
_uart_init(MB89371 initialize)
;
;
;
;
;
;
;
;---------------------------------------------------
_uart_init:
Figure 3.3 Example of Creating a Standard I/O Driver (Continued...)
.program
mb89371
.title
mb89371
#include scdef_s.inc
.section
IO_mb89371, IO, LOCATE=H'C0
.res.b
1
.res.b
1
.res.b
1
.res.b
1
.res.b
1
.res.b
1
.res.b
.section
CODE_mb89371, CODE, ALIGN=2
.export
_stdout, _stdin
.data.l
chrout
.data.l
chrinp
*
.equ
H'40
.equ
B'01001111
.equ
B'01000010
.equ
B'00000010
.equ
B'00010101
.equ
B'00111000
.equ
1
.equ
0
*PARAMETER*
None
*RETURN*
None
*ERROR CODE*
None
.export
_uart_init
mov
i:RS_CTRL, #0
call
delay
mov
i:RS_CTRL, #0
call
delay
mov
i:RS_CTRL, #0
call
delay
3.3 Example of Creating a Standard I/O Driver
;MB89371
;h'C0
data register
;h'C2
control register
;h'C4
371 baud rate register
;h'C6
371 mode register
; error reset
; mode (8251 compatible)
; mode (8251 compatible)
; 9600bps
; receive&transmit
; pattern of error
; status bit of receiver
; status bit of transmission
; wait time
; MB89371 reset
23

Advertisement

Table of Contents
loading

This manual is also suitable for:

F2mc-16xlF2mc-16F2mc-16hF2mc-16f

Table of Contents