RabbitCore RCM2200 C-Programmable Module with Ethernet User’s Manual 019–0097 • 010418–A RabbitCore RCM2200: User’s Manual

Part Number 019-0097 • 010418–A • Printed in U.S.A. © 2001 Z-World Inc. • All rights reserved. Z-World reserves the right to make changes and improvements to its products without providing notice.

Notice to Users Z-WORLD PRODUCTS ARE NOT AUTHORIZED FOR USE AS CRITICAL COMPONENTS IN LIFE-SUPPORT DEVICES OR SYSTEMS UNLESS A SPECIFIC WRITTEN AGREEMENT REGARDING SUCH INTENDED USE IS ENTERED INTO BETWEEN THE CUSTOMER AND ZWORLD PRIOR TO USE. Life-support devices or systems are devices or systems intended for surgical implantation into the body or to sustain life, and whose failure to perform, when properly used in accordance with instructions for use provided in the labeling and user’s manual, can be reasonably expected to result in significant injury. No complex software or hardware system is perfect. Bugs are always present in a system of any size. In order to prevent danger to life or property, it is the responsi- bility of the system designer to incorporate redundant protective mechanisms appropriate to the risk involved.

Trademarks Rabbit 2000 is a trademark of Rabbit Semiconductor. Dynamic C is a registered trademark of Z-World Inc.. Z80/Z180 is a trademark of Inc.

Rabbit Semiconductor Z-World Inc. 2932 Spafford Street 2900 Spafford Street Davis, California 95616-6800 Davis, California 95616-6800 USA USA Telephone: (530) 757-8400 Telephone: (530) 757-3737 Fax: (530) 757-8402 Fax: (530) 753-5141 www.rabbitsemiconductor.com www.zworld.com

ii RabbitCore RCM2200 Table of Contents

1 Introduction 1.1 RabbitCore RCM2200 Features ...... 1-1 1.2 Advantages of the RabbitCore RCM2200 ...... 1-2 1.3 Development and Evaluation Tools ...... 1-2 1.4 How to Use This Manual...... 1-2

2 Hardware Reference 2.1 RabbitCore RCM2200 Digital Inputs and Outputs ...... 2-1 2.1.1 Dedicated Inputs ...... 2-2 2.1.2 Dedicated Outputs ...... 2-2 2.1.3 Memory I/O Interface...... 2-2 2.1.4 Other Inputs and Outputs ...... 2-2 2.2 Serial Communication ...... 2-5 2.2.1 Serial Ports ...... 2-5 2.2.2 Ethernet Port...... 2-5 2.2.3 Programming Port ...... 2-5 2.3 Other Hardware ...... 2-7 2.3.1 Clock Doubler ...... 2-7 2.3.2 Backup Battery Circuit...... 2-7

User’s Manual iii 2.4 Programming Cable...... 2-9 2.4.1 Changing from Program Mode to Run Mode...... 2-9 2.4.2 Changing from Run Mode to Program Mode...... 2-9

3 Software Reference 3.1 More About Dynamic C ...... 3-1 3.1.1 Framework ...... 3-2 3.1.2 Using Dynamic C ...... 3-2 3.2 Dynamic C Libraries ...... 3-3 3.2.1 I/O ...... 3-3 3.2.2 Serial Communication Drivers ...... 3-3 3.2.3 TCP/IP Drivers ...... 3-4 3.3 Sample Programs ...... 3-4 3.4 Upgrading Dynamic C ...... 3-5 3.4.1 Upgrades ...... 3-5

A RabbitCore RCM2200 Specifications A.1 Electrical and Mechanical Characteristics ...... A-2 A.1.1 Headers ...... A-5 A.1.2 Physical Mounting ...... A-5 A.2 Bus Loading ...... A-5 A.3 Rabbit 2000 DC Characteristics ...... A-7 A.4 I/O Buffer Sourcing and Sinking Limit...... A-8 A.5 Conformal Coating ...... A-9

B Power Supply B.1 Power Supplies...... B-1 B.2 Battery Backup Circuits...... B-1

C Programming Cable

D Sample Circuits D.1 RS-232/RS-485 Serial Communication ...... D-2 D.2 Keypad and LCD Connections...... D-3 D.3 External Memory ...... D-4 D.4 D/A Converter ...... D-5

iv RabbitCore RCM2200 E External Interrupts E.1 Use of External Interrupts ...... E-2 E.2 Single-Interrupt Request ...... E-3 E.3 OR’ed Interrupt Request ...... E-3

Index

Schematics

User’s Manual v vi RabbitCore RCM2200 Introduction 1

The RabbitCore RCM2200 module is designed to be the heart of embedded control systems. The RCM2200 features an integrated Ethernet port and provides for LAN and Internet-enabled systems to be built as easily as serial-communication systems.

The RabbitCore RCM2200 has a Rabbit 2000 1.1 RabbitCore RCM2200 microprocessor operating at 22.1 MHz, static RAM, Features , two clocks (main oscillator and time- keeping), and the circuitry necessary for reset and • Small size: 1.60" × 2.30" × 0.86" (41 mm × 58 mm × 22 mm) management of battery backup of the Rabbit 2000’s internal real-time clock and the static RAM. Two • Microprocessor: Rabbit 2000 running at 26-pin headers bring out the Rabbit 2000 I/O bus 22.1 MHz lines, address lines, data lines, parallel ports, and • 26 parallel I/O lines: 16 configurable for serial ports. input or output, 7 fixed inputs, 3 fixed out- puts The RabbitCore RCM2200 receives its +5 V power from the user board on which it is mounted. The • 8 data lines (D0–D7) RabbitCore RCM2200 can interface with all kinds of CMOS-compatible digital devices through the user board.

User’s Manual Introduction 1–1 • 4 address lines (A0–A3) • Generous memory size allows large pro- • Memory I/0 read, write grams with tens of thousands of lines of code, and substantial data storage. • External reset input • Integrated Ethernet port for network con- • Five 8-bit timers (cascadable in pairs) and nectivity, royalty-free TCP/IP software. two 10-bit timers • 256K flash memory, 128K SRAM • Real-time clock 1.3 Development and • Watchdog supervisor Evaluation Tools • Provision for customer-supplied backup A complete Development Kit, including a Prototyp- battery via connections on header J5 ing Board, and Dynamic C development software, is • 10Base-T RJ-45 Ethernet port available to accompany the RCM2200 module. The Development Kit puts together the essentials you • Raw Ethernet and two associated LED need to design an embedded microprocessor-based control signals available on 26-pin header system rapidly and efficiently. • Three CMOS-compatible serial ports: max- imum asynchronous baud rate of See the RabbitCore RCM2200 Getting Started 345,600 bps, maximum synchronous baud Manual for complete information on the Develop- rate of 138,240 bps. One port is config- ment Kit. urable as a clocked port. • Six additional I/O lines are located on the programming port, can be used as I/O lines 1.4 How to Use This Manual when the programming port is not being This user’s manual is intended to give users detailed used for programming or in-circuit debug- ging—one synchronous serial port can also information on the RCM2200 module. It does not be used as two general CMOS inputs and contain detailed information on the Dynamic C one general CMOS output, and there are development environment or the TCP/IP software two additional inputs and one additional support for the integrated Ethernet port. Most users output. will want more detailed information on some or all Appendix A, “RabbitCore RCM2200 Specifica- of these topics in order to put the RCM2200 module tions,” provides detailed specifications for the Rab- to effective use. bitCore RCM2200. 1.4.1 Additional Product Information 1.2 Advantages of the Introductory information about the RabbitCore RabbitCore RCM2200 RCM2200 and its associated Development Kit and Prototyping Board will be found in the printed Rab- • Fast time to market using a fully engi- bitCore RCM2200 Getting Started Manual, which neered, “ready to run” microprocessor is also provided on the accompanying CD-ROM in core. both HTML and Adobe PDF format. • Competitive pricing when compared with the alternative of purchasing and assem- We recommend that any users unfamiliar with bling individual components. Z-World products, or those who will be using the • Easy C-language program development prototyping board for initial evaluation and develop- and debugging, including rapid produc- ment, begin with at least a read-through of the Get- tion loading of programs. ting Started manual.

