Oki JOB60851 user manual Serial Port Structure

Page 62

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

Image 62
Contents JOB60851 Starter Kit Page OKI Contents Software Development Port 7 LED2 Control Introduction 1. Packing List Checking Packing ListIntroduction Host Environment Icons Precaution for Safe and Proper UseLabels Use only the specified voltage Do not pile objects on top of the productUse only the cables and other accessories provided Notation Putting Board through Its Paces Putting Board through its Paces SetupConfiguring JOB60851 Board Installing Development Software Installing USB Driver Running Default ProgramConnecting Board Running Flash Memory ProgramUse the -u command line option to view the USB pipe numbers Running User Programs Connecting Serial Cable Loading Terminal EmulatorSynchronizing Link Downloading and ExecutingOverwriting Flash Memory Contents System Specifications System Objective System SpecificationsSystem Components System ComponentsUse only the AC adapter included with the product Hardware SpecificationConnectors and Switches System Specifications Circuit Diagram 2. Circuit Diagram 1/2System Specifications Parts List 1. Parts List 1/24. Memory Map for Download Mode Memory Maps5. Memory Map for Flash Execution Mode 6. Memory Map for Application Mode 7. Memory Map for Flash Rewrite Mode 1. MSM66Q573 Pin Assignments 1/2 System LimitationsResources Uses System Specifications 1. MSM66Q573 Pin Assignments 2/2 P11-3/XTOUTSoftware Development Software Development USB BasicsBus Topology, Addresses, and Hot Plugging Specification Documents Core Specifications2. USB Data Flow Types Data Flow TypesBus Transactions 3. lists the USB packet types PacketsEndpoints Data Rates Device Class Specifications5. USB Device Class Specifications 4. Maximum Payload Sizes6. Device Request Types Device RequestsStandard Device Requests 7. Control Transfer Data PacketDevice Descriptors Device Descriptor for Bidirectional PrinterString descriptor Sample USB Firmware SetupSample Firmware Specifications 1. Sample USB FirmwareConfirming USB Compliance with Usbcheck.exe Sample USB Host SoftwareCompiling and Executing Sample USB Firmware Software Development Creating USB Mouse Demo Modifying Application Layer Receive Only Skeleton Simple Debugging Evaluating USB EquipmentUSB Bits and Pieces Device Controller Specifications1. ML60851C Specifications Overview of ML60851C OperationConnecting Microcontroller to USB Controller 1. ML60851C Block DiagramSpecial USB Considerations 2. Microcontroller with 16- or 32-Bit BusOther Tools Necessary Building a ProductVendor and Product IDs Products Limitations Port 7 LED2 Control Port 7 Registers Changing LED2 Color Sample Port 7 Control Program Standard I/O over Serial Link JOB60851 Board Standard I/OSerial Port 2. Serial Port StructureSerial port SIO0 Chapter Internal timer 9 and following Read and write Functions 3. read Operation4. write Operation Sample Program Using Standard Output Standard I/O ExamplesSample Program Using Standard Input Debugging with Standard I/O