Z-World RabbitCore 2000 User manual

RabbitCore 2000
C-Programmable Core Module
Getting Started
001004 - C

RabbitCore 2000
RabbitCore 2000 Getting Started
Part Number 019-0080 • 001004 - C • Printed in U.S.A.
Copyright
© 2000 Z-World, Inc. • All rights reserved.
Z-World, Inc. reserves the right to make changes and improvements to its products with-
out providing notice.
Trademarks
•Dynamic C®is a registered trademark of Z-World, Inc.
•Windows®is a registered trademark of Microsoft Corporation
Notice to Users
When a system failure may cause serious consequences, protecting life and property
against such consequences with a backup system or safety device is essential. The buyer
agrees that protection against consequences resulting from system failure is the buyer’s
responsibility.
This device is not approved for life-support or medical systems.
All Z-World products are 100 percent functionally tested. Additional testing may include
visual quality control inspections or mechanical defects analyzer inspections. Specifica-
tions are based on characterization of tested sample units rather than testing over tempera-
ture and voltage of each unit. Rabbit Semiconductor may qualify components to operate
within a range of parameters that is different from the manufacturer’s recommended
range. This strategy is believed to be more economical and effective. Additional testing
or burn-in of an individual unit is available by special arrangement.
Company Address
Z-World, Inc.
2900 Spafford Street
Davis, California 95616-6800
USA
Telephone: (530) 757-3737
Facsimile: (530) 753-5141
Web site: http://www.zworld.com
E-mail: zworld@zworld.com
Rabbit Semiconductor
2932 Spafford Street
Davis, California 95616-6800
USA
Telephone: (530) 757-8400
Facsimile: (530) 757-8402
Web site: http://www.rabbitsemiconductor.com
E-mail: sales@rabbitsemiconductor.com

Getting Started
Table of Contents
About This Manual
1. Installing Dynamic C......................................................................................................1
1.1 Requirements...............................................................................................................................2
1.2 Installation...................................................................................................................................2
1.3 Desktop Icons..............................................................................................................................6
2. Introduction to Dynamic C .............................................................................................7
2.1 The Nature of Dynamic C...........................................................................................................8
2.1.1 Speed..........................................................................................................................8
2.2 Dynamic C Libraries...................................................................................................................9
2.3 Using Dynamic C......................................................................................................................10
2.4 Upgrading Dynamic C ..............................................................................................................11
2.4.1 Workarounds............................................................................................................11
2.4.2 Upgrades..................................................................................................................12
3. Hardware Connections..................................................................................................13
3.1 Connections...............................................................................................................................14
3.2 Starting Dynamic C...................................................................................................................16
3.3 Run a Sample Program..............................................................................................................16
Installing Dynamic C .....................................................................................................................16
3.4 Where Do I Go From Here?......................................................................................................17
4. Sample Programs..........................................................................................................19
4.1 Running Sample Program FLASHLED.C................................................................................21
4.2 Single-Stepping.........................................................................................................................22
4.2.1 Watch Expression.....................................................................................................22
4.2.2 Break Point ..............................................................................................................22
4.2.3 Editing the Program.................................................................................................23
4.2.4 Watching Variables Dynamically.............................................................................23
4.2.5 Summary of Features...............................................................................................23
4.3 Cooperative Multitasking..........................................................................................................24
4.4 Advantages of Cooperative Multitasking..................................................................................26
Schematics

RabbitCore 2000

Getting Started
About This Manual
Z-World customers develop software for their programmable controllers using Z-World’s
Dynamic C development system running on an IBM-compatible PC. Dynamic C provides
an interactive compiler, editor, and source-level debugger. The controller is connected to
a COM port on the PC (COM1 by default) whose default operation is at 115,200 bps.
This manual introduces the Dynamic C development system to write software for a Rab-
bitCore 2000 based on the Rabbit microprocessor. The Rabbit 2000 microprocessor is a
new high-performance 8-bit microprocessor developed by Rabbit Semiconductor, a com-
pany affiliated with Z-World. The Rabbit 2000 can handle C language applications of
approximately 1 megabyte (50,000+ C statements).
Conventions
Table 1 lists and defines the typographic conventions that may be encountered in Dynamic C
.
Table 1: Typographic Conventions
Example Description
while Bold Courier font indicates a program, a fragment of a
program, or a Dynamic C keyword or phrase.
// IN-01… Program comments are in normal Courier font.
Italics
Courier italics indicate that something should be typed
instead of the italicized words (e.g., type a file name where
filename is shown).
Edit Bold sans serif font indicates a menu or menu selection.
…An ellipsis indicates that (1) irrelevant program text is
omitted for brevity, or that (2) the preceding program text
may be repeated indefinitely.
[ ] Square brackets in a C function’s definition or program
segment indicate that the enclosed directive is optional.
< > Angle brackets are used to enclose classes of terms.
a | b | c A vertical bar indicates that a choice should be made from
among the items listed.