1–2 Introduction RabbitCore RCM2200 1.4.2 Additional Reference Information the number of outdated manuals we have to discard In addition to the product-specific information con- from stock as well, and it makes providing a com- tained in the RabbitCore RCM2200 Getting Started plete library of manuals an almost cost-free option. Manual and the RabbitCore RCM2200 User’s For one-time or infrequent reference, electronic doc- Manual (this manual), several higher level refer- uments are more convenient than printed ones— ence manuals are provided in HTML and PDF form after all, they aren’t taking up shelf or desk space! on the accompanying CD-ROM. Advanced users Finding Online Documents will find these references valuable in developing systems based on the RCM2200 modules: The online documentation is installed along with Dynamic C, and an icon for the documentation • Dynamic C Premier User’s Manual menu is placed on the workstation’s desktop. Dou- • Introduction to TCP/IP ble-click this icon to reach the menu. If the icon is • TCP/IP Function Reference missing, use your browser to find and load default.htm in the docs folder, found in the • Rabbit 2000 Microprocessor Dynamic C installation folder. User’s Manual The latest versions of all documents are always 1.4.3 Using Online Documentation available for free, unregistered download from our Web sites as well. We provide the bulk of our user and reference docu- mentation in two electronic formats, HTML and Printing Electronic Manuals Adobe PDF. We do this for several reasons. We recognize that many users prefer printed manu- We believe that providing all users with our com- als for some uses. Users can easily print all or parts plete library of product and reference manuals is a of those manuals provided in electronic form. The useful convenience. However, printed manuals are following guidelines may be helpful: expensive to print, stock, and ship. Rather than • Print from the Adobe PDF versions of the include and charge for manuals that every user may files, not the HTML versions. not want, or provide only product-specific manuals, we choose to provide our complete documentation • Print only the sections you will need to refer to more than once. and reference library in electronic form with every Development Kit and with our Dynamic C develop- • Print manuals overnight, when appropri- ment environment. ate, to keep from tying up shared resources during the work day. NOTE: The most current version of • If your printer supports duplex printing, Adobe Acrobat Reader can always print pages double-sided to save paper and be downloaded from Adobe’s Web increase convenience. site at http://www.adobe.com. • If you do not have a suitable printer or do We recommend that you use ver- not want to print the manual yourself, most sion 4.0 or later. retail copy shops (e.g., Kinkos, Alpha- Graphics, CopyMax) will print the manual Providing this documentation in electronic form from the PDF file and bind it for a reason- saves an enormous amount of paper by not printing able charge—about what we would have to copies of manuals that users don’t need. It reduces charge for a printed and bound manual.

User’s Manual Introduction 1–3 1–4 Introduction RabbitCore RCM2200 Hardware Reference 2

Chapter 2 describes the hardware components and principal hardware sub- systems of the RabbitCore RCM2200. Appendix A, “RabbitCore RCM2200 Specifications,” provides complete physical and electrical specifications.

2.1 RabbitCore RCM2200 Digital Inputs and Outputs Figure 2–1 shows the subsystems designed into the RabbitCore RCM2200.

PB0, PA0–PA7 PB2–PB5 PB7 PD3–PD5

Port A Port B Port D (+synch Serial Port B) (+Serial Port B)

PC0, PC2 PE0–PE1, Port C Port E PE4–PE5, PC1, PC3 (+Serial Ports C & D) RABBIT PE7 PC6 + 1 more output Programming 2000 Address Lines A0–A3 PB1, PC7, RES_IN Port (Serial Port A) + 2 more inputs IORD Real-Time Clock I/O Control 4 Ethernet signals Ethernet IOWR 2 LED outputs Port Watchdog 7 Timers Data Lines D0–D7 /RESET Misc. I/O Slave Port Clock Doubler

RAM Backup Battery Flash Support

Figure 2–1: Rabbit Subsystems

User’s Manual Hardware Reference 2–1 The RabbitCore RCM2200 has 26 parallel located on pins PA0–PA7, PD3–PD5, and PE0–PE1, I/O lines grouped in five 8-bit ports available on PE4, PE5, and PE7. The pinouts for headers J4 and headers J4 and J5. The 16 bidirectional I/O lines are J5 are shown in Figure 2–2.

J4 J5 GND VCC PA0 PA1 PC0 PC1 PA2 PA3 PC2 PC3 PA4 PA5 TPOUT- TPOUT+ PA6 PA7 LNK PD3 /RES PB0 PD4 PD5 PB2 PB3 /IORD /IOWR PB4 PB5 PE0 PE1 PB7 D7 TPIN- TPIN+ D6 D5 PE4 PE5 D4 D3 ACT PE7 D2 D1 A3 A2 D0 VBAT A1 A0 VCC GND

Note: These pinouts are as seen on the Bottom Side of the module.

Figure 2–2: RabbitCore RCM2200 I/O Pinouts

2.1.1 Dedicated Inputs pins; PC0 and PC2 can instead serve as the serial PB0 is a general CMOS input when the Rabbit 2000 data outputs for Serial Ports D and C. is either not using Serial Port B or is using Serial Port B in an asynchronous mode. Four other general 2.1.3 Memory I/O Interface CMOS input-only pins are located on PB2–PB5. Four of the Rabbit 2000 address lines (A0–A3) and These pins can also be used for the slave port. PB2 all the data lines (D0–D7) are availabl. I/0 write and PB3 are slave write and slave read strobes, (/IOWR) and I/0 read (/IORD) are also available for while PB4 and PB5 serve as slave address lines SA0 interfacing to external devices. and SA1, and are used to access the slave registers. The ports on the Rabbit 2000 microprocessor used PC1 and PC3 are general CMOS inputs only. These in the RabbitCore RCM2200 are configurable, and so pins can instead be selectively enabled to serve as the factory defaults can be reconfigured. Table 2–1 the serial data inputs for Serial Ports D and C. lists the Rabbit 2000 factory defaults and the alter- nate configurations. 2.1.2 Dedicated Outputs One of the general CMOS output-only pins is 2.1.4 Other Inputs and Outputs located on PB7. PB7 can also be used with the slave As shown in Table 2–1, pins PA0–PA7 can be used port as the /SLAVEATTN output. This configura- to allow the Rabbit 2000 to be a slave to another tion signifies that the slave is requesting attention processor. The slave port also uses PB2–PB5, PB7, from the master. PC0 and PC2 are also output-only and PE7.

2–2 Hardware Reference RabbitCore RCM2200 Table 2–1: RabbitCore RCM2200 Pinout Configurations

Pin Pin Name Default Use Alternate Use Notes

1GND

2VCC

3PC0OutputTXD

4PC1Input RXD

5PC2OutputTXC

6PC3Input RXC

7TPOUT– Ethernet transmit port 8TPOUT+

Ethernet LNK LED 9LNK indicator

10 PD3 Bitwise or parallel 11 PD4 ATXB output programmable I/O 12 PD5 ARXB input

Input (I/O read 13 /IORD strobe)

Output (I/O write

Header J4 14 /IOWR strobe)

15 PE0 I0 control or INT0A input Bitwise or parallel programmable I/O 16 PE1 I1 control or INT1A input

17 TPIN– Ethernet receive port 18 TPIN+

19 PE4 I4 control or INT0B input Bitwise or parallel programmable I/O 20 PE5 I5 control or INT1B input

Ethernet active (ACT) 21 ACT LED indicator

Bitwise or parallel I7 control or slave port 22 PE7 programmable I/O chip select /SCS

23–26 A[3:0] Rabbit 2000 address bus

User’s Manual Hardware Reference 2–3 Table 2–1: RabbitCore RCM2200 Pinout Configurations (continued)

Pin Pin Name Default Use Alternate Use Notes

Bytewide Slave port data bus 1–8 PA[0:7] programmable SD0–SD7 parallel I/O

This weak output can be 9 /RESET Reset output Reset input driven externally

10 Serial port clock CLKB PB0 Input input or output

11 PB2 Input Slave port write /SWR

12 PB3 Input Slave port read /SRD

13 PB4 Input SA0

Header J5 Slave port address lines 14 PB5 Input SA1

15 Slave port attention line PB7 Output /SLAVEATTN

16–23 D[7:0] Input/Output Rabbit 2000 data bus

24 VBAT 3 V battery input

25 VCC

26 GND

