Download RabbitCore RCM3209/RCM3229
Transcript
RabbitCore RCM3209/RCM3229 C-Programmable Module with Ethernet User’s Manual 019–0165 • 080528–D RabbitCore RCM3209/RCM3229 User’s Manual Part Number 019-0165 • 080528–D • Printed in U.S.A. ©2008 Digi International Inc. • All rights reserved. No part of the contents of this manual may be reproduced or transmitted in any form or by any means without the express written permission of Digi International. Permission is granted to make one or more copies as long as the copyright page contained therein is included. These copies of the manuals may not be let or sold for any reason without the express written permission of Digi International. Digi International reserves the right to make changes and improvements to its products without providing notice. Trademarks Rabbit and Dynamic C are registered trademarks of Digi International Inc. Rabbit 3000 and RabbitCore are trademarks of Digi International Inc. The latest revision of this manual is available on the Rabbit Web site, www.rabbit.com, for free, unregistered download. Rabbit Semiconductor Inc. www.rabbit.com RabbitCore RCM3209/RCM3229 TABLE OF CONTENTS Chapter 1. Introduction 1 1.1 RCM3209/RCM3229 Features .............................................................................................................2 1.2 Comparing the RCM3209/RCM3229 and RCM3200/RCM3220 ........................................................3 1.3 Advantages of the RCM3209/RCM3229 .............................................................................................4 1.4 Development and Evaluation Tools......................................................................................................5 1.4.1 RCM3209/RCM3229 Development Kit .......................................................................................5 1.4.2 Software ........................................................................................................................................6 1.4.3 Connectivity Interface Kits ...........................................................................................................6 1.4.4 Online Documentation ..................................................................................................................6 Chapter 2. Hardware Setup 7 2.1 Install Dynamic C .................................................................................................................................7 2.2 Hardware Connections..........................................................................................................................8 2.2.1 Step 1 — Attach Module to Prototyping Board............................................................................9 2.2.2 Step 2 — Connect Programming Cable ......................................................................................10 2.2.3 Step 3 — Connect Power ............................................................................................................11 2.3 Starting Dynamic C ............................................................................................................................12 2.4 Run a Sample Program .......................................................................................................................12 2.4.1 Troubleshooting ..........................................................................................................................12 2.5 Where Do I Go From Here? ...............................................................................................................13 2.5.1 Technical Support .......................................................................................................................13 Chapter 3. Running Sample Programs 15 3.1 Introduction.........................................................................................................................................15 3.2 Sample Programs ................................................................................................................................16 3.2.1 Serial Communication.................................................................................................................17 3.2.2 Other Sample Programs ..............................................................................................................18 Chapter 4. Hardware Reference 19 4.1 RCM3209/RCM3229 Digital Inputs and Outputs ..............................................................................20 4.1.1 Memory I/O Interface .................................................................................................................25 4.1.2 LEDs ...........................................................................................................................................25 4.1.3 Other Inputs and Outputs ............................................................................................................25 4.1.4 5 V Tolerant Inputs .....................................................................................................................25 4.2 Serial Communication ........................................................................................................................26 4.2.1 Serial Ports ..................................................................................................................................26 4.2.2 Ethernet Port (RCM3209 only)...................................................................................................27 4.2.3 Serial Programming Port.............................................................................................................28 4.3 Serial Programming Cable..................................................................................................................29 4.3.1 Changing Between Program Mode and Run Mode ....................................................................29 4.3.2 Standalone Operation of the RCM3209/RCM3229....................................................................30 4.4 Other Hardware...................................................................................................................................31 4.4.1 Clock Doubler .............................................................................................................................31 4.4.2 Spectrum Spreader ......................................................................................................................31 4.5 Memory...............................................................................................................................................32 4.5.1 SRAM .........................................................................................................................................32 4.5.2 Flash EPROM .............................................................................................................................32 4.5.3 Dynamic C BIOS Source Files ...................................................................................................32 User’s Manual Chapter 5. Software Reference 33 5.1 More About Dynamic C ..................................................................................................................... 33 5.2 Dynamic C Function Calls ................................................................................................................. 35 5.2.1 Digital I/O................................................................................................................................... 35 5.2.2 SRAM Use.................................................................................................................................. 35 5.2.3 Serial Communication Drivers ................................................................................................... 36 5.2.4 TCP/IP Drivers ........................................................................................................................... 36 5.2.5 Prototyping Board Function Calls .............................................................................................. 36 5.2.6 Prototyping Board Functions...................................................................................................... 37 5.2.6.1 Board Initialization ............................................................................................................ 37 5.3 Upgrading Dynamic C ....................................................................................................................... 38 5.3.1 Extras.......................................................................................................................................... 38 Chapter 6. Using the TCP/IP Features 39 6.1 TCP/IP Connections ........................................................................................................................... 39 6.2 TCP/IP Primer on IP Addresses ......................................................................................................... 41 6.2.1 IP Addresses Explained.............................................................................................................. 43 6.2.2 How IP Addresses are Used ....................................................................................................... 44 6.2.3 Dynamically Assigned Internet Addresses................................................................................. 45 6.3 Placing Your Device on the Network ................................................................................................ 46 6.4 Running TCP/IP Sample Programs.................................................................................................... 47 6.4.1 How to Set IP Addresses in the Sample Programs..................................................................... 48 6.4.2 How to Set Up your Computer for Direct Connect.................................................................... 49 6.5 Run the PINGME.C Sample Program................................................................................................ 50 6.6 Running More Sample Programs With Direct Connect..................................................................... 50 6.7 Where Do I Go From Here? ............................................................................................................... 51 Appendix A. RCM3209/RCM3229 Specifications 53 A.1 Electrical and Mechanical Characteristics ........................................................................................ 54 A.1.1 Headers ...................................................................................................................................... 57 A.1.2 Physical Mounting..................................................................................................................... 57 A.2 Bus Loading ...................................................................................................................................... 59 A.3 Rabbit 3000 DC Characteristics ........................................................................................................ 62 A.4 I/O Buffer Sourcing and Sinking Limit............................................................................................. 63 A.5 Jumper Configurations ...................................................................................................................... 64 A.6 Conformal Coating ............................................................................................................................ 66 Appendix B. Prototyping Board 67 B.1 Introduction ....................................................................................................................................... 68 B.1.1 Prototyping Board Features ....................................................................................................... 69 B.2 Mechanical Dimensions and Layout ................................................................................................. 71 B.3 Power Supply..................................................................................................................................... 72 B.4 Using the Prototyping Board ............................................................................................................. 73 B.4.1 Adding Other Components ........................................................................................................ 74 B.4.2 Measuring Current Draw ........................................................................................................... 74 B.4.3 Other Prototyping Board Modules and Options ........................................................................ 75 B.5 Use of Rabbit 3000 Parallel Ports...................................................................................................... 76 Appendix C. LCD/Keypad Module 79 C.1 Specifications..................................................................................................................................... 79 C.2 Contrast Adjustments for All Boards ................................................................................................ 81 C.3 Keypad Labeling................................................................................................................................ 82 C.4 Header Pinouts................................................................................................................................... 83 C.4.1 I/O Address Assignments .......................................................................................................... 83 C.5 Mounting LCD/Keypad Module on the Prototyping Board.............................................................. 84 RabbitCore RCM3209/RCM3229 C.6 Bezel-Mount Installation....................................................................................................................85 C.6.1 Connect the LCD/Keypad Module to Your Prototyping Board.................................................87 C.7 Sample Programs ...............................................................................................................................88 C.8 LCD/Keypad Module Function Calls ................................................................................................89 C.8.1 LCD/Keypad Module Initialization............................................................................................89 C.8.2 LEDs...........................................................................................................................................90 C.8.3 LCD Display...............................................................................................................................91 C.8.4 Keypad......................................................................................................................................127 Appendix D. Power Supply 135 D.1 Power Supplies.................................................................................................................................135 D.1.1 Battery Backup.........................................................................................................................135 D.1.2 Battery-Backup Circuit ............................................................................................................136 D.1.3 Reset Generator ........................................................................................................................137 D.2 Optional +5 V Output ......................................................................................................................137 Appendix E. Motor Control Option 139 E.1 Overview ..........................................................................................................................................139 E.2 Header J6 ..........................................................................................................................................140 E.3 Using Parallel Port F ........................................................................................................................141 E.3.1 Parallel Port F Registers ...........................................................................................................141 E.4 PWM Outputs...................................................................................................................................144 E.5 PWM Registers.................................................................................................................................145 E.6 Quadrature Decoder .........................................................................................................................146 Index 149 Schematics 153 User’s Manual RabbitCore RCM3209/RCM3229 1. INTRODUCTION The RCM3209 and RCM3229 RabbitCore® modules are designed to be the heart of embedded control systems. The RCM3209 features an integrated 10/100Base-T Ethernet port and provides for LAN and Internet-enabled systems to be built as easily as serialcommunication systems. In addition to the features already mentioned above, the RCM3209 and RCM3229 have two clocks (main oscillator and real-time clock), reset circuitry, and the circuitry necessary for management of battery backup of the Rabbit 3000’s internal real-time clock and the static RAM. Two 34-pin headers bring out the Rabbit 3000 I/O bus lines, parallel ports, and serial ports. The RCM3209 or RCM3229 receives +3.3 V power from the customer-supplied motherboard on which it is mounted. The RCM3209 and RCM3229 can interface with all kinds of CMOS-compatible digital devices through the motherboard. The Development Kit has what you need to design your own microprocessor-based system: a complete Dynamic C software development system and a Prototyping Board that allows you to evaluate the RCM3209 or RCM3229, and to prototype circuits that interface to the RCM3209 or RCM3229 module. User’s Manual 1 1.1 RCM3209/RCM3229 Features • Small size: 1.85" x 2.73" x 0.86" (47 mm x 69 mm x 22 mm) • Microprocessor: Rabbit 3000 running at 44.2 MHz • (RCM3209 only) 10/100Base-T auto MDI/MDIX Ethernet port chooses Ethernet interface automatically based on whether a crossover cable or a straight-through cable is used in a particular setup • 52 parallel 5 V tolerant I/O lines: 44 configurable for I/O, 4 fixed inputs, 4 fixed outputs • Two additional digital inputs, two additional digital outputs • External reset input • Alternate I/O bus can be configured for 8 data lines and 6 address lines (shared with parallel I/O lines), I/O read/write • Ten 8-bit timers (six cascadable) and one 10-bit timer with two match registers • 512K flash memory, 512K program execution SRAM, 256K data SRAM • Real-time clock • Watchdog supervisor • Provision for customer-supplied backup battery via connections on header J2 • 10-bit free-running PWM counter and four width registers • Two-channel Input Capture can be used to time input signals from various port pins • Two-channel Quadrature Decoder accepts inputs from external incremental encoder modules • Six CMOS-compatible serial ports: maximum asynchronous baud rate of 5.5 Mbps. Four ports are configurable as a clocked serial port (SPI), and two ports are configurable as SDLC/HDLC serial ports. • Supports 1.15 Mbps IrDA transceiver. The RCM3209 and RCM3229 modules are similar in form, dimensions, and function to the RCM3200/RCM3220, and based on the RCM3900 RabbitCore modules which were first released in 2008. The RCM3900/RCM3910 and RCM3309/RCM3319 RabbitCore modules are similar to the RCM3209/RCM3229, but they offer fixed NAND and/or removable media mass-storage memories.The RCM3309 and the RCM3319 offer fixed serial flash mass-storage options instead. 2 RabbitCore RCM3209/RCM3229 Table 1 summarizes the main features of the RCM3209 and the RCM3229 modules. Table 1. RCM3209/RCM3229 Features Feature Microprocessor SRAM RCM3209 Rabbit 3000 running at 44.2 MHz 512K program (fast SRAM) + 256K data Flash Memory (program) RJ-45 Ethernet Connector, Filter Capacitors, and LEDs Serial Ports RCM3229 512K Yes No 6 shared high-speed, CMOS-compatible ports: 6 are configurable as asynchronous serial ports; 4 are configurable as clocked serial ports (SPI); 2 are configurable as SDLC/HDLC serial ports; 1 asynchronous serial port is dedicated for programming The RCM3209 and RCM3229 are programmed over a standard PC USB serial port through a programming cable supplied with the Development Kit, and can also be programed directly over an Ethernet link using the RabbitLink. Appendix A provides detailed specifications for the RCM3209/RCM3229. 1.2 Comparing the RCM3209/RCM3229 and RCM3200/RCM3220 This section compares the two lines of RabbitCore modules. • Temperature Specifications — We can no longer obtain certain components for the RCM3200/RCM3220 RabbitCore modules that support the -40°C to +70°C temperature range. RCM3200/RCM3220 RabbitCore modules manufactured after May, 2008, are specified to operate at 0°C to +70°C. The RCM3209/RCM3229, rated for -40°C to +85°C, are offered to customers requiring a larger temperature range after May, 2008. • Maximum Current — The RCM3200/RCM3220 draws 255 mA vs. the 325 mA required by the RCM3209 (with Ethernet) or 190 mA (RCM3229 without Ethernet). • LEDs — The LNK/ACT LEDs have been combined to one LED on the RCM3209, and the RCM3209 has an FDX/COL LED where the ACT LED was on the RCM3200. The RCM3229, like the RCM3220, has no LEDs and no Ethernet. • Ethernet chip. A different Ethernet controller chip is used on the RCM3209. The Ethernet chip is able to detect automatically whether a crossover cable or a straightthrough cable is being used in a particular setup, and will configure the signals on the Ethernet jack interface. The RCM3229, like the RCM3220, has no Ethernet interface. • Dynamic C — You may run an application developed for the RCM3200/RCM3220 on the RCM3209/RCM3229 after you recompile it using Dynamic C v. 9.60. The new Dynamic C release incorporates many of the modules that previously had to be purchased separately. User’s Manual 3 1.3 Advantages of the RCM3209/RCM3229 • Fast time to market using a fully engineered, “ready to run” microprocessor core. • Competitive pricing when compared with the alternative of purchasing and assembling individual components. • Easy C-language program development and debugging • Program Download Utility and cloning board options for rapid production loading of programs. • Generous memory size allows large programs with tens of thousands of lines of code, and substantial data storage. • Integrated Ethernet port for network connectivity, royalty-free TCP/IP software. • Pin-compatible with RCM3309/RCM3319 and RCM3900/RCM3910 to offer fixed and/or removable media mass-storage memory options. 4 RabbitCore RCM3209/RCM3229 1.4 Development and Evaluation Tools 1.4.1 RCM3200 Development Kit The RCM3200 Development Kit contains the hardware you need to use your RCM3209 or RCM3229 module. • RCM3209 module. • Prototyping Board. • Universal AC adapter, 12 V DC, 1 A (includes Canada/Japan/U.S., Australia/N.Z., U.K., and European style plugs). • USB programming cable with 10-pin header. • Dynamic C CD-ROM, with complete product documentation on disk. • Getting Started instructions. • Accessory parts for use on the Prototyping Board. • Screwdriver and Cat. 5 Ethernet cables. • Rabbit 3000 Processor Easy Reference poster. • Registration card. DIAG Programming Cable Universal AC Adapter with Plugs Screwdriver PROG Ethernet Cables POWER 06 C7 R59 R51 R7 R2 JP3 R55 R56 R57 R58 C6 BT1 R16 R19 R18 C13 U5 /RES_OUT RABBITNET R3 R4 R5 R6 U6 C14 C15 07 SERI AL MODE FLAS M H/ 04 05 RP2 J11 R20 02 03 R17 C10 C11 C12 JP4 R8 R9 R10 R11 C9 PE7 PF6 U7 R63 R64 R65 R66 J2 JP1 PF4 R60 R61 C5 OUT RP1 U4 R52 R53 R62 J3 JP2 C8 PF0_QD U3 L293D H-DRIVER R14 R54 +DC J1 GND GND VMA+ MDA1 MDA2 MDA3 MDA4 VMA VMB MDB1 MDB2 MDB3 MDB4 VMB+ +DC J4 GND J5 DS1 QD2A QD2B QD1A QD1B GND PB6 PB4 PB2 01 +5V U2 C4 R13 J10 OUT 00 +5V R67 R68 R69 R70 IN0 PB7 PB5 PB3 PB0 U1 R12 IN1 PE6 PF7 • RCM3309 module. C3 L293D H-DRIVER PE3 PF5 • Prototyping Board. C2 L1 PE5 IN2 PE1 The RCM3309/RCM3319 Development Kit contains the following items PF0_CLKD C1 D2 IN3 PG4 PG6 PE0 PE4 Development Kit Contents D1 NC +3.3 V VRAM SMODE1 /IORD /IOWR PG5 PG7 GND J8 GND GND VBT /RES SM0 The RCM3309/RCM3319 RabbitCore modules feature built-in Ethernet, and onboard mass storage (serial flash). These Getting Started instructions included with the Development Kit will help you get your RCM3309 up and running so that you can run the sample programs to explore its capabilities and develop your own applications. J6 R1 RabbitCore RCM3309/RCM3319 J7 Accessory Parts for Prototyping Board R15 RCM3300 PROTOTYPING BOARD • Universal AC adapter, 12 V DC, 1 A (includes Canada/Japan/U.S., Australia/N.Z., U.K., and European style plugs). • USB programming cable with 10-pin header. DS2 D4 D5 D6 DS3 DS4 DS5 J14 RxE GND TxF RxF RELA Y 0.5 A RATED @ 30 V BD7 BD6 BD5 BD4 BD3 BD2 BD1 BD0 LCD /CS BA3 BA1 BA0 BA2 D6 D4 D2 D0 A1 A3 6 4 2 0 /RES GND +V LED LED LED LED 1 GND GND LED D5 D3 D1 A0 A2 NC2 COM2 NO2 R44 5 3 D7 C27 R43 C28 C20 /CS LED +BK LED R41 3-6 SOT2 R38 NC1 K E Y PA D D I S P L AY B O A R D C29 C30 Q5 R47 COM1 C18 C17 R33 R34 JP5 C26 LCD1JB TxE J17 D8 R35 NO1 C23 C24 K1 R45 C21 D7 DS6 J16 R42 U12 R46 J12 C19 DS RELA7 Y R50 Q6 CORE R36 C22 R40 U11 U10 R48 R28 HO1 R27 S3 U9 J13 JB HO2 R26 R49 S2 3-6 SOT2 LT Q4 R32 Q3 Q2 GND R25 J9 Getting Started Instructions UX2 SO20W HO3 Q1 JA R30 GND STAT R24 HO4 PA3 PA5 PA7 Rabbit, Dynamic C, and Digi are registered trademarks of Digi International Inc. S1 RESET R23 C25 R22 UX5 DX2 C16 R21 +3.3 V R39 J15 LCD1JA R37 PC0 PF1 PF3 PA1 R31 PA2 PA6 DX1 CX2 PC2 PC3 PC1 PF0 PF2 PA0 PA4 U8 PC4 R29 Insert the CD from the Development Kit in your PC’s CD-ROM drive. If the installation does not auto-start, run the setup.exe program in the root directory of the Dynamic C CD. Install any optional Dynamic C modules or packs after you install Dynamic C. RX16 RX17 RX18 UX4 UX1 SO20W PC6 PC7 PC5 Visit our online Rabbit store at www.rabbit.com/store/ for the latest information on peripherals and accessories that are available for the RCM3309/RCM3319 RabbitCore modules. RX13 RX14 RX15 CX1 PD4 PG2 PG0 PG1 GND +3.3 V PD6 PD2 PD3 PD5 PG3 Installing Dynamic C® GND/EGND LINK ACT PD7 • Screwdriver and Cat. 5 Ethernet cables. • Getting Started instructions. • Registration card. GND CORE MODULE • A bag of accessory parts for use on the Prototyping Board. • Rabbit 3000 Processor Easy Reference poster. +5 V +5 V • Dynamic C® CD-ROM — with complete product documentation on disk. LCD1JC 485+ GND 485 Prototyping Board Figure 1. RCM3200 Development Kit User’s Manual 5 1.4.2 Software The RCM3209 and the RCM3229 are programmed using version 9.60 of Rabbit’s Dynamic C. A compatible version is included on the Development Kit CD-ROM. This version of Dynamic C includes the popular µC/OS-II real-time operating system, point-topoint protocol (PPP), FAT file system, RabbitWeb, and other select libraries. Rabbit also offers for purchase the Rabbit Embedded Security Pack featuring the Secure Sockets Layer (SSL) and a specific Advanced Encryption Standard (AES) library. In addition to the Web-based technical support included at no extra charge, a one-year telephonebased technical support subscription is also available for purchase. Visit our Web site at www.rabbit.com for further information and complete documentation, or contact your Rabbit sales representative or authorized distributor. 1.4.3 Connectivity Interface Kits Rabbit has available a Connector Adapter Board to allow you to use the the RCM3209/ RCM3229 with header sockets that have a 0.1" pitch. • Connector Adapter Board (Part No. 151-0114)—allows you to plug the RCM3209/ RCM3229 whose headers have a 2 mm pitch into header sockets with a 0.1" pitch. Visit our Web site at www.rabbit.com or contact your Rabbit sales representative or authorized distributor for further information. 1.4.4 Online Documentation The online documentation is installed along with Dynamic C, and an icon for the documentation menu is placed on the workstation’s desktop. Double-click this icon to reach the menu. If the icon is missing, use your browser to find and load default.htm in the docs folder, found in the Dynamic C installation folder. The latest versions of all documents are always available for free, unregistered download from our Web sites as well. 6 RabbitCore RCM3209/RCM3229 2. HARDWARE SETUP This chapter describes how to set up and connect the RCM3209 and the Prototyping Board included in the RCM3200 Development Kit. NOTE: This chapter (and this manual) assume that you have a Development Kit. If you purchased an RCM3200 series RabbitCore module by itself, you will have to adapt the information in this chapter and elsewhere to your test and development setup. 2.1 Install Dynamic C To develop and debug programs for an RCM3200 series RabbitCore module (and for all other Rabbit hardware), you must install and use Dynamic C. If you have not yet installed Dynamic C, do so now by inserting the Dynamic C CD from the Development Kit in your PC’s CD-ROM drive. If autorun is enabled, the CD installation will begin automatically. If autorun is disabled or the installation otherwise does not start, use the Windows Start | Run menu or Windows Disk Explorer to launch setup.exe from the root folder of the CD-ROM. The installation program will guide you through the installation process. Most steps of the process are self-explanatory. Dynamic C uses a COM (serial) port to communicate with the target development system. The installation allows you to choose the COM port that will be used. The default selection is COM1. Select any available USB port for Dynamic C’s use.This selection can be changed later within Dynamic C. NOTE: The installation utility does not check the selected COM port in any way. Specifying a port in use by another device (mouse, modem, etc.) may lead to a message such as "could not open serial port" when Dynamic C is started. Once your installation is complete, you will have up to three icons on your PC desktop. One icon is for Dynamic C, one opens the documentation menu, and the third is for the Rabbit Field Utility, a tool used to download precompiled software to a target system. If you have purchased the optional Dynamic C Rabbit Embedded Security Pack, install it after installing Dynamic C. You must install the Rabbit Embedded Security Pack in the same directory where Dynamic C was installed. User’s Manual 7 2.2 Hardware Connections There are three steps to connecting the Prototyping Board for use with Dynamic C and the sample programs: 1. Attach the RCM3200 series RabbitCore module to the Prototyping Board. 2. Connect the programming cable between the RCM3200 series RabbitCore module and the workstation PC. 3. Connect the power supply to the Prototyping Board. 8 RabbitCore RCM3209/RCM3229 2.2.1 Step 1 — Attach Module to Prototyping Board Turn the RCM3209 module so that the Ethernet connector end of the module extends off the Prototyping Board, as shown in Figure 2 below. Align the pins from headers J61 and J62 on the bottom side of the module into header sockets RCM2JA and RCM2JB on the Prototyping Board. The installation of the RCM3229, which does not have an Ethernet connector, is similar. MOTOR/ENCODER J6 C11 C10 +3.3V R23 R21 R20 6 C34 C30 C31 R13 R12 C26 C32 R14 C18 C13 Y1 C5 PA1 PA2 PA3 PB4 PA4 PA5 PB2 PA6 PA7 PB0 /RES STATUS GND C16 BA1 BD0 BD2 BD4 BD6 BD5 BD7 GND BA3 DISPLAY BOARD RC25 RC4 RC5 C14 RC27 U3 U3 RC28 RC29 RC26 UX5 R14 RC9 UX7 U1 C5 RCM30/31/32XX SERIES PROTOTYPING BOARD C8 RCM2JA RESET C4 PA0 PB6 PB3 U6 GND J2 PF4 PB5 BD3 TP1 R15 JP1 PF5 PB7 RCM2JB BD1 U2 PF3 C9 RCM2JA +5V UX4 +5V GND R4 PF1 PF2 R15 PC0 PF0 PF6 J1 PC2 PC1 PE7 PF7 R2 PC3 PE5 PE6 RC7 BA0 C11 PE3 PE4 RC6 +5V J8 BA2 C10 JP2 JP3 JP4 JP5 PE1 +5V /RES LCD R5 R6 PC4 +3.3V +3.3V +5V U3 PC5 +5V C8 C9 U4 PE0 GND GND +3.3V U1 L1 PG7 R11 J3 PD5 GND GND +3.3V R16 C33 PG0 PD4 +5V C17 DS1 PG2 PG1 PG6 RC1 L2 R16 DS2 R33 PD4 PG3 PG4 GND U7 R19 Y2 DS3 R34 PD5 /IORD PG5 RC18 C29 R18 Q1 SM1 SM0 /IOWR UX2 +5V JP14 C46 PD2 C1 PD3 RC2 R1 VRAM R13 R9R3 C2 VBAT EXT /RES IN R11 C4 PD6 PD0 RC21 C3 PD7 R12 R7 R10 R9 R8 PD1 +3.3V RC22 C6 C7 R7 U5 NC R10 R6 C14 RC14 RC17 RC16 C16R8C12 R17 C19 C15 RC23 UX9 RC11 GND RC24 RC20 UX3 GND UX11 C24 C20 C21 JP9 JP8 JP10 JP7 C2 C27 C22 C23 RC13 RC12 J15 SLAVE MASTER RCM2 RC19 C3 R5 RC10 +3.3V GND 1 R25 R26 UX10 RC15 R4 R2 Do not press down here. Battery BPE3 R28 GND C1 R3 R21 R24 Y3 Q2 D1 R29 U10 PA7 J3 R1 2 DS4 RCM39XX U9 PE4 C45 PA6 /RES +5V BT1 PA5 C28 C25U PB2 RN2 J1 PA3 C35 PB0 PA1 C36 PB3 PF3 +DC U5 RN4 PA4 R27 PA2 PB4 GND C12 +5V C38 PA0 PB6 C37 PF2 PF4 PF1 C40 R22 PF6 PF5 PB5 PC0 2.5 MM JACK D2 U4 PC2 C44 C39 PF7 PB7 PC4 C43 U8 R30 PF0 PE7 PD5 C47 PC1 PE5 JP13 R32 C48 R31 PC3 C41 C42 PC5 CURRENT MEASUREMENT OPTION PD4 J11 D1 C13 R20 R17 C49 C50 CE PE6 PE3 BSY SPD LNK FDX ACT COL PE4 PE0 C17 JP1 PG0 PE1 DS3 PG1 PG6 PG7 +3.3V POWER PG4 PG5 C15 /IOWR L1 POWER PG2 RN5 RCM3000 ETHERNET CORE MODULE JP11 PD4 PG3 RCM1JB GND JP12 PD5 /IORD R35 RCM3209 SM1 SM0 RCM1JA J9 PD2 +DC PD6 PD3 GND PD0 PD7 VRAM VBAT EXT /RES IN GND PD1 +3.3V RN3 NC GND +5V +3.3V RN1 GND C6 RxC TxC GND J5 J4 TxB RxB GND RCM2JB S2 S3 PG6 RS-232 J10 DS1 UX13 PG7 C7 DS2 J7 DISPLAY BOARD DISPLAY BOARD Figure 2. Install the RCM3209 Module on the Prototyping Board Although you can install a single module into either the MASTER or the SLAVE position on the Prototyping Board, all the Prototyping Board features (switches, LEDs, serial port drivers, etc.) are connected to the MASTER position — install a single module in the MASTER position. NOTE: It is important that you line up the pins on headers J61 and J62 of the RCM3209/ RCM3229 exactly with the corresponding pins of header sockets RCM2JA and RCM2JB on the Prototyping Board. The header pins may become bent or damaged if the pin alignment is offset, and the module will not work. Permanent electrical damage to the module may also result if a misaligned module is powered up. Press the module’s pins firmly into the Prototyping Board header sockets—press down in the area above the header pins using your thumbs or fingers over the connectors as shown in Figure 2. Do not press down on the middle of the RCM3209/RCM3229 module to avoid flexing the module, which could damage the module or the components on the module. Should you need to remove the RCM3209/RCM3229 module, grasp it with your fingers along the sides by the connectors and gently work the module up to pull the pins away from the sockets where they are installed. Do not remove the module by grasping it at the top and bottom. User’s Manual 9 2.2.2 Step 2 — Connect Programming Cable The programming cable connects the RCM3209/RCM3229 to the PC running Dynamic C to download programs and to monitor the RCM3209/RCM3229 module during debugging. Connect the 10-pin connector of the programming cable labeled PROG to header J1 on the RCM3209/RCM3229 module as shown in Figure 3. Be sure to orient the marked (usually red) edge of the cable towards pin 1 of the connector. (Do not use the DIAG connector, which is used for a normal serial connection.) MOTOR/ENCODER J6 C11 C10 MASTER UX11 Q2 JP14 R21 C8 C9 U4 C11 C10 JP2 JP3 JP4 JP5 U2 JP1 J2 C4 C8 C6 RxC TxC GND J5 J4 GND C7 RS-232 S2 GND BA3 BA1 BD0 BD2 BD4 BD6 BA0 BD1 BD3 BD5 BD7 GND BA2 C16 GND GND U6 DISPLAY BOARD RC25 RC4 RC5 C14 RC27 U3 RC28 RC29 RC26 UX5 UX7 RCM30/31/32XX SERIES PROTOTYPING BOARD RCM2JB S3 PG6 PG7 DS1 DS2 J10 DISPLAY BOARD Colored edge UX13 To PC USB port J7 DISPLAY BOARD Programming Cable J1 PROG TxB RxB C9 RC9 R4 RCM2JA RESET C5 +5V UX4 +5V R11 U1 /RES LCD C18 L1 /RES STATUS C17 PB0 C13 J3 C33 PA7 RC7 +5V L2 PA5 PA6 C26 C32 PA4 PB2 R16 PB4 PB3 C31 PB5 R14 PA3 GND R20 U7 R19 PA1 PA2 C34 PF3 PA0 PB6 RC6 U3 R14 C1 PF1 PF2 PF4 +3.3V +3.3V +5V +5V J8 R1 PF0 PF6 PF5 C30 DS1 PE7 PF7 PB7 1 DS2 R33 PE6 R25 R26 DS3 R34 PC0 RC1 C46 Q1 PC2 PC1 R23 DS4 RCM39XX R28 PC4 PC3 PE5 +3.3V R3 PC5 PE3 PE4 +3.3V C6 PE0 PE1 C12 PG7 C16 PD5 GND GND C24 C20 C21 PD4 JP11 PG6 C2 PG5 C28 C25U PG0 JP13 PG1 C4 PG4 GND GND C3 /IOWR R8 PG2 C7 R7 PD4 PG3 R10 PD2 PD5 /IORD UX2 R9 PD3 SM1 RC2 U5 VRAM SM0 RC21 C14 VBAT EXT /RES IN R17 C19 C15 PD6 JP7 PD7 JP9 +3.3V JP8 GND C27 C22 C23 PD0 JP10 PD1 JP12 C35 RC11 NC C38 R9 R11 C36 R13 RC10 GND RC22 C37 R7 UX3 R27 R12 C44 C39 C40 R22 R6 RC16 C43 U8 R30 R21 RC24 RC23 R10 C47 R8 RC17 RC13 RC12 C49 C50 R32 C48 R31 R35 UX9 RC14 CE C3 R5 R2 SPD LNK FDX ACT COL R3 RC20 BSY C2 R4 RCM2 D1 RC15 RC19 R29 U10 C1 U9 J3 R1 C45 RN2 J1 BT1 J15 SLAVE UX10 +5V GND BPE3 PA7 PE4 +5V +3.3V GND PA5 PA6 /RES DIAG PA3 PA4 PB2 PB0 +5V +3.3V +5V PA2 PB4 PB3 +DC +5V PB6 PB5 Battery R16 PB7 TP1 PA1 R15 PF3 PA0 GND RC18 PF1 PF2 PF4 PROG PF0 PF6 PF5 R15 PE7 PF7 U1 PE6 J1 PC0 R2 PC1 R5 R6 PE5 C12 U5 U3 PE4 2.5 MM JACK D2 U4 Y1 C5 PC2 R13 PC3 R12 PE3 6 PC4 PE1 Y2 PD5 PC5 C29 PG0 PD4 PE0 R18 PG1 PG6 PG7 R17 R24 Y3 PG4 PG5 D1 C13 R20 2 /IOWR J11 RCM3000 ETHERNET CORE MODULE C41 C42 PG2 CURRENT MEASUREMENT OPTION PG3 C17 JP1 /IORD L1 DS3 SM0 +3.3V POWER PD4 C15 PD2 PD5 RN5 POWER PD3 SM1 RCM1JB GND J9 VRAM RCM1JA +DC PD6 GND PD7 GND PD0 +3.3V RN4 PD1 GND VBAT EXT /RES IN RN3 NC +5V +3.3V RN1 GND Figure 3. Connect Programming Cable to RCM3209/RCM3229 Connect the other end of the programming cable to an available USB port on your PC or workstation. Your PC should recognize the new USB hardware, and the LEDs in the shrink-wrapped area of the USB programming cable will flash. 10 RabbitCore RCM3209/RCM3229 2.2.3 Step 3 — Connect Power When all other connections have been made, you can connect power to the Prototyping Board. First, prepare the AC adapter for the country where it will be used by selecting the plug. The RCM3209/RCM3229 Development Kit presently includes Canada/Japan/U.S., Australia/N.Z., U.K., and European style plugs. Snap in the top of the plug assembly into the slot at the top of the AC adapter as shown in Figure 4, then press down on the springloaded clip below the plug assembly to allow the plug assembly to click into place. Connect the AC adapter to the power connector header J9 on the Prototyping Board as shown in Figure 4 below. AC adapter 3-pin power connector MOTOR/ENCODER J6 C11 C10 SLAVE Q2 R21 GND R20 GND BA3 BA1 BD0 BD2 BD4 BD6 BA0 BD1 BD3 BD5 BD7 GND BA2 J3 C33 C18 C13 R15 C9 U6 C16 GND +5V GND C26 C32 R14 C17 R11 C8 C9 L1 C11 C10 JP2 JP3 JP4 JP5 DISPLAY BOARD RC25 RC4 RC5 C14 RC27 U3 U3 RC28 RC29 RC26 UX5 R14 RC9 R4 C5 JP1 J2 C4 C8 C6 RxC TxC GND J5 J4 TxB RxB /RES LCD L2 RCM2JA RESET +5V U7 R19 /RES STATUS R16 PB0 C34 C31 PA7 C30 DS1 PA5 PA6 +5V DS2 R33 PA3 PA4 PB2 BPE3 DS3 R34 PA1 PA2 PB4 1 Q1 PA0 PB6 PB3 Press down on clip, snap plug into place +5V UX4 UX7 U1 GND C1 PF4 PB5 2 Assemble AC Adapter S2 R1 PF5 PB7 R25 R26 JP14 PF3 RC1 C46 PF1 PF2 R23 DS4 RCM39XX R28 PC0 PF0 PF6 RC7 +5V J8 Insert tab into slot R3 PC2 PC1 PE7 PF7 RC6 C6 PC3 PE5 PE6 +5V C12 PE3 PE4 +3.3V +3.3V +3.3V C16 PE1 JP11 PC4 C2 PC5 C4 PE0 GND GND +3.3V C3 PG7 R10 PD5 R9 PD4 R8 PG6 GND GND C7 R7 PG0 PG5 U5 PG2 PG1 UX2 C14 PD4 PG3 PG4 RC2 C24 C20 C21 PD2 PD5 /IORD RC21 C28 C25U PD3 SM1 JP13 VRAM SM0 /IOWR JP12 VBAT EXT /RES IN R27 PD6 R17 C19 C15 PD7 JP7 +3.3V JP9 GND JP8 PD0 JP10 PD1 C27 C22 C23 NC 1 C37 R9 R11 R13 C35 RC11 C36 RC10 GND RC22 C38 R7 R21 C44 R12C39 R6 C40 R22 UX3 C43 U8 R8 R30 RC16 RC12 RC24 RC23 R10 C47 RC17 RC13 +3.3V GND UX11 C49 C50 R32 C48 R31 RC14 R35 UX9 CE SPD LNK FDX ACT COL C3 R5 R2 RC20 BSY C2 R4 R3 RCM2 D1 RC15 RC19 R29 U10 RN2 MASTER C1 +3.3V +5V UX10 GND J3 R1 +DC BT1 U9 PE4 /RES J1 GND J15 C45 PB0 +5V +5V PA7 Battery R16 PA6 TP1 PB2 +5V RC18 PB3 U2 PA5 RCM2JB S3 RCM30/31/32XX SERIES PROTOTYPING BOARD U1 PA3 PA4 R15 PA1 PA2 PB4 J1 PF3 PA0 PB6 R2 PF2 PF4 R5 R6 PF6 PF5 PB5 U3 PF7 PB7 U4 PF1 Y1 C5 PF0 R13 PE7 C12 U5 R12 PE6 2.5 MM JACK D2 U4 6 PC0 Y2 PC1 C29 PE5 R18 PC2 PE4 2 PC4 PC3 D1 C13 R20 R17 R24 Y3 PD5 PC5 PE3 J11 RCM3000 ETHERNET CORE MODULE C41 C42 PG0 PD4 PE0 PE1 CURRENT MEASUREMENT OPTION PG1 PG6 PG7 C17 JP1 PG4 PG5 L1 DS3 /IOWR +3.3V POWER PG2 C15 PD4 PG3 RN5 POWER PD5 /IORD RCM1JB GND RN4 SM1 SM0 RCM1JA J9 PD2 +DC PD6 PD3 GND PD0 PD7 VRAM VBAT EXT /RES IN GND PD1 +3.3V RN3 NC GND +5V +3.3V RN1 GND PG6 RS-232 J10 DS1 UX13 PG7 C7 DS2 DISPLAY BOARD J7 DISPLAY BOARD RESET Figure 4. Power Supply Connections Plug in the AC adapter. The red power lamp on the Prototyping Board to the left of header J9 should light up. The RCM3209/RCM3229 and the Prototyping Board are now ready to be used. NOTE: A RESET button is provided on the Prototyping Board to allow hardware reset without disconnecting power. User’s Manual 11 2.3 Starting Dynamic C Once the RCM3209/RCM3229 is connected as described in the preceding pages, start Dynamic C by double-clicking on the Dynamic C icon on your desktop or in your Start menu. Select Code and BIOS in Flash, Run in RAM on the “Compiler” tab in the Dynamic C Options > Project Options menu. Then click on the “Communications” tab and verify that Use USB to Serial Converter is selected to support the USB programming cable. Click OK. 2.4 Run a Sample Program Use the File menu to open the sample program PONG.C, which is in the Dynamic C SAMPLES folder. Press function key F9 to compile and run the program. The STDIO window will open on your PC and will display a small square bouncing around in a box. This program shows that the CPU is working. The sample program described in Section 6.5, “Run the PINGME.C Sample Program,” tests the TCP/IP portion of the board. 2.4.1 Troubleshooting If Dynamic C cannot find the target system (error message "No Rabbit Processor Detected."): • Check that the RCM3209/RCM3229 is powered correctly — the power LED on the Prototyping Board should be lit when the RCM3209/RCM3229 is mounted on the Prototyping Board and the AC adapter is plugged in. • Check both ends of the programming cable to ensure that they are firmly plugged into the PC and the PROG connector, not the DIAG connector, is plugged in to the programming port on the RCM3209/RCM3229 with the marked (colored) edge of the programming cable towards pin 1 of the programming header. • Ensure that the RCM3209/RCM3229 module is firmly and correctly installed in its connectors on the Prototyping Board. • Dynamic C uses the USB port specified during installation. Select a different COM port within Dynamic C. From the Options menu, select Project Options, then select Communications. Select another USB COM port from the list, then click OK. Press <Ctrl-Y> to force Dynamic C to recompile the BIOS. If Dynamic C still reports it is unable to locate the target system, repeat the above steps until you locate the USB COM port used by the RCM3209/RCM3229 programming cable. • If you get an error message when you plugged the programming cable into a USB port, you will have to install USB drivers. Drivers for Windows XP are available in the Dynamic C Drivers\Rabbit USB Programming Cable\WinXP_2K folder — double-click DPInst.exe to install the USB drivers. Drivers for other operating systems are available online at www.ftdichip.com/Drivers/VCP.htm. 12 RabbitCore RCM3209/RCM3229 If Dynamic C appears to compile the BIOS successfully, but you then receive a communication error message when you compile and load a sample program, it is possible that your PC cannot handle the higher program-loading baud rate. Try changing the maximum download rate to a slower baud rate as follows. • Locate the Serial Options dialog on the “Communications” tab in the Dynamic C Options > Project Options menu. Select a slower Max download baud rate. Click OK to save. If a program compiles and loads, but then loses target communication before you can begin debugging, it is possible that your PC cannot handle the default debugging baud rate. Try lowering the debugging baud rate as follows. • Locate the Serial Options dialog in the Dynamic C Options > Project Options > Communications menu. Choose a lower debug baud rate. Click OK to save. Press <Ctrl-Y> to force Dynamic C to recompile the BIOS. The LEDs on the USB programming cable will blink and you should receive a Bios compiled successfully message. 2.5 Where Do I Go From Here? If the sample program ran fine, you are now ready to go on to other sample programs and to develop your own applications. The source code for the sample programs is provided to allow you to modify them for your own use. The RCM3209/RCM3229 User’s Manual also provides complete hardware reference information and describes the software function calls for the RCM3209 and the RCM3229, the Prototyping Board, and the optional LCD/keypad module. For advanced development topics, refer to the Dynamic C User’s Manual and the Dynamic C TCP/IP User’s Manual, also in the online documentation set. 2.5.1 Technical Support NOTE: If you purchased your RCM3209/RCM3229 through a distributor or through a Rabbit partner, contact the distributor or partner first for technical support. If there are any problems at this point: • Use the Dynamic C Help menu to get further assistance with Dynamic C. • Check the Rabbit Technical Bulletin Board and forums at www.rabbit.com/support/bb/ and at www.rabbit.com/forums/. • Use the Technical Support e-mail form at www.rabbit.com/support/. User’s Manual 13 14 RabbitCore RCM3209/RCM3229 3. RUNNING SAMPLE PROGRAMS To develop and debug programs for the RCM3209/RCM3229 (and for all other Rabbit hardware), you must install and use Dynamic C. 3.1 Introduction To help familiarize you with the RCM3209/RCM3229 modules, Dynamic C includes several sample programs. Loading, executing and studying these programs will give you a solid hands-on overview of the RCM3209/RCM3229’s capabilities, as well as a quick start using Dynamic C as an application development tool. NOTE: The sample programs assume that you have at least an elementary grasp of the C programming language. If you do not, see the introductory pages of the Dynamic C User’s Manual for a suggested reading list. Complete information on Dynamic C is provided in the Dynamic C User’s Manual. In order to run the sample programs discussed in this chapter and elsewhere in this manual, 1. Your RCM3209/RCM3229 module must be plugged in to the Prototyping Board as described in Chapter 2, “Hardware Setup.” 2. Dynamic C must be installed and running on your PC. 3. The RCM3209/RCM3229 module must be connected to your PC through the serial programming cable. 4. Power must be applied to the RCM3209/RCM3229 through the Prototyping Board. Refer to Chapter 2, “Hardware Setup,” if you need further information on these steps. Remember to allow the compiler to run the application in the program execution SRAM by selecting Code and BIOS in Flash, Run in RAM from the Dynamic C Options > Project Options > Compiler menu. To run a sample program, open it with the File menu, then press function key F9 to compile and run the program. Complete information on Dynamic C is provided in the Dynamic C User’s Manual. User’s Manual 15 3.2 Sample Programs Of the many sample programs included with Dynamic C, several are specific to the RCM3209/RCM3229. Sample programs illustrating the general operation of the RCM3209/RCM3229, and serial communication are provided in the SAMPLES\RCM3200 folder. Each sample program has comments that describe the purpose and function of the program. Follow the instructions at the beginning of the sample program. • CONTROLLED.C—uses the STDIO window to demonstrate digital outputs by toggling LEDs DS1 and DS2 on the Prototyping Board on and off. Parallel Port G bit 6 = LED DS1 Parallel Port G bit 7 = LED DS2 Once you have compiled and run this program, you will be prompted via the Dynamic C STDIO window to select LED DS1 or DS2. Use your PC keyboard to make your selection. Once you have selected the LED, you will be prompted to select to turn the LED either ON or OFF. A logic low will light up the LED you selected. • FLASHLED1.c—demonstrates the use of costatements to flash LEDs DS1 and DS2 on the Prototyping Board at different rates. Once you have compiled and run this program, LEDs DS1 and DS2 will flash on/off at different rates. • FLASHLED2.c—demonstrates the use of cofunctions and costatements to flash LEDs DS1 and DS2 on the Prototyping Board at different rates. Once you have compiled and run this program, LEDs DS1 and DS2 will flash on/off at different rates. • TOGGLESWITCH.c—demonstrates the use of costatements (cooperative multitasking) to detect switches using the press-and-release method of debouncing. LEDs DS1 and DS2 on the Prototyping Board are turned on and off when you press switches S2 and S3. • IR_DEMO.c—Demonstrates sending Modbus ASCII packets between two Prototyping Board assemblies via the IrDA transceivers with the IrDA transceivers facing each other. Note that this sample program will only work with the RCM30/31/32XX Prototyping Board. First, compile and run this program on one Prototyping Board assembly, then remove the programming cable and press the RESET button on the Prototyping Board so that the first RabbitCore module is operating in the Run mode. Then connect the programming cable to the second Prototyping Board assembly with the RCM3209/RCM3229 and compile and run the same sample program. With the programming cable still connected to the second Prototyping Board assembly, press switch S2 on the second Prototyping Board to transmit a packet. Once the first Prototyping Board assembly receives a test packet, it will send back a response packet that will be displayed in the Dynamic C STDIO window. The test packets and response packets have different codes. Once you have loaded and executed these five programs and have an understanding of how Dynamic C and the RCM3209/RCM3229 modules interact, you can move on and try the other sample programs, or begin building your own. 16 RabbitCore RCM3209/RCM3229 3.2.1 Serial Communication The following sample programs can be found in the SAMPLES\RCM3200\SERIAL folder. • FLOWCONTROL.C—This program demonstrates hardware flow control by configuring Serial Port C (PC3/PC2) for CTS/RTS with serial data coming from TxB at 115,200 bps. One character at a time is received and is displayed in the STDIO window. To set up the Prototyping Board, you will need to tie TxB and RxB together on the RS-232 header at J5, and you will also tie TxC and RxC together using the jumpers supplied in the Development Kit as shown in the diagram. RxC TxC J5 TxB RxB GND A repeating triangular pattern should print out in the STDIO window. The program will periodically switch flow control on or off to demonstrate the effect of no flow control. • PARITY.C—This program demonstrates the use of parity modes by repeatedly sending byte values 0–127 from Serial Port B to Serial Port C. The program will switch between generating parity or not on Serial Port B. Serial Port C will always be checking parity, so parity errors should occur during every other sequence. RxC TxC J5 TxB RxB GND To set up the Prototyping Board, you will need to tie TxB and RxC together on the RS-232 header at J5 using the jumpers supplied in the Development Kit as shown in the diagram. The Dynamic C STDIO window will display the error sequence. • SIMPLE3WIRE.C—This program demonstrates basic RS-232 serial communication. Lower case characters are sent by TxC, and are received by RxB. The characters are converted to upper case and are sent out by TxB, are received by RxC, and are displayed in the Dynamic C STDIO window. RxC TxC J5 TxB RxB GND To set up the Prototyping Board, you will need to tie TxB and RxC together on the RS-232 header at J5, and you will also tie RxB and TxC together using the jumpers supplied in the Development Kit as shown in the diagram. • SIMPLE5WIRE.C—This program demonstrates 5-wire RS-232 serial communication with flow control on Serial Port C and data flow on Serial Port B. To set up the Prototyping Board, you will need to tie TxB and RxB together on the RS-232 header at J5, and you will also tie TxC and RxC together using the jumpers supplied in the Development Kit as shown in the diagram. RxC TxC J5 TxB RxB GND Once you have compiled and run this program, you can test flow control by disconnecting TxC from RxC while the program is running. Characters will no longer appear in the STDIO window, and will display again once TxC is connected back to RxC. User’s Manual 17 • SWITCHCHAR.C—This program demonstrates transmitting and then receiving an ASCII string on Serial Ports B and C. It also displays the serial data received from both ports in the STDIO window. To set up the Prototyping Board, you will need to tie TxB and RxC together on the RS-232 header at J5, and you will also tie RxB and TxC together using the jumpers supplied in the Development Kit as shown in the diagram. RxC TxC J5 TxB RxB GND Once you have compiled and run this program, press and release S2 and S3 on the Prototyping Board. The data sent between the serial ports will be displayed in the STDIO window. Two sample programs, SIMPLE485MASTER.C and SIMPLE485SLAVE.C, are available to illustrate RS-485 master/slave communication. To run these sample programs, you will need a second Rabbitbased system with RS-485, and you will also have to add an RS-485 transceiver such as the SP483E and bias resistors to the RCM30/31/32XX Prototyping Board. PC0 PC1 PD4 GND Vcc 485+ Vcc bias 681 W RO termination 220 W /RE bias 681 W DI A RS-485 DE CHIP B 485 The diagram shows the connections. You will have to connect PC0 and PC1 (Serial Port D) on the RCM30/31/32XX Prototyping Board to the RS-485 transceiver, and you will connect PD4 to the RS-485 transceiver to enable or disable the RS-485 transmitter. The RS-485 connections between the slave and master devices are as follows. • RS485+ to RS485+ • RS485– to RS485– • GND to GND • SIMPLE485MASTER.C—This program demonstrates a simple RS-485 transmission of lower case letters to a slave RCM3209/RCM3229. The slave will send back converted upper case letters back to the master RCM3209/RCM3229 and display them in the STDIO window. Use SIMPLE485SLAVE.C to program the slave RCM3209/RCM3229. • SIMPLE485SLAVE.C—This program demonstrates a simple RS-485 transmission of lower case letters to a master RCM3209/RCM3229. The slave will send back converted upper case letters back to the master RCM3209/RCM3229 and display them in the STDIO window. Use SIMPLE485MASTER.C to program the master RCM3209/ RCM3229. 3.2.2 Other Sample Programs Section 6.5 describes the TCP/IP sample programs, and Appendix C.7 provides sample programs for the optional LCD/keypad module that can be installed on the Prototyping Board. 18 RabbitCore RCM3209/RCM3229 4. HARDWARE REFERENCE Chapter 4 describes the hardware components and principal hardware subsystems of the RCM3209/RCM3229. Appendix A, “RCM3209/ RCM3229 Specifications,” provides complete physical and electrical specifications. Figure 5 shows these Rabbit-based subsystems designed into the RCM3209/RCM3229. Ethernet Fast SRAM (program) Data SRAM 32 kHz 22.1 MHz osc osc RABBIT ® 3000 Program Flash Battery-Backup Circuit RabbitCore Module Customer-specific applications CMOS-level signals Level converter RS-232, RS-485 serial communication drivers on motherboard Customer-supplied external 3 V battery Figure 5. RCM3209/RCM3229 Subsystems User’s Manual 19 4.1 RCM3209/RCM3229 Digital Inputs and Outputs The RCM3209/RCM3229 has 52 parallel I/O lines grouped in seven 8-bit ports available on headers J1 and J2. The 44 bidirectional I/O lines are located on pins PA0–PA7, PB0, PB2–PB7, PD2–PD7, PE0–PE1, PE3–PE7, PF0–PF7, and PG0–PG7. Figure 6 shows the RCM3209/RCM3229 pinouts for headers J61 and J62. J61 GND PA7 PA5 PA3 PA1 PF3 PF1 PC0 PC2 PC4 PC6-TxA PG0 PG2 PD4 PD2 PD6 n.c. J62 STATUS PA6 PA4 PA2 PA0 PF2 PF0 PC1 PC3 PC5 PC7-RxA PG1 PG3 PD5 PD3 PD7 n.c. PB0 PB3 PB5 PB7 PF5 PF7 PE6 PE4 PE1 PG7 PG5 /IOWR SMOD0 /RESET_IN VBAT_EXT GND GND /RES PB2 PB4 PB6 PF4 PF6 PE7 PE5 PE3 PE0 PG6 PG4 /IORD SMOD1 VRAM +3.3V n.c. n.c. = not connected Note: These pinouts are as seen on the Bottom Side of the module. Figure 6. RCM3209/RCM3229 Pinouts The pinouts for the RCM3000, RCM3100, RCM3209, RCM3309, and RCM3900 are compatible. Visit the Web site for further information. Headers J61 and J62 are standard 2 × 34 headers with a nominal 2 mm pitch. An RJ-45 Ethernet jack is also included on the RCM3209. Pins 29–32 on header J61 are configured using 0 Ω resistors at locations JP9, JP10, JP7, and JP8 to enable connections to PD2, PD3, PD6, and PD7 respectively. They may also be reconfigured to carry the Ethernet signals TPO+, TPO–, TPI+, and TPI–, but this capability is reserved for future use. Pins 33 and 34 on header J61 are wired via 0 Ω surface-mount resistors at JP2 and JP3 to carry the ACT and LINK signals that illuminate the corresponding LEDs on the RCM3209 module. These pins may be “configured” to carry PD0 and PD1, an option that is reserved for future use. See Appendix A.5 for more information about the locations of these headers. 20 RabbitCore RCM3209/RCM3229 Figure 7 shows the use of the Rabbit 3000 microprocessor ports in the RCM3209/ RCM3229 modules. PC0, PC2, PC4 PC1, PC3, PC5 PG2, PG6 PG3, PG7 PB1, PC6, STATUS PC7, /RES, SMODE0, SMODE1 4 Ethernet signals PA0PA7 PB0, PB2PB7 PD4PD5 Port A Port B (+Ethernet Port) Port C (Serial Ports B,C & D) Port G Port D RABBIT ® 3000 (Serial Ports E & F) Programming Port (Serial Port A) Ethernet Port RAM Real-Time Clock Watchdog 11 Timers Slave Port Clock Doubler Port E PE0PE1, PE3PE7 Port F PF0PF7 Port G PG0PG1, PG4PG5 (+Serial Ports) Misc. I/O Backup Battery Support Flash /RES_IN /RESET /IORD /IOWR Figure 7. Use of Rabbit 3000 Ports The ports on the Rabbit 3000 microprocessor used in the RCM3209/RCM3229 are configurable, and so the factory defaults can be reconfigured. Table 2 lists the Rabbit 3000 factory defaults and the alternate configurations. User’s Manual 21 Table 2. RCM3209/RCM3229 Pinout Configurations Pin Pin Name 1 GND 2 STATUS Default Use Alternate Use Output (Status) Output Notes 3–10 PA[7:0] Parallel I/O External data bus (ID0–ID7) Slave port data bus (SD0–SD7) 11 PF3 Input/Output QD2A 12 PF2 Input/Output QD2B 13 PF1 Input/Output QD1A CLKC 14 PF0 Input/Output QD1B CLKD 15 PC0 Output TXD 16 PC1 Input RXD 17 PC2 Output TXC 18 PC3 Input RXC 19 PC4 Output TXB 20 PC5 Input RXB 21 PC6 Output TXA 22 PC7 Input RXA Serial Port A (programming port) 23 PG0 Input/Output TCLKF Serial Clock F output 24 PG1 Input/Output RCLKF Serial Clock F input 25 PG2 Input/Output TXF 26 PG3 Input/Output RXF 27 PD4 Input/Output ATXB 28 PD5 Input/Output ARXB 29 PD2 Input/Output TPOUT– * 30 PD3 Input/Output TPOUT+ * 31 PD6 Input/Output TPIN– * 32 PD7 Input/Output TPIN+ * 33 LNK_OUT Output 34 ACT_OUT Output Serial Port D Header J61 Serial Port C Serial Port B Serial Port F Ethernet transmit port Ethernet receive port * 22 Max. current draw 1 mA (see Note 1) Pins 29–32 are reserved for future use. RabbitCore RCM3209/RCM3229 Table 2. RCM3209/RCM3229 Pinout Configurations (continued) Header J62 Pin Pin Name Default Use Alternate Use Notes Reset output from Reset Generator 1 /RES Reset output Reset input 2 PB0 Input/Output CLKB 3 PB2 Input/Output IA0 /SWR External Address 0 Slave port write 4 PB3 Input/Output IA1 /SRD External Address 1 Slave port read 5 PB4 Input/Output IA2 SA0 External Address 2 Slave port Address 0 6 PB5 Input/Output IA3 SA1 External Address 3 Slave port Address 1 7 PB6 Input/Output IA4 External Address 4 8 PB7 Input/Output IA5 /SLAVEATTN External Address 5 Slave Attention 9 PF4 Input/Output AQD1B PWM0 10 PF5 Input/Output AQD1A PWM1 11 PF6 Input/Output AQD2B PWM2 12 PF7 Input/Output AQD2A PWM3 13 PE7 Input/Output I7 /SCS 14 PE6 Input/Output I6 15 PE5 Input/Output I5 INT1B 16 PE4 Input/Output I4 INT0B 17 PE3 Input/Output I3 18 PE1 Input/Output I1 INT1A I/O Strobe 1 Interrupt 1A 19 PE0 Input/Output I0 INT0A I/O Strobe 0 Interrupt 0A User’s Manual 23 Table 2. RCM3209/RCM3229 Pinout Configurations (continued) Pin Pin Name Default Use Alternate Use Notes 20 PG7 Input/Output RXE 21 PG6 Input/Output TXE 22 PG5 Input/Output RCLKE Serial Clock E input 23 PG4 Input/Output TCLKE Serial Clock E ouput 24 /IOWR Output External write strobe 25 /IORD Input External read strobe Header J62 Serial Port E 26–27 SMODE0, SMODE1 (0,0)—start executing at address zero (0,1)—cold boot from slave port (1,0)—cold boot from clocked Serial Port A Also connected to programming cable SMODE0 =1, SMODE1 = 1 Cold boot from asynchronous Serial Port A at 2400 bps (programming cable connected) 28 /RESET_IN Input Input to Reset Generator 29 VRAM Output See Notes below table 30 VBAT_EXT 3 V battery Input Minimum battery voltage 2.85 V 31 +3.3V Input 3.15–3.45 V DC 32 GND 33 n.c. 34 GND Reserved for future use Notes 1. When using pins 33–34 on header J61 to drive LEDs, you must use an external buffer to drive these external LEDs. These pins are not connected on the RCM3229, which does not have the LEDs installed. 2. The VRAM voltage is temperature-dependent. If the VRAM voltage drops below about 1.2 V to 1.5 V, the contents of the battery-backed SRAM may be lost. If VRAM drops below 1.0 V, the 32 kHz oscillator could stop running. Pay careful attention to this voltage if you draw any current from this pin. 24 RabbitCore RCM3209/RCM3229 4.1.1 Memory I/O Interface The Rabbit 3000 address lines (A0–A19) and all the data lines (D0–D7) are routed internally to the onboard flash memory and SRAM chips. I/0 write (/IOWR) and I/0 read (/IORD) are available for interfacing to external devices. Parallel Port A can also be used as an external I/O data bus to isolate external I/O from the main data bus. Parallel Port B pins PB2–PB7 can also be used as an auxiliary address bus. When using the external I/O bus, you must add the following line at the beginning of your program. #define PORTA_AUX_IO // required to enable external I/O bus 4.1.2 LEDs The RCM3209 has three Ethernet status LEDs located beside the RJ-45 Ethernet jack— these are discussed in Section 4.2. 4.1.3 Other Inputs and Outputs The status, /RESET_IN, SMODE0 and SMODE1 I/O are normally associated with the programming port. Since the status pin is not used by the system once a program has been downloaded and is running, the status pin can then be used as a general-purpose CMOS output. The programming port is described in more detail in Section 4.2.3. /RES is an output from the reset circuitry that can be used to reset external peripheral devices. 4.1.4 5 V Tolerant Inputs The RCM3209/RCM3229 operates over a voltage from 3.15 V to 3.45 V, but most RCM3209/RCM3229 input pins, except /RESET_IN, VRAM, VBAT_EXT, and the power-supply pins, are 5 V tolerant. When a 5 V signal is applied to 5 V tolerant pins, they present a high impedance even if the Rabbit power is off. The 5 V tolerant feature allows 5 V devices that have a suitable switching threshold to be connected directly to the RCM3209/RCM3229. This includes HCT family parts operated at 5 V that have an input threshold between 0.8 and 2 V. NOTE: CMOS devices operated at 5 V that have a threshold at 2.5 V are not suitable for direct connection because the Rabbit 3000 outputs do not rise above VDD, and is often specified as 3.3 V. Although a CMOS input with a 2.5 V threshold may switch at 3.3 V, it will consume excessive current and switch slowly. In order to translate between 5 V and 3.3 V, HCT family parts powered from 5 V can be used, and are often the best solution. There is also the “LVT” family of parts that operate from 2.0 V to 3.3 V, but that have 5 V tolerant inputs and are available from many suppliers. True level-translating parts are available with separate 3.3 V and 5 V supply pins, but these parts are not usually needed, and have design traps involving power sequencing. User’s Manual 25 4.2 Serial Communication The RCM3209/RCM3229 boards do not have any serial protocol-level transceivers directly on the board. However, an RS-232 or RS-485 interface may be incorporated on the board the RCM3209/RCM3229 is mounted on. For example, the Prototyping Board has a standard RS-232 transceiver chip. 4.2.1 Serial Ports There are six serial ports designated as Serial Ports A, B, C, D, E, and F. All six serial ports can operate in an asynchronous mode up to the baud rate of the system clock divided by 8. An asynchronous port can handle 7 or 8 data bits. A 9th bit address scheme, where an additional bit is sent to mark the first byte of a message, is also supported. Serial Ports A, B, C, and D can also be operated in the clocked serial mode. In this mode, a clock line synchronously clocks the data in or out. Either of the two communicating devices can supply the clock. When the Rabbit 3000 provides the clock, the baud rate can be up to 80% of the system clock frequency divided by 128, or 276,250 bps for a 44.2 MHz clock speed. Serial Ports E and F can also be configured as SDLC/HDLC serial ports. The IrDA protocol is also supported in SDLC format by these two ports. Serial Port A is available only on the programming port. 26 RabbitCore RCM3209/RCM3229 4.2.2 Ethernet Port (RCM3209 only) Figure 8 shows the pinout for the RJ-45 Ethernet port (J4). Note that some Ethernet connectors are numbered in reverse to the order used here. ETHERNET 1 8 1. 2. 3. 6. RJ-45 Plug E_Tx+ E_Tx E_Rx+ E_Rx RJ-45 Jack Figure 8. RJ-45 Ethernet Port Pinout Three LEDs are placed next to the RJ-45 Ethernet jack, one to indicate an Ethernet link or Ethernet activity (LNK/ACT), and one (FDX/COL) to indicate whether the Ethernet connection is in fullduplex mode (steady on) or that a half-duplex connection is experiencing collisions (blinks). The transformer/connector assembly ground is connected to the RCM3209 printed circuit board digital ground via a ferrite bead, L1, as shown in Figure 9. RJ-45 Ethernet Jack L1 Board Ground Chassis Ground Figure 9. Ferrite Bead Isolation The RJ-45 connector is shielded to minimize EMI effects to/from the Ethernet signals. The Ethernet chip supports auto MDI/MDIX on the Ethernet port to choose the Ethernet interface automatically based on whether a crossover cable or a straight-through cable is used in a particular setup. The Ethernet chip may spike the current draw by up to 200 mA while it is searching to determine the type of Ethernet cable. This search is repeated every second if no Ethernet cable is detected. If you do not plan to connect an Ethernet cable, use the Dynamic C pd_powerdown() function call to turn off the Ethernet chip. The pd_powerup() function call is available to turn the Ethernet chip back on at a later time. These function calls are described in the Dynamic C TCP/IP User’s Manual, Volume 1. User’s Manual 27 4.2.3 Serial Programming Port The RCM3209/RCM3229 serial programming port is accessed using header J1 or over an Ethernet connection via the RabbitLink EG2110. The programming port uses the Rabbit 3000’s Serial Port A for communication. Dynamic C uses the programming port to download and debug programs. The programming port is also used for the following operations. • Cold-boot the Rabbit 3000 on the RCM3209/RCM3229 after a reset. • Remotely download and debug a program over an Ethernet connection using the RabbitLink EG2110. • Fast copy designated portions of flash memory from one Rabbit-based board (the master) to another (the slave) using the Rabbit Cloning Board. In addition to Serial Port A, the Rabbit 3000 startup-mode (SMODE0, SMODE1), status, and reset pins are available on the programming port. The two startup mode pins determine what happens after a reset—the Rabbit 3000 is either cold-booted or the program begins executing at address 0x0000. The status pin is used by Dynamic C to determine whether a Rabbit microprocessor is present. The status output has three different programmable functions: 1. It can be driven low on the first op code fetch cycle. 2. It can be driven low during an interrupt acknowledge cycle. 3. It can also serve as a general-purpose CMOS output. The /RESET_IN pin is an external input that is used to reset the Rabbit 3000 and the RCM3209/RCM3229 onboard peripheral circuits. The serial programming port can be used to force a hard reset on the RCM3209/RCM3229 by asserting the /RESET_IN signal. Alternate Uses of the Serial Programming Port All three clocked Serial Port A signals are available as • a synchronous serial port • an asynchronous serial port, with the clock line usable as a general CMOS I/O pin The programming port may also be used as a serial port once the application is running. The SMODE pins may then be used as inputs and the status pin may be used as an output. Refer to the Rabbit 3000 Microprocessor User’s Manual for more information. 28 RabbitCore RCM3209/RCM3229 4.3 Serial Programming Cable The programming cable is used to connect the serial programming port of the RCM3209/ RCM3229 to a PC serial COM port. The programming cable converts the voltage levels used by the PC USB port to the CMOS voltage levels used by the Rabbit 3000. When the PROG connector on the programming cable is connected to the RCM3209/ RCM3229 serial programming port at header J1, programs can be downloaded and debugged over the serial interface. The DIAG connector of the programming cable may be used on header J1 of the RCM3209/ RCM3229 with the RCM3209/RCM3229 operating in the Run Mode. This allows the programming port to be used as a regular serial port. 4.3.1 Changing Between Program Mode and Run Mode The RCM3209/RCM3229 is automatically in Program Mode when the PROG connector on the programming cable is attached, and is automatically in Run Mode when no programming cable is attached. When the Rabbit 3000 is reset, the operating mode is determined by the state of the SMODE pins. When the programming cable’s PROG connector is attached, the SMODE pins are pulled high, placing the Rabbit 3000 in the Program Mode. When the programming cable’s PROG connector is not attached, the SMODE pins are pulled low, causing the Rabbit 3000 to operate in the Run Mode. MOTOR/ENCODER J6 C11 C10 RESET GND RC1 GND GND R72 +5V C75 C74 GND +5V BA3 BA1 BD0 BD2 BD4 BD6 BD1 BD3 BD5 BD7 GND BA0 /RES LCD BA2 +5V GND GND R16 +5V C45 C44 C43 R38 C9 U6 C16 DISPLAY BOARD R24 RC25 RC4 RC5 C14 RC27 U3 RC28 RC29 RC26 UX5 R14 PROG RC9 UX7 PG6 PG7 DS1 DS2 DIAG S3 C7 RS-232 +5V UX4 +5V U3 RCM2JB S2 RC7 +5V J8 Programming Cable R15 C39 TP1 RC6 C32 C19 C24 C20 +5V BPE3 R47 R44 C49 JP4 C28 C27 C4 J5 TxB RxB JP3 C37 C36 C16 C15 C17 J2 C3 GND J4 R28 JP5 R31 R27 C18 C9 C8 C1 R74 R42 C33 C23 JP1 C4 U1 C5 U2 RP1 C12 JP2 JP3 JP4 JP5 R10 J1 R14 R15 C35 R25 C11 C10 C6 RxC TxC R8 Y3 C18 U5 C29 C8 C9 R29 R37 R39 R40 C42 C8 R2 L1 R35 C5 R1 J3 C33 U6 U1 RCM2JA RESET C48 C26 C32 C30 R51 R49 R48 C61 L2 R16 Q1 /RES STATUS R41 PB0 C17 R67 R70 L2 R20 C64 R21 C67 PA7 C34 PA6 C62 PB2 C57 C31 Y2C59 C30 L1 PB3 R14 DS1 PA5 U3 C83 C72 U7 R19 DS1 R33 PA3 PA4 R7 R9 C71 C68 DS3 DS3 DS2 DS2 R34 PA1 PA2 PB4 1 R71 PF3 PA0 PB6 C1 PF2 PF4 +3.3V +3.3V R1 PF6 PF5 PB5 R25 R26 GND R75 Q1 R63 R64 C46 JP14 C79 J4 Y4 PF7 PB7 R23 C86 DS4 PF1 U4 Q2 PC0 PF0 R3 PC2 PC1 PE7 GND GND C6 PC4 PC3 PE5 PE6 C12 PC5 PE3 PE4 C2 PE0 PE1 C4 PG7 C3 PD5 R10 PD4 R9 PG6 R8 PG5 GND GND +3.3V C7 R7 PG0 U5 PG2 PG1 C14 PD4 PG3 PG4 +3.3V +3.3V C16 PD2 PD5 /IORD UX2 C24 C20 C21 PD3 SM1 R17 C19 C15 VRAM SM0 /IOWR JP7 VBAT EXT /RES IN JP9 PD6 JP8 PD7 C27 C22 C23 +3.3V JP10 GND RC2 C28 C25 C35 PD0 +3.3V C37 R9 R11 PD1 U1 RCM39XX RC21 C36 R13 RC11 NC Battery C38 R7 RC10 C43 U8 R12 C44 C39 C40 R22 R6 RC22 R27 R30 UX3 GND +DC JP11 RC23 R10 C47 R8 RC16 RC12 R21 RC24 JP13 R32 RC14 RC17 RC13 JP12 C48 R31 UX9 UX11 C49 C50 R35 RC20 CE R2 RC19 RCM2 BSY C3 R5 FDX LNK ACT SPD LNK SPD ACT COL R4 GND RC18 MASTER RC15 C2 R1 R3 +5V J15 SLAVE UX10 GND C1 R17 R4R18 PA7 J3 R28 PE4 D1 PA6 /RES R29 U10 PB2 RN2 J1 U9 PB0 C45 PB3 +5V BT1 R19 R5 R20 R6 PA5 R23 PA4 J3 PB4 U4 PA3 PB5 C31 PA1 PA2 D1 PF3 PA0 PB6 R22 Y1 C5 PF2 PF4 R11 PF6 PF5 C13 PF7 PB7 R13 PF1 R12 PF0 U6 PE7 C12 U5 C53 PE6 2.5 MM JACK D2 U4 C47 PC0 U8 PC1 C29 PE5 R18 PC2 PE4 2 PC3 R24 Y3 PE3 R58 PC4 PE1 R73 PD5 PC5 J11 D1 C13 R20 R17 C41 R69 C42 PG0 PD4 PE0 C17 JP1 PG2 PG1 PG6 CURRENT MEASUREMENT OPTION PG3 PG4 PG7 DS3 /IORD PG5 L1 RCM3000 ETHERNET CORE MODULE RN4 SM0 /IOWR +3.3V POWER PD4 RN5 C15 PD5 RCM1JB GND POWER SM1 RCM1JA J9 PD2 +DC PD6 PD3 GND PD0 PD7 VRAM VBAT EXT /RES IN GND PD1 +3.3V RN3 NC GND +5V +3.3V RN1 GND RCM30/31/32XX SERIES PROTOTYPING BOARD J10 Colored edge DISPLAY BOARD UX13 J7 To PC USB port DISPLAY BOARD RESET RCM3209/RCM3229 when changing mode: Short out pins 2832 on header J2, OR Press RESET button (if using Prototyping Board), OR Cycle power off/on after removing or attaching programming cable. Figure 10. Switching Between Program Mode and Run Mode User’s Manual 29 A program “runs” in either mode, but can only be downloaded and debugged when the RCM3209/RCM3229 is in the Program Mode. Refer to the Rabbit 3000 Microprocessor User’s Manual for more information on the programming port. 4.3.2 Standalone Operation of the RCM3209/RCM3229 The RCM3209/RCM3229 must be programmed via the Prototyping Board or via a similar arrangement on a customer-supplied board. Once the RCM3209/RCM3229 has been programmed successfully, remove the serial programming cable from the programming connector and reset the RCM3209/RCM3229. The RCM3209/RCM3229 may be reset by cycling the power off/on or by pressing the RESET button on the Prototyping Board. The RCM3209/RCM3229 module may now be removed from the Prototyping Board for enduse installation. CAUTION: Disconnect power to the Prototyping Board or other boards when removing or installing your RCM3209/RCM3229 module to protect against inadvertent shorts across the pins or damage to the RCM3209/RCM3229 if the pins are not plugged in correctly. Do not reapply power until you have verified that the RCM3209/RCM3229 module is plugged in correctly. 30 RabbitCore RCM3209/RCM3229 4.4 Other Hardware 4.4.1 Clock Doubler The RCM3209/RCM3229 takes advantage of the Rabbit 3000 microprocessor’s internal clock doubler. A built-in clock doubler allows half-frequency crystals to be used to reduce radiated emissions. The 44.2 MHz frequency specified for the RCM3209/RCM3229 is generated using a 22.12 MHz resonator. The clock doubler may be disabled if 44.2 MHz clock speeds are not required. Disabling the Rabbit 3000 microprocessor’s internal clock doubler will reduce power consumption and further reduce radiated emissions. The clock doubler is disabled with a simple configuration macro as shown below. 1. Select the “Defines” tab from the Dynamic C Options > Project Options menu. 2. Add the line CLOCK_DOUBLED=0 to always disable the clock doubler. The clock doubler is enabled by default, and usually no entry is needed. If you need to specify that the clock doubler is always enabled, add the line CLOCK_DOUBLED=1 to always enable the clock doubler. 3. Click OK to save the macro. The clock doubler will now remain off whenever you are in the project file where you defined the macro. 4.4.2 Spectrum Spreader The Rabbit 3000 features a spectrum spreader, which helps to mitigate EMI problems. By default, the spectrum spreader is on automatically, but it may also be turned off or set to a stronger setting. The means for doing so is through a simple configuration macro as shown below. 1. Select the “Defines” tab from the Dynamic C Options > Project Options menu. 2. Normal spreading is the default, and usually no entry is needed. If you need to specify normal spreading, add the line ENABLE_SPREADER=1 For strong spreading, add the line ENABLE_SPREADER=2 To disable the spectrum spreader, add the line ENABLE_SPREADER=0 NOTE: The strong spectrum-spreading setting is unnecessary for the BL2000. 3. Click OK to save the macro. The spectrum spreader will now be set to the state specified by the macro value whenever you are in the project file where you defined the macro. NOTE: Refer to the Rabbit 3000 Microprocessor User’s Manual for more information on the spectrum-spreading setting and the maximum clock speed. User’s Manual 31 4.5 Memory 4.5.1 SRAM The RCM3209/RCM3229 have 512K of program execution fast SRAM installed at U66. The RCM3209/RCM3229 data SRAM installed at U9 is 256K. 4.5.2 Flash EPROM The RCM3209/RCM3229 boards also have 512K of flash EPROM at U8. NOTE: Rabbit recommends that any customer applications should not be constrained by the sector size of the flash EPROM since it may be necessary to change the sector size in the future. Writing to arbitrary flash memory addresses at run time is also discouraged. Instead, define a “user block” area to store persistent data. The functions writeUserBlock() and readUserBlock() are provided for this. Refer to the Rabbit 3000 Microprocessor Designer’s Handbook and the Dynamic C Function Reference Manual for additional information. A Flash Memory Bank Select jumper configuration option based on 0 Ω surface-mounted resistors exists at header JP12 on the RCM3209/RCM3229 RabbitCore modules. This option, used in conjunction with some configuration macros, allows Dynamic C to compile two different co-resident programs for the upper and lower halves of a 256K flash in such a way that both programs start at logical address 0000. This option is not relevant to the RCM3209/RCM3229 RabbitCore modules, which use 512K flash memories. 4.5.3 Dynamic C BIOS Source Files The Dynamic C BIOS source files handle different standard RAM and flash EPROM sizes automatically. 32 RabbitCore RCM3209/RCM3229 5. SOFTWARE REFERENCE Dynamic C is an integrated development system for writing embedded software. It runs on an IBM-compatible PC and is designed for use with Rabbit with controllers based on the Rabbit microprocessor Chapter 5 provides the libraries and function calls related to the RCM3209/RCM3229. 5.1 More About Dynamic C Dynamic C has been in use worldwide since 1989. It is specially designed for programming embedded systems, and features quick compile and interactive debugging in the real environment. A complete reference guide to Dynamic C is contained in the Dynamic C User’s Manual. You have a choice of doing your software development in the flash memory or in the data SRAM included on the RCM3209/RCM3229. The flash memory and SRAM options are selected with the Options > Project Options > Compiler menu. The advantage of working in RAM is to save wear on the flash memory, which is limited to about 100,000 write cycles. The disadvantage is that the code and data might not both fit in RAM. NOTE: An application should be run from the program execution SRAM after the programming cable is disconnected. Your final code must always be stored in flash memory for reliable operation. For RCM3209/RCM3229 modules running at 44.2 MHz, which have a fast program execution SRAM that is not battery-backed, you should select Code and BIOS in Flash, Run in RAM from the Dynamic C Options > Project Options > Compiler menu to store the code in flash and copy it to the fast program execution SRAM at run-time to take advantage of the faster clock speed. This option optimizes the performance of RCM3209/RCM3229 modules running at 44.2 MHz. NOTE: Do not depend on the flash memory sector size or type. Due to the volatility of the flash memory market, the RCM3209/RCM3229 and Dynamic C were designed to accommodate flash devices with various sector sizes. Developing software with Dynamic C is simple. Users can write, compile, and test C and assembly code without leaving the Dynamic C development environment. Debugging occurs while the application runs on the target. Alternatively, users can compile a program to an image file for later loading. Dynamic C runs on PCs under Windows 2000/NT and later— see Rabbit’s Technical Note TN257, Running Dynamic C® With Windows Vista®, for User’s Manual 33 additional information if you are using a Dynamic C release prior to v. 9.60 under Windows Vista. Programs can be downloaded at baud rates of up to 460,800 bps after the program compiles. Dynamic C has a number of standard features. • Full-feature source and/or assembly-level debugger, no in-circuit emulator required. • Royalty-free TCP/IP stack with source code and most common protocols. • Hundreds of functions in source-code libraries and sample programs: X Exceptionally fast support for floating-point arithmetic and transcendental functions. X RS-232 and RS-485 serial communication. X Analog and digital I/O drivers. X I2C, SPI, GPS, file system. X LCD display and keypad drivers. • Powerful language extensions for cooperative or preemptive multitasking • Loader utility program to load binary images into Rabbit targets in the absence of Dynamic C. • Provision for customers to create their own source code libraries and augment on-line help by creating “function description” block comments using a special format for library functions. • Standard debugging features: X Breakpoints—Set breakpoints that can disable interrupts. X Single-stepping—Step into or over functions at a source or machine code level, µC/OS-II aware. X Code disassembly—The disassembly window displays addresses, opcodes, mnemonics, and machine cycle times. Switch between debugging at machine-code level and source-code level by simply opening or closing the disassembly window. X Watch expressions—Watch expressions are compiled when defined, so complex expressions including function calls may be placed into watch expressions. Watch expressions can be updated with or without stopping program execution. X Register window—All processor registers and flags are displayed. The contents of general registers may be modified in the window by the user. X Stack window—shows the contents of the top of the stack. X Hex memory dump—displays the contents of memory at any address. X STDIO window—printf outputs to this window and keyboard input on the host PC can be detected for debugging purposes. printf output may also be sent to a serial port or file. 34 RabbitCore RCM3209/RCM3229 5.2 Dynamic C Function Calls 5.2.1 Digital I/O The RCM3209/RCM3229 was designed to interface with other systems, and so there are no drivers written specifically for the I/O. The general Dynamic C read and write functions allow you to customize the parallel I/O to meet your specific needs. For example, use WrPortI(PEDDR, &PEDDRShadow, 0x00); to set all the Port E bits as inputs, or use WrPortI(PEDDR, &PEDDRShadow, 0xFF); to set all the Port E bits as outputs. When using the external I/O bus on the Rabbit 3000 chip, add the line #define PORTA_AUX_IO // required to enable external I/O bus to the beginning of any programs using the external I/O bus. The sample programs in the Dynamic C SAMPLES/RCM3200 directory provide further examples. 5.2.2 SRAM Use The RCM3209/RCM3229 has a battery-backed data SRAM and a program-execution SRAM. Dynamic C provides the protected keyword to identify variables that are to be placed into the battery-backed SRAM. The compiler generates code that creates a backup copy of a protected variable before the variable is modified. If the system resets while the protected variable is being modified, the variable's value can be restored when the system restarts. The sample code below shows how a protected variable is defined and how its value can be restored. protected nf_device nandFlash; int main() { ... _sysIsSoftReset(); // restore any protected variables The bbram keyword may also be used instead if there is a need to store a variable in battery-backed SRAM without affecting the performance of the application program. Data integrity is not assured when a reset or power failure occurs during the update process. Additional information on bbram and protected variables is available in the Dynamic C User’s Manual. User’s Manual 35 5.2.3 Serial Communication Drivers Library files included with Dynamic C provide a full range of serial communications support. The LIB\RS232.LIB library provides a set of circular-buffer-based serial functions. The LIB\PACKET.LIB library provides packet-based serial functions where packets can be delimited by the 9th bit, by transmission gaps, or with user-defined special characters. Both libraries provide blocking functions, which do not return until they are finished transmitting or receiving, and nonblocking functions, which must be called repeatedly until they are finished. For more information, see the Dynamic C Function Reference Manual and Rabbit’s Technical Note 213, Rabbit 2000 Serial Port Software in the online documentation set. 5.2.4 TCP/IP Drivers The TCP/IP drivers are located in the LIB\TCPIP directory. Complete information on these libraries and the TCP/IP functions is provided in the Dynamic C TCP/IP User’s Manual. 5.2.5 Prototyping Board Function Calls The functions described in this section are for use with the Prototyping Board features. The source code is in the RCM3200.LIB library in the Dynamic C SAMPLES\RCM3200 folder if you need to modify it for your own board design. Other generic functions applicable to all devices based on Rabbit microprocessors are described in the Dynamic C Function Reference Manual. 36 RabbitCore RCM3209/RCM3229 5.2.6 Prototyping Board Functions The functions described in this section are for use with the Prototyping Board features. The source code is in the Dynamic C SAMPLES\RCM3200\RCM3200.LIB library if you need to modify it for your own board design. Other generic functions applicable to all devices based on Rabbit microprocessors are described in the Dynamic C Function Reference Manual. 5.2.6.1 Board Initialization brdInit void brdInit (void); DESCRIPTION Call this function at the beginning of your program. This function initializes Parallel Ports A through G for use with the Prototyping Board. This function call is intended for demonstration purposes only, and can be modified for your applications. Summary of Initialization 1. I/O port pins are configured for Prototyping Board operation. 2. Unused configurable I/O are set as tied inputs or outputs. 3. Only one RabbitCore module is plugged in, and is in the MASTER position on the Prototyping Board. 4. The LCD/keypad module is disabled. 5. RS-485 is not enabled. 6. RS-232 is not enabled. 7. The IrDA transceiver is disabled. 8. LEDs are off. RETURN VALUE None. User’s Manual 37 5.3 Upgrading Dynamic C Dynamic C patches that focus on bug fixes are available from time to time. Check the Web site www.rabbit.com/support/ for the latest patches, workarounds, and bug fixes. 5.3.1 Extras Dynamic C installations are designed for use with the board they are included with, and are included at no charge as part of our low-cost kits. Starting with Dynamic C version 9.60, which is included with the RCM3209/RCM3229 Development Kit, Dynamic C includes the popular µC/OS-II real-time operating system, point-to-point protocol (PPP), FAT file system, RabbitWeb, and other select libraries. Rabbit also offers for purchase the Rabbit Embedded Security Pack featuring the Secure Sockets Layer (SSL) and a specific Advanced Encryption Standard (AES) library. In addition to the Web-based technical support included at no extra charge, a one-year telephone-based technical support subscription is also available for purchase. Visit our Web site at www.rabbit.com for further information and complete documentation. 38 RabbitCore RCM3209/RCM3229 6. USING THE TCP/IP FEATURES 6.1 TCP/IP Connections Programming and development can be done with the RCM3209 RabbitCore modules without connecting the Ethernet port to a network. However, if you will be running the sample programs that use the Ethernet capability or will be doing Ethernet-enabled development, you should connect the RCM3209 module’s Ethernet port at this time. Before proceeding you will need to have the following items. • If you don’t have Ethernet access, you will need at least a 10Base-T Ethernet card (available from your favorite computer supplier) installed in a PC. • One Cat. 5 straight through or crossover Ethernet cable. Ethernet cables and a 10Base-T Ethernet hub are available in a TCP/IP tool kit. More information is available at www.rabbit.com. NOTE: Although 10Base-T is the minimum required, 10/100Base-T or 100Base-T is recommended to allow you to work with the full speed capabilities of the RCM3209. 1. Connect the AC adapter and the programming cable as shown in Section 2.2.2, “Step 2 — Connect Programming Cable.” 2. Ethernet Connections There are four options for connecting the RCM3209 module to a network for development and runtime purposes. The first two options permit total freedom of action in selecting network addresses and use of the “network,” as no action can interfere with other users. We recommend one of these options for initial development. • No LAN — The simplest alternative for desktop development. Connect the RCM3209’s module’s Ethernet port directly to the PC’s network interface card using either a Cat. 5 crossover cable or a Cat. 5 straight-through cable. • Micro-LAN — Another simple alternative for desktop development. Use a small Ethernet 10Base-T hub and connect both the PC’s network interface card and the RCM3209’s Ethernet port to it, using standard network cables. User’s Manual 39 The following options require more care in address selection and testing actions, as conflicts with other users, servers and systems can occur: • LAN — Connect the RCM3209’s Ethernet port to an existing LAN, preferably one to which the development PC is already connected. You will need to obtain IP addressing information from your network administrator. • WAN — The RCM3209 is capable of direct connection to the Internet and other Wide Area Networks, but exceptional care should be used with IP address settings and all network-related programming and development. We recommend that development and debugging be done on a local network before connecting a RabbitCore system to the Internet. TIP: Checking and debugging the initial setup on a micro-LAN is recommended before connecting the system to a LAN or WAN. The PC running Dynamic C through the serial port on the RCM3209 does not need to be the PC with the Ethernet card. 3. Apply Power Plug in the AC adapter. The RCM3209 module is now ready to be used. 40 RabbitCore RCM3209/RCM3229 6.2 TCP/IP Primer on IP Addresses Obtaining IP addresses to interact over an existing, operating, network can involve a number of complications, and must usually be done with cooperation from your ISP and/or network systems administrator. For this reason, it is suggested that the user begin instead by using a direct connection between a PC and the RCM3209 board. In order to set up this direct connection, the user will have to use a PC without networking, or disconnect a PC from the corporate network, or install a second Ethernet adapter and set up a separate private network attached to the second Ethernet adapter. Disconnecting your PC from the corporate network may be easy or nearly impossible, depending on how it is set up. If your PC boots from the network or is dependent on the network for some or all of its disks, then it probably should not be disconnected. If a second Ethernet adapter is used, be aware that Windows TCP/IP will send messages to one adapter or the other, depending on the IP address and the binding order in Microsoft products. Thus you should have different ranges of IP addresses on your private network from those used on the corporate network. If both networks service the same IP address, then Windows may send a packet intended for your private network to the corporate network. A similar situation will take place if you use a dial-up line to send a packet to the Internet. Windows may try to send it via the local Ethernet network if it is also valid for that network. The following IP addresses are set aside for local networks and are not allowed on the Internet: 10.0.0.0 to 10.255.255.255, 172.16.0.0 to 172.31.255.255, and 192.168.0.0 to 192.168.255.255. The RCM3209 board uses a 10/100Base-T type of Ethernet connection, which is the most common scheme. The RJ-45 connectors are similar to U.S. style telephone connectors, are except larger and have 8 contacts. An alternative to the direct connection is a connection using a hub. The hub relays packets received on any port to all of the ports on the hub. Hubs are low in cost and are readily available. The RCM3209 board uses 10/100 Mbps Ethernet, so the hub or Ethernet adapter should be a 10/100 Mbps unit. In a corporate setting where the Internet is brought in via a high-speed line, there are typically machines between the outside Internet and the internal network. These machines include a combination of proxy servers and firewalls that filter and multiplex Internet traffic. In the configuration below, the RCM3209 board could be given a fixed address so any of the computers on the local network would be able to contact it. It may be possible to configure the firewall or proxy server to allow hosts on the Internet to directly contact the controller, but it would probably be easier to place the controller directly on the external network outside of the firewall. This avoids some of the configuration complications by sacrificing some security. User’s Manual 41 Hub(s) T1 in Adapter Ethernet Firewall Proxy Server Network Ethernet Typical Corporate Network RCM3209 Board If your system administrator can give you an Ethernet cable along with its IP address, the netmask and the gateway address, then you may be able to run the sample programs without having to setup a direct connection between your computer and the RCM3209 board. You will also need the IP address of the nameserver, the name or IP address of your mail server, and your domain name for some of the sample programs. 42 RabbitCore RCM3209/RCM3229 6.2.1 IP Addresses Explained IP (Internet Protocol) addresses are expressed as 4 decimal numbers separated by periods, for example: 216.103.126.155 10.1.1.6 Each decimal number must be between 0 and 255. The total IP address is a 32-bit number consisting of the 4 bytes expressed as shown above. A local network uses a group of adjacent IP addresses. There are always 2N IP addresses in a local network. The netmask (also called subnet mask) determines how many IP addresses belong to the local network. The netmask is also a 32-bit address expressed in the same form as the IP address. An example netmask is: 255.255.255.0 This netmask has 8 zero bits in the least significant portion, and this means that 28 addresses are a part of the local network. Applied to the IP address above (216.103.126.155), this netmask would indicate that the following IP addresses belong to the local network: 216.103.126.0 216.103.126.1 216.103.126.2 etc. 216.103.126.254 216.103.126.255 The lowest and highest address are reserved for special purposes. The lowest address (216.102.126.0) is used to identify the local network. The highest address (216.102.126.255) is used as a broadcast address. Usually one other address is used for the address of the gateway out of the network. This leaves 256 - 3 = 253 available IP addresses for the example given. User’s Manual 43 6.2.2 How IP Addresses are Used The actual hardware connection via an Ethernet uses Ethernet adapter addresses (also called MAC addresses). These are 48-bit addresses and are unique for every Ethernet adapter manufactured. In order to send a packet to another computer, given the IP address of the other computer, it is first determined if the packet needs to be sent directly to the other computer or to the gateway. In either case, there is an IP address on the local network to which the packet must be sent. A table is maintained to allow the protocol driver to determine the MAC address corresponding to a particular IP address. If the table is empty, the MAC address is determined by sending an Ethernet broadcast packet to all devices on the local network asking the device with the desired IP address to answer with its MAC address. In this way, the table entry can be filled in. If no device answers, then the device is nonexistent or inoperative, and the packet cannot be sent. IP addresses are arbitrary and can be allocated as desired provided that they don’t conflict with other IP addresses. However, if they are to be used with the Internet, then they must be numbers that are assigned to your connection by proper authorities, generally by delegation via your service provider. Each RCM3209 RabbitCore module has its own unique MAC address, which consists of the prefix 0090C2 followed by the code that appears on the label affixed to the RCM3209 module. For example, a MAC address might be 0090C2C002C0. TIP: You can always verify the MAC address on your board by running the sample program DISPLAY_MAC.C from the SAMPLES\TCPIP folder. 44 RabbitCore RCM3209/RCM3229 6.2.3 Dynamically Assigned Internet Addresses In many instances, devices on a network do not have fixed IP addresses. This is the case when, for example, you are assigned an IP address dynamically by your dial-up Internet service provider (ISP) or when you have a device that provides your IP addresses using the Dynamic Host Configuration Protocol (DHCP). The RCM3209 RabbitCore modules can use such IP addresses to send and receive packets on the Internet, but you must take into account that this IP address may only be valid for the duration of the call or for a period of time, and could be a private IP address that is not directly accessible to others on the Internet. These addresses can be used to perform some Internet tasks such as sending e-mail or browsing the Web, but it is more difficult to participate in conversations that originate elsewhere on the Internet. If you want to find out this dynamically assigned IP address, under Windows 98 you can run the winipcfg program while you are connected and look at the interface used to connect to the Internet. Many networks use private IP addresses that are assigned using DHCP. When your computer comes up, and periodically after that, it requests its networking information from a DHCP server. The DHCP server may try to give you the same address each time, but a fixed IP address is usually not guaranteed. If you are not concerned about accessing the RCM3209 from the Internet, you can place the RCM3209 on the internal network using a private address assigned either statically or through DHCP. User’s Manual 45 6.3 Placing Your Device on the Network In many corporate settings, users are isolated from the Internet by a firewall and/or a proxy server. These devices attempt to secure the company from unauthorized network traffic, and usually work by disallowing traffic that did not originate from inside the network. If you want users on the Internet to communicate with your RCM3209, you have several options. You can either place the RCM3209 directly on the Internet with a real Internet address or place it behind the firewall. If you place the RCM3209 behind the firewall, you need to configure the firewall to translate and forward packets from the Internet to the RCM3209. 46 RabbitCore RCM3209/RCM3229 6.4 Running TCP/IP Sample Programs We have provided a number of sample programs demonstrating various uses of TCP/IP for networking embedded systems. These programs require you to connect your PC and the RCM3209 board together on the same network. This network can be a local private network (preferred for initial experimentation and debugging), or a connection via the Internet. RCM3209 Board User’s PC Cat. 5 Ethernet cable Direct Connection (network of 2 computers) User’s Manual RCM3209 Board Ethernet cables Hub To additional network elements Direct Connection Using a Hub 47 6.4.1 How to Set IP Addresses in the Sample Programs With the introduction of Dynamic C 7.30 we have taken steps to make it easier to run many of our sample programs. Instead of the MY_IP_ADDRESS and other macros, you will see a TCPCONFIG macro. This macro tells Dynamic C to select your configuration from a list of default configurations. You will have three choices when you encounter a sample program with the TCPCONFIG macro. 1. You can replace the TCPCONFIG macro with individual MY_IP_ADDRESS, MY_NETMASK, MY_GATEWAY, and MY_NAMESERVER macros in each program. 2. You can leave TCPCONFIG at the usual default of 1, which will set the IP configurations to 10.10.6.100, the netmask to 255.255.255.0, and the nameserver and gateway to 10.10.6.1. If you would like to change the default values, for example, to use an IP address of 10.1.1.2 for the RCM3209 board, and 10.1.1.1 for your PC, you can edit the values in the section that directly follows the “General Configuration” comment in the TCP_CONFIG.LIB library. You will find this library in the LIB/TCPIP directory. 3. You can create a CUSTOM_CONFIG.LIB library and use a TCPCONFIG value greater than 100. Instructions for doing this are at the beginning of the TCP_CONFIG.LIB file. There are some other “standard” configurations for TCPCONFIG that let you select different features such as DHCP. Their values are documented at the top of the TCP_CONFIG.LIB library. More information is available in the Dynamic C TCP/IP User’s Manual. 48 RabbitCore RCM3209/RCM3229 6.4.2 How to Set Up your Computer for Direct Connect Follow these instructions to set up your PC or notebook. Check with your administrator if you are unable to change the settings as described here since you may need administrator privileges. The instructions are specifically for Windows 2000, but the interface is similar for other versions of Windows. TIP: If you are using a PC that is already on a network, you will disconnect the PC from that network to run these sample programs. Write down the existing settings before changing them to facilitate restoring them when you are finished with the sample programs and reconnect your PC to the network. 1. Go to the control panel (Start > Settings > Control Panel), and then double-click the Network icon. 2. Select the network interface card used for the Ethernet interface you intend to use (e.g., TCP/IP Xircom Credit Card Network Adapter) and click on the “Properties” button. Depending on which version of Windows your PC is running, you may have to select the “Local Area Connection” first, and then click on the “Properties” button to bring up the Ethernet interface dialog. Then “Configure” your interface card for a “10Base-T Half-Duplex” or an “Auto-Negotiation” connection on the “Advanced” tab. NOTE: Your network interface card will likely have a different name. 3. Now select the IP Address tab, and check Specify an IP Address, or select TCP/IP and click on “Properties” to assign an IP address to your computer (this will disable “obtain an IP address automatically”): IP Address : 10.10.6.101 Netmask : 255.255.255.0 Default gateway : 10.10.6.1 4. Click <OK> or <Close> to exit the various dialog boxes. RCM3209 Board IP 10.10.6.101 Netmask 255.255.255.0 User’s PC Cat. 5 Ethernet cable Direct Connection PC to RCM3209 Board User’s Manual 49 6.5 Run the PINGME.C Sample Program Connect a Cat. 5 Ethernet cable from your computer’s Ethernet port to the RCM3209 board’s RJ-45 Ethernet connector. Open this sample program from the SAMPLES\TCPIP\ ICMP folder, compile the program, and start it running under Dynamic C. When the program starts running, the green LNK/ACT LED on the RCM3209 board should be on to indicate an Ethernet connection is made. (Note: If the LNK/ACT LED does not light, and you are using a hub, check that the power is not off on the hub.) The next step is to ping the board from your PC. This can be done by bringing up the MSDOS window and running the pingme program: ping 10.10.6.100 or by Start > Run and typing the entry ping 10.10.6.100 Notice that the green LNK/ACT LED flashes on the RCM3209 board while the ping is taking place, and indicates the transfer of data. The ping routine will ping the board four times and write a summary message on the screen describing the operation. 6.6 Running More Sample Programs With Direct Connect The sample programs discussed here are in the Dynamic C SAMPLES\RCM3209\TCPIP\ folder. • BROWSELED.C—This program demonstrates a basic controller running a Web page. Two “LEDs” are created on the Web page, and two buttons on the Prototyping Board then toggle them. Users can change the state of the lights from the Web browser. The LEDs on the Prototyping Board match the ones on the Web page. As long as you have not modified the TCPCONFIG 1 macro in the sample program, enter the following server address in your Web browser to bring up the Web page served by the sample program. http://10.10.6.100. Otherwise use the TCP/IP settings you entered in the TCP_CONFIG.LIB library. • ECHOCLIENT.C—This program demonstrates a basic client that will send a packet and wait for the connected server to echo it back. After every number of sends and receives, transfer times are shown in the STDIO window. Use ECHO_SERVER.C to program a server controller. • ECHOSERVER.C—This program demonstrates a basic server that will echo back any data sent from a connected client. Use ECHO_CLIENT.C to program a client controller. • ENET_AD.C—This program demonstrates Ethernet communication between two single-board computers. The program sends an A/D voltage value to the second singleboard computer via Ethernet for display. Use ENET_MENU.C to program the other single-board computer. 50 RabbitCore RCM3209/RCM3229 • ENET_MENU.C—This program demonstrates how to implement a menu system using a highlight bar on a graphic LCD display and to communicate it to another single-board computer via Ethernet. Use ENET_AD.C to program the other single-board computer with analog inputs and outputs. • MBOXDEMO.C—Implements a Web server that allows e-mail messages to be entered and then shown on the LCD/keypad module. • SMTP.C—This program allows you to send an E-mail when a switch on the Prototyping Board is pressed. Follow the instructions included with the sample program. • PINGLED.C—This program demonstrates ICMP by pinging a remote host. It will flash LEDs DS1 and DS2 on the Prototyping Board when a ping is sent and received. 6.7 Where Do I Go From Here? NOTE: If you purchased your RCM3209 through a distributor or through a Rabbit partner, contact the distributor or partner first for technical support. If there are any problems at this point: • Use the Dynamic C Help menu to get further assistance with Dynamic C. • Check the Rabbit Technical Bulletin Board and forums at www.rabbit.com/support/bb/ and at www.rabbit.com/forums/. • Use the Technical Support e-mail form at www.rabbit.com/support/. If the sample programs ran fine, you are now ready to go on. Additional sample programs are described in the Dynamic C TCP/IP User’s Manual. Please refer to the Dynamic C TCP/IP User’s Manual to develop your own applications. An Introduction to TCP/IP provides background information on TCP/IP, and is available on the CD and on our Web site. User’s Manual 51 52 RabbitCore RCM3209/RCM3229 APPENDIX A. RCM3209/RCM3229 SPECIFICATIONS Appendix A provides the specifications for the RCM3209/ RCM3229, and describes the conformal coating. User’s Manual 53 A.1 Electrical and Mechanical Characteristics Figure A-1 shows the mechanical dimensions for the RCM3209/RCM3229. 1.850 (47.0) 1.375 (34.9) R15 C1 C4 R10 U5 C3 R9 R8 C7 R7 C8 C9 U4 C10 C11 (69.2) 2.725 JP9 U7 R19 R20 R34 DS2 DS3 DS4 0.829 1.021 (21.1) 0.17 (4.3) (6.2) (2.2) (22) (6.2) 0.245 (2.2) J1 0.087 (47.0) (1.6) 1.850 0.063 J2 0.86 (14) 0.55 (69.2) 0.245 (1.6) 2.725 0.087 0.063 (22) 0.86 (14) 0.55 (25.9) DS1 SPD LNK FDX ACT COL R32 R33 CE Q2 RCM39XX BSY R29 U10 D1 U9 Q1 C48 R31 R28 R35 JP14 C47 C45 R30 C40 R22 1 C46 JP13 C43 U8 R25 R26 2 C49 C50 JP11 JP12 C41 C42 R27 R24 Y3 C44 C39 C38 R21 R23 (33.5) (17.5) 0.690 C34 1.320 C31 C30 0.47 Y2 C29 J3 L2 C37 R18 L1 C33 R16 (11.9) C26 C32 JP8 C27 C22 C23 R14 C35 R13 C36 C24 C20 C21 C28 C25U R12 6 JP10 C18 JP7 C13 C17 R17 C19 C15 C14 R11 C16 Please refer to the RCM3209 footprint diagram later in this appendix for precise header locations. JP2 JP3 JP4 JP5 R5 R6 U3 C12 (2.5) J2 R4 Y1 C5 C6 0.100 dia JP1 U2 J1 C2 R2 R3 R1 U1 Figure A-1. RCM3209/RCM3229 Dimensions NOTE: All measurements are in inches followed by millimeters enclosed in parentheses. All dimensions have a manufacturing tolerance of ±0.01" (0.25 mm). 54 RabbitCore RCM3209/RCM3229 It is recommended that you allow for an “exclusion zone” of 0.04" (1 mm) around the RCM3209/RCM3229 in all directions (except above the RJ-45 plug) when the RCM3209/ RCM3229 is incorporated into an assembly that includes other printed circuit boards. This “exclusion zone” that you keep free of other components and boards will allow for sufficient air flow, and will help to minimize any electrical or electromagnetic interference between adjacent boards. An “exclusion zone” of 0.08" (2 mm) is recommended below the RCM3209/RCM3229 when the RCM3209/RCM3229 is plugged into another assembly using the shortest connectors for headers J61 and J62. Figure A-2 shows this “exclusion zone.” 2.81 (2) 0.08 0.6 (16) (71.2) 2.725 (69.2) Exclusion Zone 1.93 (2) 0.08 0.6 (16) (49.0) J62 1.850 J61 (47.0) Figure A-2. RCM3209/RCM3229 “Exclusion Zone” User’s Manual 55 Table A-1 lists the electrical, mechanical, and environmental specifications for the RCM3209/ RCM3229. Table A-1. RabbitCore RCM3209/RCM3229 Specifications Feature RCM3209 RCM3229 Microprocessor Rabbit 3000® at 44.2 MHz EMI Reduction Spectrum spreader for reduced EMI (radiated emissions) Ethernet Port 10/100Base-T, RJ-45, 3 LEDs — Flash Memory 512K Data SRAM 256K Program Execution SRAM 512K Backup Battery General-Purpose I/O Additional Inputs Additional Outputs External I/O Bus Connection for user-supplied backup battery (to support RTC and data SRAM) 52 parallel digital I/0 lines: • 44 configurable I/O • 4 fixed inputs • 4 fixed outputs Startup mode (2), reset in Status, reset out Can be configured for 8 data lines and 6 address lines (shared with parallel I/O lines), plus I/O read/write 6 shared high-speed, CMOS-compatible ports: • all 6 configurable as asynchronous (with IrDA), 4 as clocked Serial Ports serial (SPI), and 2 as SDLC/HDLC (with IrDA) • 1 asynchronous serial port dedicated for programming • support for MIR/SIR IrDA transceiver Serial Rate Slave Interface Real-Time Clock Timers Watchdog/Supervisor Pulse-Width Modulators 56 Maximum asynchronous baud rate = CLK/8 A slave port allows the RCM3209/RCM3229 to be used as an intelligent peripheral device slaved to a master processor, which may either be another Rabbit 3000 or any other type of processor Yes Ten 8-bit timers (6 cascadable), one 10-bit timer with 2 match registers Yes 10-bit free-running counter and four pulse-width registers Input Capture 2- channel input capture can be used to time input signals from various port pins Quadrature Decoder 2-channel quadrature decoder accepts inputs from external incremental encoder modules RabbitCore RCM3209/RCM3229 Table A-1. RabbitCore RCM3209/RCM3229 Specifications (continued) Feature Power Operating Temperature Humidity RCM3209 RCM3229 3.15 V to 3.45 V DC 325 mA @ 3.3 V 3.15 V to 3.45 V DC 190 mA @ 3.3 V –40°C to +85°C 5% to 95%, noncondensing Connectors Two 2 × 17, 2 mm pitch Board Size 1.850" × 2.725" × 0.86" (47 mm × 69 mm × 22 mm) A.1.1 Headers The RCM3209/RCM3229 uses headers at J61 and J62 for physical connection to other boards. J61 and J62 are 2 × 17 SMT headers with a 2 mm pin spacing. J1, the programming port, is a 2 × 5 header with a 1.27 mm pin spacing. Figure A-3 shows the layout of another board for the RCM3209/RCM3229 to be plugged into. These values are relative to the mounting hole. A.1.2 Physical Mounting A 9/32” (7 mm) standoff with a 2-56 screw is recommended to attach the RCM3209/ RCM3229 to a user board at the hole position shown in Figure A-3. Either use plastic hardware, or use insulating washers to keep any metal hardware from shorting out signals on the RCM3209/RCM3229. User’s Manual 57 1.375 (34.9) 58 (8.3) 0.328 RCM3209/RCM3229 Footprint 0.475 (12.1) Figure A-3. User Board Footprint for RCM3209/RCM3229 RabbitCore RCM3209/RCM3229 (30.4) 1.199 (28.5) 1.121 (26.5) 1.043 (24.2) 0.953 (28.9) 1.136 (8.0) 0.314 (2.0) 0.079 (2.5) 0.100 dia (35.7) 1.405 (2.0) 0.079 (34.1) 1.341 (28.6) 1.125 (0.5) 0.020 sq typ J1 J61 J62 A.2 Bus Loading You must pay careful attention to bus loading when designing an interface to the RCM3209/RCM3229. This section provides bus loading information for external devices. Table A-2 lists the capacitance for the various RCM3209/RCM3229 I/O ports. Table A-2. Capacitance of Rabbit 3000 I/O Ports I/O Ports Input Capacitance (pF) Output Capacitance (pF) 12 14 Parallel Ports A to G Table A-3 lists the external capacitive bus loading for the various RCM3209/RCM3229 output ports. Be sure to add the loads for the devices you are using in your custom system and verify that they do not exceed the values in Table A-3. Table A-3. External Capacitive Bus Loading -40°C to +70°C Output Port All I/O lines with clock doubler enabled User’s Manual Clock Speed (MHz) Maximum External Capacitive Loading (pF) 44.2 100 59 Figure A-4 shows a typical timing diagram for the Rabbit 3000 microprocessor external I/ O read and write cycles. External I/O Read (no extra wait states) T1 Tw T2 CLK A[15:0] valid Tadr /CSx /IOCSx TCSx TCSx TIOCSx TIOCSx /IORD TIORD TIORD /BUFEN TBUFEN Tsetup TBUFEN D[7:0] valid Thold External I/O Write (no extra wait states) T1 Tw T2 CLK A[15:0] valid Tadr /CSx /IOCSx /IOWR /BUFEN D[7:0] TCSx TCSx TIOCSx TIOCSx TIOWR TIOWR TBUFEN TBUFEN valid TDHZV TDVHZ Figure A-4. I/O Read and Write Cycles—No Extra Wait States NOTE: /IOCSx can be programmed to be active low (default) or active high. 60 RabbitCore RCM3209/RCM3229 Table A-4 lists the delays in gross memory access time for VDD = 3.3 V. Table A-4. Data and Clock Delays VDD ±10%, Temp, -40°C–+85°C (maximum) Clock to Address Output Delay (ns) 30 pF 60 pF 90 pF Data Setup Time Delay (ns) 6 8 11 1 VDD 3.3 Spectrum Spreader Delay (ns) Normal Strong dbl/no dbl dbl/no dbl 3/4.5 4.5/9 The measurements are taken at the 50% points under the following conditions. • T = -40°C to 85°C, V = VDD ±10% • Internal clock to nonloaded CLK pin delay ≤ 1 ns @ 85°C/3.0 V The clock to address output delays are similar, and apply to the following delays. • Tadr, the clock to address delay • TCSx, the clock to memory chip select delay • TIOCSx, the clock to I/O chip select delay • TIORD, the clock to I/O read strobe delay • TIOWR, the clock to I/O write strobe delay • TBUFEN, the clock to I/O buffer enable delay The data setup time delays are similar for both Tsetup and Thold. When the spectrum spreader is enabled with the clock doubler, every other clock cycle is shortened (sometimes lengthened) by a maximum amount given in the table above. The shortening takes place by shortening the high part of the clock. If the doubler is not enabled, then every clock is shortened during the low part of the clock period. The maximum shortening for a pair of clocks combined is shown in the table. Technical Note TN227, Interfacing External I/O with Rabbit 2000/3000 Designs, contains suggestions for interfacing I/O devices to the Rabbit 3000 microprocessors. User’s Manual 61 A.3 Rabbit 3000 DC Characteristics Table A-5 outlines the DC characteristics for the Rabbit at 3.3 V over the recommended operating temperature range from Ta = –55°C to +125°C, VDD = 3.0 V to 3.6 V. Table A-5. 3.3 Volt DC Characteristics Symbol Parameter Test Conditions Min IIH Input Leakage High VIN = VDD, VDD = 3.3 V IIL Input Leakage Low (no pull-up) VIN = VSS, VDD = 3.3 V -1 IOZ Output Leakage (no pull-up) VIN = VDD or VSS, VDD = 3.3 V VIL CMOS Input Low Voltage VIH CMOS Input High Voltage VT CMOS Switching Threshold VDD = 3.3 V, 25°C VOL Low-Level Output Voltage VOH High-Level Output Voltage 62 Typ Max 1 Units µA µA -1 1 µA 0.3 x VDD V 0.7 x VDD 1.65 IOL = See (sinking) VDD = 3.0 V V 0.4 VDD = 3.0 V IOH = See (sourcing) V 0.7 x VDD V V RabbitCore RCM3209/RCM3229 A.4 I/O Buffer Sourcing and Sinking Limit Unless otherwise specified, the Rabbit I/O buffers are capable of sourcing and sinking 6.8 mA of current per pin at full AC switching speed. Full AC switching assumes a 29.4 MHz CPU clock and capacitive loading on address and data lines of less than 70 pF per pin. The absolute maximum operating voltage on all I/O is 5.5 V. Table A-6 shows the AC and DC output drive limits of the parallel I/O buffers when the Rabbit 3000 is used in the RCM3209/RCM3229. Table A-6. I/O Buffer Sourcing and Sinking Capability Output Drive (Full AC Switching) Pin Name All data, address, and I/O lines with clock doubler enabled Sourcing/Sinking Limits (mA) Sourcing Sinking 6.8 6.8 Under certain conditions, you can exceed the limits outlined in Table A-7. See the Rabbit 3000 Microprocessor User’s Manual for additional information. User’s Manual 63 A.5 Jumper Configurations Figure A-5 shows the header locations used to configure the various RCM3209/RCM3229 options via jumpers. RCM3209 JP13 JP11 JP12 JP7 JP8 JP9 JP10 JP2 JP3 JP4 JP5 JP1 JP14 Top Side Figure A-5. Location of RCM3209/RCM3229 Configurable Positions Table A-7 lists the configuration options. Table A-7. RCM3209/RCM3229 Jumper Configurations Header Description JP1 Serial Flash Chip Enable Indicator 1–2 ACT or PD1 Output on J61 pin 34 1–2 ACT JP2 2–3 PD1 LINK or PD0 Output on J61 pin 33 1–2 LINK 2–3 PD0 1–2 ENET 2–3 PE0 1–2 Reserved for future use 2–3 PD1 controls NAND Flash JP3 JP4 JP5 64 ENET or PE0 Output on J62 pin 19 Pins Connected Factory Default n.c. × × × NAND Flash Chip Enable n.c. RabbitCore RCM3209/RCM3229 Table A-7. RCM3209/RCM3229 Jumper Configurations Header JP7 JP8 JP9 JP10 JP11 JP12 JP13 JP14 Description PD6 or TPI– Input on J61 pin 31 PD7 or TPI+ Input on J61 pin 32 PD2 or TPO– Output on J61 pin 29 PD3 or TPO+ Output on J61 pin 30 Pins Connected 1–2 TPI– 2–3 PD6 1–2 TPI+ 2–3 PD7 1–2 TPO– 2–3 PD2 1–2 TPO+ 2–3 PD3 1–2 256K 2–3 512K 1–2 Normal Mode 2–3 Bank Mode 1–2 256K 2–3 512K 1–2 FDX/COL displayed by LED DS1 2–3 Optional ACT displayed by LED DS1 Factory Default Flash Memory Size Flash Memory Bank Select Data SRAM Size LED DS1 Display × × × × × × × × NOTE: The jumper connections are made using 0 Ω surface-mounted resistors. User’s Manual 65 A.6 Conformal Coating The areas around the 32 kHz real-time clock crystal oscillator has had the Dow Corning silicone-based 1-2620 conformal coating applied. The conformally coated area is shown in Figure A-6. The conformal coating protects these high-impedance circuits from the effects of moisture and contaminants over time. Conformally coated areas R15 JP2 JP3 JP4 JP5 C1 C4 R10 R9 R8 C7 R7 C8 C9 U4 U5 C3 R5 R6 U3 C10 C11 C26 C32 Y2 C31 C30 JP9 JP8 J3 L2 C34 C37 C29 L1 C33 R16 R18 JP10 C27 C22 C23 R14 C28 C25 R13 C36 R12 U6 R17 C19 C15 C18 JP7 C13 C17 C35 C16 C12 C14 R11 C24 C20 C21 J2 R4 Y1 C5 C6 JP1 U2 J1 C2 R2 R3 R1 U1 U7 R19 R20 D1 U9 Q2 RCM39XX R32 R34 DS2 DS3 DS1 SPD LNK FDX ACT COL R33 Q1 C48 R31 R29 U10 R35 C47 JP14 R28 CE C46 C45 R30 C40 R22 C43 U8 2 1 BSY JP13 C49 C50 JP11 JP12 C41 C42 R27 R24 Y3 R25 R26 C44 C39 C38 R21 R23 DS4 Figure A-6. RCM3209/RCM3229 Areas Receiving Conformal Coating Any components in the conformally coated area may be replaced using standard soldering procedures for surface-mounted components. A new conformal coating should then be applied to offer continuing protection against the effects of moisture and contaminants. NOTE: For more information on conformal coatings, refer to Rabbit’s Technical Note TN303, Conformal Coatings, in the online documentation. 66 RabbitCore RCM3209/RCM3229 APPENDIX B. PROTOTYPING BOARD Appendix B describes the features and accessories of the Prototyping Board, and explains the use of the Prototyping Board to demonstrate the RCM3209/RCM3229 and to build prototypes of your own circuits. User’s Manual 67 B.1 Introduction The Prototyping Board included in the Development Kit makes it easy to connect an RCM3209/RCM3229 module to a power supply and a PC workstation for development. It also provides some basic I/O peripherals (switches and LEDs), as well as a prototyping area for more advanced hardware development. For the most basic level of evaluation and development, the Prototyping Board can be used without modification. As you progress to more sophisticated experimentation and hardware development, modifications and additions can be made to the board without modifying or damaging the RCM3209/RCM3229 module itself. The Prototyping Board is shown below in Figure B-1, with its main features identified. MOTOR/ENCODER J6 PE7 PF0 PF1 PF7 PF6 PF2 PF3 PF5 PF4 PA0 PA1 PB7 PB6 PA2 PA3 PB5 PB4 PA4 PA5 PB3 PB2 PA6 PA7 PE4 /RES RN2 J1 MASTER RC15 C2 R4 R3 SMT Prototyping Area R12 R6 RC14 RC13 +3.3V Through-Hole Prototyping Area RC22 RC16 R7 UX3 RC12 +3.3V RC23 UX9 RC17 RC21 R9 R11 RC10 R13 R21 Battery RC24 RC20 R8 C3 R5 R2 UX11 RCM2 RC19 R10 RCM3000/RCM3100/ RCM3200/RCM3209 Master Module Connectors +5V J15 SLAVE UX10 GND C1 +5V BT1 J3 R1 +DC U5 RC1 PB0 GND C12 GND PE6 2.5 MM JACK D2 U4 RC2 RC11 GND PC0 C11 C10 PC1 GND PE5 +5V PC2 PE4 +5V PC4 PC3 J11 D1 C13 R20 R17 RC18 PD5 PC5 PE3 CURRENT MEASUREMENT OPTION PG0 PD4 PE0 PE1 C17 JP1 PG1 PG6 PG7 DS3 PG4 PG5 +3.3V POWER /IOWR C15 PG2 L1 POWER PD4 PG3 RN5 RCM3000 ETHERNET CORE MODULE RN4 PD5 /IORD RCM1JB GND J9 IrDA Transceiver SM1 SM0 RCM1JA +DC PD2 GND PD6 PD3 GND PD0 PD7 VRAM +5V PD1 +3.3V RN3 NC GND Power Input Power LED +3.3V RN1 GND VBAT EXT /RES IN Voltage Regulators CurrentRCM3000/RCM3100/ RCM3200 Slave Module Measurement Header Connectors Slave Module Extension Headers UX2 GND GND GND PE1 PE3 PC3 PC2 PE4 PE5 PC1 PC0 PE6 PE7 PF0 PF1 PF7 PF6 PF2 PF3 PF5 PF4 PA0 PA1 PB7 PB6 PA2 PA3 PB5 PB4 PA4 PA5 PB3 PB2 PA6 PA7 PB0 /RES STATUS R14 GND +5V UX4 +5 V, 3.3 V, and GND Buses +5V RC7 SMT Prototyping Area C9 U6 C16 DISPLAY BOARD RC25 RC4 RC5 C14 RC27 U3 U3 RC28 RC29 RC26 UX5 RC9 UX7 U1 C5 RCM30/31/32XX SERIES PROTOTYPING BOARD C8 RCM2JA RESET C6 RCM2JB S2 RxC TxC GND J5 J4 TxB RxB Master Module Extension Headers BD6 PC4 BD4 PC5 BD7 PE0 RC6 BD5 PG7 +5V BD2 PD5 BD0 PG0 PD4 BA1 PG2 PG1 PG6 BA3 PD4 PG3 PG4 +5V J8 BD3 PD5 /IORD PG5 +3.3V +3.3V +3.3V GND SM1 SM0 /IOWR +3.3V BD1 PD2 GND PD3 BA0 VRAM /RES LCD VBAT EXT /RES IN +5V PD6 +5V PD7 BPE3 +3.3V R16 GND TP1 PD0 R15 PD1 C4 NC BA2 GND GND Reset Switch GND S3 PG6 RS-232 J10 RS-232 Signal Header DS1 UX13 PG7 C7 DS2 User Switches DISPLAY BOARD User LEDs J7 DISPLAY BOARD LCD/Keypad Module Connections Figure B-1. Prototyping Board 68 RabbitCore RCM3200 B.1.1 Prototyping Board Features • Power Connection—A power-supply jack and a 3-pin header are provided for connection to the power supply. Note that the 3-pin header is symmetrical, with both outer pins connected to ground and the center pin connected to the raw V+ input. The cable of the AC adapter provided with Development Kit ends in a 3-pin plug that connects to the 3-pin header (J9)—the center pin of J9 is always connected to the positive terminal, and either edge pin is negative. Users providing their own power supply should ensure that it delivers 8–24 V DC at 8 W. The voltage regulators will get warm while in use. • Regulated Power Supply—The raw DC voltage provided at the POWER IN jack is routed to a 5 V switching voltage regulator, then to a separate 3.3 V linear regulator. The regulators provide stable power to the RCM3209/RCM3229 module and the Prototyping Board. • Power LED—The power LED lights whenever power is connected to the Prototyping Board. • Reset Switch—A momentary-contact, normally open switch is connected directly to the RCM3209/RCM3229’s /RESET_IN pin. Pressing the switch forces a hardware reset of the system. • I/O Switches and LEDs—Two momentary-contact, normally open switches are connected to the PG0 and PG1 pins of the master RCM3209/RCM3229 module and may be read as inputs by sample applications. Two LEDs are connected to the PG6 and PG7 pins of the master module, and may be driven as output indicators by sample applications. • Prototyping Area—A generous prototyping area has been provided for the installation of through-hole components. +3.3 V, +5 V, and Ground buses run around the edge of this area. Several areas for surface-mount devices are also available. (Note that there are SMT device pads on both top and bottom of the Prototyping Board.) Each SMT pad is connected to a hole designed to accept a 30 AWG solid wire. • Master Module Connectors—A set of connectors is pre-wired to permit installation of the first RCM3000, RCM3100, or RCM3209/RCM3229 module that serves as the primary or “master module.” • Slave Module Connectors—A second set of connectors is pre-wired to permit installation of a second, slave RCM3209/RCM3229, RCM3100, or RCM3000 module. This capability is reserved for future use, although the schematics in this manual contain all of the details an experienced developer will need to implement a master-slave system. • Module Extension Headers—The complete pin sets of both the MASTER and SLAVE RabbitCore modules are duplicated at these two sets of headers. Developers can solder wires directly into the appropriate holes, or, for more flexible development, 26-pin header strips can be soldered into place. See Figure B-4 for the header pinouts. User’s Manual 69 • RS-232—Two 3-wire or one 5-wire RS-232 serial port are available on the Prototyping Board. Refer to the Prototyping Board schematic (090-0137) for additional details. A 10-pin 0.1-inch spacing header strip is installed at J5 to permit connection of a ribbon cable leading to a standard DE-9 serial connector. • Current Measurement Option—Jumpers across pins 1–2 and 5–6 on header JP1 can be removed and replaced with an ammeter across the pins to measure the current drawn from the +5 V or the +3.3 V supplies, respectively. • Motor Encoder—A motor/encoder header is provided at header J6 for future use. • LCD/Keypad Module—Rabbit’s LCD/keypad module may be plugged in directly to headers J7, J8, and J10. 70 RabbitCore RCM3200 B.2 Mechanical Dimensions and Layout 5.55 0.20 (141) (5) MOTOR/ENCODER J6 PE5 PC1 PC0 PE6 PE7 PF0 PF1 PF7 PF6 PF2 PF3 PF5 PF4 PA0 PA1 PB7 PB6 PA2 PA3 PB5 PB4 PB3 PB2 PA6 /RES PE4 RN2 J1 PA5 PA7 UX10 RC15 C2 R4 R3 UX11 RCM2 RC24 RC19 RC20 RC23 UX9 R8 R12 R6 RC14 R10 C3 R5 R2 RC22 RC17 RC13 RC16 R7 UX3 RC12 RC21 R9 R11 RC10 R13 R21 +5V +3.3V J15 SLAVE MASTER C1 +5V +3.3V BT1 RCM1 J14 GND J3 R1 Battery +5V PA4 +DC U5 RC1 PB0 GND C12 (135) PE4 2.5 MM JACK D2 U4 RCM30/31/32XX CORE MODULE 5.30 PC2 4.95 PC4 PC3 (126) PD5 PC5 PE3 GND PG0 PD4 PE0 PE1 RC2 RC11 GND PG1 PG6 PG7 C11 C10 PG4 PG5 GND /IOWR J11 R17 +5V PG2 D1 C13 R20 RC18 PG3 C17 JP1 /IORD CURRENT MEASUREMENT OPTION SM0 L1 DS3 PD4 +3.3V POWER PD2 PD5 C15 PD3 SM1 RN5 POWER VRAM VBAT EXT /RES IN GND +DC PD6 GND PD0 PD7 GND PD1 +3.3V RN4 NC GND RN3 GND +5V +3.3V RN1 J9 (26) (5) 1.025 0.20 Figure B-2 shows the mechanical dimensions and layout for the Prototyping Board. UX2 GND GND GND PC4 PC3 PC2 PE5 PC1 PC0 PE6 PE7 PF0 PF1 PF7 PF6 PF2 PF3 PF5 PF4 PA0 PA1 PB7 PB6 PA2 PA3 PB5 PB4 PA4 PA5 PB3 PB2 PA6 PA7 PB0 /RES PE4 GND TP1 R15 C9 U6 C16 DISPLAY BOARD RC25 RC4 RC5 C14 RC27 U3 RC28 RC29 RC26 UX5 R14 RC9 UX7 U1 R C M30/ 31/ 32X X SE R I E S P R OTOT Y P IN G B OA R D C5 C8 J12 RESET C6 RxC TxC J5 TxB RxB (12) +5V U3 J4 0.475 +5V UX4 GND J13 S2 S3 PG6 J7 J10 C7 RS-232 DS1 3.40 UX13 PG7 DS2 DISPLAY BOARD DISPLAY BOARD 2.70 (86) (69) 0.20 (5) (4) PC5 PE3 PE4 BD6 PE0 PE1 BD4 PG7 BD2 PD5 BD7 PD4 BD5 PG6 BD3 PG5 BD0 PG0 RC7 BA1 PG1 RC6 BA3 PG4 +5V BD1 /IOWR +3.3V +3.3V RCM30/31/32XX CORE MODULE GND PG2 GND PD4 PG3 GND PD2 PD5 /IORD +5V J8 BA0 PD3 SM1 /RES LCD VRAM SM0 +3.3V +5V PD6 VBAT EXT /RES IN +3.3V +5V PD7 BPE3 +3.3V R16 GND PD0 0.15 (3.2) PD1 C4 0.125 dia × 5 NC BA2 GND GND 6.775 (172) Figure B-2. RCM30/31/32XX Prototyping Board Dimensions NOTE: All measurements are in inches followed by millimeters enclosed in parentheses. All dimensions have a manufacturing tolerance of ±0.01" (0.25 mm). User’s Manual 71 Table B-1 lists the electrical, mechanical, and environmental specifications for the Prototyping Board. Table B-1. Prototyping Board Specifications Parameter Specification Board Size 5.30" × 6.775" × 1.00" (135 mm × 172 mm × 25 mm) Operating Temperature –20°C to +60°C Humidity 5% to 95%, noncondensing Input Voltage 8 V to 24 V DC Maximum Current Draw 800 mA max. for +3.3 V supply, (including user-added circuits) 1 A total +3.3 V and +5 V combined Prototyping Area 2.0" × 3.5" (50 mm × 90 mm) throughhole, 0.1" spacing, additional space for SMT components Standoffs/Spacers 5, accept 4-40 × 3/8 screws B.3 Power Supply The RCM3209/RCM3229 requires a regulated 3.3 V ± 0.15 V DC power source to operate. Depending on the amount of current required by the application, different regulators can be used to supply this voltage. The Prototyping Board has an onboard +5 V switching power regulator from which a +3.3 V linear regulator draws its supply. Thus both +5 V and +3.3 V are available on the Prototyping Board. The Prototyping Board itself is protected against reverse polarity by a Shottky diode at D2 as shown in Figure B-3. SWITCHING POWER REGULATOR POWER IN J9/J11 1 2 3 D2 DCIN DL4003 C17 47 µF +RAW +5 V LINEAR POWER REGULATOR +3.3 V 3 U5 330 µH LM2575 340 µF LM1117 U1 1 2 10 µF L1 D1 1N5819 Figure B-3. Prototyping Board Power Supply 72 RabbitCore RCM3200 B.4 Using the Prototyping Board The Prototyping Board is actually both a demonstration board and a prototyping board. As a demonstration board, it can be used to demonstrate the functionality of the RCM3209/ RCM3229 right out of the box without any modifications to either board. There are no jumpers or dip switches to configure or misconfigure on the Prototyping Board so that the initial setup is very straightforward. The Prototyping Board comes with the basic components necessary to demonstrate the operation of the RCM3209/RCM3229. Two LEDs (DS1 and DS2) are connected to PG6 and PG7, and two switches (S2 and S3) are connected to PG1 and PG0 to demonstrate the interface to the Rabbit 3000 microprocessor. Reset switch S1 is the hardware reset for the RCM3209/RCM3229. The Prototyping Board provides the user with RCM3209/RCM3229 connection points brought out conveniently to labeled points at headers J2 and J4 on the Prototyping Board. Small to medium circuits can be prototyped using point-to-point wiring with 20 to 30 AWG wire between the prototyping area and the holes at locations J2 and J4. The holes are spaced at 0.1" (2.5 mm), and 40-pin headers or sockets may be installed at J2 and J4. The pinouts for locations J2 and J4, which correspond to headers J1 and J2, are shown in Figure B-4. J4 J2 GND GND VBAT_EXT /RESET_IN SMODE0 /IOWR PG5 PG7 PE1 PE4 PE6 PF7 PF5 PB7 PB5 PB3 PB0 n.c. +3.3V VRAM SMODE1 /IORD PG4 PG6 PE0 PE3 PE5 PE7 PF6 PF4 PB6 PB4 PB2 /RES PD1 PD7 PD3 PD5 PG3 PG1 PC7 PC5 PC3 PC1 PF0 PF2 PA0 PA2 PA4 PA6 STATUS PD0 PD6 PD2 PD4 PG2 PG0 PC6 PC4 PC2 PC0 PF1 PF3 PA1 PA3 PA5 PA7 GND n.c. = not connected Figure B-4. Prototyping Board Pinout (Top View) The small holes are also provided for surface-mounted components that may be installed around the prototyping area. There is a 2.0" × 3.5" through-hole prototyping space available on the Prototyping Board. +3.3 V, +5 V, and GND traces run along the edge of the Prototyping Board for easy access. User’s Manual 73 B.4.1 Adding Other Components There are pads that can be used for surface-mount prototyping involving SOIC devices. There is provision for seven 16-pin devices (six on one side, one on the other side). There are 10 sets of pads that can be used for 3- to 6-pin SOT23 packages. There are also pads that can be used for SMT resistors and capacitors in an 0805 SMT package. Each component has every one of its pin pads connected to a hole in which a 30 AWG wire can be soldered (standard wire wrap wire can be soldered in for point-to-point wiring on the Prototyping Board). Because the traces are very thin, carefully determine which set of holes is connected to which surface-mount pad. B.4.2 Measuring Current Draw The Prototyping Board has a current-measurement feature available on header JP1. Normally, a jumper connects pins 1–2 and pins 5–6 on header JP1, which provide jumper connections for the +5 V and the +3.3 V regulated voltages respectively. You may remove a jumper and place an ammeter across the pins instead, as shown in the example in Figure B-5, to measure the current being drawn. 0 +5V +3.3V A CURRENT MEASUREMENT OPTION JP1 Figure B-5. Prototyping Board Current-Measurement Option 74 RabbitCore RCM3200 B.4.3 Other Prototyping Board Modules and Options With the RCM3209/RCM3229 plugged into the MASTER slots, it has full access to the RS-232 transceiver, and can act as the “master” relative to another RabbitCore RCM3000, RCM3100, or RCM3209/RCM3229 plugged into the SLAVE slots, which acts as the “slave.” An optional LCD/keypad module is available that can be mounted on the Prototyping Board. Refer to Appendix C, “LCD/Keypad Module,” for complete information. The RCM3209/RCM3229 has a 2-channel quadrature decoder and a 10-bit free-running PWM counter with four pulse-width registers. These features allow the RCM3209/ RCM3229 to be used in a motor control application, although Rabbit does not offer the drivers or a compatible stepper motor control board at this time. The Prototyping Board has a header at J6 to which a customer-developed motor encoder may be connected. Figure B-6 shows the motor encoder pinout at header J6. J6 PF0 PF2 PF4 PF6 +5 V PF1 PF3 PF5 PF7 GND Figure B-6. Prototyping Board Motor Encoder Connector Pinout Refer to Appendix E, “Motor Control Option,” for complete information on using the Rabbit 3000’s Parallel Port F in conjunction with this application. User’s Manual 75 B.5 Use of Rabbit 3000 Parallel Ports Table B-2 lists the Rabbit 3000 parallel ports and their use for the RCM30/31/32XX Prototyping Board. Table B-2. RCM30/31/32XX Prototyping Board Use of Rabbit 3000 Parallel Ports Port I/O Use Initial State PA0–PA7 Output PB0–PB1 Input Not used PB2–PB5 Input Configurable external I/O bus PB6–PB7 Output Not used Pulled up on RCM3209/ RCM3229 PC0 Output Not used High (disabled) PC1 Input Not used Pulled up on RCM3209/ RCM3229 PC2 Output TXC PC3 Input RXC Pulled up on RCM3209/ RCM3229 PC4 Output TXB High (disabled) PC5 Input RXB PC6 Output TXA Programming Port PC7 Input RXA Programming Port PD0 Output PD1 Input Not used Pulled up on RCM3209/ RCM3229 PD2–PD4 Output Not used High PD5 Input Not used Pulled up on Prototyping Board PD6–PD7 Output Not used High PE0–PE1 Output Not used High PE2 Output Ethernet chip select High PE3 Output LCD device select Low (disabled) PE4 Output IrDA speed select Low (disabled) High when not driven by I/O bus Configurable external I/O bus Pulled up on RCM3209/ RCM3229 High when not driven by I/O bus High (disabled) Serial Port C Serial Port B High (disabled) Serial Port A 76 Ethernet RSTDRV Pulled up on RCM3209/ RCM3229 Pulled up on RCM3209/ RCM3229 High RabbitCore RCM3200 Table B-2. RCM30/31/32XX Prototyping Board Use of Rabbit 3000 Parallel Ports (continued) Port I/O Use Initial State PE5 Output Not used PE6 Output External I/O strobe High (disabled) PE7 Output Not used High (disabled) PF0–PF7 Input Reserved for future use PG0 Input Switch S3 (normally open) High PG1 Input Switch S2 (normally open) High PG2 Output High Pulled up on Prototyping Board TXF IrDA Pulled down Serial Port F PG3 Input RXF IrDA Driven by IrDA driver PG4 Input IrDA MD1 Pulled up on Prototyping Board PG5 Input IrDA MD0 Pulled down on Prototyping Board PG6 Output LED DS1 High (disabled) PG7 Output LED DS2 High (disabled) User’s Manual 77 78 RabbitCore RCM3200 APPENDIX C. LCD/KEYPAD MODULE An optional LCD/keypad is available for the Prototyping Board. Appendix C describes the LCD/keypad and provides the software function calls to make full use of the LCD/keypad. C.1 Specifications Two optional LCD/keypad modules—with or without a panel-mounted bezel—are available for use with the Prototyping Board. They are shown in Figure C-1. LCD/Keypad Modules Figure C-1. LCD/Keypad Modules Models Only the version without the bezel can mount directly on the Prototyping Board; if you have the version with a bezel, you will have to remove the bezel to be able to mount the LCD/keypad module on the Prototyping Board. Either version of the LCD/keypad module can be installed at a remote location up to 60 cm (24") away. Contact your Rabbit sales representative or your authorized distributor for further assistance in purchasing an LCD/ keypad module. User’s Manual 79 Mounting hardware and a 60 cm (24") extension cable are also available for the LCD/keypad module through your sales representative or authorized distributor. Table C-1 lists the electrical, mechanical, and environmental specifications for the LCD/ keypad module. Table C-1. LCD/Keypad Specifications Parameter Specification Board Size 2.60" × 3.00" × 0.75" (66 mm × 76 mm × 19 mm) Bezel Size 4.50" × 3.60" × 0.30" (114 mm × 91 mm × 7.6 mm) Temperature Operating Range: 0°C to +50°C Storage Range: –40°C to +85°C Humidity 5% to 95%, noncondensing Power Consumption 1.5 W maximum* Connections Connects to high-rise header sockets on the Prototyping Board LCD Panel Size 122 × 32 graphic display Keypad 7-key keypad LEDs Seven user-programmable LEDs * The backlight adds approximately 650 mW to the power consumption. The LCD/keypad module has 0.1" IDC headers at J1, J2, and J3 for physical connection to other boards or ribbon cables. Figure C-2 shows the LCD/keypad module footprint. These values are relative to one of the mounting holes. (2.5) (19.5) 0.768 (15.4) 0.607 J1 (40.6) 0.200 (5.1) J3 J2 1.600 NOTE: All measurements are in inches followed by millimeters enclosed in parentheses. All dimensions have a manufacturing tolerance of ±0.01" (0.25 mm). 0.100 0.500 (12.7) 1.450 (36.8) 2.200 (55.9) Figure C-2. User Board Footprint for LCD/Keypad Module 80 RabbitCore RCM3209/RCM3229 C.2 Contrast Adjustments for All Boards Starting in 2005, LCD/keypad modules were factory-configured to optimize their contrast based on the voltage of the system they would be used in. Be sure to select a KDU5V LCD/keypad module for use with the RCM3000/3100/3200 Prototyping Board — these modules operate at 5 V. You may adjust the contrast using the potentiometer at R2 as shown in Figure C-3. LCD/keypad modules configured for 3.3 V should not be used with the 5 V RCM3000/3100/3200 Prototyping Board because the higher voltage will reduce the backlight service life dramatically. LCD/Keypad Module Jumper Configurations Description Pins Connected Factory Default 2.8 V 12 × 3.3 V 34 5V n.c. C9 U3 D1 C7 JP1 R3 U2 C4 U1 R4 R5 C11 C13 U4 J5 CR1 C12 R7 LCD1 R6 D2 C1 C6 C10 R2 C5 C2 Contrast Adjustment C3 J5 R1 Header Q1 J5 Part No. 101-0541 R8 R26 4 2 R20 1 R17 3 R10 Q4 Q6 OTHER LP3500 3.3 V 2.8 V n.c. = 5 V R12 R9 Q7 Q2 U6 U5 Q5 R15 R18 R14 R16 R13 R21 R11 J5 Q3 R19 2 R23 1 4 R22 3 J1 R25 Q8 J2 U7 C14 C16 R24 C15 KP1 C17 RN1 DISPLAY BOARD J4 Figure C-3. LCD/Keypad Module Voltage Settings You can set the contrast on the LCD display of pre-2005 LCD/keypad modules by adjusting the potentiometer at R2 or by setting the voltage for 5 V by removing the jumper across pins 1–2 on header J5 as shown in Figure C-3. Only one of these two options is available on these LCD/keypad modules. NOTE: Older LCD/keypad modules that do not have a header at J5 or a contrast adjustment potentiometer at R2 are limited to operate only at 5 V, and will work with the Prototyping Board. The older LCD/keypad modules are no longer being sold. User’s Manual 81 C.3 Keypad Labeling The keypad may be labeled according to your needs. A template is provided in Figure C-4 to allow you to design your own keypad label insert. 1.10 (28) 2.35 (60) Figure C-4. Keypad Template To replace the keypad legend, remove the old legend and insert your new legend prepared according to the template in Figure C-4. The keypad legend is located under the blue keypad matte, and is accessible from the left only as shown in Figure C-5. Keypad label is located under the blue keypad matte. Figure C-5. Removing and Inserting Keypad Label 82 RabbitCore RCM3209/RCM3229 C.4 Header Pinouts DB6B DB4B DB2B DB0B A1B A3B GND LED7 LED5 LED3 LED1 /RES VCC Figure C-6 shows the pinouts for the LCD/keypad module. J3 GND LED7 LED5 LED3 LED1 /RES VCC GND DB6B DB4B DB2B DB0B A1B A3B DB7B DB5B DB3B DB1B A0B A2B GND GND LED6 LED4 LED2 /CS +5BKLT J1 GND GND LED6 LED4 LED2 PE7 +5BKLT GND DB7B DB5B DB3B DB1B A0B A2B J2 Figure C-6. LCD/Keypad Module Pinouts C.4.1 I/O Address Assignments The LCD and keypad on the LCD/keypad module are addressed by the /CS strobe as explained in Table C-2. Table C-2. LCD/Keypad Module Address Assignment Address User’s Manual Function 0xC000 Device select base address (/CS) 0xCxx0–0xCxx7 LCD control 0xCxx8 LED enable 0xCxx9 Not used 0xCxxA 7-key keypad 0xCxxB (bits 0–6) 7-LED driver 0xCxxB (bit 7) LCD backlight on/off 0xCxxC–ExxF Not used 83 C.5 Mounting LCD/Keypad Module on the Prototyping Board Install the LCD/keypad module on header sockets J7, J8, and J10 of the Prototyping Board as shown in Figure C-7. Be careful to align the pins over the headers, and do not bend them as you press down to mate the LCD/keypad module with the Prototyping Board. MOTOR/ENCODER J6 PA6 /RES PE4 PA4 R21 R20 C26 C32 R11 C8 C9 U4 U3 C11 C10 R5 R6 JP2 JP3 JP4 JP5 R4 R2 RC25 RC4 RC5 C14 RC27 U3 RC28 R16 RC29 RC26 RC9 RCM30/31/32XX SERIES PROTOTYPING BOARD U1 U2 R15 JP1 J2 C4 DISPLAY BOARD UX5 S3 PG6 PG7 DS1 DS2 C7 RS-232 C16 UX7 J1 J5 GND U6 +5V UX4 Y1 C5 GND J4 J8 +5V U3 RCM2JB S2 RC7 R15 C18 L1 C6 RxC TxC TP1 C17 C13 J3 C33 C5 C8 TxB RxB GND L2 R16 R14 U1 RCM2JA RESET +5V C31 R13 /RES STATUS R12 PB0 6 PA7 Y2 U7 R19 PA5 PA6 C34 PA4 PB2 C30 PB4 PB3 C29 PB5 R18 DS1 PA3 RC1 1 PA1 PA2 R25 R26 DS2 R33 PF3 PA0 PB6 RC6 C9 R14 C1 PF2 PF4 +5V +5V J8 R1 PF6 PF5 R23 DS3 R34 PF7 PB7 R24 Y3 JP14 Q1 PF1 +5V R28 C46 DS4 PC0 PF0 2 Q2 D1 R29 U10 PC2 PC1 PE7 GND RCM39XX U9 PC4 PC3 PE5 PE6 C12 PC5 PE3 PE4 +3.3V +3.3V C16 PE0 PE1 +3.3V R3 PG7 GND GND +3.3V C6 PD5 C24 C20 C21 PD4 JP11 PG6 C2 PG5 C7 R7 PG0 C28 C25U PG1 JP13 PG4 C4 /IOWR GND GND C3 PG2 R10 PD4 PG3 R9 PD2 PD5 /IORD R8 PD3 SM1 U5 VRAM SM0 UX2 C14 VBAT EXT /RES IN R17 C19 C15 PD6 JP7 PD7 RC21 RC2 C27 C22 C23 +3.3V JP9 GND JP8 PD0 JP10 PD1 JP12 RC11 C37 R9 C36 R13 C35 R11 RC10 NC RC22 C38 R7 UX3 GND C43 U8 RC16 R27 R12 C44 C39 R6 C40 R22 R21 RC24 RC23 R10 R30 C47 R8 RC17 RC13 RC12 UX11 C49 C50 R32 UX9 RC14 RCM2 C48 R31 R35 RC20 CE SPD LNK FDX ACT COL C2 C3 R5 RC19 BSY RC15 R4 R2 RC18 MASTER C1 R3 J15 SLAVE UX10 GND C41 C42 PA7 R1 +DC BT1 PA5 J3 C45 RN2 J1 GND GND PA3 PB2 PB0 BD6 PA2 PB4 PB3 +3.3V BD4 PB6 PB5 +5V +3.3V BD7 PB7 Battery BD5 PA1 C11 C10 PF3 PA0 BD2 PF1 PF2 PF4 BD0 PF0 PF6 PF5 BA1 PE7 PF7 BA3 PE6 +5V BD3 PC0 GND PC1 U5 BD1 PE5 C12 GND PE4 2.5 MM JACK D2 U4 BA0 PC2 GND PC3 BA2 PE3 /RES LCD PC4 PE1 +5V PD5 PC5 +5V PG0 PD4 PE0 J11 D1 C13 R20 R17 BPE3 PG2 PG1 PG6 JP1 PG3 PG4 PG7 CURRENT MEASUREMENT OPTION /IORD PG5 C17 RCM3000 ETHERNET CORE MODULE RN4 SM0 /IOWR L1 DS3 PD4 +3.3V POWER PD2 PD5 RN5 C15 PD3 SM1 RCM1JB GND POWER VRAM VBAT EXT /RES IN RCM1JA J9 PD6 +DC PD7 GND PD0 +3.3V GND PD1 GND RN3 NC +5V +3.3V RN1 GND J10 DISPLAY BOARD J10 UX13 J7 J7 DISPLAY BOARD Figure C-7. Install LCD/Keypad Module on Prototyping Board 84 RabbitCore RCM3209/RCM3229 C.6 Bezel-Mount Installation This section describes and illustrates how to bezel-mount the LCD/keypad module. Follow these steps for bezel-mount installation. 1. Cut mounting holes in the mounting panel in accordance with the recommended dimensions in Figure C-8, then use the bezel faceplate to mount the LCD/keypad module onto the panel. 0.125 D, 4x 0.230 (5.8) 2.870 (86.4) 0.130 (3.3) CUTOUT 3.400 (3) (72.9) 3.100 (78.8) Figure C-8. Recommended Cutout Dimensions 2. Carefully “drop in” the LCD/keypad module with the bezel and gasket attached. User’s Manual 85 3. Fasten the unit with the four 4-40 screws and washers included with the LCD/keypad module. If your panel is thick, use a 4-40 screw that is approximately 3/16" (5 mm) longer than the thickness of the panel. Bezel/Gasket DISPLAY BOARD U1 C1 U2 C4 U3 C3 C2 Q1 R17 D1 J1 R1 R2 R4 R3 R5 R7 R6 R8 R15 R14 R13 R12 R11 R9 R10 Panel R18 Q2 Q3 Q4 Q5 Q6 Q8 Q7 C5 R16 KP1 J3 RN1 U4 C6 C7 C8 J2 Figure C-9. LCD/Keypad Module Mounted in Panel (rear view) Carefully tighten the screws until the gasket is compressed and the plastic bezel faceplate is touching the panel. Do not tighten each screw fully before moving on to the next screw. Apply only one or two turns to each screw in sequence until all are tightened manually as far as they can be so that the gasket is compressed and the plastic bezel faceplate is touching the panel. 86 RabbitCore RCM3209/RCM3229 C.6.1 Connect the LCD/Keypad Module to Your Prototyping Board The LCD/keypad module can be located as far as 2 ft. (60 cm) away from the RCM30/31/ 32XX Prototyping Board, and is connected via a ribbon cable as shown in Figure C-10. C5 D1 C7 JP1 R3 U2 C4 U1 C10 C9 R4 R5 C11 CR1 C13 Pin 1 C12 R7 LCD1 R6 D2 C1 C6 C3 R1 C2 R2 U3 U4 Q1 J5 J1 R25 R8 Q4 Q6 3.3 V 2.8 V n.c. = 5 V Q3 R19 2 OTHER LP3500 R12 R9 Q7 Q2 U6 U5 R15 Q5 R18 R10 R20 4 R17 1 R16 R14 J5 3 R21 R13 R23 R11 R22 R26 Q8 J2 U7 C14 C16 R24 C15 KP1 RN1 C17 DISPLAY BOARD J4 TxB RxB GND RS-232 J4 RN2 PC3 PE3 PE1 PC5 PE0 PG7 PD4 PG6 PG5 PG1 PG4 /IOWR PG3 /IORD SM0 GND PD5 SM1 PD3 VRAM PD7 +3.3V PD1 NC JP9 JP8 JP10 R7 R6 R30 R32 CE R35 SPD LNK FDX ACT COL C40 R22 C48 R31 BSY C2 PC1 PE5 PE4 U5 R1 R3 R9 R8 UX11 GND BT1 PA3 PA1 PF3 Battery PF1 +3.3V +3.3V +5V +5V PC0 U5 PC2 C12 U4 PC4 PG0 PG2 +DC 2.5 MM JACK R17 PD4 R20 PD2 C13 D1 RCM3000 ETHERNET CORE MODULE PD6 PD0 GND D2 PD5 RCM1JA GND RCM1JB RN5 J6 MOTOR/ENCODER RN1 +5V J15 PA5 RN4 PF0 PE7 PE6 RC24 RN3 PF2 PF6 PF7 SLAVE RC23 +5V PA0 PF4 PF5 RC22 +3.3V PA2 PB6 PB7 UX10 PA7 UX4 J11 C17 L1 +DC PA4 PB4 PB5 GND MASTER GND GND GND PA6 PB2 RC25 GND PE4 /RES GND CURRENT MEASUREMENT OPTION PB3 +3.3V +3.3V +5V J8 +3.3V POWER PB0 C7 R7 C14 R9 C1 J3 RC4 +5V +3.3V GND UX2 RC5 C11 C10 C15 VBAT EXT /RES IN RCM2 RC15 RC7 RC6 +3.3V RC28 RC27 RC18 GND JP1 DS3 POWER J9 J1 RC20 RC19 +5V DISPLAY BOARD C16 GND DS4 R4 DS2 DS3 R1 UX9 R34 R3 RC21 R10 C47 R8 RC14 R12 C44 C39 RC17 Q2 RCM39XX DS1 R33 C3 R5 C12 R17 C19 C15 R11 RC16 Q1 R2 RC2 RC29 U6 C14 C38 RC13 C1 C2 C35 UX3 C36 R13 RC10 JP14 R28 R29 U10 D1 U9 RC12 C46 C45 R21 C3 C4 RC11 C6 R10 JP7 PD0 PD1 NC GND C27 C22 C23 PD6 PD7 +3.3V RC26 U3 C9 C37 PD2 PD3 VRAM GND C43 U8 PD4 PD5 SM1 VBAT EXT /RES IN C16 PG2 PG3 /IORD UX5 U3 C24 C20 C21 PG0 PG1 PG4 /IOWR RC9 R14 C28 C25U PD5 PD4 PG6 UX13 UX7 R27 PC4 PC5 PE0 RCM30/31/32XX SERIES PROTOTYPING BOARD RCM2JB JP13 PC2 PC3 PE3 PE1 PG5 U1 J7 JP11 PC0 PC1 PE5 PE4 PG7 C8 C5 C49 C50 PF1 PF0 PE7 S3 S2 C6 JP12 PF3 PF2 PF6 PF7 PE6 RCM2JA RESET RC1 +5V C41 C42 2 1 PA1 U7 R19 R21 R24 Y3 R25 R26 PA3 J3 R20 R23 PA5 L1 C33 L2 C34 PA0 C29 PA2 C26 C32 C31 PA4 C30 PF4 R14 Y2 PB6 +5V GND R13 R16 R18 PB4 /RES LCD +5V GND BA3 BA1 BD0 BD2 BD4 BD6 R12 6 PF5 DISPLAY BOARD DISPLAY BOARD J10 TP1 C17 PB7 PG7 R15 R16 C18 PB5 C11 C13 PB3 DS2 DS1 PG6 C7 RxC TxC C10 R11 PA7 C8 C9 U4 SM0 J5 GND JP2 JP3 JP4 JP5 R5 R6 U3 Y1 C5 +5V BPE3 GND GND BA2 BA0 BD1 BD3 BD5 BD7 J8 J2 R4 PA6 Pin 1 JP1 PB2 U2 /RES STATUS R15 J1 PB0 R2 C4 U1 Figure C-10. Connecting LCD/Keypad Module to RCM30/31/32XX Prototyping Board Note the locations and connections relative to pin 1 on both the Prototyping Board and the LCD/keypad module. Rabbit offers 2 ft. (60 cm) extension cables. Contact your authorized Rabbit distributor or a sales representative for more information. User’s Manual 87 C.7 Sample Programs Sample programs illustrating the use of the LCD/keypad module with the Prototyping Board are provided in the SAMPLES\RCM3200 directory. These sample programs use the external I/O bus on the Rabbit 3000 chip, and so the #define PORTA_AUX_IO line is already included in the sample programs. Each sample program has comments that describe the purpose and function of the program. Follow the instructions at the beginning of the sample program. 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 RCM3209/RCM3229 must be in Program mode (see Section 4.3, “Serial Programming Cable”), and must be connected to a PC using the programming cable as described in Section 2.2.2. Complete information on Dynamic C is provided in the Dynamic C User’s Manual. The following sample programs are found in the SAMPLES\RCM3200\LCD_KEYPAD folder. • KEYPADTOLED.C—This program demonstrates the use of the external I/O bus. The program will light up an LED on the LCD/keypad module and will display a message on the LCD when a key press is detected. The DS1 and DS2 LEDs on the Prototyping Board will also light up. • LCDKEYFUN.C—This program demonstrates how to draw primitive features from the graphic library (lines, circles, polygons), and also demonstrates the keypad with the key release option. • SWITCHTOLED.C—This program demonstrates the use of the external I/O bus. The program will light up an LED on the LCD/keypad module and will display a message on the LCD when a switch press is detected. The DS1 and DS2 LEDs on the Prototyping Board will also light up. 88 RabbitCore RCM3209/RCM3229 C.8 LCD/Keypad Module Function Calls When mounted on the Prototyping Board, the LCD/keypad module uses the external I/O bus on the Rabbit 3000 chip. Remember to add the line #define PORTA_AUX_IO to the beginning of any programs using the external I/O bus. C.8.1 LCD/Keypad Module Initialization The function used to initialize the LCD/keypad module can be found in the Dynamic C LIB\DISPLAYS\LCD122KEY7.LIB library. dispInit void dispInit(); DESCRIPTION Initializes the LCD/keypad module. The keypad is set up using keypadDef() or keyConfig() after this function call. RETURN VALUE None. User’s Manual 89 C.8.2 LEDs When power is applied to the LCD/keypad module for the first time, the red LED (DS1) will come on, indicating that power is being applied to the LCD/keypad module. The red LED is turned off when the brdInit function executes. One function is available to control the LEDs, and can be found in the Dynamic C LIB\ DISPLAYS\LCD122KEY7.LIB library. displedOut void displedOut(int led, int value); DESCRIPTION LED on/off control. This function will only work when the LCD/keypad module is installed on the Prototyping Board. PARAMETERS led is the LED to control. 0 = LED DS1 1 = LED DS2 2 = LED DS3 3 = LED DS4 4 = LED DS5 5 = LED DS6 6 = LED DS7 value is the value used to control whether the LED is on or off (0 or 1). 0 = off 1 = on RETURN VALUE None. 90 RabbitCore RCM3209/RCM3229 C.8.3 LCD Display The functions used to control the LCD display are contained in the Dynamic C LIB\ DISPLAYS\GRAPHIC\GRAPHIC.LIB library. When x and y coordinates on the display screen are specified, x can range from 0 to 121, and y can range from 0 to 31. These numbers represent pixels from the top left corner of the display. glInit void glInit(void); DESCRIPTION Initializes the display devices, clears the screen. RETURN VALUE None. SEE ALSO glDispOnOFF, glBacklight, glSetContrast, glPlotDot, glBlock, glPlotDot, glPlotPolygon, glPlotCircle, glHScroll, glVScroll, glXFontInit, glPrintf, glPutChar, glSetBrushType, glBuffLock, glBuffUnlock, glPlotLine glBackLight void glBackLight(int onOff); DESCRIPTION Turns the display backlight on or off. PARAMETER onOff turns the backlight on or off 1—turn the backlight on 0—turn the backlight off RETURN VALUE None. SEE ALSO glInit, glDispOnoff, glSetContrast User’s Manual 91 glDispOnOff void glDispOnOff(int onOff); DESCRIPTION Sets the LCD screen on or off. Data will not be cleared from the screen. PARAMETER onOff turns the LCD screen on or off 1—turn the LCD screen on 0—turn the LCD screen off RETURN VALUE None. SEE ALSO glInit, glSetContrast, glBackLight glSetContrast void glSetContrast(unsigned level); DESCRIPTION Sets display contrast. NOTE: This function is not used with the LCD/keypad module since the support circuits are not available on the LCD/keypad module. 92 RabbitCore RCM3209/RCM3229 glFillScreen void glFillScreen(int pattern); DESCRIPTION Fills the LCD display screen with a pattern. PARAMETER The screen will be set to all black if pattern is 0xFF, all white if pattern is 0x00, and vertical stripes for any other pattern. RETURN VALUE None. SEE ALSO glBlock, glBlankScreen, glPlotPolygon, glPlotCircle glBlankScreen void glBlankScreen(void); DESCRIPTION Blanks the LCD display screen (sets LCD display screen to white). RETURN VALUE None. SEE ALSO glFillScreen, glBlock, glPlotPolygon, glPlotCircle User’s Manual 93 glFillRegion void glFillRegion(int left, int top, int width, int height, char pattern); DESCRIPTION Fills a rectangular block in the LCD buffer with the pattern specified. Any portion of the block that is outside the LCD display area will be clipped. PARAMETERS left the x coordinate of the top left corner of the block. top the y coordinate of the top left corner of the block. width the width of the block. height the height of the block. pattern the bit pattern to display (all black if pattern is 0xFF, all white if pattern is 0x00, and vertical stripes for any other pattern). RETURN VALUE None. SEE ALSO glFillScreen, glBlankScreen, glBlock, glBlankRegion 94 RabbitCore RCM3209/RCM3229 glFastFillRegion void glFastFillRegion(int left, int top, int width, int height, char pattern); DESCRIPTION Fills a rectangular block in the LCD buffer with the pattern specified. The block left and width parameters must be byte-aligned. Any portion of the block that is outside the LCD display area will be clipped. PARAMETERS left the x coordinate of the top left corner of the block. top the y coordinate of the top left corner of the block. width the width of the block. height the height of the block. pattern the bit pattern to display (all black if pattern is 0xFF, all white if pattern is 0x00, and vertical stripes for any other pattern). RETURN VALUE None. SEE ALSO glFillScreen, glBlankScreen, glBlock, glBlankRegion User’s Manual 95 glBlankRegion void glBlankRegion(int left, int top, int width, int height); DESCRIPTION Clears a region on the LCD display. The block left and width parameters must be bytealigned. Any portion of the block that is outside the LCD display area will be clipped. PARAMETERS left the x coordinate of the top left corner of the block (x must be evenly divisible by 8). top the y coordinate of the top left corner of the block. width the width of the block (must be evenly divisible by 8). height the height of the block. RETURN VALUE None. SEE ALSO glFillScreen, glBlankScreen, glBlock 96 RabbitCore RCM3209/RCM3229 glBlock void glBlock(int left, int top, int width, int height); DESCRIPTION Draws a rectangular block in the page buffer and on the LCD if the buffer is unlocked. Any portion of the block that is outside the LCD display area will be clipped. PARAMETERS left the x coordinate of the top left corner of the block. top the y coordinate of the top left corner of the block. width the width of the block. height the height of the block. RETURN VALUE None. SEE ALSO glFillScreen, glBlankScreen, glPlotPolygon, glPlotCircle glPlotVPolygon void glPlotVPolygon(int n, int *pFirstCoord); DESCRIPTION Plots the outline of a polygon in the LCD page buffer, and on the LCD if the buffer is unlocked. Any portion of the polygon that is outside the LCD display area will be clipped. If fewer than 3 vertices are specified, the function will return without doing anything. PARAMETERS n the number of vertices. pFirstCoord a pointer to array of vertex coordinates: x1,y1, x2,y2, x3,y3, ... RETURN VALUE None. SEE ALSO glPlotPolygon, glFillPolygon, glFillVPolygon User’s Manual 97 glPlotPolygon void glPlotPolygon(int n, int y1, int x2, int y2, ...); DESCRIPTION Plots the outline of a polygon in the LCD page buffer and on the LCD if the buffer is unlocked. Any portion of the polygon that is outside the LCD display area will be clipped. If fewer than 3 vertices are specified, the function will return without doing anything. PARAMETERS n the number of vertices. y1 the y coordinate of the first vertex. x1 the x coordinate of the first vertex. y2 the y coordinate of the second vertex. x2 the x coordinate of the second vertex. ... the coordinates of additional vertices. RETURN VALUE None. SEE ALSO glPlotVPolygon, glFillPolygon, glFillVPolygon 98 RabbitCore RCM3209/RCM3229 glFillVPolygon void glFillVPolygon(int n, int *pFirstCoord); DESCRIPTION Fills a polygon in the LCD page buffer and on the LCD screen if the buffer is unlocked. Any portion of the polygon that is outside the LCD display area will be clipped. If fewer than 3 vertices are specified, the function will return without doing anything. PARAMETERS n the number of vertices. pFirstCoord a pointer to array of vertex coordinates: x1,y1, x2,y2, x3,y3, ... RETURN VALUE None. SEE ALSO glFillPolygon, glPlotPolygon, glPlotVPolygon User’s Manual 99 glFillPolygon void glFillPolygon(int n, int x1, int y1, int x2, int y2, ...); DESCRIPTION Fills a polygon in the LCD page buffer and on the LCD if the buffer is unlocked. Any portion of the polygon that is outside the LCD display area will be clipped. If fewer than 3 vertices are specified, the function will return without doing anything. PARAMETERS n the number of vertices. x1 the x coordinate of the first vertex. y1 the y coordinate of the first vertex. x2 the x coordinate of the second vertex. y2 the y coordinate of the second vertex. ... the coordinates of additional vertices. RETURN VALUE None. SEE ALSO glFillVPolygon, glPlotPolygon, glPlotVPolygon 100 RabbitCore RCM3209/RCM3229 glPlotCircle void glPlotCircle(int xc, int yc, int rad); DESCRIPTION Draws the outline of a circle in the LCD page buffer and on the LCD if the buffer is unlocked. Any portion of the circle that is outside the LCD display area will be clipped. PARAMETERS xc the x coordinate of the center of the circle. yc the y coordinate of the center of the circle. rad the radius of the center of the circle (in pixels). RETURN VALUE None. SEE ALSO glFillCircle, glPlotPolygon, glFillPolygon glFillCircle void glFillCircle(int xc, int yc, int rad); DESCRIPTION Draws a filled circle in the LCD page buffer and on the LCD if the buffer is unlocked. Any portion of the circle that is outside the LCD display area will be clipped. PARAMETERS xc the x coordinate of the center of the circle. yc the y coordinate of the center of the circle. rad the radius of the center of the circle (in pixels). RETURN VALUE None. SEE ALSO glPlotCircle, glPlotPolygon, glFillPolygon User’s Manual 101 glXFontInit void glXFontInit(fontInfo *pInfo, char pixWidth, char pixHeight, unsigned startChar, unsigned endChar, unsigned long xmemBuffer); DESCRIPTION Initializes the font descriptor structure, where the font is stored in xmem. Each font character's bitmap is column major and byte aligned. PARAMETERS pInfo a pointer to the font descriptor to be initialized. pixWidth the width (in pixels) of each font item. pixHeight the height (in pixels) of each font item. startChar the value of the first printable character in the font character set. endChar the value of the last printable character in the font character set. xmemBuffer the xmem pointer to a linear array of font bitmaps. RETURN VALUE None. SEE ALSO glPrinf 102 RabbitCore RCM3209/RCM3229 glFontCharAddr unsigned long glFontCharAddr(fontInfo *pInfo, char letter); DESCRIPTION Returns the xmem address of the character from the specified font set. PARAMETERS pInfo pointer to the xmem address of the bitmap font set. letter an ASCII character. RETURN VALUE xmem address of bitmap character font, column major and byte-aligned. SEE ALSO glPutFont, glPrintf glPutFont void glPutFont(int x, int y, fontInfo *pInfo, char code); DESCRIPTION Puts an entry from the font table to the page buffer and on the LCD if the buffer is unlocked. Each font character's bitmap is column major and byte-aligned. Any portion of the bitmap character that is outside the LCD display area will be clipped. PARAMETERS x the x coordinate (column) of the top left corner of the text. y the y coordinate (row) of the top left corner of the text. pInfo a pointer to the font descriptor. code the ASCII character to display. RETURN VALUE None. SEE ALSO glFontCharAddr, glPrintf User’s Manual 103 glSetPfStep void glSetPfStep(int stepX, int stepY); DESCRIPTION Sets the glPrintf() printing step direction. The x and y step directions are independent signed values. The actual step increments depend on the height and width of the font being displayed, which are multiplied by the step values. PARAMETERS stepX the glPrintf x step value stepY the glPrintf y step value RETURN VALUE None. SEE ALSO Use glGetPfStep() to examine the current x and y printing step direction. glGetPfStep int glGetPfStep(void); DESCRIPTION Gets the current glPrintf() printing step direction. Each step direction is independent of the other, and is treated as an 8-bit signed value. The actual step increments depends on the height and width of the font being displayed, which are multiplied by the step values. RETURN VALUE The x step is returned in the MSB, and the y step is returned in the LSB of the integer result. SEE ALSO Use glGetPfStep() to control the x and y printing step direction. 104 RabbitCore RCM3209/RCM3229 glPutChar void glPutChar(char ch, char *ptr, int *cnt, glPutCharInst *pInst) DESCRIPTION Provides an interface between the STDIO string-handling functions and the graphic library. The STDIO string-formatting function will call this function, one character at a time, until the entire formatted string has been parsed. Any portion of the bitmap character that is outside the LCD display area will be clipped. PARAMETERS ch the character to be displayed on the LCD. ptr not used, but is a place holder for a pointer to STDIO string functions. cnt not used, is a place holder for a pointer to STDIO string functions. pInst a pointer to the font descriptor. RETURN VALUE None. SEE ALSO glPrintf, glPutFont, doprnt User’s Manual 105 glPrintf void glPrintf(int x, int y, fontInfo *pInfo, char *fmt, ...); DESCRIPTION Prints a formatted string (much like printf) on the LCD screen. Only the character codes that exist in the font set are printed, all others are skipped. For example, '\b', '\t', '\n' and '\r' (ASCII backspace, tab, new line, and carriage return, respectively) will be printed if they exist in the font set, but will not have any effect as control characters. Any portion of the bitmap character that is outside the LCD display area will be clipped. PARAMETERS x the x coordinate (column) of the upper left corner of the text. y the y coordinate (row) of the upper left corner of the text. pInfo a pointer to the font descriptor. fmt pointer to a formatted string. ... formatted string conversion parameter(s). EXAMPLE glprintf(0,0, &fi12x16, "Test %d\n", count); RETURN VALUE None. SEE ALSO glXFontInit 106 RabbitCore RCM3209/RCM3229 glBuffLock void glBuffLock(void); DESCRIPTION Increments LCD screen locking counter. Graphic calls are recorded in the LCD memory buffer and are not transferred to the LCD if the counter is non-zero. NOTE: glBuffLock() and glBuffUnlock() can be nested up to a level of 255, but be sure to balance the calls. It is not a requirement to use these procedures, but a set of glBuffLock() and glBuffUnlock() bracketing a set of related graphic calls speeds up the rendering significantly. RETURN VALUE None. SEE ALSO glBuffUnlock, glSwap glBuffUnlock void glBuffUnlock(void); DESCRIPTION Decrements the LCD screen locking counter. The contents of the LCD buffer are transferred to the LCD if the counter goes to zero. RETURN VALUE None. SEE ALSO glBuffLock, glSwap User’s Manual 107 glSwap void glSwap(void); DESCRIPTION Checks the LCD screen locking counter. The contents of the LCD buffer are transferred to the LCD if the counter is zero. RETURN VALUE None. SEE ALSO glBuffUnlock, glBuffLock, _glSwapData (located in the library specifically for the LCD that you are using) glSetBrushType void glSetBrushType(int type); DESCRIPTION Sets the drawing method (or color) of pixels drawn by subsequent graphic calls. PARAMETER type value can be one of the following macros. PIXBLACK draws black pixels (turns pixel on). PIXWHITE draws white pixels (turns pixel off). PIXXOR draws old pixel XOR'ed with the new pixel. RETURN VALUE None. SEE ALSO glGetBrushType 108 RabbitCore RCM3209/RCM3229 glGetBrushType int glGetBrushType(void); DESCRIPTION Gets the current method (or color) of pixels drawn by subsequent graphic calls. RETURN VALUE The current brush type. SEE ALSO glSetBrushType glXGetBitmap void glXGetBitmap(int x, int y, int bmWidth, int bmHeight, unsigned long xBm); DESCRIPTION Gets a bitmap from the LCD page buffer and stores it in xmem RAM. This function automatically calls glXGetFastmap() if the left edge of the bitmap is byte-aligned and the left edge and width are each evenly divisible by 8. This function call is intended for use only when a graphic engine is used to interface with the LCD/keypad module. PARAMETERS x the x coordinate in pixels of the top left corner of the bitmap (x must be evenly divisible by 8). y the y coordinate in pixels of the top left corner of the bitmap. bmWidth the width in pixels of the bitmap (must be evenly divisible by 8). bmHeight the height in pixels of the bitmap. xBm the xmem RAM storage address of the bitmap. RETURN VALUE None. User’s Manual 109 glXGetFastmap void glXGetFastmap(int left, int top, int width, int height, unsigned long xmemptr); DESCRIPTION Draws bitmap in the specified space. The data for the bitmap are stored in xmem. This function is similar to glXPutBitmap(), except that it's faster. The bitmap must be byte-aligned. Any portion of a bitmap image or character that is outside the LCD display area will be clipped. This function call is intended for use only when a graphic engine is used to interface with the LCD/keypad module. PARAMETERS left the x coordinate of the top left corner of the bitmap (x must be evenly divisible by 8). top the y coordinate in pixels of the top left corner of the bitmap. width the width of the bitmap (must be evenly divisible by 8). height the height of the bitmap. xmemptr the xmem RAM storage address of the bitmap. RETURN VALUE None. SEE ALSO glXPutBitmap, glPrintf 110 RabbitCore RCM3209/RCM3229 glPlotDot void glPlotDot(int x, int y); DESCRIPTION Draws a single pixel in the LCD buffer, and on the LCD if the buffer is unlocked. If the coordinates are outside the LCD display area, the dot will not be plotted. PARAMETERS x the x coordinate of the dot. y the y coordinate of the dot. RETURN VALUE None. SEE ALSO glPlotline, glPlotPolygon, glPlotCircle glPlotLine void glPlotLine(int x0, int y0, int x1, int y1); DESCRIPTION Draws a line in the LCD buffer, and on the LCD if the buffer is unlocked. Any portion of the line that is beyond the LCD display area will be clipped. PARAMETERS x0 the x coordinate of one endpoint of the line. y0 the y coordinate of one endpoint of the line. x1 the x coordinate of the other endpoint of the line. y1 the y coordinate of the other endpoint of the line. RETURN VALUE None. SEE ALSO glPlotDot, glPlotPolygon, glPlotCircle User’s Manual 111 glLeft1 void glLeft1(int left, int top, int cols, int rows); DESCRIPTION Scrolls byte-aligned window left one pixel, right column is filled by current pixel type (color). PARAMETERS left the top left corner of bitmap, must be evenly divisible by 8, otherwise truncates. top the top left corner of the bitmap. cols the number of columns in the window, must be evenly divisible by 8, otherwise truncates. rows the number of rows in the window. RETURN VALUE None. SEE ALSO glHScroll, glRight1 112 RabbitCore RCM3209/RCM3229 glRight1 void glRight1(int left, int top, int cols, int rows); DESCRIPTION Scrolls byte-aligned window right one pixel, left column is filled by current pixel type (color). PARAMETERS left the top left corner of bitmap, must be evenly divisible by 8, otherwise truncates. top the top left corner of the bitmap. cols the number of columns in the window, must be evenly divisible by 8, otherwise truncates. rows the number of rows in the window. RETURN VALUE None. SEE ALSO glHScroll, glLeft1 User’s Manual 113 glUp1 void glUp1(int left, int top, int cols, int rows); DESCRIPTION Scrolls byte-aligned window up one pixel, bottom column is filled by current pixel type (color). PARAMETERS left the top left corner of bitmap, must be evenly divisible by 8, otherwise truncates. top the top left corner of the bitmap. cols the number of columns in the window, must be evenly divisible by 8, otherwise truncates. rows the number of rows in the window. RETURN VALUE None. SEE ALSO glVScroll, glDown1 114 RabbitCore RCM3209/RCM3229 glDown1 void glDown1(int left, int top, int cols, int rows); DESCRIPTION Scrolls byte-aligned window down one pixel, top column is filled by current pixel type (color). PARAMETERS left the top left corner of bitmap, must be evenly divisible by 8, otherwise truncates. top the top left corner of the bitmap. cols the number of columns in the window, must be evenly divisible by 8, otherwise truncates. rows the number of rows in the window. RETURN VALUE None. SEE ALSO glVScroll, glUp1 User’s Manual 115 glHScroll void glHScroll(int left, int top, int cols, int rows, int nPix); DESCRIPTION Scrolls right or left, within the defined window by x number of pixels. The opposite edge of the scrolled window will be filled in with white pixels. The window must be byte-aligned. Parameters will be verified for the following: 1. The left and cols parameters will be verified that they are evenly divisible by 8. If not, they will be truncated to a value that is a multiple of 8. 2. Parameters will be checked to verify that the scrolling area is valid. The minimum scrolling area is a width of 8 pixels and a height of one row. PARAMETERS left the top left corner of bitmap, must be evenly divisible by 8. top the top left corner of the bitmap. cols the number of columns in the window, must be evenly divisible by 8. rows the number of rows in the window. nPix the number of pixels to scroll within the defined window (a negative value will produce a scroll to the left). RETURN VALUE None. SEE ALSO glVScroll 116 RabbitCore RCM3209/RCM3229 glVScroll void glVScroll(int left, int top, int cols, int rows, int nPix); DESCRIPTION Scrolls up or down, within the defined window by x number of pixels. The opposite edge of the scrolled window will be filled in with white pixels. The window must be byte-aligned. Parameters will be verified for the following: 1. The left and cols parameters will be verified that they are evenly divisible by 8. If not, they will be truncated to a value that is a multiple of 8. 2. Parameters will be checked to verify that the scrolling area is valid. The minimum scrolling area is a width of 8 pixels and a height of one row. PARAMETERS left the top left corner of bitmap, must be evenly divisible by 8. top the top left corner of the bitmap. cols the number of columns in the window, must be evenly divisible by 8. rows the number of rows in the window. nPix the number of pixels to scroll within the defined window (a negative value will produce a scroll up). RETURN VALUE None. SEE ALSO glHScroll User’s Manual 117 glXPutBitmap void glXPutBitmap(int left, int top, int width, int height, unsigned long bitmap); DESCRIPTION Draws bitmap in the specified space. The data for the bitmap are stored in xmem. This function calls glXPutFastmap() automatically if the bitmap is byte-aligned (the left edge and the width are each evenly divisible by 8). Any portion of a bitmap image or character that is outside the LCD display area will be clipped. PARAMETERS left the top left corner of the bitmap. top the top left corner of the bitmap. width the width of the bitmap. height the height of the bitmap. bitmap the address of the bitmap in xmem. RETURN VALUE None. SEE ALSO glXPutFastmap, glPrintf 118 RabbitCore RCM3209/RCM3229 glXPutFastmap void glXPutFastmap(int left, int top, int width, int height, unsigned long bitmap); DESCRIPTION Draws bitmap in the specified space. The data for the bitmap are stored in xmem. This function is like glXPutBitmap(), except that it is faster. The restriction is that the bitmap must be byte-aligned. Any portion of a bitmap image or character that is outside the LCD display area will be clipped. PARAMETERS left the top left corner of the bitmap, must be evenly divisible by 8, otherwise truncates. top the top left corner of the bitmap. width the width of the bitmap, must be evenly divisible by 8, otherwise truncates. height the height of the bitmap. bitmap the address of the bitmap in xmem. RETURN VALUE None. SEE ALSO glXPutBitmap, glPrintf User’s Manual 119 TextWindowFrame int TextWindowFrame(windowFrame *window, fontInfo *pFont, int x, int y, int winWidth, int winHeight); DESCRIPTION Defines a text-only display window. This function provides a way to display characters within the text window using only character row and column coordinates. The text window feature provides end-of-line wrapping and clipping after the character in the last column and row is displayed. NOTE: Execute the TextWindowFrame() function before other Text... functions. PARAMETERS window a pointer to the window frame descriptor. pFont a pointer to the font descriptor. x the x coordinate of the top left corner of the text window frame. y the y coordinate of the top left corner of the text window frame. winWidth the width of the text window frame. winHeight the height of the text window frame. RETURN VALUE 0—window frame was successfully created. -1—x coordinate + width has exceeded the display boundary. -2—y coordinate + height has exceeded the display boundary. -3—Invalid winHeight and/or winWidth parameter value. 120 RabbitCore RCM3209/RCM3229 TextBorderInit void TextBorderInit(windowFrame *wPtr, int border, char *title); DESCRIPTION This function initializes the window frame structure with the border and title information. NOTE: Execute the TextWindowFrame() function before using this function. PARAMETERS wPtr a pointer to the window frame descriptor. border the border style: SINGLE_LINE—The function will draw a single-line border around the text window. DOUBLE_LINE—The function will draw a double-line border around the text window. title a pointer to the title information: If a NULL string is detected, then no title is written to the text menu. If a string is detected, then it will be written center-aligned to the top of the text menu box. RETURN VALUE None. SEE ALSO TextBorder, TextGotoXY, TextPutChar, TextWindowFrame, TextCursorLocation User’s Manual 121 TextBorder void TextBorder(windowFrame *wPtr); DESCRIPTION This function displays the border for a given window frame. This function will automatically adjust the text window parameters to accommodate the space taken by the text border. This adjustment will only occur once after the TextBorderInit() function executes. NOTE: Execute the TextWindowFrame() function before using this function. PARAMETER wPtr a pointer to the window frame descriptor. RETURN VALUE None. SEE ALSO TextBorderInit, TextGotoXY, TextPutChar, TextWindowFrame, TextCursorLocation TextGotoXY void TextGotoXY(windowFrame *window, int col, int row); DESCRIPTION Sets the cursor location to display the next character. The display location is based on the height and width of the character to be displayed. NOTE: Execute the TextWindowFrame() function before using this function. PARAMETERS window a pointer to a font descriptor. col a character column location. row a character row location. RETURN VALUE None. SEE ALSO TextPutChar, TextPrintf, TextWindowFrame 122 RabbitCore RCM3209/RCM3229 TextCursorLocation void TextCursorLocation(windowFrame *window, int *col, int *row); DESCRIPTION Gets the current cursor location that was set by a graphic Text... function. NOTE: Execute the TextWindowFrame() function before using this function. PARAMETERS window a pointer to a font descriptor. col a pointer to cursor column variable. row a pointer to cursor row variable. RETURN VALUE Lower word = Cursor Row location Upper word = Cursor Column location SEE ALSO TextGotoXY, TextPrintf, TextWindowFrame, TextCursorLocation User’s Manual 123 TextPutChar void TextPutChar(struct windowFrame *window, char ch); DESCRIPTION Displays a character on the display where the cursor is currently pointing. Once a character is displayed, the cursor will be incremented to the next character position. If any portion of a bitmap character is outside the LCD display area, the character will not be displayed. NOTE: Execute the TextWindowFrame() function before using this function. PARAMETERS window a pointer to a font descriptor. ch a character to be displayed on the LCD. RETURN VALUE None. SEE ALSO TextGotoXY, TextPrintf, TextWindowFrame, TextCursorLocation 124 RabbitCore RCM3209/RCM3229 TextPrintf void TextPrintf(struct windowFrame *window, char *fmt, ...); DESCRIPTION Prints a formatted string (much like printf) on the LCD screen. Only printable characters in the font set are printed; escape sequences '\r' and '\n' are also recognized. All other escape sequences will be skipped over; for example, '\b' and \'t' will cause nothing to be displayed. The text window feature provides end-of-line wrapping and clipping after the character in the last column and row is displayed. The cursor then remains at the end of the string. NOTE: Execute the TextWindowFrame() function before using this function. PARAMETERS window a pointer to a font descriptor. fmt a pointer to a formatted string. ... formatted string conversion parameter(s). EXAMPLE TextPrintf(&TextWindow, "Test %d\n", count); RETURN VALUE None. SEE ALSO TextGotoXY, TextPutChar, TextWindowFrame, TextCursorLocation User’s Manual 125 TextMaxChars int TextMaxChars(windowFrame *wPtr); DESCRIPTION This function returns the maximum number of characters that can be displayed within the text window. NOTE: Execute the TextWindowFrame() function before using this function. PARAMETER wPtr a pointer to the window frame descriptor. RETURN VALUE The maximum number of characters that can be displayed within the text window. SEE ALSO TextGotoXY, TextPrintf, TextWindowFrame, TextCursorLocation TextWinClear void TextWinClear(windowFrame *wPtr); DESCRIPTION This functions clears the entire area within the specified text window. NOTE: Execute the TextWindowFrame() function before using this function. PARAMETERS wPtr a pointer to the window frame descriptor. RETURN VALUE None. SEE ALSO TextGotoXY, TextPrintf, TextWindowFrame, TextCursorLocation 126 RabbitCore RCM3209/RCM3229 C.8.4 Keypad The functions used to control the keypad are contained in the Dynamic C LIB\KEYPADS\ KEYPAD7.LIB library. keyInit void keyInit(void); DESCRIPTION Initializes keypad process. RETURN VALUE None. SEE ALSO brdInit User’s Manual 127 keyConfig void keyConfig(char cRaw, char cPress, char cRelease, char cCntHold, char cSpdLo, char cCntLo, char cSpdHi); DESCRIPTION Assigns each key with keypress and release codes, and hold and repeat ticks for auto repeat and debouncing. PARAMETERS a raw key code index. cRaw 1 × 7 keypad matrix with raw key code index assignments (in brackets): [0] [1] [4] [2] [5] [3] [6] User Keypad Interface cPress a keypress code An 8-bit value is returned when a key is pressed. 0 = Unused. See keypadDef() for default press codes. cRelease a key release code. An 8-bit value is returned when a key is pressed. 0 = Unused. cCntHold a hold tick, which is approximately one debounce period or 5 µs. How long to hold before repeating. 0 = No Repeat. cSpdLo a low-speed repeat tick, which is approximately one debounce period or 5 µs. How many times to repeat. 0 = None. cCntLo a low-speed hold tick, which is approximately one debounce period or 5 µs. How long to hold before going to high-speed repeat. 0 = Slow Only. cSpdHi a high-speed repeat tick, which is approximately one debounce period or 5 µs. How many times to repeat after low speed repeat. 0 = None. 128 RabbitCore RCM3209/RCM3229 keyConfig (continued) RETURN VALUE None. SEE ALSO keyProcess, keyGet, keypadDef User’s Manual 129 keyProcess void keyProcess(void); DESCRIPTION Scans and processes keypad data for key assignment, debouncing, press and release, and repeat. NOTE: This function is also able to process an 8 × 8 matrix keypad. RETURN VALUE None. SEE ALSO keyConfig, keyGet, keypadDef keyGet char keyGet(void); DESCRIPTION Get next keypress. RETURN VALUE The next keypress, or 0 if none. SEE ALSO keyConfig, keyProcess, keypadDef 130 RabbitCore RCM3209/RCM3229 keyUnget int keyUnget(char cKey); DESCRIPTION Pushes the value of cKey to the top of the input queue, which is 16 bytes deep. PARAMETER cKey RETURN VALUE None. SEE ALSO keyGet User’s Manual 131 keypadDef void keypadDef(); DESCRIPTION Configures the physical layout of the keypad with the desired ASCII return key codes. 1 × 7 keypad physical mapping: 0 4 ['L'] 1 5 2 ['U'] ['–'] 6 ['D'] 3 ['R'] ['+'] ['E'] where 'L' represents Left Scroll 'U' represents Up Scroll 'D' represents Down Scroll 'R' represents Right Scroll '–' represents Page Down '+' represents Page Up 'E' represents the ENTER key Example: Do the following for the above physical vs. ASCII return key codes. keyConfig keyConfig keyConfig keyConfig keyConfig keyConfig keyConfig ( ( ( ( ( ( ( 3,'R',0, 6,'E',0, 2,'D',0, 4,'-',0, 1,'U',0, 5,'+',0, 0,'L',0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 0 0 0 0 0 0 ); ); ); ); ); ); ); Characters are returned upon keypress with no repeat. RETURN VALUE None. SEE ALSO keyConfig, keyGet, keyProcess 132 RabbitCore RCM3209/RCM3229 keyScan void keyScan(char *pcKeys); DESCRIPTION Writes "1" to each row and reads the value. The position of a keypress is indicated by a zero value in a bit position. PARAMETER pcKeys a pointer to the address of the value read. RETURN VALUE None. SEE ALSO keyConfig, keyGet, keypadDef, keyProcess User’s Manual 133 134 RabbitCore RCM3209/RCM3229 APPENDIX D. POWER SUPPLY Appendix D provides information on the current requirements of the RCM3209/RCM3229, and includes some background on the chip select circuit used in power management. D.1 Power Supplies The RCM3209/RCM3229 requires a regulated 3.3 V ± 0.15 V DC power source. The RabbitCore design presumes that the voltage regulator is on the user board, and that the power is made available to the RCM3209/RCM3229 board through header J62. An RCM3209/RCM3229 with no loading at the outputs operating at 29.4 MHz typically draws 145 mA. The RCM3209/RCM3229 will consume an additional 10 mA when the programming cable is used to connect the programming header, J1, to a PC. D.1.1 Battery Backup The RCM3209/RCM3229 does not have a battery, but there is provision for a customersupplied battery to back up the data SRAM and keep the internal Rabbit 3000 real-time clock running. Header J62, shown in Figure D-1, allows access to the external battery. This header makes it possible to connect an external 3 V power supply. This allows the SRAM and the internal Rabbit 3000 real-time clock to retain data with the RCM3209/RCM3229 powered down. External Battery J62 VRAM 29 +3.3 VIN 31 30 VBAT_EXT 32 GND Figure D-1. External Battery Connections at Header J2 User’s Manual 135 A lithium battery with a nominal voltage of 3 V and a minimum capacity of 165 mA·h is recommended. A lithium battery is strongly recommended because of its nearly constant nominal voltage over most of its life. The drain on the battery by the RCM3209/RCM3229 is typically 12 µA when no other power is supplied. If a 165 mA·h battery is used, the battery can last almost 2 years: 165 mA·h ------------------------ = 1.6 years. 12 µA The actual life in your application will depend on the current drawn by components, not on the RCM3209/RCM3229 and the storage capacity of the battery. The RCM3209/RCM3229 does not drain the battery while it is powered up normally. Cycle the main power off/on on the RCM3209/RCM3229 after you install a backup battery for the first time, and whenever you replace the battery. This step will minimize the current drawn by the real-time clock oscillator circuit from the backup battery should the RCM3209/RCM3229 experience a loss of main power. NOTE: Remember to cycle the main power off/on any time the RCM3209/RCM3229 is removed from the Prototyping Board or motherboard since that is where the backup battery would be located. Rabbit’s Technical Note TN235, External 32.768 kHz Oscillator Circuits, provides additional information about the current draw by the real-time clock oscillator circuit. D.1.2 Battery-Backup Circuit Figure D-2 shows the battery-backup circuit. VOSC VRAM External Battery VBAT-EXT D61 R74 R75 150 kW 100 W R10 47 kW C8 100 nF C9 10 nF C4 10 nF Figure D-2. RCM3209/RCM3229 Backup Battery Circuit The battery-backup circuit serves three purposes: • It reduces the battery voltage to the SRAM and to the real-time clock, thereby limiting the current consumed by the real-time clock and lengthening the battery life. • It ensures that current can flow only out of the battery to prevent charging the battery. • A voltage, VOSC, is supplied to U5, which keeps the 32.768 kHz oscillator working when the voltage begins to drop. 136 RabbitCore RCM3209/RCM3229 D.1.3 Reset Generator The RCM3209/RCM3229 uses a reset generator to reset the Rabbit 3000 microprocessor when the voltage drops below the voltage necessary for reliable operation. The reset occurs between 2.85 V and 3.00 V, typically 2.93 V. The RCM3209/RCM3229 has a reset output, pin 1 on header J2. D.2 Optional +5 V Output The RCM3209/RCM3229 boards have an onboard charge pump that provides the +5 V needed by the RealTek Ethernet chip. User’s Manual 137 138 RabbitCore RCM3209/RCM3229 APPENDIX E. MOTOR CONTROL OPTION The Prototyping Board has a header at J6 for a motor control option. While Rabbit does not support this option at this time, this appendix provides additional information about Parallel Port F on the Rabbit 3000 microprocessor to enable you to use this feature on the Prototyping Board for your needs. E.1 Overview The Parallel Port F connector on the Prototyping Board, J6, gives access to all 8 pins of Parallel Port F, along with +5 V. This appendix describes the function of each pin, and the ways they may be used for motion-control applications. It should be read in conjunction with the Rabbit 3000 Microprocessor User’s Manual and the RCM3209 and the Prototyping Board schematics. User’s Manual 139 E.2 Header J6 The connector is a 2 × 5, 0.1" pitch header suitable for connecting to an IDC header socket, with the following pin allocations. Table E-1. Prototyping Board Header J6 Pinout Pin Rabbit 3000 Primary Function Alternate Function 1 Alternate Function 2 1 Parallel Port F, bit 0 General-purpose I/O port Quadrature decoder 1 Q SCLK_D input 2 Parallel Port F, bit 1 General-purpose I/O port Quadrature decoder 1 I input 3 Parallel Port F, bit 2 General-purpose I/O port Quadrature decoder 2 Q input 4 Parallel Port F, bit 3 General-purpose I/O port Quadrature decoder 2 I input 5 Parallel Port F, bit 4 General-purpose I/O port PWM[0] output Quadrature decoder 1 Q input 6 Parallel Port F, bit 5 General-purpose I/O port PWM[1] output Quadrature decoder 1 I input 7 Parallel Port F, bit 6 General-purpose I/O port PWM[2] output Quadrature decoder 2 Q input 8 Parallel Port F, bit 7 General-purpose I/O port PWM[3] output Quadrature decoder 2 I input 9 +5 V External buffer logic supply 10 0V Common SCLK_C - All Parallel Port F lines (pins 1 to 8) are pulled up internally to +3.3 V via 100 kΩ resistors. When used as outputs, the port pins will sink up to 6 mA at a VOL of 0.4 V max. (0.2 V typ), and source up to 6 mA at a VOH of 2.2 V typ. When used as inputs, all pins are 5 V tolerant. As the outputs from Parallel Port F are compatible with 3.3 V logic, buffers may be needed when the external circuit drive requirements exceed the 2.2 V typ logic high and/or the 6 mA maximum from the Rabbit 3000. The +5 V supply output is provided for supplying interface logic. When used as inputs, the pins on header J6 do not require buffers unless the input voltage will exceed the 5 V tolerance of the processor pins. Usually, a simple resistive divider with catching diodes will suffice if higher voltage inputs are required. If the outputs are configured for open-drain operation, they may be pulled up to +5 V (while observing the maximum current, of course). 140 RabbitCore RCM3209/RCM3229 E.3 Using Parallel Port F Parallel Port F is a byte-wide port with each bit programmable for data direction and drive. These are simple inputs and outputs controlled and reported in the Port F Data Register. As outputs, the bits of the port are buffered, with the data written to the Port F Data Register transferred to the output pins on a selected timing edge. The outputs of Timer A1, Timer B1, or Timer B2 can be used for this function, with each nibble of the port having a separate select field to control this timing. These inputs and outputs are also used for access to other peripherals on the chip. As outputs, Parallel Port F can carry the four Pulse Width Modulator outputs on PF4–PF 7 (J6, pins 5–8). As inputs, Parallel Port F can carry the inputs to the Quadrature Decoders on PF0–PF3 (J6, pins 1–4). When Serial Port C or Serial Port D is used in clocked serial mode, two pins of Port F (PF0 / J6:1 and PF1 / J6:2) are used to carry the serial clock signals. When the internal clock is selected in these serial ports, the corresponding bit of Parallel Port F is set as an output. E.3.1 Parallel Port F Registers Data Direction Register—PFDDR, address 00111111 (0x3F), write-only, default value on reset 00000000. For each bit position, write a 1 to make the corresponding port line an output, or 0 to produce an input. Drive Control Register—PFDCR, address 00111110 (0x3E), Write-only, no default on reset (port defaults to all inputs). Effective only if the corresponding port bits are set as outputs, each bit set to 1 configures the corresponding port bit as open drain. Setting the bit to 0 configures that output as active high or low. Function Register—PFFR, address 00111101 (0x3D), Write-only, no default on reset. This register sets the alternate output function assigned to each of the pins of the port. When set to 0, the corresponding port pin functions normally as an output (if configured to be an output in PFDDR). When set to 1, each bit sets the corresponding pin to have the alternate output function as shown in the summary table at the end of this section. Control Register—PFCR, address 00111100 (0x3C), Write-only, default on reset xx00xx00. This register sets the transfer clock, which controls the timing of the outputs on each nibble of the output ports to allow close synchronization with other events. The summary table at the end of this section shows the settings for this register. The default values on reset transfer the output values on CLK/2. Data Register—PFDR, address 00111000 (0x38), Read or Write, no default value on reset. On read, the current state of the pins is reported. On write, the output buffer is written with the value for transfer to the output port register on the next rising edge of the transfer clock, set in the PFCR. User’s Manual 141 Table E-2. Parallel Port F Registers Register Name Port F Data Register Mnemonic PFDR Bits 0:7 Port F Control Register R/W 00111000 (0x38) Value R/W Reset Value xxxxxxxx Description Read Current state of pins Write Port buffer. Value transferred to O/P register on next rising edge of transfer clock. PFCR 00111100 (0x3C) Bits 0:1 I/O Address Value W only xx00xx00 Description 00 Lower nibble transfer clock is CLK/2 01 Lower nibble transfer clock is Timer A1 10 Lower nibble transfer clock is Timer B1 11 Lower nibble transfer clock is Timer B2 2:3 xx These bits are ignored 4:5 00 Upper nibble transfer clock is CLK/2 01 Upper nibble transfer clock is Timer A1 10 Upper nibble transfer clock is Timer B1 11 Upper nibble transfer clock is Timer B2 6:7 xx These bits are ignored Port F Function Register PFFR 00111101 (0x3D) Bits Value W xxxxxxxx Description 0:7 0 Corresponding port bits function normally 0 1 Bit 0 carries SCLK_D 1 1 Bit 1 carries SCLK_C 2:3 x No effect 4 1 Bit 4 carries PWM[0] output 5 1 Bit 5 carries PWM[1] output 6 1 Bit 6 carries PWM[2] output 7 1 Bit 7 carries PWM[3] output Port F Drive Control Register PFDCR 00111110 (0x3E) Bits 0:7 142 Value W xxxxxxxx Description 0 Corresponding port bit is active high or low 1 Corresponding port bit is open drain RabbitCore RCM3209/RCM3229 Table E-2. Parallel Port F Registers (continued) Register Name Port F Data Direction Register Mnemonic PFDDR Bits 0:7 User’s Manual Value I/O Address 00111111 (0x3F) R/W W Reset Value 00000000 Description 0 Corresponding port bit is an input 1 Corresponding port bit is an output 143 E.4 PWM Outputs The Pulse-Width Modulator consists of a 10-bit free-running counter and four width registers. Each PWM output is high for n + 1 counts out of the 1024-clock count cycle, where n is the value held in the width register. The PWM output high time can optionally be spread throughout the cycle to reduce ripple on the externally filtered PWM output. The PWM is clocked by the output of Timer A9. The spreading function is implemented by dividing each 1024-clock cycle into four quadrants of 256 clocks each. Within each quadrant, the Pulse-Width Modulator uses the eight MSBs of each pulse-width register to select the base width in each of the quadrants. This is the equivalent to dividing the contents of the pulsewidth register by four and using this value in each quadrant. To get the exact high time, the Pulse-Width Modulator uses the two LSBs of the pulse-width register to modify the high time in each quadrant according to Table E-3 below. The “n/4” term is the base count, and is formed from the eight MSBs of the pulse-width register. Table E-3. PWM Outputs Pulse Width LSBs 1st 2nd 3rd 4th 00 n/4 + 1 n/4 n/4 n/4 01 n/4 + 1 n/4 n/4 + 1 n/4 10 n/4 + 1 n/4 + 1 n/4 + 1 n/4 11 n/4 + 1 n/4 + 1 n/4 + 1 n/4 + 1 The diagram below shows a PWM output for several different width values for both modes of operation. Operation in the spread mode reduces the filtering requirements on the PWM output in most cases. n=255, normal n=255, spread (256 counts) (64 counts) (64 counts) (64 counts) (64 counts) n=256, spread (65 counts) (64 counts) (64 counts ) (64 counts) n=257, spread (65 counts) (64 counts ) (65 counts) (64 counts) n=258, spread (65 counts) (65 counts) (65 counts) (65 counts) n=259, spread n=259, normal (65 counts) (65 counts) (64 counts) (65 counts) (260 counts) Figure E-1. PWM Outputs for Various Normal and Spread Modes 144 RabbitCore RCM3209/RCM3229 E.5 PWM Registers There are no default values on reset for any of the PWM registers. Table E-4. PWM Registers PWM LSBs Register PWL0R 10001000 (0x88) PWL1R 10001010 (0x8A) PWL2R 10001100 (0x8C) PWL3R 10001110 (0x8E) Bit(s) 7:6 Address Value Write 5:1 Description The least significant two bits for the Pulse Width Modulator count are stored These bits are ignored. 0 PWM MSB x Bit(s) 7:0 User’s Manual 0 PWM output High for single block. 1 Spread PWM output throughout the cycle Register Address PWM0R Address = 10001001 (0x89) PWM1R Address = 10001011 (0x8B) PWM2R Address = 10001101 (0x8D) PWM3R Address = 10001111 (0x8F) Value write Description The most significant eight bits for the Pulse-Width Modulator count are stored With a count of n, the PWM output will be high for n +1 clocks out of the 1024 clocks of the PWM counter. 145 E.6 Quadrature Decoder The two-channel Quadrature Decoder accepts inputs via Parallel Port F from two external optical incremental encoder modules. Each channel of the Quadrature Decoder accepts an in-phase (I) and a quadrature-phase (Q) signal, and provides 8-bit counters to track shaft rotation and provide interrupts when the count goes through the zero count in either direction. The Quadrature Decoder contains digital filters on the inputs to prevent false counts and is clocked by the output of Timer A10. Each Quadrature Decoder channel accepts inputs from either the upper nibble or lower nibble of Parallel Port F. The I signal is input on an odd-numbered port bit, while the Q signal is input on an even-numbered port bit. There is also a disable selection, which is guaranteed not to generate a count increment or decrement on either entering or exiting the disable state. The operation of the counter as a function of the I and Q inputs is shown below. I input Q input Counter 00 01 02 03 04 05 06 07 08 07 06 05 04 03 02 01 00 FF Interrupt Figure E-2. Operation of Quadrature Decoder Counter The Quadrature Decoders are clocked by the output of Timer A10, giving a maximum clock rate of one-half of the peripheral clock rate. The time constant of Timer A10 must be fast enough to sample the inputs properly. Both the I and Q inputs go through a digital filter that rejects pulses shorter than two clock periods wide. In addition, the clock rate must be high enough that transitions on the I and Q inputs are sampled in different clock cycles. The Input Capture (see the Rabbit 3000 Microprocessor Users Manual) may be used to measure the pulse width on the I inputs because they come from the odd-numbered port bits. The operation of the digital filter is shown below. Peri Clock Timer A10 Rejected Accepted 146 RabbitCore RCM3209/RCM3229 The Quadrature Decoder generates an interrupt when the counter increments from 0x00 to 0x01 or when the counter decrements from 0x00 to 0xFF. Note that the status bits in the QDCSR are set coincident with the interrupt, and the interrupt (and status bits) are cleared by reading the QDCSR. Table E-5. Quadrature Decoder Registers Register Name Quad Decode Control/Status Register Mnemonic QDCSR Bit 7 (rd-only) Value Address 10010000 (0x90) Description 0 Quadrature Decoder 2 did not increment from 0xFF. 1 Quadrature Decoder 2 incremented from 0xFF to 0x00. This bit is cleared by a read of this register. 0 Quadrature Decoder 2 did not decrement from 0x00. 1 Quadrature Decoder 2 decremented from 0x00 to 0xFF. This bit is cleared by a read of this register 5 0 This bit always reads as zero. 4 (wr-only) 0 No effect on the Quadrature Decoder 2. 1 Reset Quadrature Decoder 2 to 0x00, without causing an interrupt. 0 Quadrature Decoder 1 did not increment from 0xFF. 1 Quadrature Decoder 1 incremented from 0xFF to 0x00. This bit is cleared by a read of this register. 0 Quadrature Decoder 1 did not decrement from 0x00. 1 Quadrature Decoder 1 decremented from 0x00 to 0xFF. This bit is cleared by a read of this register. 0 This bit always reads as zero. 6 (rd-only) 3 (rd-only) 2 (rd-only) 1 Bit 0 (wr-only) User’s Manual Value Description 0 No effect on the Quadrature Decoder 1. 1 Reset Quadrature Decoder 1 to 0x00, without causing an interrupt. 147 Table E-5. Quadrature Decoder Registers (continued) Register Name Quad Decode Control Register Mnemonic QDCR Bit Value Address Address = 10010001 (0x91) Description 0x Disable Quadrature Decoder 2 inputs. Writing a new value to these bits will not cause Quadrature Decoder 2 to increment or decrement. 10 Quadrature Decoder 2 inputs from Port F bits 3 and 2. 11 Quadrature Decoder 2 inputs from Port F bits 7 and 6. 5:4 xx These bits are ignored. 3:2 0x Disable Quadrature Decoder 1 inputs. Writing a new value to these bits will not cause Quadrature Decoder 1 to increment or decrement. 10 Quadrature Decoder 1 inputs from Port F bits 1 and 0. 11 Quadrature Decoder 1 inputs from Port F bits 5 and 4. 0 Quadrature Decoder interrupts are disabled. 1 Quadrature Decoder interrupt use Interrupt Priority 1. 10 Quadrature Decoder interrupt use Interrupt Priority 2. 11 Quadrature Decoder interrupt use Interrupt Priority 3. QDC1R Address = 10010100 (0x94) (QDC2R) Address = 10010110 (0x96) 7:6 1:0 Quad Decode Count Register Bit(s) 7:0 148 Value read Description The current value of the Quadrature Decoder counter is reported. RabbitCore RCM3209/RCM3229 INDEX A additional information online documentation .......... 6 B battery backup battery life ....................... 136 circuit .............................. 136 external battery connections ............................ 135 real-time clock ................ 136 reset generator ................. 137 use of battery-backed SRAM ....................................... 35 board initialization function calls ..................... 37 brdInit() ......................... 37 bus loading ............................ 59 C clock doubler ........................ 31 conformal coating ................. 66 connectivity interface kits Connector Adapter Board ... 6 Connector Adapter Board ....... 6 D Development Kit ..................... 7 AC adapter .......................... 5 DC power supply ................ 5 programming cable ............. 5 RCM3209/RCM3229 .......... 5 Getting Started instructions .............................. 5 User’s Manual digital I/O .............................. 20 I/O buffer sourcing and sinking limits ....................... 63 memory interface .............. 25 SMODE0 .................... 25, 28 SMODE1 .................... 25, 28 dimensions LCD/keypad module ......... 79 LCD/keypad template ....... 82 Prototyping Board ............. 71 RCM3209/RCM3229 ........ 54 Dynamic C .............. 6, 7, 12, 33 add-on modules ............. 7, 38 installation ....................... 7 battery-backed SRAM ...... 35 libraries RCM3200.LIB .............. 37 protected variables ............ 35 Rabbit Embedded Security Pack ...................... 6, 7, 38 sample programs ............... 16 standard features debugging ...................... 34 telephone-based technical support ...................... 6, 38 upgrades and patches ........ 38 E Ethernet cables ...................... 39 Ethernet connections ....... 39, 41 10/100Base-T .................... 41 10/100Base-T Ethernet card ....................................... 39 additional resources .......... 51 direct connection ............... 41 Ethernet cables .................. 41 IP addresses ................. 41, 43 MAC addresses ................. 44 steps ............................ 39, 40 Ethernet port ......................... 27 function calls pd_powerdown() ........... 27 pd_powerup() ................ 27 pinout ................................ 27 exclusion zone ...................... 55 external I/O bus .................... 25 F features comparison with RCM3200/RCM3220 ..... 3 Prototyping Board ....... 68, 69 RCM3209/RCM3229 ......... 2 H hardware connections ............. 8 install RCM3209/RCM3229 on Prototyping Board ..... 9 power supply ..................... 11 programming cable ........... 10 hardware reset ....................... 11 I I/O address assignments LCD/keypad module ......... 83 I/O buffer sourcing and sinking limits ............................. 63 IP addresses .......................... 43 how to set in sample programs ....................................... 48 how to set PC IP address .. 49 149 J jumper configurations RCM3209/RCM3229 ........64 JP1 (not stuffed) ............64 JP10 (PD3 or TPO+ Output on J61 pin 30) .............65 JP11 (flash memory size) .....................................65 JP12 (flash memory bank select) ....................32, 65 JP13 (data SRAM size) .65 JP14 (LED DS1 display) 65 JP2 (ACT or PD1 output on J61 pin 34) ..................64 JP3 (LINK or PD0 output on J61 pin 33) ..................64 JP4 (ENET or PE0 output on J62 pin 19) .............64 JP5 (not stuffed) ............64 JP7 (PD6 or TPO– input on J61 pin 31) ..................65 JP8 (PD7 or TPI+ input on J61 pin 32) ..................65 JP9 (PD2 or TPO– output on J61 pin 29) ..................65 jumper locations ............64 K keypad template ....................82 removing and inserting label ........................................82 L LCD/keypad module bezel-mount installation ....85 dimensions .........................79 function calls dispInit() ........................89 header pinout .....................83 I/O address assignments ....83 keypad function calls keyConfig() ...............128 keyGet() ....................130 keyInit() ....................127 keypadDef() ..............132 keyProcess() .............130 keyScan() ..................133 keyUnget() ................131 keypad template .................82 150 LCD display function calls glBackLight() .............91 glBlankRegion() .........96 glBlankScreen() ..........93 glBlock() .....................97 glBuffLock() .............107 glBuffUnlock() .........107 glDispOnOff() ............92 glDown1() .................115 glFastFillRegion() .......95 glFillCircle() .............101 glFillPolygon() .........100 glFillRegion() .............94 glFillScreen() ..............93 glFillVPolygon() .........99 glFontCharAddr() .....103 glGetBrushType() .....109 glGetPfStep() ............104 glHScroll() ................116 glInit() .........................91 glLeft1() ....................112 glPlotCircle() ............101 glPlotDot() ................111 glPlotLine() ...............111 glPlotPolygon() ...........98 glPlotVPolygon() ........97 glPrintf() ...................106 glPutChar() ...............105 glPutFont() ................103 glRight1() .................113 glSetBrushType() .....108 glSetContrast() ............92 glSetPfStep() .............104 glSwap() ...................108 glUp1() .....................114 glVScroll() ................117 glXFontInit() .............102 glXGetBitmap() ........109 glXGetFastmap() ......110 glXPutBitmap() ........118 glXPutFastmap() .......119 TextBorder() .............122 TextBorderInit() .......121 TextCursorLocation() 123 TextGotoXY() ..........122 TextMaxChars() .......126 TextPrintf() ...............125 TextPutChar() ...........124 TextWinClear() .........126 TextWindowFrame() 120 LEDs function calls .................90 displedOut() ................90 mounting instructions ........84 remote cable connection ....87 removing and inserting keypad label ...............................82 sample programs ...............88 voltage settings ..................81 LEDs (RCM3209/RCM3229) other LEDs ........................25 M MAC addresses .....................44 mass storage options ...............2 motor control applications ....75 motor control option quadrature decoder ..........146 mounting instructions LCD/keypad module .........84 P physical mounting .................57 pinout Ethernet port ......................27 LCD/keypad module .........83 Prototyping Board .............73 RCM3209 alternate configurations .22 RCM3209 headers .............20 power supplies +3.3 V ..............................135 battery backup .................135 optional +5 V output .......137 power supply connections ........................11 Program Mode .......................29 switching modes ................29 programming cable .............139 PROG connector ...............29 RCM3209/RCM3229 connections ...................10 programming port .................28 Prototyping Board .................68 adding RS-232 transceiver 74 dimensions .........................71 expansion area ...................69 features ........................68, 69 J6 pinout ...........................140 motor encoder connector pinout ............................75 RabbitCore RCM3209/RCM3229 Prototyping Board (cont’d) mounting RCM3209/RCM3229 ..... 9 pinout ................................ 73 power supply ..................... 72 power supply connections . 11 prototyping area ................ 73 specifications .................... 72 use of parallel ports ........... 76 PWM outputs ...................... 144 PWM registers .................... 145 Q quadrature decoder .............. 146 quadrature decoder registers 147 R Rabbit 3000 data and clock delays ........ 61 Parallel Port F Registers . 141 Parallel Port F registers ... 142 PWM outputs .................. 144 PWM registers ................ 145 quadrature decoder registers .............................. 147 spectrum spreader time delays ....................................... 61 Rabbit subsystems ................ 21 RCM3209/RCM3229 comparison with RCM3200/RCM3220 ..... 3 mounting on Prototyping Board .............................. 9 real-time clock battery backup ................. 136 reset ....................................... 11 Run Mode ............................. 29 switching modes ............... 29 S sample programs ................... 16 getting to know the RCM3209 CONTROLLED.C ........ 16 FLASHLED1.C ............ 16 FLASHLED2.C ............ 16 IR_DEMO.C ................. 16 TOGGLESWITCH.C .... 16 how to run TCP/IP sample programs ................. 47, 48 how to set IP address ........ 48 User’s Manual LCD/keypad KEYPADTOLED.C ...... 88 LCDKEYFUN.C ........... 88 SWITCHTOLED.C ...... 88 LCD/keypad module ......... 88 PONG.C ............................ 12 serial communication FLOWCONTROL.C ..... 17 PARITY.C .................... 17 SIMPLE3WIRE.C ........ 17 SIMPLE485MASTER.C 18 SIMPLE485SLAVE.C .. 18 SIMPLE5WIRE.C ........ 17 SWITCHCHAR.C ........ 18 TCP/IP BROWSELED.C .......... 50 DISPLAY_MAC.C ....... 44 ECHOCLIENT.C .......... 50 ECHOSERVER.C ......... 50 ENET_AD.C ................. 50 ENET_MENU.C ........... 51 MBOXDEMO.C ........... 51 PINGLED.C .................. 51 PINGME.C .................... 50 SMTP.C ........................ 51 serial communication ............ 26 drivers ............................... 36 libraries PACKET.LIB ................ 36 RS232.LIB .................... 36 serial ports ............................. 26 Ethernet port ..................... 27 programming port ............. 28 software .................................. 6 digital I/O I/O drivers ..................... 35 external I/O bus ................. 25 libraries KEYPAD7.LIB ........... 127 LCD122KEY7.LIB . 89, 90 RCM3200.LIB ........ 36, 37 specifications ........................ 53 bus loading ........................ 59 digital I/O buffer sourcing and sinking limits ................ 63 dimensions ........................ 54 electrical, mechanical, and environmental ................... 56 exclusion zone ................... 55 header footprint ................. 58 headers .............................. 57 specifications (continued) LCD/keypad module dimensions .................... 79 electrical ........................ 80 header footprint ............. 80 mechanical .................... 80 relative pin 1 locations .. 80 temperature ................... 80 physical mounting ............. 57 Prototyping Board ............. 72 Rabbit 3000 DC characteristics ................................ 62 Rabbit 3000 timing diagram ....................................... 60 relative pin 1 locations ...... 58 spectrum spreader ................. 61 subsystems digital inputs and outputs .. 20 switching modes ................... 29 T TCP/IP software libraries ......................... 36 TCP/IP drivers ...................... 36 TCP/IP primer ....................... 41 technical support ................... 13 troubleshooting changing COM port .......... 12 connections ....................... 12 U user block flash memory addresses .... 32 function calls readUserBlock() ............ 32 writeUserBlock() ........... 32 151 152 RabbitCore RCM3209/RCM3229 SCHEMATICS 090-0253 RCM3209 Schematic www.rabbit.com/documentation/schemat/090-0253.pdf 090-0137 Prototyping Board Schematic www.rabbit.com/documentation/schemat/090-0137.pdf 090-0156 LCD/Keypad Module Schematic www.rabbit.com/documentation/schemat/090-0156.pdf 090-0252 USB Programming Cable Schematic www.rabbit.com/documentation/schemat/090-0252.pdf You may use the URL information provided above to access the latest schematics directly. User’s Manual 153