RabbitCore 2000
Development and Evaluation Tools
Development Kit
The Development Kit has the essentials that you need to design your own a microproces-
sor-based system, and includes a complete software development system (Dynamic C).
The items in the Development Kit and their use are as follows:
•CD-ROM with Dynamic C®SE software, RabbitCore 2000, and Rabbit™2000 micro-
processor documentation. You may install this software by inserting the disk into your
CD-ROM drive. If it doesn’t start automatically, click on “setup.exe.”This software
runs under Windows ‘95, Windows ‘98, Windows 2000, and Windows NT. We sug-
gest taking the option to load the documentation to your hard disk. The documentation
is in both HTML and Adobe PDF format, and may be viewed with a browser.
•RabbitCore 2000 (RCM2020). This is a complete controller board that includes a Rab-
bit 2000 processor, 256K of flash memory, 128K of SRAM.
•Prototyping Board. The RabbitCore 2000 can be plugged into this board. The Protoyp-
ing Board includes a 5 V supply for powering the RabbitCore 2000, and various acces-
sories such as pushbutton switches, and LEDs. In addition, you can add your own
circuitry using through-hole or surface mount parts in the prototyping space provided.
•Programming cable. The programming cable is used to connect your PC serial port
directly to the RabbitCore 2000 to write and debug C programs that run on the Rabbit
2000.
•AC adapter. The AC adapter is used to power the Prototyping Board and the Rabbit-
Core 2000. The wall transformer is supplied only for Development Kits sold for the
North American market. The RabbitCore 2000 can also be powered from any DC volt-
age source between 7.5 V and 25 V, but 12 V is recommended. The linear regulator
becomes rather hot for voltages above 15 V.
Documentation
•Our documentation is provided in paperless form on the CD-ROM included in the
Development Kit. (A paper copy of the “Getting Started”page is included.) Most doc-
uments, including this comprehensive RabbitCore 2000 User’s Manual, are provided
in two formats: HTML and PDF. HTML documents can be viewed with an Internet
browser, either Netscape Navigator or Internet Explorer. HTML documents are very
convenient because all the documents are hyperlinked together, and it is easy to navi-
gate from one place to another. PDF documents can be viewed using the Adobe Acro-
bat reader, which is automatically invoked from the browser. The PDF format is best
suited for documents requiring high resolution, such as schematics, or if you want to
print the document. Don’t print a hard copy from the HTML version because the
HTML version has no page numbers and the cross-references and table of contents
links only work if viewed on line. The PDF versions contain page number references
to allow navigation when reading a paper version of the manual. To view the online
documentation with a browser, open the file default.htm in the docs folder.

Getting Started 1
1. INSTALLING DYNAMIC C

2RabbitCore 2000
1.1 Requirements
Dynamic C software comes on CD. To install Dynamic C, your system must be running
one of the following.
•Windows 95
•Windows 98
•Windows 2000
•Windows NT
Your PC should have at least one free COM port
1.2 Installation
Insert the CD in the CD-ROM disk drive on your PC. As long as auto-install is enabled,
the CD installation will begin automatically. If not, issue the Windows Start > Run...
command and type the following.
The installation program will then guide you through the installation process described below.

Getting Started 3
Click the Next > button to continue to the license agreement.
After reading and agreeing to the terms of the license, continue with the Next > button to
select the destination folder where the files will be installed.
Click the Next > button to continue the installation. The Installation Wizard will prompt
you to select a Compact, a Custom, or a Typical installation.
•Compact Installation—Dynamic C files only, no documents
•Custom Installation—your choice of Dynamic C files and documents
•Typical Installation—all Dynamic C files and all documents

4RabbitCore 2000
After choosing the installation, click the Next > button to continue. The files selected for
installation are check-marked. Now select the PC COM port, usually, COM1.
Click the
Next >
button to continue.

Getting Started 5
A status indicator shows the progress of the installation.
Before the installation is complete, the installation wizard will ask you what icons to dis-
play on your PC desktop. Separate icons are available for Dynamic C itself and for the
manuals and other documents.
Click the Finish button to end the installation. Notice that there is a check mark option to
start Dynamic C immediately once the installation is complete.

6RabbitCore 2000
1.3 Desktop Icons
Once your installation of Dynamic C and the documentation is complete, you will have
two icons on your PC desktop: one for Dynamic C and one for the documentation.
Double-click the corresponding icon start Dynamic C or to access the documentation.
It is also possible to start Dynamic C or access the documentation by double-clicking the
corresponding launch file on the drive where you installed Dynamic C and the documenta-
tion. The default file locations for a typical installation are shown.
•C:\DCRABBIT_652\DcRab652.exe to start Dynamic C
•C:\DCRABBIT_652\Docs\default to display the documentation screen.