PE0, PE1, PE4, and PE5 can be used for up to two Serial Port B. PD5 can be used as a serial input by external interrupts. PB0 can be used to access the Serial Port B. clock on Serial Port B of the Rabbit microprocessor. PC4, PC5, PD0, PD1, PE2, PE3, and PE6 are used PD4 can be programmed to be a serial output for for internal communication with the RealTek Ether- net interface chip.

2–4 Hardware Reference RabbitCore RCM2200 2.2 Serial Communication Two LEDs are placed next to the RJ-45 Ethernet jack, one to indicate an Ethernet link (LNK) and one The RabbitCore RCM2200 board does not have an to indicate Ethernet activity (ACT). RS-232 or an RS-485 transceiver directly on the board. However, an RS-232 or RS-485 interface The Ethernet signals are also available on header J4. may be incorporated on the board the RCM2200 is The ACK and LNK signals can be used to drive LEDs mounted on. For example, the Prototyping Board on the user board the RCM2200 is connected to. supports a standard RS-232 transceiver chip. The transformer/connector assembly ground is con- nected to the RabbitCore RCM2200 printed circuit 2.2.1 Serial Ports board digital ground via a 0 Ω resistor, R29, as There are four serial ports designated as Serial Ports shown in Figure 2–4. A, B, C, and D. All four serial ports can operate in an asynchronous mode up to the baud rate of the system clock divided by 64. An asynchronous port RJ-45 Ethernet Plug can handle 7 or 8 data bits. A 9th bit address scheme, where an additional bit is sent to mark the R29 first byte of a message, is also supported. Serial Ports A and B can also be operated in the clocked Board Chassis Ground Ground serial mode. In this mode, a clock line synchro- nously clocks the data in or out. Either of the two Figure 2–4: Isolation Resistor R29 communicating devices can supply the clock. When the Rabbit 2000 provides the clock, the baud rate can be up to 80% of the system clock frequency The RJ-45 connector is shielded to minimize EMI divided by 128, or 138,240 bps for a 22.1 MHz effects to/from the Ethernet signals. Z-World recom- clock speed. mends that an equivalent RJ-45 connector be used on the user board if the customer wishes to have an Serial Port A is available only on the programming RJ-45 connector on the user board. port, and so is likely to be inconvenient to interface with. NOTE: Z-World may offer large-vol- ume orders for the RCM2200 with- 2.2.2 Ethernet Port out the LEDs and the RJ-45 connector if you plan to use your Figure 2–3 shows the pinout for the RJ-45 Ethernet own RJ-45 connector on your user port (J2). Note that some Ethernet connectors are board. Ask your Z-World or Rabbit numbered in reverse to the order used here. Semiconductor sales representative for more information.

ETHERNET 2.2.3 Programming Port

1 8 Serial Port A has special features that allow it to cold-boot the system after reset. Serial Port A is also the port that is used for software development under 1. E_Tx+ 2. E_Tx– Dynamic C. 3. E_Rx+ 6. E_Rx– The RabbitCore RCM2200 has a 10-pin program RJ-45 Plug RJ-45 Jack header labeled J1. The Rabbit 2000 startup-mode Figure 2–3: RJ-45 Ethernet Port Pinout pins (SMODE0, SMODE1) are presented to the

User’s Manual Hardware Reference 2–5 programming port so that an externally connected 2.2.3.1 Alternate Uses of the Program- device can force the RCM2200 to start up in an ming Port external bootstrap mode. The Rabbit 2000 Micro- The programming port may also be used as an appli- processor User’s Manual provides more informa- cation port with the DIAG connector on the pro- tion related to the bootstrap mode. gramming cable. The programming port is used to start the Rabbit- All three clocked Serial Port A signals are available as Core RCM2200 in a mode where it will download a • a synchronous serial port program from the port and then execute the program. The programming port transmits information to and • an asynchronous serial port, with the clock from a PC while a program is being debugged in- line useable as a general CMOS input circuit. • two general CMOS inputs and one general The RabbitCore RCM2200 can be reset from the CMOS output. programming port via the /RESET_IN line. Two startup mode pins, SMODE0 and SMODE1, are available as general CMOS inputs after they are The Rabbit 2000 status pin is also presented to the read during the initial boot-up. The logic state of programming port. The status pin is an output that these two pins is very important in determining the can be used to send a general digital signal. startup procedure after a reset. The clock line for Serial Port A is presented to the /RES_IN is an external input used to reset the Rab- programming port, which makes synchronous serial bit 2000 microprocessor. communication possible. The status pin may also be used as a general CMOS output. See Appendix C, “Programming Cable,” for more information.

2–6 Hardware Reference RabbitCore RCM2200 2.3 Other Hardware automatically in the BIOS for crystals with a fre- quency above 12.9 MHz. 2.3.1 Clock Doubler The clock doubler may be disabled if 22.1 MHz clock speeds are not required. Disabling the Rabbit The RabbitCore RCM2200 takes advantage of the 2000 microprocessor’s internal clock doubler will Rabbit 2000 microprocessor’s internal clock dou- reduce power consumption and further reduce radi- bler. A built-in clock doubler allows half-frequency ated emissions. The clock doubler is disabled with a crystals to be used to reduce radiated emissions. The simple change to the BIOS as described below. 22.1 MHz frequency is generated using an 11.0592 MHz crystal. The clock doubler is disabled

1. Open the BIOS source code file, RABBITBIOS.C in the BIOS directory.

2. Change the line #define CLOCK_DOUBLED 1 // set to 1 to double the clock if XTAL<=12.9MHz, to read as follows. #define CLOCK_DOUBLED 0 // set to 1 to double the clock if XTAL<=12.9MHz, 3. Change the serial baud rate to 57,600 bps when the RabbitCore RCM2200 is operated at 11.05 MHz.

4. Save the change using File > Save.

2.3.2 Backup Battery Circuit External The RabbitCore RCM2200 does not have a battery, J5 Battery but there is provision for a customer-supplied bat- tery to back up SRAM and keep the internal Rabbit D0 23 24 VBAT 2000 real-time clock running. VCC 25 26 GND Header J5, shown in Figure 2–5, allows access to the external battery. This header makes it possible to connect an external 3 V power supply. This allows Figure 2–5: External Battery Connections the internal Rabbit 2000 real-time clock to run and at Header J5 allows the SRAM to retain data when the Rabbit- Core RCM2200 is powered down. 950 mA·h ------= 6.8 years. A lithium battery with a nominal voltage of 3 V and 16 µA a minimum capacity of 950 mA·h is recommended. A lithium battery is needed because of its nearly The actual life in your application will depend on constant nominal voltage over most of its life. the current drawn by components not on the Rabbit- Core RCM2200 and the storage capacity of the bat- The drain on the battery by the RabbitCore RCM2200 tery. Note that the shelf life of a lithium battery is is typically 16 µA when no other power is supplied. ultimately 10 years. If a 950 mA·h battery is used, the battery can last more than 6 years:

User’s Manual Hardware Reference 2–7 The battery-backup circuit serves two purposes: VCC VRAM • It reduces the battery voltage to the real-time R33

clock, thereby reducing the current consumed 0 W by the real-time clock and lengthening the bat- tery life. Q5 • It ensures that current can flow only out of the FDV302P R30 battery to prevent charging the battery. 10 kW Figure 2–6 shows the RabbitCore 2000 battery backup circuit. R17 /RESET Q2 22 kW MMBT3904 (5 V or VRAM 2.2 V) MMBT5088LT1 Q1 Figure 2–7: VRAM Switch

(3 V) VBAT Transistor Q5 is needed to ensure a very small volt- R5 R4 age drop between Vcc and VRAM (<100 mV, typi- 1.3 kW 220 kW R3 cally 10 mV) so that the processor lines powered by 2 MW Vcc will not have a significantly different voltage than VRAM.

Figure 2–6: RabbitCore RCM2200 When the RCM2200 is not resetting (pin 2 on U1 is Battery Backup Circuit high), the /RESET line will be high. This turns on Q2, causing its collector to go low. This turns on Q5, allowing VRAM to nearly equal Vcc. It is important not to charge a lithium battery with any appreciable current. Resistor R5, shown in When the RCM2200 is resetting, the /RESET line Figure 2–6, prevents any catastrophic failure of Q1 will go low. This turns off Q2 and Q5, providing an by limiting current to the customer-supplied battery. isolation between Vcc and VRAM. VRAM and Vcc are nearly equal (<100 mV, typi- The battery backup circuit keeps VRAM from drop- cally 10 mV) when power is supplied to the Rabbit- ping below 2 V. Core RCM2200.

