Oki JOB60851 user manual Creating USB Mouse Demo

Page 48

Chapter 4 Software Development

4-2-6. Creating USB Mouse Demo

The next stage involves modifying the sample program slightly so that the JOB60851 board emulates a USB mouse. Use the following steps to modify the source code and then recompile.

(1)Modifying source code

The file Include\Class.h under the work directory specifies as its default the device class BULK_IN_OUT_AND_INT. Comment out that #define and uncomment the HID_MOUSE_ONLY one.

/*

1. Specify device class

*/

 

 

#define

HID_MOUSE_ONLY

 

/* Enable this one */

/*

#define

BULK_AND_HID_MOUSE

*/

 

/*

#define

HID_MOUSE_AND_BULK

*/

 

/*

#define

BULK_IN_OUT_AND_INT

*/

/* Disable this default */

/*

#define

COMPLEX_ALTERNATE

*/

 

/*

#define

PRINTER

*/

 

/*

#define

ISO_TEST

*/

 

(2)Compiling

The supplied make files and compiler do not check for dependencies on files in the include directory, so first clean the .HEX and .OBJ files from the work directory and then run the make utility.

n make clean <Enter> or maker clean <Enter>

nmake <Enter> or maker <Enter>

Successful compilation produces the file USB.HEX in the work directory. Check the link map file USB.M66 in the same directory for error messages from the linker.

(3)Setting up mouse demo

The sample mouse program emulates a USB mouse in response to commands received over a serial link to the JOB60851 board. It therefore requires connecting both the USB cable and, using the procedure in subsections 1-3 in Section 2.3 "Running User Programs," the serial cable.

(4)Downloading program and installing mouse driver

To test USB.HEX, download it to the JOB60851 board and execute it there with the procedure in Section 2.3 "Running User Programs."

When the JOB60851 board connects the emulated USB mouse to the personal computer, Windows 98 automatically launches its driver wizard, so install the HID mouse driver from the CD-ROM.

page 4-13

Image 48
Contents JOB60851 Starter Kit Page OKI Contents Software Development Port 7 LED2 Control Introduction Checking Packing List Introduction1. Packing List Host Environment Precaution for Safe and Proper Use LabelsIcons 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 Setup Configuring JOB60851 BoardPutting Board through its Paces Installing Development Software Running Default Program Connecting BoardInstalling USB Driver 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 Specifications System ComponentsSystem Objective System ComponentsHardware Specification Connectors and SwitchesUse only the AC adapter included with the product 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 System Limitations Resources Uses1. MSM66Q573 Pin Assignments 1/2 System Specifications 1. MSM66Q573 Pin Assignments 2/2 P11-3/XTOUTSoftware Development USB Basics Bus Topology, Addresses, and Hot PluggingSoftware Development Specification Documents Core SpecificationsData Flow Types Bus Transactions2. USB Data Flow Types Packets Endpoints3. lists the USB packet types Device Class Specifications 5. USB Device Class SpecificationsData Rates 4. Maximum Payload SizesDevice Requests Standard Device Requests6. Device Request Types 7. Control Transfer Data PacketDevice Descriptors Device Descriptor for Bidirectional PrinterString descriptor Setup Sample Firmware SpecificationsSample USB Firmware 1. Sample USB FirmwareSample USB Host Software Compiling and Executing Sample USB FirmwareConfirming USB Compliance with Usbcheck.exe Software Development Creating USB Mouse Demo Modifying Application Layer Receive Only Skeleton Simple Debugging Evaluating USB EquipmentDevice Controller Specifications 1. ML60851C SpecificationsUSB Bits and Pieces Overview of ML60851C OperationConnecting Microcontroller to USB Controller 1. ML60851C Block DiagramSpecial USB Considerations 2. Microcontroller with 16- or 32-Bit BusBuilding a Product Vendor and Product IDsOther Tools Necessary Products Limitations Port 7 LED2 Control Port 7 RegistersChanging 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