Getting Started 7
2. INTRODUCTION TO DYNAMIC C
Dynamic C is an integrated development system for writing embedded software. It runs
on an IBM-compatible PC and is designed for use with Z-World controllers and other con-
trollers based on the Rabbit microprocessor.

8RabbitCore 2000
2.1 The Nature of Dynamic C
Dynamic C integrates the following development functions
•Editing
•Compiling
•Linking
•Loading
•Debugging
into one program. In fact, compiling, linking and loading are one function. Dynamic C
has an easy-to-use built-in text editor. Programs can be executed and debugged interac-
tively at the source-code or machine-code level. Pull-down menus and keyboard shortcuts
for most commands make Dynamic C easy to use.
Dynamic C also supports assembly language programming. It is not necessary to leave C
or the development system to write assembly language code. C and assembly language
may be mixed together.
Debugging under Dynamic C includes the ability to use printf commands, watch
expressions, breakpoints and other advanced debugging features. Watch expressions can
be used to compute C expressions involving the target’s program variables or functions.
Watch expressions can be evaluated while stopped at a breakpoint or while the target is
running its program.
Dynamic C provides extensions to the C language (such as shared and protected variables,
costatements and cofunctions) that support real-world embedded system development.
Interrupt service routines may be written in C. Dynamic C supports cooperative and pre-
emptive multi-tasking.
Dynamic C comes with many function libraries, all in source code. These libraries sup-
port real-time programming, machine level I/O, and provide standard string and math
functions.
2.1.1 Speed
Dynamic C compiles directly to memory. Functions and libraries are compiled and linked
and downloaded on-the-fly. On a fast PC, Dynamic C might load 30,000 bytes of code in
5 seconds at a baud rate of 115,200 bps.

Getting Started 9
2.2 Dynamic C Libraries
With Dynamic C running, click File > Open, and select Lib. The following list of
Dynamic C libraries will be displayed.
Let’s examine the libraries.
•Bioslib—libraries specific to running a BIOS, apply to all controllers. Although the
functions in these libraries are required by the BIOS, they are not exclusive to the
BIOS.
•Cofunc.lib—enables multitasking cofunctions to be defined starting with cofunc.
Cofunctions may be nested within costatements.
•
Costate.lib
—enables multitasking costatements to be defined starting with
costate
.
Also contains a library of commonly used costatements.
•Fft.lib—fast Fourier transform functions.
•
Math.lib
—math functions.
•
Program.lib
—
does program initialization before calling main.
•Rs232.lib—interface designed to provide users with a set of functions that send and
receive data without yielding to other tasks, and a set of single-user cofunctions that
send and receive data but yield to other tasks.
•
Rtclock.lib
—real-time clock drivers.
•
Slice.lib
—library functions that allow multitasking.
•
Stdio.lib
—standard Dynamic C terminal window I/O functions.
•
String.lib
—string operations.
•
Sys.lib
—support libraries.

10 RabbitCore 2000
•
Vdriver.lib
—generic virtual drivers.
•
Xmem.lib
—extended memory support functions.
The
Bioslib
folder contains libraries required by the BIOS, but not exclusive to the BIOS.
•Biosfsm.lib—support libraries.
•Clone.lib—functions used to “clone”boards by copying BIOS and programs from
one board to another via a special cloning cable.
•
Csupport.lib
—support libraries.
•
Dbugkern.lib
—debugging kernel support functions.
•
Flashwr.lib
—utility functions for writing to flash EPROM.
•
Idblock.lib
—functions to access the ID block in Z-World product flash devices, also
contains general CRC checking functions.
•
Mutil.lib
—integer math utility functions.
•
Mutilfp.lib
—floating-point math utility functions.
•
Stack.lib
—base data structure for maintaining stack allocation information.
•
Sysio.lib
—support libraries.
•
Util.lib
—utility functions.
2.3 Using Dynamic C
Chapter 4., “Sample Programs,”provides sample programs and explains how to use the
basic features of Dynamic C.
More complete information on Dynamic C is provided in the Dynamic C (Rabbit Version)
User’s Manual. Functions specific to the RabbitCore 2000 are described in the Rabbit-
Core 2000 User’s Manual.

Getting Started 11
2.4 Upgrading Dynamic C
Dynamic C upgrades and patches are available from time to time. An upgrade may either
enhance the features and libraries, or it may focus on bug fixes. Check the Web sites
www.zworld.com/support/supportcenter.html
or
www.rabbitsemiconductor.com/support.html
for the latest updates, patches, workarounds, and bug fixes.
2.4.1 Workarounds
Workarounds describe problems and recommended ways around them. The figure below
shows a typical workaround panel from one of the two Web sites.