Resistors R3 and R4 make up a voltage divider that 2.3.2.2 Reset Generator biases the base of Q1 to about 0.9 × VBAT. VBE on The RabbitCore RCM2200 uses a reset generator, Q1 is about 0.55 V. Therefore, VRAM is about 0.9 × U1, to reset the Rabbit 2000 microprocessor when VBAT - 0.55 V, or about 2.15 V for a 3 V battery. the voltage drops below the voltage necessary for reliable operation. The reset occurs between 4.50 V 2.3.2.1 Power to VRAM Switch and 4.75 V, typically 4.63 V. The VRAM switch, shown in Figure 2–7, allows a The RCM2200 has a reset output, pin 9 on header customer-supplied external battery to provide power J5. The reset output may be overdriven with at least when the external power goes off. The switch pro- 5 mA, essentially turning pin 9 on header J5 into a vides an isolation between Vcc and the battery when reset input, which may be used to reset the RCM2200. Vcc goes low. This prevents the Vcc line from draining the battery.

2–8 Hardware Reference RabbitCore RCM2200 Program Mode Run Mode

To PC COM port

RESET RabbitCore when changing mode: Short out pins 9 and 26 on header J5, OR Press RESET button (if using Prototyping Board), OR Remove, then reapply power after removing or attaching programming cable.

Figure 2–8: Switching Between Program Mode and Run Mode

2.4 Programming Cable 2.4.1 Changing from Program Mode to The RabbitCore RCM2200 is automatically in pro- Run Mode gram mode when the PROG connector on the pro- 1. Disconnect the programming cable from gramming cable is attached, and is automatically in header J5 of the RabbitCore RCM2200. run mode when no programming cable is attached. 2. Reset the RabbitCore RCM2200. You may The DIAG connector of the programming cable do this as explained in Figure 2–8. may be used on header J5 of the RabbitCore The RabbitCore RCM2200 is now ready to operate RCM2200 with the board operating in the run in the run mode. mode. This allows the programming port to be used as an application port. See Appendix C, “Program- ming Cable,” for more information. 2.4.2 Changing from Run Mode to Program Mode 1. Attach the programming cable to header J3 on the RabbitCore RCM2200 series.

2. Reset the RabbitCore RCM2200 series. You may do this as explained in Figure 2–8. The RabbitCore RCM2200 is now ready to operate in the program mode.

User’s Manual Hardware Reference 2–9 2–10 Hardware Reference RabbitCore RCM2200 Software Reference 3

Dynamic C Premier is an integrated development system for writing embed- ded software. It runs on an IBM-compatible PC and is designed for use with Z-World controllers and other controllers based on the Rabbit microprocessor. Chapter 3 provides the libraries, function calls, and sample programs related to the RabbitCore RCM2200.

3.1 More About Dynamic C Dynamic C cold-boots the target system and com- piles the BIOS. The BIOS is a basic program of a Dynamic C has been in use worldwide since 1989. It is specially designed for programming embedded few thousand bytes in length that provides the systems, and features quick compile and interactive debugging and communication facilities that debugging in the real environment. A complete ref- Dynamic C needs. Once the BIOS has been com- erence guide to Dynamic C is contained in the piled, the user can compile his own program and test Dynamic C Premier User’s Manual. it. If the user program stops running, a new cold boot and BIOS compile can be done at any time. Dynamic C for Rabbit 2000™ processors uses the standard Rabbit programming interface. This is a Dynamic C does not use include files, rather it 10-pin connector that connects to the Rabbit 2000 has libraries that are used for the same purpose, that serial port A. It is possible to reset and cold-boot a is, to supply functions and function prototypes to Rabbit processor via the programming port. No soft- programs before they are compiled. ware needs to be present in the target system. More Dynamic C supports assembly language, either as details are available in the Rabbit 2000 Micropro- separate functions or as fragments embedded in C cessor User’s Manual. programs. Interrupt routines may be written in Dynamic C or in assembly language.

User’s Manual Software Reference 3–1 3.1.1 Operating System Framework Dynamic C. See the Dynamic C Premier User’s Manual for more information. Dynamic C does not include an operating system in the usual sense of a complex software system that is resident in memory. The user has complete control 3.1.2 Using Dynamic C of what is loaded as a part of his program, other than You have a choice of doing your software develop- those routines that support loading and debugging ment in the flash memory or in the static RAM. (which are inactive at embedded run time). How- There are 256K bytes of flash memory and 128K ever, certain routines are very basic and normally bytes of SRAM. The advantage of working in RAM should always be present and active. is to save wear on the flash, which is limited to about 100,000 writes. • Periodic interrupt routine. This interrupt routine is driven by the Rabbit periodic NOTE: Note that an application can interrupt facility, and when enabled creates be developed in RAM, but cannot an interrupt every 16 ticks of the 32.768 run standalone from RAM after the kHz oscillator, or every 488 µs. This rou- programming cable is discon- tine drives three long global variables that nected. All applications can only run keep track of the time: SEC_TIMER, from flash memory. MS_TIMER, and TICK_TIMER that respectively count seconds, milliseconds, NOTE: Do not depend on the flash and 488 µs ticks. These variables are memory sector size or type. Due to needed by some functions that measure the volatility of the flash memory time. The SEC_TIMER is set to seconds market, the RabbitCore RCM2200 elapsed since 1 Jan 1980, and thus also keeps track of the time and date. The peri- and Dynamic C were designed to odic interrupt routine must be disabled accommodate flash devices with when the microprocessor enters sleepy various sector sizes. mode and the processor clock is operating at 32.768 kHz. The interrupt routine can- The disadvantage of using flash memory when not complete at this slow speed before the debugging a program is that interrupts must be dis- next tick of the periodic interrupt. In this abled for approximately 5 ms to 20 ms whenever a situation, the hardware real-time clock can break point is set in the program. This can crash fast be read directly to provide the time. interrupt routines that are running while you stop at a break point or single-step the program. The periodic interrupt function also hits the hardware watchdog timer. Software or Flash memory or RAM is selected with the “virtual” watchdog timers are available in Dynamic C Options > Compiler menu.

3–2 Software Reference RabbitCore RCM2200 3.2 Dynamic C Libraries The sample programs in the Dynamic C SAM- PLES/RCM2200 directory provide further exam- With Dynamic C running, click File > Open, and ples. select Lib. The following list of Dynamic C librar- ies will be displayed. 3.2.2 Serial Communication Drivers The Prototyping Board has room for an RS-232 chip for which the Rabbit serial library, RS232.LIB, provides a set of functions that send and receive entire blocks of data without yielding to other tasks, a set of single-user cofunctions that send and receive data but yield to other tasks, and a set of circular buffer functions. The naming convention is serXfn: ser—serial X—the port being used: A, B, C, or D

There is no unique library that is specific to the Rab- fn - the function being imple- bitCore RCM2200. The functions in the above mented libraries are described in the Dynamic C Premier For example, serBgetc() is the serial port B User’s Manual. function getc(), which returns a character. The Rabbit serial functions are listed in the follow- 3.2.1 I/O ing groups. The RabbitCore RCM2200 was designed to inter- face with other systems, and so there are no drivers Open and Close Functions written specifically for the I/O. The general Non-Cofunction Blocking Dynamic C read and write functions allow you to Input Functions customize the parallel I/O to meet your specific needs. For example, use Non-Cofunction Blocking Out- put Functions WrPortI(PEDDR, &PEDDRShadow, 0x00); Single-User Cofunction Input Functions to set all the port E bits as inputs, or use WrPortI(PEDDR, &PEDDRShadow, Single-User Cofunction Output 0xFF); Functions to set all the port E bits as outputs. Circular Buffer Functions

User’s Manual Software Reference 3–3 3.2.3 TCP/IP Drivers 3.3 Sample Programs The TCP/IP drivers are located in the TCPIP direc- Sample programs are provided in the Dynamic C tory. Samples folder, which is shown below.

Complete information on these libraries and the The various folders contain specific sample pro- TCP/IP functions is provided in the Dynamic C Pre- grams that illustrate the use of the corresponding mier TCP/IP Function Reference Manual. Dynamic C libraries. For example, the sample pro- gram PONG.C demonstrates the output to the Dynamic C STDIO window.

