Oki JOB60851 user manual Changing LED2 Color

Page 59

Chapter 4 Software Development

This concludes the description of Port 7. To use the port, manipulate the above registers within the program. For further details on registers for other ports and Port 7 operation, refer to Chapter 5 in the MSM6657 Family User's Manual.

4-4-2. Changing LED2 Color

The next page gives sample code (port7exp.c) that changes the color of the LED connected to Port 7.

This sample program calls std_init_573(), a support function for initializing the MSM66Q573 on the JOB60851 board, so be sure to include the corresponding source code file (stdrw573.c) on the compiler command line.

CL665S /T m66573 /H /WIN port7exp.c stdrw573.c l66ks50s.lib <Enter>

This sample program uses the secondary function, serial port, for Port 7's lowest four bits to send character strings to the terminal emulator running on the host personal computer by setting the lower halves of Port Mode (P7IO) and Port Secondary Function Control (P7SF) Registers to the following values.

P7IO

=

0xC2;

/*

1100_-010

*/

/* Configure Port 7 pin 1 for output */

P7SF

=

0x03;

/*

0000_-011

*/

/* Configure Port 7 pins 1 and 0 for secondary function */

See Section 4.5 "Standard I/O over Serial Link" below for a different approach.

page 4-24

Image 59
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 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 Putting Board through its Paces SetupConfiguring JOB60851 Board Installing Development Software Running Flash Memory Program Running Default ProgramConnecting Board Installing USB DriverUse 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 Components System ObjectiveUse only the AC adapter included with the product Hardware SpecificationConnectors and Switches 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 1. MSM66Q573 Pin Assignments 1/2 System LimitationsResources Uses P11-3/XTOUT System Specifications 1. MSM66Q573 Pin Assignments 2/2Software Development Software Development USB BasicsBus Topology, Addresses, and Hot Plugging Core Specifications Specification Documents2. USB Data Flow Types Data Flow TypesBus Transactions 3. lists the USB packet types PacketsEndpoints 4. Maximum Payload Sizes Device Class Specifications5. USB Device Class Specifications Data Rates7. Control Transfer Data Packet Device RequestsStandard Device Requests 6. Device Request TypesDevice Descriptor for Bidirectional Printer Device DescriptorsString descriptor 1. Sample USB Firmware SetupSample Firmware Specifications 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 Evaluating USB Equipment Simple DebuggingOverview of ML60851C Operation Device Controller Specifications1. ML60851C Specifications USB Bits and Pieces1. ML60851C Block Diagram Connecting Microcontroller to USB Controller2. Microcontroller with 16- or 32-Bit Bus Special USB ConsiderationsOther Tools Necessary Building a ProductVendor and Product IDs 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