Chapter 4 Software Development

Table 4.5.1. Library Functions Calling read() and write()

I/O Library Function

Required Low-Level Function

 

 

fgetc,fgets,fscanf,getc,getchar,gets,scanf

read

 

 

fflush,fprintf,fputc,fputs,fwrite,printf,putc,putchar,puts,

write

vfprintf,vprintf

 

 

 

For further details on these and other library functions, refer to the RTL665S Run-Time Library Reference.

The source code file stdrw573.c contains the source code and settings for these two low-level functions. Including it on the compiler command line provides the user program with access to the standard library I/O functions.

Command Line

cl665s /T m66573 /H /WIN [user program] stdrw573.c l66ks50s.lib <enter>

4.5.2Serial Port

Including the source code file stdrw573.c provides the user program with access to this standard I/O. This Section discusses the MSM66Q573 internal serial port that the JOB60851 board uses for this purpose, with the structure outlined in Figure 4.5.2.

 

MSM66Q573 internal bus

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I/O data

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SIO0 (UART)

 

 

 

 

 

Transmit data: TXD0 (Port7_1)

Baud rate

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I/O control

 

 

 

 

 

generator

 

 

 

 

 

 

 

 

Receive data: RXD0 (Port7_0)

 

 

 

circuitry I/O

 

 

 

 

 

 

 

 

 

 

 

 

(BRG)

 

 

 

 

 

 

 

 

External clock: RXC0 (Port7_2)

 

 

 

 

 

 

 

 

 

 

 

buffers

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 4.5.2. Serial Port Structure

Port 7_1 on the is the MSM66Q573 TX pin transmitting the standard output data to the terminal emulator running on the host personal computer; Port 7_0, the RX pin receiving the standard input data in the reverse direction. (The JOB60851 board does not use Port 7_2.)

The baud rate generator (BRG) uses the overflow signal from MSM66Q573 internal timer 3.

page 4-27

Page 62
Image 62
Oki JOB60851 user manual Serial Port Structure