Two folders contain sample programs that illustrate features unique to the RabbitCore RCM2200.

• RCM2200—Demonstrates the basic operation and the Ethernet functionality of the RabbitCore RCM2200. • TCPIP—Demonstrates more advanced TCP/IP programming for Z-World’s Ethernet-enabled Rabbit-based boards. Follow the instructions included with the sample program to connect the RabbitCore RCM2200 and the other hardware identified in the instructions.

To run a sample program, open it with the File menu (if it is not still open), compile it using the Compile menu, and then run it by selecting Run in the Run menu. The RabbitCore RCM2200 must be in Program Mode (see Section 2.4, “Programming Cable”) and must be connected to a PC using the programming cable.

More complete information on Dynamic C is pro- vided in the Dynamic C Premier User’s Manual.

3–4 Software Reference RabbitCore RCM2200 3.4 Upgrading Dynamic C ply copy over an entire file since you may overwrite a bug fix; of course, you may copy over any pro- Dynamic C patches that focus on bug fixes are grams you have written. Once you are sure the new available from time to time. Check the Web sites patch works entirely to your satisfaction, you may • www.zworld.com/support/support- retire the existing installation, but keep it available center.html to handle legacy applications. or • www.rabbitsemiconductor.com/sup- 3.4.1 Upgrades port.html A special edition of Dynamic C, Dynamic C SE, is for the latest patches, workarounds, and bug fixes. included on the CD that comes with the RabbitCore RCM2200 Development Kit, and has been custom- The default installation of a patch or bug fix is to ized with all the libraries and features needed to install the file in a directory (folder) different from develop and run an application on the RabbitCore that of the original Dynamic C installation. Z-World RCM2200. recommends using a different directory so that you can verify the operation of the patch without over- More advanced users who may need upgrades and writing the existing Dynamic C installation. If you additional capabilities for other Z-World products in have made any changes to the BIOS or to libraries, the future are encouraged to consider the standard or if you have programs in the old directory (folder), edition of Dynamic C Premier, which Z-World plans make these same changes to the BIOS or libraries in to fully supported with upgrades now and into the the new directory containing the patch. Do not sim- future.

User’s Manual Software Reference 3–5 3–6 Software Reference RabbitCore RCM2200 RabbitCore RCM2200 Specifications A

Appendix A provides the specifications for the RabbitCore RCM2200, and describes the conformal coating.

User’s Manual RabbitCore RCM2200 Specifications A–1 A.1 Electrical and Mechanical Characteristics Figure A–1 shows the mechanical dimensions for the RabbitCore RCM2200.

2.300 (58.4) 1.060 (26.9) 0.130 dia (3.3) (40.6) 1.600 (20.3) 0.800

(0,0) for Pin 1 coordinates 0.625 0.602 (15.3) (4.0) (15.7) 0.156 (14) 0.55 (16) 0.62 (18) 0.72 (22) 0.86

2.300 (58.4) (14) 0.55 (16) 0.62 (18) 0.72 (22) 0.86

1.600 (40.6)

Figure A–1: RabbitCore RCM2200 Dimensions

A–2 RabbitCore RCM2200 Specifications RabbitCore RCM2200 Table A –1 provides the pin 1 locations for the RabbitCore RCM2200 headers viewed from the top side (as in Figure A–1).

Table A –1: RabbitCore RCM2200 Header Pin 1 Locations

Pin 1 (x,y) Header Description Coordinates (Inches)

J4 RabbitCore RCM2200 user board interface (0.100, 1.445)

J5 RabbitCore RCM2200 user board interface (0.100, 0.195)

J1 Programming header (top side) (0.125, 1.515)

DS1 LNK LED (1.815, 0.105)

DS2 ACT LED (2.015, 0.105)

Table A –2 lists the electrical, mechanical, and environmental specifications for the RabbitCore RCM2200.

User’s Manual RabbitCore RCM2200 Specifications A–3 Table A–2: RabbitCore RCM2200 Specifications

Parameter Specification

1.60" × 2.30" × 0.86" Board Size (41 mm × 59 mm × 22 mm)

Operating Temperature –40°C to +70°C

Humidity 5% to 95%, noncondensing

Input Voltage 4.75 V to 5.25 V DC

134 mA at 22.1 MHz, 5 V DC; 10 mA additional with programming Current cable attached

26 parallel I/0 lines grouped in five 8-bit ports (shared with serial General-Purpose I/O ports): 16 configurable for I/O, 7 fixed inputs, 3 fixed outputs

Memory, I/O Interface 4 address lines, 8 data lines, I/O read/write

Additional Digital Inputs Startup mode (2), reset in, Serial Port A (1)

Additional Digital Outputs Status, reset out, Serial Port A (1)

Ethernet Interface 10base-T

Microprocessor Rabbit 2000™

Clock 22.1 MHz

SRAM 128K × 8, surface mount

Flash Memory One 256K × 8, surface mount

Five 8-bit timers cascadable in pairs, one 10-bit timer with 2 match Timers registers that each have an interrupt

Three CMOS-compatible ports. One port is configurable as a clocked Serial Ports port, a fourth clocked pin is available on the programming port.

CMOS: Serial Rate maximum asynchronous 345,600 bps maximum synchronous 138,240 bps

A slave port allows the RabbitCore RCM2200 to be used as an Slave Interface intelligent peripheral device slaved to a master processor, which may either be another Rabbit 2000 or any other type of processor

Watchdog/Supervisor Yes

Time/Date Clock Yes

Socket Strip (for connection 2x13, 2 mm pitch to headers J4 and J5)

Provision for user-supplied backup battery (2.85 V to 3.15 V) via Backup Battery connections on header J5

A–4 RabbitCore RCM2200 Specifications RabbitCore RCM2200 A.1.1 Headers Figure A–2 shows the layout of another board for The RabbitCore 2000 uses headers at J4 and J5 for the RabbitCore RCM2200 to be plugged into. These physical connection to other boards. J4 and J5 are values are relative to the header connectors. 2 × 13 SMT headers with a 2 mm pin spacing. J1, the programming port, is a 2 × 5 header with a 2 A.1.2 Physical Mounting mm pin spacing. A 9/32” (7 mm) standoff with a 6-32 screw is rec- ommended to attach RabbitCore RCM2200 to a user board at the hole position shown in Figure A–2.

J4 J1 0.935 0.715 RCM2200 Footprint (23.7) 0.645 (18.2) (16.4) 0.130 dia (3.3)

0.960 (24.4) 0.605 0.020 sq typ (15.4) 0.079 (0.5) (2.0) J5

0.079 (2.0)

Figure A–2: User Board Footprint for RabbitCore RCM2200

A.2 Bus Loading This section provides bus loading information for external devices. You must pay careful attention to bus loading when designing an interface to the RabbitCore RCM2200. Table A –3 lists the capacitance for the various Rab- bitCore 2000 I/O ports.

Table A –3: Capacitance of Rabbit 2000 I/O Ports

Input Output I/O Ports Capacitance Capacitance (pF) (pF)

Parallel Ports A to E 12 14

Data Lines BD0–BD7 10 12

Address Lines BA0–BA12 4 8

User’s Manual RabbitCore RCM2200 Specifications A–5 Figure A–3 shows a typical timing diagram for the Rabbit 2000 microprocessor external memory read and write cycles.

External I/O Read (no extra wait states) T1 Tw T2

CLK

A[15:0] valid

Tadr Tsetup D[7:0] valid Thold /CSx

/OEx

/IOCSx valid

/IORD /BUFEN

External I/O Write (no extra wait states) T1 Tw T2

CLK

A[15:0] valid

Tadr

D[7:0] valid

/CSx

/WEx

/IOCSx valid

Thold /IOWR

/BUFEN

Figure A–3: Memory Read and Write Cycles

Tadr is the time required for the address output to reach 0.8 V. This time depends on the bus loading. Tsetup is the data setup time relative to the clock. Tsetup is specified from 30%/70% of the VDD voltage level.

A–6 RabbitCore RCM2200 Specifications RabbitCore RCM2200 Table A –4 lists the parameters shown in these figures and provides minimum or measured values.

Table A –4: Memory and External I/O Read/Write Parameters

Parameter Description Value