12 RabbitCore 2000
2.4.2 Upgrades
Upgrades are also available on the Web site, and are first downloaded to your PC. The
downloaded application is then run, much like an installation would be.
The default installation of an upgrade is to install the new release of Dynamic C in a direc-
tory (folder) different from that of the original installation. Z-World recommends using a
different directory so that you can verify the operation of the new release without over-
writing the previous release. If you have made any changes to the BIOS or to libraries, or
if you have programs in the old directory (folder), make these same changes to the BIOS
or libraries in the new directory containing the upgraded release of Dynamic C. Do not
simply copy over an entire file since you may overwrite a bug fix; of course, you may
copy over any programs you have written. Once you are sure the new release works
entirely to your satisfaction, you may retire the older release, but keep it available to han-
dle legacy applications.

Getting Started 13
3. HARDWARE CONNECTIONS
Before proceeding with the hardware connections described in this chapter, locate the fol-
lowing items.
•RabbitCore 2000 (model RCM2020)
•RCM2000 Prototyping Board
•Power supply (a 12 V, 500 mA power supply is included with Development Kits sold
for the North American market)
•10-pin to DE9 programming cable

14 RabbitCore 2000
3.1 Connections
1. Attach RabbitCore 2000 to Prototyping Board
Turn the RabbitCore 2000 so that the Rabbit 2000 microprocessor is facing as shown
below. Plug RabbitCore 2000 Headers J1 and J2 into the sockets of headers J1 and J3 on
the Prototyping Board.
Figure 1. Attaching RabbitCore 2000 to Prototyping Board
It is important that you line up the pins on the RabbitCore 2000 headers J1 and
J2 exactly with the corresponding pins of headers J1 and J3 on the Prototyping
Board. The header pins may become bent or damaged if the pin alignment is
offset, and the RabbitCore 2000 will not work.
J2
J1
+
C1
J4
U1
J5
S2
S3
S1
RN1
D2
JP1
DS3
DS2
DS1
C2
U2
C3 C4 C5
J6
C6
GND
VCC
VCC
PA1
PA3
PA5
PA7
PB1
PB3
PB5
PB7
GND
D6
GND
PA0
PA2
PA4
PA6
PB0
PB2
PB4
PB6
D7
PCLK
RCM2000 PROTOTYPING BOARD
D4
D2
D0
PE6
PE4
PE2
PE0
/IOR
/ DO
A11
A9
A7
A5
A3
A1
STAT
PC1
PC3
PC5
PC7
PD1
PD3
PD5
PD7
VCC
VRAM
SM1
/RSTI
GND
A12
A10
A8
A6
A4
A2
A0
PC0
PC2
PC4
PC6
PD0
PD2
PD4
PD6
GND
VBAT
SM0
VCC
D5
D3
D1
PE7
PE5
PE3
PE1
/RSTO
/BEN
/IO
RESET
S2
PB3
PB2
PA1
PA0
DS3
S3
DS2
P R
GND
RXB
TXB
TXCRXC
GND
J3
RS-232
Prototyping
Board
Rabbit 2000
Core Module
C4
U1 U2
R4
Y2
C5
R3
Y1
C1
C2
R2
TP1
R1 JP1
C3
TP3
TP2
J3
PB5
PB7
GND
PB4
PB6
PCLK
D6 D7
D2 D3
D5
D4
D1
D0
PE7
PE6
PE5
PE4
PE3
PE2
PE1
PE0
/IO
/IOR
/BEN
/ DO
PA1
PA3
PA5
PA7
PB1
PB3
GND
PA0
PA2
PA4
PA6
PB0
PB2
J1
VCC
J2
A12
A10
A8
A6
A4
A2
A0
A11
A9
A7
A5
A3
A1
STAT
PC0
PC2
PC4
PC6
PD0
PD2
PD4
PD6
GND
VBAT
PC1
PC3
PC5
PC7
PD1
PD3
PD5
PD7
VCC
SM1
GND
VRAM
SM0
VCC
/RESO
/RSTI
SRAM
Line up the
mounting holes
Table of contents
Other Z-World Control Unit manuals
Popular Control Unit manuals by other brands

HP
HP 7500 48p 1000BASE-T w/PoE+ SE Mod Disassembly instructions

HP
HP 83481A user guide

CIRCUIT DESIGN
CIRCUIT DESIGN CDP-RX-07M Operation guide

Roger Technology
Roger Technology H70/200AC Instructions and Recomendations for the Installer

DMP Electronics
DMP Electronics 734N Series Installation and programming guide

Maxim Integrated
Maxim Integrated MAXIM001 MGT quick start guide