Oki user manual Standard I/O over Serial Link, JOB60851 Board Standard I/O

Page 61

Chapter 4 Software Development

4-5. Standard I/O over Serial Link

Section 2-.3 "Running User Programs" downloaded and executed a simple "Hello world!" program that displays its message on the personal computer screen.

C compilers for personal computers assign a keyboard to the standard input and a monitor to the standard output. The JOB60851 board has neither, but the programmer can provide substitutes as described in this section.

4-5-1. JOB60851 Board Standard I/O

The sample file stdrw573.c maps the JOB60851 board's standard input and output to a serial link joining a terminal emulator running on the host personal computer to an MSM66Q573 serial port on the JOB60851 board.

Standard input: Data from terminal emulator to MSM66Q573 RX pin

Standard output: Data to terminal emulator from MSM66Q573 TX pin

The functions required to create these mappings are read() and write(). Because of their tight links with hardware, these are known as low-level functions (as opposed to high-level functions without such dependencies).

Figure 4.5.1 summarizes the data flows for the resulting I/O.

C language I/O functions

Low-level standard I/O library functions read() and write()

MSM66Q573 serial port

Terminal emulator running on

personal computer

getchar(), putchar(), and similar standard library functions (high-level standard I/O library functions)

High-level output functions write their data with write(). High-level input functions read their data with read().

TX data from write(). RX data to read(). (Only SIO0 used)

Data received: from MSM66Q573 TX pin

Data transmitted: to MSM66Q573 RX pin

Figure 4.5.1. JOB60851 Board Standard I/O

Table 4.5.1 shows the dependencies on these two low-level functions by the higher-level I/O functions included in the standard libraries for the JOB60851 board C compiler (cc665s). Because of these dependencies, be sure to include the corresponding source code file (stdrw573.c) on the compiler command line.

page 4-26

Image 61
Contents JOB60851 Starter Kit Page OKI Contents Software Development Port 7 LED2 Control Introduction Introduction Checking Packing List1. Packing List Host Environment Labels Precaution for Safe and Proper UseIcons Do not pile objects on top of the product Use only the specified voltageUse only the cables and other accessories provided Notation Putting Board through Its Paces Configuring JOB60851 Board SetupPutting Board through its Paces Installing Development Software Connecting Board Running Default ProgramInstalling USB Driver Running Flash Memory ProgramUse the -u command line option to view the USB pipe numbers Running User Programs Loading Terminal Emulator Connecting Serial CableDownloading and Executing Synchronizing LinkOverwriting Flash Memory Contents System Specifications System Components System SpecificationsSystem Objective System ComponentsConnectors and Switches Hardware SpecificationUse only the AC adapter included with the product System Specifications 2. Circuit Diagram 1/2 Circuit DiagramSystem Specifications 1. Parts List 1/2 Parts ListMemory Maps 4. Memory Map for Download Mode5. Memory Map for Flash Execution Mode 6. Memory Map for Application Mode 7. Memory Map for Flash Rewrite Mode Resources Uses System Limitations1. MSM66Q573 Pin Assignments 1/2 P11-3/XTOUT System Specifications 1. MSM66Q573 Pin Assignments 2/2Software Development Bus Topology, Addresses, and Hot Plugging USB BasicsSoftware Development Core Specifications Specification DocumentsBus Transactions Data Flow Types2. USB Data Flow Types Endpoints Packets3. lists the USB packet types 5. USB Device Class Specifications Device Class SpecificationsData Rates 4. Maximum Payload SizesStandard Device Requests Device Requests6. Device Request Types 7. Control Transfer Data PacketDevice Descriptor for Bidirectional Printer Device DescriptorsString descriptor Sample Firmware Specifications SetupSample USB Firmware 1. Sample USB FirmwareCompiling and Executing Sample USB Firmware Sample USB Host SoftwareConfirming USB Compliance with Usbcheck.exe Software Development Creating USB Mouse Demo Modifying Application Layer Receive Only Skeleton Evaluating USB Equipment Simple Debugging1. ML60851C Specifications Device Controller SpecificationsUSB Bits and Pieces Overview of ML60851C Operation1. ML60851C Block Diagram Connecting Microcontroller to USB Controller2. Microcontroller with 16- or 32-Bit Bus Special USB ConsiderationsVendor and Product IDs Building a ProductOther Tools Necessary Products Limitations Port 7 Registers Port 7 LED2 ControlChanging LED2 Color Sample Port 7 Control Program JOB60851 Board Standard I/O Standard I/O over Serial Link2. Serial Port Structure Serial PortSerial port SIO0 Chapter Internal timer 9 and following 3. read Operation Read and write Functions4. write Operation Standard I/O Examples Sample Program Using Standard OutputDebugging with Standard I/O Sample Program Using Standard Input