Time from CPU clock rising 7 ns @ 20 pF, 5 V (10 ns @ 3.3 V) T Max. adr edge to address valid 14 ns @ 70 pF, 5 V (19 ns @ 3.3 V)

Tsetup Data read setup time Min. 2 ns @ 5 V (3 ns @ 3.3 V)

Thold Data read hold time Min. 0 ns Read Parameters Read

Time from CPU clock rising 7 ns @ 20 pF, 5 V (10 ns @ 3.3 V) T Max. adr edge to address valid 14 ns @ 70 pF, 5 V (19 ns @ 3.3 V)

Data write hold time from /WEx T Min. ½ CPU clock cycle hold or /IOWR Write Parameters

A.3 Rabbit 2000 DC Characteristics Table A –5 outlines the DC characteristics for the Rabbit 2000 at 5.0 V over the recommended operating tem- perature range from Ta = –40°C to +85°C, VDD = 4.5 V to 5.5 V.

Table A –5: 5.0 Volt DC Characteristics

Symbol Parameter Test Conditions Min Typ Max Units

V = V , V = 5.5 I Input Leakage High IN DD DD 10 µA IH V

Input Leakage Low I V = V , V = 5.5 V -10 µA IL (no pull-up) IN SS DD

Output Leakage (no pull- VIN = VDD or VSS, IOZ -10 10 µA up) VDD = 5.5 V

VIL CMOS Input Low Voltage 0.3 x VDD V

VIH CMOS Input High Voltage 0.7 x VDD V CMOS Switching V V = 5.0 V, 25°C2.4V T Threshold DD

I = See Table A–6 CMOS Output Low OL V (sinking) 0.2 0.4 V OL Voltage VDD = 4.5 V I = See Table A–6 CMOS Output High OH V (sourcing) 0.7 x V 4.2 V OH Voltage DD VDD = 4.5 V

User’s Manual RabbitCore RCM2200 Specifications A–7 A.4 I/O Buffer Sourcing and per pin. Address pin A0 and data pin D0 are rated at Sinking Limit 16 mA each. Pins A1–A12 and D1–D7 are each rated at 8 mA. The absolute maximum operating Unless otherwise specified, the Rabbit I/O buffers voltage on all I/O is V + 0.5 V, or 5.5 V. are capable of sourcing and sinking 8 mA of current DD per pin at full AC switching speed. Full AC switch- Table A –6 shows the AC and DC output drive lim- ing assumes a 25.8 MHz CPU clock and capacitive its of the parallel I/O buffers when the Rabbit 2000 loading on address and data lines of less than 100 pF is used in the RabbitCore RCM2200.

Table A –6: I/O Buffer Sourcing and Sinking Capability

Output Drive Pin Name Sourcing*/Sinking† Limits (mA)

Maximum‡ DC Full AC Switching Output Port Name Output Drive SRC/SNK SRC/SNK

PA [7:0] 8/8 12/12

PB [7, 1, 0] 8/8 12/12

PC [6, 2, 0] 8/8 12/12

PD [5::4] 8/8 12/12

PD3** 16/16 25/25

PE [7, 5, 4, 1, 0] 8/8 12/12 * The maximum DC sourcing current for I/O buffers between VDD pins is 112 mA.

† The maximum DC sinking current for I/O buffers between VSS pins is 150 mA. ‡ The maximum DC output drive on I/O buffers must be adjusted to take into consideration the current demands made my AC switching outputs, capacitive loading on switching outputs, and switching volt- age. The current drawn by all switching and nonswitching I/O must not exceed the limits specified in the first two footnotes. ** The combined sourcing from Port D [7:0] may need to be adjusted so as not to exceed the 112 mA sourcing limit requirement specified in the first footnote.

A–8 RabbitCore RCM2200 Specifications RabbitCore RCM2200 A.5 Conformal Coating The areas around the crystal oscillator has had the Dow Corning silicone-based 1-2620 conformal coating applied. The conformally coated area is shown in Figure A–4. The conformal coating pro- tects these high-impedance circuits from the effects of moisture and contaminants over time. Any components in the conformally coated area may be replaced using standard soldering proce- dures for surface-mounted components. A new con- formal coating should then be applied to offer continuing protection against the effects of mois- ture and contaminants.

NOTE: For more information on con- Figure A–4: RabbitCore RCM2200 Areas formal coatings, refer to Rabbit Receiving Conformal Coating Semiconductor Technical Note 303, Conformal Coatings.

User’s Manual RabbitCore RCM2200 Specifications A–9 A–10 RabbitCore RCM2200 Specifications RabbitCore RCM2200 Power Supply B

Appendix B provides information on the current requirements of the RabbitCore RCM2200, and some background on the chip select circuit used in power manage- ment.

B.1 Power Supplies The current drain on the battery in a battery-backed circuit must be kept to a minimum. When the Rab- The RabbitCore RCM2200 requires a regulated 5 V bitCore RCM2200 is not powered, the battery keeps ± 0.25 V DC power source. The RabbitCore design the SRAM memory contents and the real-time clock presumes that the voltage regulator is on the user (RTC) going. The SRAM has a powerdown mode board, and that the power is made available to the that greatly reduces power consumption. This pow- RabbitCore board through headers J4 and J5. erdown mode is activated by raising the chip select A RabbitCore RCM2200 with no loading at the out- (CS) signal line. Normally the SRAM requires Vcc puts operating at 22.1 MHz typically draws 134 mA. to operate. However, only 2 V is required for data The RabbitCore RCM2200 will consume an addi- retention in powerdown mode. Thus, when power is tional 10 mA when the programming cable is used removed from the circuit, the battery voltage needs to connect J1 to a PC. to be provided to both the SRAM power pin and to the CS signal line. The CS control switch accom- plishes this task for the CS signal line. B.2 Battery Backup Circuits Figure B–1 shows a schematic of the chip select As explained in Section 2.3.2, the RabbitCore control switch. RCM2200 has provision for battery backup, which kicks in to keep VRAM from dropping below 2 V.

User’s Manual Power Supply B–1 VRAM

R28 100 kW

/CSRAM Q4 /CS1

Q3 VRAM SWITCH

/RESET_OUT

Figure B–1: Chip Select Control Switch

In a powered-up condition, the CS control switch from the processor. The isolated /CSRAM line has a must allow the processor’s chip select signal /CS1 to 100 kΩ pullup resistor to VRAM (R28). This pullup control the SRAM’s CS signal /CSRAM. So, with resistor keeps /CSRAM at the VRAM voltage level power applied, /CSRAM must be the same signal as (which under no power condition is the backup bat- /CS1, and with power removed, /CSRAM must be tery’s regulated voltage at a little more than 2 V). held high (but only needs to be as high as the battery Transistors Q3 and Q4 are of opposite polarity so voltage). Q3 and Q4 are MOSFET transistors with that a rail-to-rail voltages can be passed. When the opposing polarity. They are both turned on when /CS1 voltage is low, Q3 will conduct. When the power is applied to the circuit. They allow the CS /CS1 voltage is high, Q4 will conduct. It takes time signal to pass from the processor to the SRAM so for the transistors to turn on, creating a propagation that the processor can periodically access the delay. This delay is typically very small, about 10 ns SRAM. When power is removed from the circuit, to 15ns. the transistors will turn off and isolate /CSRAM

B–2 Power Supply RabbitCore RCM2200 Programming Cable C

Appendix C provides additional theoretical information for the Rabbit 2000™ microprocessor when using the DIAG and PROG connectors on the program- ming cable. The PROG connector is used only when the programming cable is attached to the programming connector (header J5) while a new application is being developed. Otherwise, the DIAG connector on the programming cable allows the programming cable to be used as an RS-232 to CMOS level con- verter for serial communication, which is appropriate for monitoring or debugging a RabbitCore system while it is running.

User’s Manual Programming Cable C–1 The programming port, which is shown in Figure C–1, a setup function, that is, write setup information to can serve as a convenient communications port for flash memory, then the controller can be reset field setup or other occasional communication need through the programming port and a cold boot per- (for example, as a diagnostic port). There are sev- formed to start execution of a special program dedi- eral ways that the port can be automatically inte- cated to this functionality. grated into software. If the port is simply to perform

PROGRAMMING PORT PIN ASSIGNMENTS (Rabbit PQFP pins are shown in parenthesis) ~50 kW 12 1. RXA (51) +

