Oki JOB60851 User Manual

Manual is about: Developer's Starter Kit

Summary of JOB60851

  • Page 1

    Oki job60851 starter kit user’ s manual version 1.07 (july 27, 2000) oki electric industry co., ltd.. Technocollage inc.

  • Page 3: Oki

    Oki notice 1. The information contained herein can change without notice owing to product and/or technical improvements. Before using the product, please make sure that the information being referred to is up-to-date. 2. The outline of action and examples for application circuits described herein ha...

  • Page 4: Contents

    I contents 1. Introduction ............................................................................ 1-1 1-1. Cheking packing list ...................................................................................1-2 1-2. Host environment ............................................................

  • Page 5

    Ii 3-2-1. Connectors and switches .............................................................................. 3-3 3-2-2. Circuit diagram .............................................................................................. 3-5 3-2-3. Parts list ..............................................

  • Page 6

    Iii 4-2-8. Simple debugging........................................................................................ 4-16 4-2-9. Evaluating usb equipment ......................................................................... 4-16 4-3. Usb bits and pieces ..............................................

  • Page 7: 1.  Introduction

    1. Introduction.

  • Page 8: 1-1. Checking Packing List

    Chapter 1 introduction page 1-2 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 ...

  • Page 9: 1-2. Host Environment

    Chapter 1 introduction page 1-3 1-2. Host environment the job60851 starter kit assumes the following development environment. • microsoft windows 98 • usb interface fully compatible with microsoft windows 98 usb driver • terminal emulation software the compiler package will also run under microsoft ...

  • Page 10: 1-3.

    Chapter 1 introduction page 1-4 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 the...

  • Page 11: Warning

    Chapter 1 introduction page 1-5 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 cor...

  • Page 12: Caution

    Chapter 1 introduction page 1-6 please read this page before using the product. Caution 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 corro...

  • Page 13: Notation

    Chapter 1 introduction page 1-7 notation this manual utilizes the following notational conventions for convenience. N caution n a “caution” indicates a section of the manual that requires special attention. N reference n a “reference” provides information related to the current topic and indicates t...

  • Page 14

    2. Putting board through its paces.

  • Page 15: 2-1. Setup

    Chapter 2 putting board through its paces page 2-2 2-1. Setup 2-1-1. 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 (6) serial (rs-232...

  • Page 16

    Chapter 2 putting board through its paces page2-3 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...

  • Page 17

    Chapter 2 putting board through its paces page 2-4 2-1-3. Connecting board this section gives the procedures for preparing the job60851 board for connection to the development host. 1. Make sure that the flash writer selection switch (fw-sel, #4 in figure 2.1.1) is in its b position. 2. Plug the ac ...

  • Page 18

    Chapter 2 putting board through its paces page2-5 vendor -- vendor request test detail usage for -? Option: rwbulk info -? Rwbulk bulk -? Rwbulk desc -? Rwbulk class -? Rwbulk vendor -? Examples: rwbulk -u rwbulk desc 03 00 00 00ff rwbulk -o pipe00 -fo out.Dat -vl 2 rwbulk -i 1 -r 8192 -fi in.Dat -v...

  • Page 19: 2-3. Running User Programs

    Chapter 2 putting board through its paces page 2-6 "usb_endpoint_descriptor for pipe00" "usb_endpoint_descriptor for pipe01" "usb_endpoint_descriptor for pipe02" the software defines three pipes, pipe00 to pipe02. The first is for output--that is, from the development host to the job60851 board. The...

  • Page 20

    Chapter 2 putting board through its paces page2-7 2-3-1. Connecting serial cable 1. Disconnect the usb cable from the board and plug the ac adapter into the jack (#1 in figure 2.1.1). Make sure that the power (#2 in figure 2.1.1) is off. 2. Plug one end of the serial cable into a serial port on the ...

  • Page 21

    Chapter 2 putting board through its paces page 2-8 speed 38,400 b/s word size 8 bits parity check none stop bits 2 flow control none (3) activating job60851 board 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...

  • Page 22

    Chapter 2 putting board through its paces page2-9 the above program to display a different string. 1. Copy the source code main.C to a new name, test.C, in the work directory--c:\test in our example. 2. Open the copy in a text editor. #include #include #include void main(void) { std_init_573(); s0bu...

  • Page 23: 3.  System Specifications

    3. System specifications.

  • Page 24: 3-1. System Components

    Chapter 3 system specifications page 3-2 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 figure 3.1.1. System...

  • Page 25: 3-2. Hardware Specification

    Chapter 3 system specifications page 3-3 3-2. Hardware specification 3-2-1. Connectors and switches figure 3.2.1. Job60851 board, top view (1) ac adapter jack the included ac adapter has the following specifications. Input: 100 v ac, 50/60 hz, 18 va output: 10 v dc, 850 ma n note n use only the ac a...

  • Page 26

    Chapter 3 system specifications page 3-4 (4) flash writer selection switch (fw-sel) the b side of this switch is for executing the program in the msm66q573 flash memory or overwriting it with the pw66k flash writer (available separately). (5) usb connector this series b connector is for the usb cabl...

  • Page 27

    Chapter 3 system specifications page 3-5 3-2-2. Circuit diagram figure 3.2.2. Circuit diagram (1/2).

  • Page 28

    Chapter 3 system specifications page 3-6 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 29

    Chapter 3 system specifications page 3-7 3-2-3. Parts list tables 3.2.1 and 3.2.2 list the parts on the job60851 board. Table 3.2.1. Parts list (1/2) item quantity reference part dscription 1 15 c13,c15,c16,c17,c18,c19,c20, c21,c22,c23 0.1uf ceramic capacitor c24,c25,c26,c27,c28 2 1 c7 1000pf cerami...

  • Page 30

    Chapter 3 system specifications page 3-8 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. It uses the loader, a program stored i...

  • Page 31

    Chapter 3 system specifications page 3-9 (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. Figu...

  • Page 32

    Chapter 3 system specifications page 3-10 (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. Figure 3.2.6. Memory map for application mode 1:0000 h 0:0200 h 0:1200 h 0:0000 h sfr/xsfr int._ram 0:8000 h 0:3000 h ...

  • Page 33

    Chapter 3 system specifications page 3-11 (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. Figur...

  • Page 34: 3-3. System Limitations

    Chapter 3 system specifications page 3-12 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 bo...

  • Page 35

    Chapter 3 system specifications page 3-13 table 3.3.1. Msm66q573 pin assignments (2/2) ic1.41 vdd vcc ic1.42 p11-0/wait ic1.43 p11-1/hold ic1.44 p11-2/clkout ic1.45 p11-3/xtout ic1.46 p11-6/tm9out ic1.47 p11-7/tm9evt ic1.48 p3-1/psenb ic3.22 ic8.5 ic9.10 r34 ic1.49 p3-2/rdb ic6.12 ic8.9 r26 ic1.50 p...

  • Page 36: 4.  Software Development

    4. Software development.

  • Page 37: 4-1. Usb Basics

    Chapter 4 software development page 4-2 section 4-1. "usb basics" provides an overview of the universal serial bus (usb) specifications as well as urls for obtaining detailed specifications. Section 4-2. "sample usb firmware" provides a functional overview of the sample device firmware shipped with ...

  • Page 38

    Chapter 4 software development page 4-3 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 http://www.Usb.Org/developers/ developers section http://...

  • Page 39

    Chapter 4 software development page 4-4 standard device requests, and standard device descriptors chapter 10 usb host: hardware and software functions and operation of host hardware and software chapter 11 hub specification hub port operation, requests, and descriptors chapter 4 provides a firm grou...

  • Page 40

    Chapter 4 software development page 4-5 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 transaction...

  • Page 41

    Chapter 4 software development page 4-6 4-1-8. Data rates the usb supports two data rates: 12 mb/s and 1.5 mb/s. Table 4.1.4 lists the maximum payload sizes for each combination of data flow type and data rate. Table 4.1.4. Maximum payload sizes max payload size transfer types 12 mbps 1.5 mbps contr...

  • Page 42

    Chapter 4 software development page 4-7 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 request...

  • Page 43

    Chapter 4 software development page 4-8 7 set_descriptor update or add a descriptor 8 get_configuration return the current device configuration value 9 set_configuration set the device configuration value 10 get_interface return the selected alternate setting for the specified interface 11 set_inter...

  • Page 44

    Chapter 4 software development page 4-9 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 interf...

  • Page 45: 4-2. Sample Usb Firmware

    Chapter 4 software development page 4-10 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 .He...

  • Page 46

    Chapter 4 software development page 4-11 4-2-3. Sample usb host software the cd-rom directory \package\host contains the following usb host software for testing such things as bulk data flow. A brief overview of operation appears in section 2. Readme.Txt software description, usage notes, etc. Rwbul...

  • Page 47

    Chapter 4 software development page 4-12 http://www.Usb.Org/developers/complian.Html n note n as of august 1999, this software is at version 3.2 and requires windows 98 second edition. Users of older windows 98 versions should download version 2.9 instead. Once this software has been successfully in...

  • Page 48

    Chapter 4 software development page 4-13 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\clas...

  • Page 49

    Chapter 4 software development page 4-14 n note n the windows 98 cd-rom is not necessary if the oem release has copied the installation image from the cd-rom to the directory c:\windows\option. If so, specify that directory instead of the cd-rom. (5) operate mouse with terminal emulator after readin...

  • Page 50

    Chapter 4 software development page 4-15 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)...

  • Page 51

    Chapter 4 software development page 4-16 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 th...

  • Page 52: 4-3. Usb Bits and Pieces

    Chapter 4 software development page 4-17 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...

  • Page 53

    Chapter 4 software development page 4-18 figure 4.3.1. Ml60851c block diagram protocol engine operation for a control transfer setup transaction differs from that for all other transactions. Setup transactions always write the eight bytes in the associated data packet to the setup registers. If this...

  • Page 54

    Chapter 4 software development page 4-19 figure 4.3.2 shows sample connections to a microcontroller with a 16- or 32-bit bus. Register must be 8 bits wide. Only dma uses 16-bit bus. Registers must be aligned at word boundaries for 16-bit bus and at double boundaries for 32-bit bus. Figure 4.3.2. Mic...

  • Page 55

    Chapter 4 software development page 4-20 with the above-mentioned requirement for average suspend current. 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...

  • Page 56

    Chapter 4 software development page 4-21 a bus monitor also comes in handy during host driver development when the personal computer hangs, making it impossible to pinpoint the exact circumstances producing the failure. Bus monitor data is also highly effective in tracing host controller operation a...

  • Page 57

    Chapter 4 software development page 4-22 (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 controlle...

  • Page 58: 4-4. Port 7 Led2 Control

    Chapter 4 software development page 4-23 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. 4-4-1. Port 7 registers...

  • Page 59

    Chapter 4 software development page 4-24 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 c...

  • Page 60

    Chapter 4 software development page 4-25 sample port 7 control program /* sample program(port7) */ /* filename:port7exp.C */ /* copyright(c) 1999 technocollage,inc. All rights reserved. */ #include #include #include void main(void) { int i = 0; unsigned int j = 0; std_init_573(); /* initialize msm66...

  • Page 61

    Chapter 4 software development page 4-26 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 inp...

  • Page 62

    Chapter 4 software development page 4-27 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, vfprintf,vprintf write for further details o...

  • Page 63

    Chapter 4 software development page 4-28 for further details on these components, refer to the msm6657 family user's manual. Serial port (sio0): chapter 12 internal timer: chapter 8, page 9 and following the source code file stdrw573.C sets up the serial port for these functions using the following ...

  • Page 64

    Chapter 4 software development page 4-29 receive end interrupt flag "0" (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 (...

  • Page 65

    Chapter 4 software development page 4-30 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...

  • Page 66

    Chapter 4 software development page 4-31 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 writ...

  • Page 67

    Chapter 4 software development page 4-32 sample program using standard input /* read/write sample program 2 */ /* filename:rw_smpl2.C */ /* copyright(c) 1999 oki electric industry co.,ltd. All right reserved. */ /* copyright(c) 1999 technocollage,inc. All right reserved. */ #include #include #includ...