Page 1
JOB60851 Starter Kit User ’ s Manual Version 1.07 (July 27, 2000) Oki Electric Industry Co., Ltd.. Technocollage Inc...
Page 3
Oki assumes no responsibility or liability whatsoever for any failure or unusual or unexpected operation resulting from misuse, neglect, improper installation, repair, alteration or accident,...
1-3. Precaution for Safe and Proper Use ...1-4 2. Putting Board through its Paces ... 2-1 2-1. Setup ...2-2 2-1-1. Configuring JOB60851 Board... 2-2 2-1-2. Installing Development Software ... 2-3 2-1-3. Connecting Board ... 2-4 2-2. Running Default Program ...2-4 2-2-1.
Page 5
3-2-1. Connectors and Switches ... 3-3 3-2-2. Circuit Diagram ... 3-5 3-2-3. Parts List ... 3-7 3-2-4. Memory Maps ... 3-8 3-3. System Limitations...3-12 3-3-1. Resources Uses ... 3-12 4. Software Development ... 4-1 4-1. USB Basics ...4-2 4-1-1. Bus Topology, Addresses, and Hot Plugging... 4-2 4-1-2.
Page 6
4-4-1. Port 7 Registers ... 4-22 4-4-2. Changing LED2 Color ... 4-23 4-5. Standard I/O over Serial Link...4-26 4-5-1. JOB60851 Board Standard I/O... 4-26 4-5-2. Serial Port ... 4-27 4-5-3. read() and write() Functions... 4-29 4-5-4. Standard I/O Examples... 4-31...
Page 8
1-1. Checking Packing List Thank you for purchasing the JOB60851 Starter Kit. The JOB60851 Starter Kit drives an Oki Electric Industry ML60851 Universal Serial Bus (USB) device controller with an Oki MSM66Q573 microcontroller to create a starting point for developing products with built-in USB support.
USB interface fully compatible with Microsoft Windows 98 USB driver Terminal emulation software The compiler package will also run under Microsoft Windows 95 and MS-DOS version 5.0 or later, but the JOB60851 board will not be accessible as a USB device. Chapter 1 Introduction page 1-3...
Chapter 1 Introduction 1-3. Precaution for Safe and Proper Use This User’s Guide uses various labels and icons that serve as your guides to operating this product safely and properly so as to prevent death, personal injury, and property damage. The following table lists these labels and their definitions.
Page 11
Chapter 1 Introduction Please read this page before using the product. Warning Use only the specified voltage. Using the wrong voltage risks fire and electrical shock. At the first signs of smoke, an unusual smell, or other problems, unplug the emulator and disconnect all external power cords. Continued use risks fire and electrical shock.
Page 12
Chapter 1 Introduction Please read this page before using the product. Do not use this product on an unstable or inclined base as it can fall or overturn, producing injury. Do not use this product in an environment exposing it to excessive vibration, strong magnetic fields, or corrosive gases.
Page 13
Notation This manual utilizes the following notational conventions for convenience. n Caution n n Reference n n Application Example n (note ) n Note x n The descriptions below indicate keyboard keys with capitalized names inside angle brackets. Examples <Enter> Enter (or Return) key <Space>...
Configuring JOB60851 Board Make sure that the switches and jumpers numbered 4, 7, 8, and 9 in Figure 2.1.1 are all in their factory default positions, B. Figure 2.1.1. JOB60851 Board, Top View (1) AC adapter jack (2) Power switch...
2-1-2. Installing Development Software (1) Install CC665S compiler package 1. Create a directory for the package--c:\665s, for example. 2. Copy the contents of the CD-ROM directory \package\cc665s to that directory. readme.txt c665spak.exe mac66k.exe rtl665s.exe tgt665s.exe 3. In an MS-DOS compatibility box, switch to the above directory and run the .EXE files, self- expanding archives that automatically extract compiler files to the appropriate subdirectories.
Bulkusb.sys Bulkusb.inf Connect the JOB60851 board as described in Section 2.1.3 above and apply power to it. When Windows 98 automatically detects the new device, install the driver using the Windows 98 driver wizard. (Have the Windows 98 CD-ROM or CABs handy.) 2-2-2.
Page 18
-c [n] where n is number of iterations (default=1, 0 is infinity) The options and the meanings are: -i [s] To specify the input pipe name the device(JOB60851) to the host direction. -o [s] To specify the output pipe name the host to the device(JOB60851) direction.
For more detailed operation please refer to readme.txt file in host driver (Package\Host) directory. 2-3. Running User Programs This section gives the procedures for downloading a program over a serial link to the JOB60851 board and then running it. page 2-6 <Enter>...
Loading Terminal Emulator Checking serial link operation requires HyperTerminal, Tera Term Pro, or other terminal emulator configured to use the following communications parameters for the serial port (COM1 or COM2) with the serial cable to the JOB60851 board. Speed Word size...
Once the terminal emulator is configured, turn on the power (#2 in Figure 2.1.1). 2-3-3. Synchronizing Link Before communicating with the JOB60851 board, check that it and the development host are using the same data transfer speed by downloading the file !zero.dat in the work directory--c:\test in our example.
As already mentioned in Section 2.2 above, the board ships with a test program in the MSM66Q573 Flash memory. This may be overwritten, however, with a PW66K Flash programmer. For further details about flash programmer, contact Oki Electric Device Sales or distributor. Chapter 2 Putting Board through its Paces...
Chapter 3 System Specifications 3-1. System Components 3-1-1. System Objective The JOB60851 board's primary objective is lowering the threshold for developing new USB devices. 3-1-2. System Components The JOB60851 board has the components shown in Figure 3.1.1. JOB60851 MSM66Q573 Flash TERMINAL Figure 3.1.1.
AC adapter connections. (3) Flash writer connector This set of pins connects to the PW66K Flash writer for rewriting the program in the MSM66Q573 Flash memory. For further details, contact Oki Electric Device Sales at +81-3- 5445-6027. Chapter 3 System Specifications...
Page 26
JOB60851 board to a terminal emulator running on the host personal computer. n Note n Always include the JOB60851 serial number with any queries. It is printed in black ink on the underside of the board, near the serial connector.
Page 28
Chapter 3 System Specifications Figure 3.2.3. Circuit Diagram (2/2) n Note n An electronic version of this circuit diagram is available in the CD-ROM directory \document\job60851 as the MS Power Point document cir_j851.ppt. page 3-6...
3-2-3. Parts List Tables 3.2.1 and 3.2.2 list the parts on the JOB60851 board. Item Quantity Reference C13,C15,C16,C17,C18,C19,C20, C21,C22,C23 C24,C25,C26,C27,C28 C4,C5,C8 C1,C10,C11,C12 R1,R2,R3,R4,R7,R8,R12,R17,R18,R19 R30,R31,R32,R33,R34 R9,R22,R23 R10,R11,R15 R13,R14 R16,R20,R21,R24,R26,R27 R28,R29 RA1,RA2,RA3,RA4,RA5 D1,D2,D3 FB1,FB2 IC6,IC11 IC8,IC12 LED1,LED2 CN1,CN2 UART-CN Chapter 3 System Specifications Table 3.2.1.
Chapter 3 System Specifications 3-2-4. Memory Maps This Section gives code and data memory maps for the various JOB60851 operation modes. (1) Download mode This mode maps the code memory to the EPROM and the data memory to program RAM and Flash memory.
Page 31
(2) Flash execution mode This mode maps the code memory to the Flash memory and the data memory to work RAM. It executes the program in Flash memory. Cutting the power does not erase the program, which starts automatically when the power is next applied. Loader Mode2 m emory map ( Load_Sel/ = L ) Program Memory...
Page 32
Chapter 3 System Specifications (3) Application mode This mode maps the code memory to program RAM and the data memory to work RAM. It executes the program in program RAM. AP Mode 1 memory map Program Memory 0:0000 h Ext._SRAM(A) (AP Program) 0:7 FFFh Ext._SRAM(B)
Page 33
(4) Flash rewrite mode This mode maps the code memory to the Flash memory and the data memory to work RAM. It executes the program in Flash memory. Cutting the power does not erase the program, which starts automatically when the power is next applied. AP Mode2 m emory map Program Memory 0:0000h...
3-3. System Limitations 3-3-1. Resources Uses The user connectors (CN1 and CN2) on the JOB60851 board make available to the user application system almost all onboard MSM66Q573 microcontroller pins and thus most microcontroller functionality. The JOB60851 board, however, monopolizes certain microcontroller resources in running its own system, making them unavailable to the developer.
(Series A) mechanically different from those on the upstream ports on devices (Series B). The JOB60851 board is for developing devices, not hubs, so features a Series B connector for connection to the Series A one on the root or other hub.
4-1-2. Specification Documents USB specifications have been established by the USB Implementers Forum. These and other materials are available on the World Wide Web at the following URLs. Forum top page Developers section Developer documentation Device classes Compliance testing The USB Implementers Forum augments the core specifications, the document specifying characteristics shared by all USB devices, with separate Universal Serial Bus Device Class Specifications for specific device types.
Chapter 4 Software Development Chapter 10 USB Host: Hardware and Software Chapter 11 Hub Specification Chapter 4 provides a firm grounding in the USB core specifications. All developers of USB equipment must study Chapter 5 very carefully. Hardware developers must read Chapter 7; firmware developers, Chapters 8 and 9.
Figure 4.1.2. Two USB Transactions All bus transactions begin with a token packet from the host. Devices never initiate data transfers on their own. The host controller is in charge of scheduling all traffic on the bus. It schedules the appropriate transactions for the four data flow types at 1-ms intervals, which the USB documentation calls frames.
D+ line to the 3.3-volt power supply voltage with a 1.5-k low speed does the same with the D- line. The ML60851C USB controller operates exclusively at 12 Mb/s, so the JOB60851 board includes only the D+ pull-up resistor.
4-1-10. Device Requests Device requests represent commands from the host to USB functions using control transfers. The USB function parses the request, performs the necessary action, and returns the appropriate response. There are three types of device requests. Table 4.1.6. Device Request Types Standard Requests that all USB devices must support because they hold the key to hot plugging (a.k.a.
Chapter 4 Software Development SET_DESCRIPTOR GET_CONFIGURATION SET_CONFIGURATION GET_INTERFACE SET_INTERFACE SYNCH_FRAME 4-1-12. Device Descriptors When a USB device first connects to the bus, it reports its attributes to the host with a device descriptor. Figure 4.1.3 illustrates the hierarchical structure of this data structure with the device descriptor for a bidirectional printer.
Page 44
Device release number in binary coded decimal Index numbers for string descriptors describing manufacturer, product, and device serial number Number of possible configurations (2) Configuration descriptor Total size of this descriptor in bytes Number of interfaces supported by this configuration Unique number for this configuration Index number for string descriptor describing this configuration Configuration power supply attributes...
Chapter 4 Software Development 4-2. Sample USB Firmware The JOB60851 Starter Kit includes the complete source code for use as the starting point for the user USB firmware. To see the effects of user modifications on behavior, edit the source code, compile it, link it into an executable .HEX file, and then download and execute this file with the procedure in...
Check the link map file USB.M66 in the same directory for error messages from the linker. To test USB.HEX, download it to the JOB60851 board and execute it there with the procedure in Section 2-3. "Running User Programs." Use Rwbulk.exe and the procedure in Section 2-2-2.
Page 47
Comply with the message box asking you to connect USB devices by plugging in the cable to the JOB60851 board and applying power to the latter (#2 in Figure 2.1.1). Wait while Windows 98 automatically installs the drivers for the JOB60851 board.
(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.
The source code below gives skeletons for two simple application layers consisting of only BulkOut (receive) or BulkIn (transmit) operations, respectively. Modify the source code, recompile it, download it to the JOB60851 board, and run the program. For further details on the API functions, refer to the file M852.txt.
Page 50
Receive Only Skeleton char buf_rx[BUF_SIZE]; void bulk_rx(uchar *buf, uint size) /* Called after receiving each packet, this function manages buffer overflow for the application layer. */ if(Receive buffer threatens to overflow){ usb_rx_start(buf_rx, EP_RX); void main(void) /* Initialize microcontroller and peripherals, etc. */ usb_init();...
4-2-8. Simple Debugging The JOB60851 board allows simple debugging over the serial link to a terminal emulator with printf(), scanf(), and other C standard I/O library functions. Also available for use in debugging is LED2, which is connected to Port 7 and thus under program control. For further details, see Sections 4.4 "Port 7 LED2 Control"...
4-3. USB Bits and Pieces 4-3-1. Device Controller Specifications Table 4.3.1 summarizes the ML60851C specifications. For detailed device specifications, see the data sheet (Ml60851c.pdf). Table 4.3.1. ML60851C Specifications Data transfer speed Full speed (12 Mb/s) only Data flow type Control Endpoint specifications Bulk...
(2) Choice, with register setting under program control, of 8- or 16-bit DMA The 16-bit data bus is only available when 16-bit DMA is used. The JOB60851 board uses separate address and data buses, an 8-bit data bus, and no DMA. page 4-18...
Some systems require software control over the timing with which the USB device connects to the upstream host or hub to provide extra time for initialization and other tasks. The JOB60851 board therefore gives the microcontroller control over the D+ pull-up resistor. For further details, refer to the circuit diagram and the source code for the sample firmware.
4-3-5. Building a Product Generally speaking, building a product with the help of the JOB60851 board requires the following modifications and additions to the software. (1) Adding and modifying descriptors At the minimum, the source code has to provide vendor and product IDs. (See Section 4.3.6 below.) Descriptors generally also have to be modified to reflect the final product, application,...
Japanese distributor: (2) Microcontroller emulator The JOB60851 Starter Kit provides printf(), scanf(), and other C standard I/O library functions for confirmation of operation and simple debugging of programs running on its MSM66Q573 microcontroller. Thorough debugging with program tracing and other facilities for illuminating firmware problems, however, requires an emulator (in-circuit emulator, ROM emulator, etc.)
Chapter 4 Software Development (4) #asm and #endasm These two directives enclose an in-line assembly language block, which the compiler simply passes to the assembler. The sample firmware uses them in read_fifo() and write_fifo(), the functions for reading from and writing to USB controller buffers, and in extint1(), extint4(), and extint5(), the functions for switching register banks in response to an external interrupt from the USB controller.
4-4. Port 7 LED2 Control The MSM66Q573 microcontroller on the JOB60851 board has twelve bidirectional ports (P0 to P11) with 75 pins and an input only port (P12). The Section describes the use of Port 7 (P7), the one connected to LED2.
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.
Page 60
Sample Port 7 Control Program /* Sample program(Port7) */ /* Filename:port7exp.c /* Copyright(C) 1999 TECHNOCOLLAGE,Inc. All rights reserved. */ #include<stdio.h> #include<stdlib.h> #include<m66573.h> void main(void) int i = 0; unsigned int j = 0; /* Initialize MSM66Q573 and the port */ std_init_573();...
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.
Serial 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.
Page 63
The serial port used for standard I/O derives its baud rate from the MSM66Q573 internal timer 3 overflow signal. The source code file stdrw573.c contains the settings for producing a 38,400- b/s baud rate from the JOB60851 board's 24-MHz system clock. (2) Configure serial port All serial ports have registers for controlling operation.
Receive end interrupt flag (3) Configuring TX and RX pins These pins represent secondary functions for Port 7 pins 1 and 0, respectively, so write the following values to the corresponding bits in the Port Mode (P7IO) and Port Secondary Function Control (P7SF) Registers.
Page 65
Chapter 4 Software Development pointer as necessary for string input. If the character is a carriage return, the function echoes both it and a line feed back to the terminal emulator and stores the latter in memory instead. The function repeats the above cycle the number of times specified by the count argument to the read() function.
4-5-4. Standard I/O Examples This Section presents examples actually using this standard I/O. For further details on the printf_c(), puts(), and gets() library functions used, refer to the RTL665S Run-Time Library Reference. (1) Using standard output and write() Section 2-3. "Running User Programs" gives one example of a program that writes to standard output.
4-5-5. Debugging with Standard I/O One way to debug programs for the JOB60851 board is with printf() calls. The sample program in Section 4-4-2. "Changing LED2 Color," for example, used them to document program steps. These calls can also track changes in key variables. These progress messages then become your guide to...
Need help?
Do you have a question about the JOB60851 and is the answer not in the manual?
Questions and answers