34 2. GND ~50 kW 3. CKLKA (94) + 56 4. +5 V/+3 V ~10 kW 78 5. /RESET + 9 10 6. TXA (54) 7. n.c. 8. STATUS (output) (38) Programming Port ~50 kW Pin Numbers 9. SMODE0 (36) GND ~50 kW 10. SMODE1 (35) GND

Figure C–1: Programming Port Pin Assignments

When the PROG connector is used, the /RESET periodically to see if communication needs to begin line can be asserted by manipulating DTR and the or to enable the port and wait for interrupts. The STATUS line can be read as DSR on the serial port. pull-up resistors on RXA and CLKA prevent spuri- The target can be restarted by pulsing reset and then, ous data reception that might take place if the pins after a short delay, sending a special character string floated. at 2400 bps. To simply restart the BIOS, the string If the clocked serial mode is used, the serial port can 80h, 24h, 80h can be sent. When the BIOS is be driven by having two toggling lines that can be started, it can tell whether the programming cable is driven and one line that can be sensed. This allows connected because the SMODE1 and SMODE0 a conversation with a device that does not have an pins are sensed as being high. This will cause the asynchronous serial port but that has two output sig- Rabbit 2000 to enter the bootstrap mode. The nal lines and one input signal line. Dynamic C programming mode then can have an escape message that will enable the diagnostic serial The line TXA (also called PC6) is zero after reset if port function. the cold-boot mode is not enabled. A possible way to detect the presence of a cable on the program- Alternatively, the DIAG connector can be used to ming port is for the cable to connect TXA to one of connect the programming port. The /RESET line the SMODE pins and then test for the connection by and the SMODE1 and SMODE0 pins are not con- raising PC6 and reading the SMODE pin after the nected to this connector. The programming port is cold-boot mode has been disabled. then enabled as a diagnostic port by polling the port

C–2 Programming Cable RabbitCore RCM2200 Once you establish that the programming port will lines. Table C–1 lists the pins available for this never again be needed for programming, it is possi- alternate configuration. ble to use the programming port for additional I/O

Table C–1: RabbitCore RCM2200 Programming Port Pinout Configurations

Pin Pin Name Default Use Alternate Use Notes

1 RXA Serial Port A PC6—Input

2GND

PB1—Bitwise or paral- 3CLKA lel programmable input

4VCC

Connected to reset 5 RESET generator U1

Header J1 6 TXA Serial Port A PC7—Output

8 STATUS Output

Must be low when 9 SMODE0 Input RCM2200 boots up

Must be low when 10 SMODE1 Input RCM2200 boots up

User’s Manual Programming Cable C–3 C–4 Programming Cable RabbitCore RCM2200 Sample Circuits D

This appendix details several basic sample circuits that can be used with the RabbitCore RCM2200 modules.

• RS-232/RS-485 Serial Communication • Keypad and LCD Connections • Keypad and LCD Connections • D/A Converter

User’s Manual Sample Circuits D–1 D.1 RS-232/RS-485 Serial Communication

RS-232 VCC

100 nF 1 C1+ V+ 2 RabbitCore 6 RCM2200 100 nF V– 3 C1– 100 nF 4 C2+ J4 100 nF 5 C2–

3 PC0 11 T1IN T1OUT 14 TXD

4 PC1 12 R1OUT R1IN 13 RXD

5 PC2 10 T2IN T2OUT 7 TXC

6 PC3 9 R2OUT R2IN 8 RXC

RabbitCore RCM2200 J4 RS-485 PC0 4 3 D VCC PC1 4 1 R 680 W A 6 485+ 220 W B 7 485– 10 PD3 3 DE 680 W 47 kW 2 RE SP483EN

Figure D–1: Sample RS-232 and RS-485 Circuits

Sample Program: PUTS.C in SAMPLES/RCM2200.

D–2 Sample Circuits RabbitCore RCM2200 D.2 Keypad and LCD Connections

RabbitCore VCC RCM2200 10 kW resistors Keypad J5 PB0 10 Row 0 PB2 11 Row 2 PB3 12 Row 3 13 PB4 Row 4 PB5 14 Row 5 Row 1

J4 4 PC1 PD3 10 Col 0 PD4 11 Col 1 NC NC

Figure D–2: Sample Keypad Connections

Sample Program: KEYLCD.C in SAMPLES/RCM2200.

2x20 LCD RabbitCore VLC 3 VLC RCM2200 2

W VCC W W W W W W 680 100 nF 1 k 1 20 k 20 10 k 10 470 2.2 k 2.2 J5 k 4.7 2 PA1 6 /CS 3 PA2 4 C/D 4 PA3 5 /WR 5 PA4 11 D4 6 PA5 12 D5 7 PA6 13 D6 8 PA7 14 D7 7 D0 8 D1 9 D2 10 D3

Figure D–3: Sample LCD Connections

Sample Program: KEYLCD.C in SAMPLES/RCM2200.

User’s Manual Sample Circuits D–3 D.3 External Memory The sample circuit can be used with an external 64K memory device. Larger SRAMs can be written to using this scheme by using other available Rabbit 2000 ports (parallel ports A to E) as address lines.

SRAM RabbitCore RCM2200 A0–A3 A0–A3

D0–D7 D0–D7

/WE /IOWR /OE /IORD /CE PE7

10 kW

Vcc

Figure D–4: Sample External Memory Connections

Sample Program: EXTSRAM.C in SAMPLES/RCM2200.

D–4 Sample Circuits RabbitCore RCM2200 D.4 D/A Converter The output will initially be 0 V to -10.05 V after the first inverting op-amp, and 0 V to +10.05 V after the sec- ond inverting op-amp. All lows produce 0 V out, FF produces 10 V out. The output can be scaled by chang- ing the feedback resistors on the op-amps. For example, changing 5.11 kΩ to 2.5 kΩ will produce an output from 0 V to -5 V. Op-amps with a very low input offset voltage are recommended.

22 pF 22 pF

5.11 kW 10 kW HC374 649 kW –

10 kW

324 kW – 162 kW +

Vo CT0–CT7 80.6 kW + PA0–PA7 1.19 kW V+ > 12 V 40.2 kW V– < –12 V 4.99 kW 20 kW

10 kW +5 V +5 V 5.11 kW 47 kW 47 kW

PE4 CLK E PE2

Figure D–5: Sample D/A Converter Connections

User’s Manual Sample Circuits D–5 D–6 Sample Circuits RabbitCore RCM2200 External Interrupts E

Appendix E provides information about using the RabbitCore RCM2200 external interrupts.

The Rabbit 2000 microprocessor has four external Figure E–1 illustrates these pins. interrupt inputs on Parallel Port E, which is accessed through pins PE0, PE1, PE4, and PE5 on header J4.

Table E –1 lists the general-purpose Parallel Port E PE0 I/O or INT0A 30 I/O pins that can be used for external interrupts. PE1 I/O or INT1A 29

Table E –1: Rabbit 2000 Parallel Port E Interrupts

Pin Default Use Alternate Use

PE0 INT0A input

PE1General- INT1A input Purpose PE4I/O INT0B input PE4 I/O or INT0B PE5 INT1B input 24

PE5 I/O or INT1B 23

Figure E–1: Rabbit 2000 Interrupt Pins

User’s Manual External Interrupts E–1 E.1 Use of External Interrupts flip-flop should be cleared automatically when the interrupt takes place. Figure E–2 shows a block diagram of how the Rab- bit 2000 external interrupt logic is used in general. Instead, the flip-flop may be cleared spuriously because a different, lower priority, interrupt occurs nearly simultaneously (during an 8-clock window) with the occurrence of the edge that sets the flip- 29 INT1A Interrupt Request #1 flop. This results in a lost interrupt. 23 INT1B Edge Or the flip-flop might not be cleared when the inter- Detectors 30 rupt takes place if a different, higher priority, inter- INT0A Interrupt Request #0 INT0B 24 rupt is being requested nearly simultaneously (during an 8-clock window) with the occurrence of the external interrupt. This results in a spurious Figure E–2: Rabbit 2000 External Interrupt Logic interrupt after the first interrupt because the interrupt request was not cleared. Interrupts on the Rabbit 2000 can take place at three In either case, precautions need to be taken if an priority levels from low to high priority, and are interrupt request transitions during a short time numbered 1, 2 and 3. Each on-chip device, includ- period 8 clocks long. These sequences are shown ing the two external interrupts, can be assigned a schematically in Figure E–3. priority at which interrupts will take place. For inter- rupts that have been assigned the same pro- grammed priority, there is an implicit priority with external interrupt #1 having the highest priority, Ext Interrupt Req ff

Spurious clear of interrupt request ff external interrupt #0 the second highest, and the 8-clock window remaining on-chip devices having lower priorities in Different lower priority interrupt the order specified in Section 7.8, “Rabbit Interrupt (e.g., serial port) takes place Structure,” in the Rabbit 2000 User’s Manual. LOST INTERRUPT The two independent interrupts are generated by Different higher priority interrupt is inputs to the four pins shown in Figure E–2. Each requested during 8-clock window pin is connected to an edge detector that can be con- Request ff fails to be cleared figured under program control to detect rising Ext Interrupt Req ff edges, falling edges, or both. These same pins, a part of parallel port E, support alternate functional- External Interrupt ity as reflected in Table E–1. takes place Spurious interrupt results When the edge detector detects the rising or falling edge that it is programmed to detect, it sets a flip- SPURIOUS INTERRUPT flop that drives the output of the edge detector. The Figure E–3: Interrupt Sequences with Lost or Spurious Interrupts

E–2 External Interrupts RabbitCore RCM2200 E.2 Single-Interrupt Request result of programming one of the on-chip periph- eral interrupts to have a higher interrupt priority. Tie the inputs for external interrupt #1 and #0 This could be the case, for example, if the external together by adding a 1 kΩ resistor between the two interrupts are programmed to have priority 1, and lines. Under this configuration, shown in Figure E– one of the serial port interrupts is programmed to 4, both interrupt #1 and #0 will be requested when have priority 2. Spurious interrupts can always be an edge is detected. The #1 interrupt will take place eliminated by programming both external interrupts first since it is of a higher priority. to have a priority equal to the highest priority used for another device. The priority can be reduced on entry to the service routine to avoid blocking the

Interrupt Request #1 true high-priority interrupts. External interrupt #1 Interrupt Request INT1A cannot cause interrupt #0 to have a spurious inter- Edge 1 kW Detectors rupt or vice versa. In some cases, spurious interrupts Interrupt Request #0 INT0A may not disturb function, but the fix is so simple that it is not usually worth the trouble to analyze this possibility. Figure E–4: RabbitCore RCM2200 Configuration for Single-Interrupt Request E.3 OR’ed Interrupt Request The interrupt service routine for interrupt #1 should Tie the inputs for external interrupt #1 and #0 ignore the interrupt. The actual service routine will together by adding a 1 kΩ resistor. This configura- be the service routine for interrupt #0. If an interrupt tion is shown in Figure E–5. is lost, it will always be #1 and never #0. The 1 kΩ resistor delays the edge slightly so that interrupt #1 is guaranteed to be latched earlier or simultaneously OR'ed Interrupt Request INT1A with interrupt #0. It is important that the programmed Interrupt Request #1 priority of interrupt #1 be higher than or equal to the INT1B 1 kW Edge programmed priority of interrupt #0. Normally they Detectors INT0A should be equal. OR'ed Interrupt Interrupt Request #0 Request INT0B Spurious interrupts, which occur because of a fail- 1 kW ure to clear the request latch, are a possibility only if Figure E–5: RabbitCore RCM2200 Configuration there are other interrupts of higher priority than for OR’ed Interrupt Request external interrupt #1 and #0. These can only be the

User’s Manual External Interrupts E–3 E–4 External Interrupts RabbitCore RCM2200 Index

A SMODE0 ...... 2-6 M SMODE1 ...... 2-6 additional information digital inputs ...... 2-2 manuals ...... 1-2 Getting Started manual ..... 1-2 digital outputs ...... 2-2 online documentation ...... 1-3 P Dynamic C ...... 3-1 references ...... 1-3 compile in flash memory or RAM physical mounting ...... A-5 B option ...... 3-2 pin 1 locations ...... A-3 libraries ...... 3-3 pin configurations ...... 2-3 backup-battery circuit ...... 2-7 operating system framework 3-2 programming port ...... C-3 external battery con- upgrades and patches ...... 3-5 pinout nections ...... 2-7 use ...... 3-2 Ethernet port ...... 2-5 battery life ...... 2-7 battery-backup circuit ...... 2-8 E programming cable ...... C-2 reset generator ...... 2-8 programming port ...... C-2 VRAM switch ...... 2-8 Ethernet port ...... 2-5 RCM2200 ...... 2-2 bus loading ...... A-5 pinout ...... 2-5 pinout configurations ...... 2-4 external interrupts ...... E-1 power supplies ...... B-1 C OR’ed interrupt request ... E-3 chip select circuit ...... B-1 single-interrupt request .... E-3 clock doubler ...... 2-7 Program Mode ...... 2-9 use ...... E-2 conformal coating ...... A-9 switching modes ...... 2-9 F programming cable ...... C-1 D DIAG connector ...... C-2 features ...... 1-1, 1-2 Development Kit ...... 1-2 pinout ...... C-2 programming port ...... 2-5 digital I/O ...... 2-1 I I/O buffer sourcing and sinking pin configurations ...... C-3 limits ...... A-8 I/O buffer sourcing and sinking lim- pinout ...... C-2 memory interface ...... 2-2 its ...... A-8 used as diagnostic port .... C-2

User’s Manual 1 R specifications ...... A-1 bus loading ...... A-5 Rabbit subsystems ...... 2-1 digital I/O buffer sourcing and Run Mode ...... 2-9 sinking limits ...... A-8 switching modes ...... 2-9 dimensions ...... A-2 S electrical, mechanical, and envi- ronmental ...... A-3 sample circuits ...... D-1 header footprint ...... A-5 serial communication ...... 2-5 headers ...... A-5 serial ports ...... 2-5 physical mounting ...... A-5 Ethernet port ...... 2-5 pin 1 locations ...... A-3 programming port ...... 2-5 Rabbit 2000 DC characteristics software A-7 I/O drivers ...... 3-3 Rabbit 2000 timing diagram A-6 libraries ...... 3-3 relative pin 1 locations .....A-5 RS232.LIB ...... 3-3 subsystems TCP/IP ...... 3-4 digital inputs and outputs . 2-1 sample programs ...... 3-4 switching modes ...... 2-9 PONG.C ...... 3-4 RCM2200 ...... 3-4 TCPIP ...... 3-4 serial communication drivers 3-3 TCP/IP drivers ...... 3-4

2 RabbitCore RCM2200 Schematics

The following schematics are included for user reference:

090–0120 RabbitCore RCM2200 schematic 090–0122 RCM2200 Prototyping Board schematic 090–0085 Programming Cable

User’s Manual Schematics 1 REVISION HISTORY REVISION APPROVAL PROJECT APPROVAL DOCUMENT APPROVAL REV ECO DESCRIPTION OF CHANGE ENGINEER DATE CONTROL DATE

APPEND THE FOLLOWING DRAWING CONTENT: DOCUMENTS WHEN CHANGING THIS DOCUMENT:

2900 SPAFFORD ST. APPROVALS: INITIAL RELEASE DAVIS, CA 95616 530 - 757-4616 C SIGNATURES DATE NONE *

C NONE REVISION HISTORY REVISION APPROVAL

PROJECT APPROVALDOCUMENT APPROVAL REV ECO DESCRIPTION ENGINEER DATE CONTROL DATE MASTER SLAVE

APPEND THE FOLLOWING DRAWING CONTENT: DOCUMENTS WHEN CHANGING THIS DOCUMENT:

2900 SPAFFORD ST. DAVIS, CA 95616 APPROVALS: INITIAL RELEASE 530 - 757 - 4616 B SIGNATURES DATE NONE REVISION HISTORY REVISION APPROVAL

PROJECT APPROVAL DOCUMENT APPROVAL REV ECO DESCRIPTION ENGINEER DATE CONTROL DATE

APPEND THE FOLLOWING DRAWING CONTENT: DOCUMENTS WHEN CHANGING THIS DOCUMENT: ZWORLD

2900 SPAFFORD ST. DAVIS, CA 95616 APPROVALS: INITIAL RELEASE 530 - 757 - 4616 B SIGNATURES DATE NONE