Rabbit RabbitCore RCM4200 User Manual

RabbitCore RCM4200
C-Programmable Analog Core Modul e
with Serial Flash and Ether net
User’s Manual
019–0159 090508–E
Part Number 019-0159 • 090508–E • Prin ted in U .S.A .
©2006–2009 Digi International Inc. • All right s rese rved.
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 n otice.
T r ade mark s
Rabbit, RabbitCore, and Dynamic C are registered trademarks of Digi International Inc.
Rabbit 4000 is a trademark of Digi International Inc.
The latest revision of this manual is available on the Rabbit Web s ite, www.rabb it.com, for free, unregistered download.
Digi International Inc.
www.rabbit.com
RabbitCore RCM4200

TABLE OF CONTENTS

Chapter 1. Introduction 1
1.1 RCM4200 Features...............................................................................................................................2
1.2 Advantages of the RCM4200 ...............................................................................................................4
1.3 Development and Evaluation Tools......................................................................................................5
1.3.1 RCM4200 Development Kit.........................................................................................................5
1.3.2 Software........................................................................................................................................6
1.3.3 Online Documentation..................................................................................................................6
Chapter 2. Getting Started 7
2.1 Install Dynamic C.................................................................................................................................7
2.2 Hardware Connections..........................................................................................................................8
2.2.1 Step 1 — Prepare the Prototyping Board for Development..........................................................8
2.2.2 Step 2 — Attach Module to Prototyping Board............................................................................9
2.2.3 Step 3 — Connect Programming Cable......................................................................................10
2.2.4 Step 4 — Connect Power............................................................................................................11
2.3 Run a Sample Program.......................................................................................................................12
2.3.1 Troubleshooting..........................................................................................................................12
2.4 Where Do I Go From Here? ...............................................................................................................13
2.4.1 Technical Support.......................................................................................................................13
Chapter 3. Running Sample Programs 15
3.1 Introduction.........................................................................................................................................15
3.2 Sample Programs................................................................................................................................16
3.2.1 Use of Serial Flash......................................................................................................................18
3.2.2 Serial Communication.................................................................................................................19
3.2.3 A/D Converter Inputs (RCM4200 only).....................................................................................22
3.2.3.1 Downloading and Uploading Calibration Constants.......................................................... 23
3.2.4 Real-Time Clock.........................................................................................................................25
Chapter 4. Hardware Reference 27
4.1 RCM4200 Digital Inputs and Outputs................................................................................................28
4.1.1 Memory I/O Interface.................................................................................................................34
4.1.2 Other Inputs and Outputs............................................................................................................34
4.2 Serial Communication ........................................................................................................................35
4.2.1 Serial Ports..................................................................................................................................35
4.2.1.1 Using the Serial Ports......................................................................................................... 36
4.2.2 Ethernet Port ...............................................................................................................................37
4.2.3 Programming Port.......................................................................................................................38
4.3 Programming Cable............................................................................................................................39
4.3.1 Changing Between Program Mode and Run Mode....................................................................39
4.3.2 Standalone Operation of the RCM4200......................................................................................40
User’s Manual
4.4 A/D Converter (RCM4200 only).......................................................................................................41
4.4.1 A/D Converter Power Supply.....................................................................................................43
4.5 Other Hardware..................................................................................................................................44
4.5.1 Clock Doubler ............................................................................................................................44
4.5.2 Spectrum Spreader......................................................................................................................44
4.6 Memory..............................................................................................................................................45
4.6.1 SRAM.........................................................................................................................................45
4.6.2 Flash EPROM.............................................................................................................................45
4.6.3 Serial Flash.................................................................................................................................45
Chapter 5. Software Reference 47
5.1 More About Dynamic C .....................................................................................................................47
5.2 Dynamic C Function Calls................................................................................................................49
5.2.1 Digital I/O...................................................................................................................................49
5.2.2 Serial Communication Drivers...................................................................................................49
5.2.3 User Block..................................................................................................................................49
5.2.4 SRAM Use..................................................................................................................................50
5.2.5 RCM4200 Cloning.....................................................................................................................50
5.2.6 Serial Flash Drivers....................................................................................................................51
5.2.7 Prototyping Board Function Calls..............................................................................................52
5.2.7.1 Board Initialization............................................................................................................ 52
5.2.7.2 Alerts.................................................................................................................................. 53
5.2.8 Analog Inputs (RCM4200 only).................................................................................................54
5.3 Upgrading Dynamic C .......................................................................................................................71
5.3.1 Add-On Modules........................................................................................................................71
Chapter 6. Using the TCP/IP Features 73
6.1 TCP/IP Connections...........................................................................................................................73
6.2 TCP/IP Primer on IP Addresses.........................................................................................................75
6.2.1 IP Addresses Explained..............................................................................................................77
6.2.2 How IP Addresses are Used.......................................................................................................78
6.2.3 Dynamically Assigned Internet Addresses.................................................................................79
6.3 Placing Your Device on the Network ................................................................................................80
6.4 Running TCP/IP Sample Programs....................................................................................................81
6.4.1 How to Set IP Addresses in the Sample Programs .....................................................................82
6.4.2 How to Set Up your Computer for Direct Connect....................................................................83
6.5 Run the PINGME.C Sample Program................................................................................................84
6.6 Running Additional Sample Programs With Direct Connect............................................................84
6.7 Where Do I Go From Here?...............................................................................................................85
Appendix A. RCM4200 Specifications 87
A.1 Electrical and Mechanical Characteristics ........................................................................................88
A.1.1 A/D Converter...........................................................................................................................92
A.1.2 Headers......................................................................................................................................93
A.2 Rabbit 4000 DC Characteristics........................................................................................................94
A.3 I/O Buffer Sourcing and Sinking Limit.............................................................................................95
A.4 Bus Loading ......................................................................................................................................95
A.5 Conformal Coating............................................................................................................................98
A.6 Jumper Configurations......................................................................................................................99
Appendix B. Prototyping Board 101
B.1 Introduction .....................................................................................................................................102
B.1.1 Prototyping Board Features.....................................................................................................103
B.2 Mechanical Dimensions and Layout...............................................................................................105
B.3 Power Supply...................................................................................................................................106
RabbitCore RCM4200
B.4 Using the Prototyping Board............................................................................................................107
B.4.1 Adding Other Components.......................................................................................................109
B.4.2 Measuring Current Draw..........................................................................................................109
B.4.3 Analog Features (RCM4200 only)...........................................................................................110
B.4.3.1 A/D Converter Inputs...................................................................................................... 110
B.4.3.2 Thermistor Input.............................................................................................................. 112
B.4.3.3 A/D Converter Calibration.............................................................................................. 112
B.4.4 Serial Communication..............................................................................................................113
B.4.4.1 RS-232............................................................................................................................. 114
B.5 Prototyping Board Jumper Configurations ......................................................................................115
Appendix C. Power Supply 119
C.1 Power Supplies.................................................................................................................................119
C.1.1 Battery Backup.........................................................................................................................119
C.1.2 Battery-Backup Circuit.............................................................................................................120
C.1.3 Reset Generator........................................................................................................................121
Index 123
Schematics 127
User’s Manual
RabbitCore RCM4200

1. INTRODUCTION

The RCM4200 series of RabbitCore modules is one of the next generation of core modules that tak e advantage of n ew Rabbit
4000 features such as hardware DMA, clock speeds of up to 60 MHz, I/O lines shared with up to six serial ports and four levels of alternate pin functions that include variable-phase PWM, auxiliary I/O, quadrature decoder, and input capture. Coupled with more than 500 new opcode instructions that help to reduce code size and improve processing speed, this equates to a core module that is fast, effi cient, and the ideal solution for a wide range of embedded applications. The RCM4200 also features an integrated 1 0/100Base-T Etherne t port, an A/D converter, and a serial flash memory for mass storage.
Each production mode l has a Developmen t Kit with th e essential s that you need to design your own microproces sor-based system,
®
and includes a comp lete Dynamic C software development sys­tem. The Development Kits also contains a Prototyping Board that will allow you to evaluate the specific RCM4200 module and to prototype circuits that interface to the module. You will also be able to write and test software for the RCM4200 modules.
Throughout this manual, the term RCM4200 refers to the complete series of RCM4200 RabbitCore modules unless other production models are referred to specifically.
The RCM4200 has a Rabbit 4000 microprocessor operating at up to 58.98 MHz, static RAM, flash memory, serial flash mass-storage option, an 8-channel A/D converter, two clocks (main oscillator and timekeeping), and the circuitry necessary for reset and man­agement of battery backup of the Rabbit 4000’s internal real-time clock and 512K of static RAM. One 50-pin header brings out the Rabbit 4000 I/O bus lines, parallel ports, A/D converter channels, and serial ports.
The RCM4200 receives its +3.3 V power from the customer-supplied motherboard on which it is mounted. The RCM4200 can interface with all kinds of CMOS-compatible digital devices through the motherboard.
User’s Manual 1

1.1 RCM4200 Features

Small size: 1.84" × 2.42" × 0.84" (47 mm × 61 mm × 21 mm)
Microprocessor: Rabbit 4000 running
at up to 58.98 MHz
Up to 33 general-purpose I/O lines configurable with up to four alternate functions
3. 3 V I/O li nes wi th low-p ow er mo des dow n to 2 kH z
Up to six CMOS-compatible serial ports — f
our ports are configurable as a clocked
serial ports (SPI), and two ports are configurable as SDLC/HDLC serial ports.
Combinations of up to eight single-ended or four differential 12-bit analog inputs (RCM4200 only)
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
512K flash memory, 512K SRAM, and a fixed mass-storage flash-memory option that may be used with the standardized directory structure supported by the Dynamic C F AT File System module
Real-time clock
Watchdog supervisor
2 RabbitCore RCM4200
There are two RCM4200 production models. Table 1 summarizes their main features.
Table 1. RCM4200 Features
Feature RCM4200 RCM4210
Microprocessor Data SRAM 512K
Fast Program-Execution SRAM
Flash Memory (program) 512K Flash Memory
(mass data storage) A/D Converter 12 bits
4 high-speed, CMOS-compatible ports:
all 4 configurable as asynchro-
1 asynchronous clocked serial
Serial Ports
1 clo cked serial port shared with
®
Rabbit
4000 at 58.98 MHz Rabbit® 4000 at 29.49 MHz
512K
8 Mbytes (serial flash) 4 Mbytes (serial flash)
5 high-speed, CMOS-compatible ports:
all 5 configurable as asynchro-
nous (with IrDA), 4 as clocked serial (SPI)
port shared with programming port
nous (with IrDA), 4 as clocked serial (SPI), and 1 as SDLC/HDLC
1 clo cked serial port shared with
serial flash
1 asynchronous clocked serial
serial flash
port dedicated for programming
1 clo cked serial port shared with
A/D converter
The RCM4200 is programmed over a stan dard P C USB por t thr ough a pro gramm ing cabl e supplied with the Development Kit.
NOTE: The RabbitLink cannot be used to program RabbitCore modules based on the
Rabbit 4000 microprocessor.
Appendix A provides detailed specifications for the RCM4200.
User’s Manual 3

1.2 Advantages of the RCM4200

Fast time to market using a fully engineered, “ready-to-run/ready-to-program” micro­processor core.
Compe tit ive prici ng whe n co mpare d with the alte rnati v e of purcha sing a nd asse mbli ng individual components.
Easy C-language program development and debugging
Rabbit Field Utility to download compiled Dynamic C .bin files, 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.
4 RabbitCore RCM4200

1.3 Development and Evaluation Tools

1.3.1 RCM4200 Development Kit

The RCM4200 Development Kit contains the hardware essentials you will need to use the RCM4200 module. The items in the Development Kit and their use are as follows.
RCM4200 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). Development Kits sold in North America ma y contain an AC adapter with only a North American style plug.
USB programming cable with 10-pin header.
10-pin header to DB9 serial cable.
Dynamic C® CD-ROM, with complete product documentation on disk.
Getting Started instructions.
A bag of accessory parts for use on the Prototyping Board.
Rabbit 4000 Processor Easy Reference poster.
Registration card.
DIAG
PROG
Getting Started
Programming
Cable
RabbitCore RCM4200
The RCM4200 RabbitCore module features an onboard A/D converter and 10/100Base-T Ethernet, allow­ing you to create a low-cost, low-power, network as part of your control solution for your embedded application. These Getting Started instructions included with the Development Kit will help you get your RCM4200 up and running so that you can run the sample programs to explore its capabilities and develop your own applications.
Development Kit Contents
The RCM4200 Development Kit contains the following items:
RCM4200 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). Development Kits sold in North America may contain an AC adapter with only a North American style plug.
USB programming cable with 10-pin header.
10-pin header to DB9 serial cable.
®
Dynamic C
CD-ROM, with complete product documentation on disk.
Getting Started instructions.
Plastic and metal standoffs with 4-40 screws and washers.
A bag of accessory parts for use on the Prototyping
Board.
Rabbit 4000 Processor Easy Reference poster.
Registration card.
Visit our online Rabbit store at www.rabbit.com/store/ for the latest information on peripherals and accessories that are available for all RCM4200 RabbitCore module models.
Rabbit and Dynamic C are registered trademarks of Rabbit Semiconductor Inc.
Installing Dynamic C
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 pro- gram in the root directory of the Dynamic C CD. Install any Dynamic C modules after you install Dynamic C
Instructions
Universal
AC Adapter
with Plugs
Accessory Parts for
Prototyping Board
PWR
R 1
J1
U1
DS1
2
C1
R
GND
GND
1 D
C2
1 P
J
4
3
V
C
C
C5
9 1
C
C15
Q1
R29
R20
C4
C5
U3
2 1 C
U6
5 6
C21
C1
U2
8 1 R
R8R6R4R3R5R
R37 R21
0
1
C8C7C
C
U5
1 6
X R
J3
R22
L1
JP16 JP6
7
C18
1
JP5
0
C
2
JP12
C
U3
JP4
JP3
JP14
JP8
C16
JP7 JP18 JP9
JP10
R25
6 2 R
PC3
PC5
PC7
80
5
9
1
1
0
2
7
1
1
1
2
2
2
1
P
P
P
P
P
P
P
J
J
J
J
J
J
J
PE1
3 1 P
J
PE3
6
4
3
5
7
R19
1
1
1
1
1
R
R
R
R
R
PE5
PE6
7
R9
PD0
PE7
LN0
PD1
PD2
C53
LN1
LN2
9
3
1 1
1
U9
C
C
PD4
PD3
C6C7R4
LN4
LN3
41 R
PD6
PD5
LN6
LN5
JP3
PD7
CVT
LN7
D
N
C17
VREF
AGND
G
C18
A
C52
N
N
N
F
I
I
I
E
7
5
3
R
N
N
N
L
V
L
L
L
C56
R23
41
T
D
N
N
N
N
I
I
I
I
V
N
0
2
4
6
C
G
N
N
N
N
A
L
L
L
L
Serial Cable
®
.
1
C8
U1
R1
R10
R2
R3
RX43
R38
4
J1
7
1
4
3
4
TP2
2
2
C
X
C3
P
P
R
J
J
U4
RX97
RX59
RX57
RX55
RX49
3
1
3
4
R13
X
X
C9
R5
U
U
C10
R6
C11
R7
2
1
4
3
C12
R8
X
9
X
C13
R9
8
U
U
C14
R10
X
R
C15
R11
7
X
3
RP1
C16
R12
R
X
20
U
R
JP4
3
UX3
6
JP5
X
JP6
40
L1
C20
R
3
.
J2
3
2
+
D
C6
2 U
PB1
PB3
PB5
PB7
PC1
PC4
PC6
PE0
PE2
PE4
D N I
N
1
G
N
A
2 1
R
1 1
R
+5 V
2 P
GND
J
GND
/RST_OUT
/IORD
+3.3 V
RCM1
/IOWR
/RST_IN
VBAT
PA0
EXT
PA1
PA2
PA3
PA4
PA5
PA6
PA7
PB0
PB2
PB4
PB6
PC0
PC2
5
8 X R
RX75
CX25
DS2
JP25
9 2
CX27
RX73
X C
RX77
RX79
CX23
DS3
R21
UX16
R22
R24
R23
8
7
GND
1
1
2
2
R
R
GND
GND
S3S2
1
S1
BT1
RESET
C
D
UX49
UX47
RX83
RX11
5
4 X U
UX10
7 1
RX67
X C
UX12
UX14
X
UX4
X
R
T
D
C
X
X
R
T
D N G
4 J
9 2
X
RX81
U
7 8 X R
1
4 X C
9
3 X C
UX30
Prototyping Board
Figure 1. RCM4200 Development Kit
User’s Manual 5

1.3.2 Software

The RCM4200 is programmed using version 10.09 or later of Dynamic C. A compatible
version is included on the Development Kit CD-ROM.
Rabbit Semiconductor also offers add-on Dynamic C modules containing the popular µC/OS-II real-time operating system, the FAT file system, as well as PPP, Advanced Encryption Standard (AES), and other select libraries. In addition to the Web-based technical support included at no extra charge, a one-year telephone-based technical support module is also available for purchase. Visit our Web site at www.rabbit.com or contact your Rabbit Semiconductor sales representative or authorized distributor for further information.

1.3.3 Online Documentation

The online documentation is installed along with Dynamic C, and an icon for the docu­mentation 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 RCM4200

2. GETTING S TARTED

This chapter describes the RCM4200 hardware in more detail, and explains how to set up and use the accompanying Prototyping Board.
NOTE: This chapter (and thi s manual) assume that you have t he RCM4200 Development
Kit. If you purchased an RCM4200 module by itself, you will have to adapt the infor­mation in this chapter and elsewhere to your test and development setup.

2.1 Install Dynamic C

To develop and de bu g programs for the RCM4200 se ries of mod ule s ( and for all ot h er Rabbit Semiconductor hardware), you must install and use Dynamic C.
If you have not yet installed Dynamic C version 10.09 (or a later version), 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 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 c ommunica te with the tar get developme nt syste m. The installation allows you to choose the COM port that will be used. The default selec­tion is COM1. You may select any available port for Dynamic C’s use. If you are not cer­tain which port is available, select COM1. This selection can be changed later within Dynamic C.
NOTE: The installation utility does not check the selected COM port in any way. Speci-
fying a port in u se by a nother 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 new icons on your PC desk­top. One icon is for Dynamic C, another 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 any of the optional Dynamic C modules, install them after installing Dynamic C. The modules may be installed in any order. You must install the modules 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. Prepare the Prototyping Board for Development.
2. Attach the RCM4200 module to the Prototyping Board.
3. Connect the programming cable between the RCM4200 and the PC.
4. Connect the power supply to the Prototyping Board.

2.2.1 Step 1 — Prepare the Prototyping Board for Development

Snap in four of the plastic standoffs supplied in the bag of accessory parts from the Devel­opment Kit in the holes at the corners as shown in Figure 2.
PWR
R
1
1 D
C5
L1
C6
2 U
JP16
JP6
C18
17
JP5
C
20
JP12
C
U3
JP4
JP3
JP14
JP8
C16
JP7
JP18
JP9
JP10
19
C
R25
C15
26
R
Q1
R29
JP11JP15JP19JP21JP22
R20
R18R16R14R13R15R
R10
RX43
47 X R
RX97
RX49
X33U
U
31 X
89 X R
UX3
R8R6R4R3R5R
10
C8C7C
23
C14C12C
JP24JP
RX59
RX57
RX55
41
61
X
X
U
R
42 X
U
65
X
37
R
X U
63 X
R
PC1
PC3
PC5
PC7
JP20
JP17
PE1
13
JP
PE3
R19
17
PE5
7
R9
PE7
PD1
LN1
LN2
9
11
13
C
C
PD4
PD3
LN4
LN3
PD6
PD5
LN6
LN5
PD7
CVT
LN7
VREF
AGND
F E
7INLN5INLN3INLN1IN
R
V
LN
J3
T
D
V
N
6INLN4INLN2INLN0IN
C
AG
LN
J1
U1
DS1
C1
GND
GND
C2
JP 3
C
2 D
2
JP
/RST_OUT
RCM1
/IOWR
VBAT EXT
PA1
PA3
PA5
PA7
PB1
PB2
PB3
PB4
PB5
PB6
PB7
PC0
PC2
PC4
PC6
PE0
PE2
PE4
PE6
PD0
LN0
PD2
D
N G A
D N G
A
11
R
2 R
1
4 C
J2
3.3 V +
GND
/IORD
/RST_IN
PA0
PA2
PA4
PA6
PB0
RX75
CX25
DS2
JP25
12
R
UX47
+5 V
GND
+3.3 V
85
RX
CX27
RX73
R23
RX79
RX77
CX23
DS3
R21
R22
R24
GND
1
1
28
R27R
GND
S3S2
1
S1
BT1
RESET
D
UX49
UX4
RX81
X R
RX83
39 X C
RX11
X45 U
RX67
X C
GND
UX10
X17
C
UX12
UX14
29
UX16
XC
TX
R
C XD R
TX
D
N
G
J4
29
UX
87
X41
C
UX30
Figure 2. Insert Standoffs
8 RabbitCore RCM4200
2.2.2 Step 2 — Attach Module to Prototyping Board
Turn the RCM4200 module so that the mounting holes line up with the corresponding holes on the Prototyping Board. Insert the metal standoffs as shown in Figure 3, secure them from the bottom using two screws and washers, then insert the module’s header J2 on the bottom side into socket RCM1 on the Prototyping Board.
Insert standoffs between mounting holes and Prototyping Board.
RCM4200
Line up mounting holes with holes on Prototyping Board.
C58
C67
J3
C88
C81
C57
R34
U13
R35
R33
R32
C65
C87
DS1
C24
LINK
JP16
R47
FDX
R49
R13
DS3
DS2
R48
C25
R52
SPEED
C19
R50
C26
C20
R4
C31
C33
C32
C34
C30
C35
C36
C37
C38
R18
R21
R19
U7
R15
C23
R23
U6
R22 C28 C29
L7
C5
C77
Q3
Y4
R14
R12
U4
R36
Q1
C85
U3
R29
C18
C7
C8
C9
C10
C6
C11
C12
U5
JP8
C13 C14
U2
C39
R9
D1
R10
R1
C21
C15
C27
R27
Y2
R11
R16
C43
L2
Y3
4
3
C82
1
R31
R20
C72
C78
JP14
JP15
U14
JP13
C74
U15
J1
R3
R51
R2
R5
C76
R41
R40
C75
JP11
JP10
JP12
JP1
JP2
JP9
JP6
JP7
JP3
JP5
D1
C17
C16
JP4
C3
C2
R8
C86
L1
R7
C1
U1
R46
R44
R45
R39
R43
R42
RX43
RX47
RX97
PWR
R1
R6
C5
L1
C6
C18
U3
C19 C20
C15
Q1
R29
RX55
RX49
UX33UX31
RX89
UX3
C17
C16
R25
JP24
UX41
UX37 UX42
JP16
JP6 JP5
JP12
JP4 JP3
JP14
JP8 JP7
JP18
JP9
JP10
R26
R20
R10
JP23
RX57
DS1
GND
C2
U2
RCM1
JP11
JP15
JP19
JP21
R18
R16
R14
R8R6R4R3R5
C8C7C9
C14
C12
C10
RX59
RX63
J1
U1
C1
GND
D2
RCM1
JP22
JP20
R13
R15
RX61
RX65
R2
JP1
C4
C3
J2
+3.3 V
JP2
/RST_OUT
/IOWR
VBAT
EXT
PA1
PA3
PA5
PA7
PB1
PB3
PB5
PB7
PC1
PC3
PC5
PC7
JP17
PE1
JP13
PE3
R19
R17
PE5
R9
R7
PE7
PD1 LN1
C11
C13
PD3 LN3
PD5 LN5
PD7 LN7
VREF
J3
UX47
+5 V
GND
GND
/IORD
+3.3 V
/RST_IN
PA0
PA2
PA4
PA6
PB0
PB2
PB4
PB6
PC0
PC2
PC4
PC6
PE0
PE2
PE4
PE6
PD0 LN0
PD2 LN2
PD4 LN4
PD6 LN6
CVT
AGND
AGND
VREF
LN7IN
LN5IN
LN3IN
LN1IN
AGND
CVT
AGND
LN6IN
LN4IN
LN2IN
LN0IN
1
S1
BT1
RESET
UX49
UX4
RX75
CX27
RX73
CX25
RX77
CX23
DS3
DS2
R21
JP25
R23
R12
R11
1
R27
RXD TXD
TXC RXC
GND
RX81
RX83
RX11
UX45
RX67
RX85
RX79
R22
R24
1
R28
GND
S3S2
J4
UX29
RX87
CX41
CX39
UX30
UX10
CX17
UX12
UX14
CX29
UX16
GND
GND
Figure 3. Install the Module on the Prototyping Board
NOTE: It is important that you line up the pins on header J2 of the module exactly with
socket RCM1 on the Pr ototyp ing Boa rd. The header pins may bec ome b ent or da maged if the pin alignment is offset, and the module will not work. Permanent electrical dam­age to the module may also result if a misaligned module is powered up.
Press the module’s pins gently into the Prototyping Board socket—press down in the area above the header pins. For additional integrity, you may secure the RCM4200 to the stand­offs from the top using the remaining two screws and washers.
User’s Manual 9

2.2.3 Step 3 — Connect Programming Cable

The programming cable connects the module to the PC running Dynamic C to download programs and to monitor the module during debugging.
Connect the 10-pin connector of the programming cable labeled
PROG to header J1 on
the RCM4200 as shown in Figure 4. 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.)
Remove slot cover,
1
insert tab into slot
Assemble
AC Adapter
Snap plug into place
2
AC Adapter
3-pin
power connector
Programming
Cable
To
or USB port
PC COM port
PROG
Colored
edge
J1
J1
PWR
R1
J1
U1
DS1
C1
D1
C5
J3
DS1
C24
LINK
JP16
R47
FDX
Y4
R49
R13
R14
DS3
R12
U4
DS2
R48
C25
R52
SPEED
R50
C31
C33
C32
C34
C30
C35
C36
C37
C38
R19
C23
C28 C29
Q1
C19
U3
C26
C18
C20
R4
C7
C11
RX43
C12
U5
RX47
R18
R21
RX97
U7
R10
R1
C21
RX49
C27
R15
R23
U6
R22
Y2
R11
R16
RX89
GND
C2
DIAG
L1
D2
C6
C58
L2
Y3
4
3
C67
C88
U3
C19 C20
C5
R36
R29
C8
C9
C10
C6
C13 C14 C39
D1
UX33UX31
UX3
U2
C82
C81
1
R3
C57
R31
R20
R34
JP16
R51
JP6
U13
R5
C18
C76
JP5
C17
R35
JP12
JP4 JP3
R33
JP14
JP8
R32
C65
C16
JP7
R41
R40
JP18
C72
C75
JP9
C87
JP10
JP11
L7
JP10
R25
C78
JP12
C77
Q3
C15
R9
JP1
R26
JP14
Q1
JP2
JP15
JP9
U14
C85
JP6
JP13
R29
JP7
JP11
JP15
JP19
JP21
JP22
JP3
JP5
R20
C17
C16
C74
JP4
C3
C2
R18
R16
R14
R13
R10
U15
R8R6R4R3R5
C86
L1
C8C7C9
C14
C12
C10
JP8
JP24
JP23
U2
RX59
R7
C1
U1
RX57
RX55
C15
R44
R27
UX41
R39 R42
UX37 UX42
RX63
C43 RCM1
JP20
R15
GND
R17
R8
R7
R46 R45
RX61
R43
RX65
JP1
C3
JP2
/RST_OUT
/IOWR
PROG
VBAT
EXT
PA1
J1
PA3
R2
PA5
PA7
PB1
PB3
PB5
PB7
PC1
PC3
PC5
PC7
JP17
PE1
JP13
PE3
R19
PE5
R6
R9
PE7
PD1 LN1
C11
C13
PD3
PD5
PD7
VREF
R2
C4
J2
+3.3 V
LN3
LN5
LN7
J3
UX47
+5 V
GND
GND
/IORD
+3.3 V
/RST_IN
PA0
PA2
PA4
PA6
PB0
PB2
PB4
PB6
PC0
PC2
PC4
PC6
PE0
PE2
PE4
PE6
PD0 LN0
PD2 LN2
PD4 LN4
PD6 LN6
CVT
AGND
AGND
VREF
LN7IN
LN5IN
LN3IN
LN1IN
AGND
CVT
AGND
LN6IN
LN4IN
LN2IN
LN0IN
RESET
1
S1
BT1
RESET
UX49
UX4
RXD TXD
TXC RXC
GND
RX81
RX83
RX11
RX67
RX75
CX25
DS2
JP25
R12
R11
RX85
CX27
RX73
RX77
RX79
CX23
DS3
R21
R22
R24
R23
1
R27
R28
GND
S3S2
J4
UX29
RX87
CX41
CX39
UX30
UX45
UX10
CX17
UX12
UX14
CX29
UX16
GND
1
GND
Figure 4. Connect Programming Cable and Power Supply
NOTE: Never disconnect the programming cable by pulling on the ribbon cable.
Carefully pull on the connector to remove it from the header.
NOTE: Either a serial or a USB programming cable was supplied with the Development
Kit. If you have a serial programming cable, an RS-232/USB converter (Rabbit Part No. 20-151-0178) is available to allow you to use the serial programming cable with a USB port.
Depending on the programming cable, connect the other end to a COM port or a USB port on your PC.
10 RabbitCore RCM4200
If you are using a USB programming cable, your PC should recognize the new USB hard­ware, and the LEDs in the shrink-wrapped area of the programming cable will flash — if you get an error message, 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.

2.2.4 Step 4 — Connect Power

Once all the other connections have been made, you can connect power to the Prototyping Board.
If you have the universal AC adapter , prepare the AC adapter for the country where it will be used by selecting the appropriate plug. 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 plug until it clicks into place.
Connect the AC adapter to 3-pin header J1 on the Prototyping Board as shown in Figure 4 above. The connector may be attached either way as long as it is not offset to one side— the center pin of J1 is always connected to the positive terminal, and either edge pin is ground.
Plug in the AC adapter. The PWR LED on the Prototyping Board next to the power con­nector at J1 should light up. The RCM4200 and the Prototyping Board are now ready to be used.
NOTE: A RESET button is provided on the Pro totyping Boar d next to t he batter y holder
to allow a hardware reset without disconnecting power.
To power down the Prototyping Board, unplug the power connector from J1. You should disconnect power before making any circuit adjustments in the prototyping area, changing any connections to the board, or removing the RCM4200 from the Prototyping Board.
User’s Manual 11

2.3 Run a Sample Program

Once the RCM4200 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. For the
RCM4200 model, select Co de and B I OS in Fla sh , Ru n in RAM on the “C ompiler ” tab in the Dynamic C Options > Project Options menu. (Select Code and BIOS in Flash
RCM4210.) Click OK. If you are using a USB port to connect your computer to the RCM4200, click on the
“Communications” tab and verify that Use USB to Serial Converter is selected to sup- port the USB programming cable. Click OK. You may have to determine which COM port was assigned to the RS-232/USB converter. Open Control Panel > System > Hardware >
Device Mana ger > Ports
In Dynamic C, select
Communications tab, then click OK. You may type the COM port number followed by Enter on your computer keyboard if the COM port number is outside the range on the
and identify which COM port is used for the USB connection.
Options > Project Options, then select this COM port on the
dropdown menu.
for the
Now find the file gram, open it with the
PONG.C, which is in the Dynamic C SAMPLES folder. To run the pro-
File menu, compile it usin g the Compile menu, and then run it by
selecting Run in the Run menu. The STDIO window will open on your PC and will dis­play a small square bouncing around in a box.

2.3.1 Troubleshooting

If you receive the message No Rabbit Processor Detected, the programming cable may be connected to the wrong COM port, a connection may be faulty, or the target system may not be powered up. First, check to see that the power LED on the Prototyping Board is lit. If the LED is lit, ch eck both ends of the programm ing cable to ensure tha t it is firmly plugged into the PC and the programming header on the RCM4200 wi th the marked (colored) edge of the programming cable tow ards pin 1 of the programming header . Ensure that the module is firmly and correctly installed in its connectors on the Prototyping Board.
If Dynamic C appears to compile the BIOS successfully, but you then receive a communi­cation 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 in the Dynamic C Options > Project Options >
Communications
menu. Select a slower Max download baud rate.
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
12 RabbitCore RCM4200
menu. Choose a lower debug baud rate.
If there are no faults with the hardware, check that you have selected the correct COM port within Dynamic C as explained for the USB po rt above. 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 for another available COM port. You should receive a Bios
compiled successfully
message once this step is completed successfully.

2.4 Where Do I Go From Here?

If the sample program ran fine, you are now ready to go on to the sample programs in Chapter 3 and to develop your own applications. The sample programs can be easily modified for your own use. The user's manual also provides complete hardware reference information and software function calls for the RCM4200 series of modules and the Prototyping Board.
For advanced development topics, refer to the Dynamic C User’s Manual, also in the online documentation set.

2.4.1 Technical Support

NOTE: If you purchased your RCM4200 t hrough a di strib utor or thr ough a Rabbi t partn er,
contact the distrib utor or partner first for tec hnical 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 Semiconductor 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 RCM4200

3. RUNNING SAMPLE PROGRAMS

To develop and debug programs for the RCM4 200 (and for all other Rabbit Semiconductor hardware), you must install and use Dynamic C. This chapter provides a tour of its major features with respect to the RCM4200.

3.1 Introduction

To help familiarize you with the RCM4200 modules, Dynamic C includes several sample programs. Loading, executing and studying these programs will give you a solid hands-on overview of the RCM4200’s capabilities, as well as a quick start with Dynamic C as an application development tool.
NOTE:
In order to run the sample programs discussed in this chapter and elsewhere in this manual,
1. Your module must be plugged in to the Prototyping Board as described in Chapter 2, “Getting Started.”
2. Dynamic C must be installed and running on your PC.
3. The programming cable must connect the programming header on the module to your PC.
4. Power must be applied to the module through the Prototyping Board.
Refer to Chapter 2, “Getting Started,” if you need further information on these steps. To run a sample program, open it with the
and run it by pressing F9. Each sample program has comments that describe the purpose and function of the pro-
gram. Follow the instructions at the beginning of the sample program. More complete information on Dynamic C is provided in the Dynamic C User’s Manual.
The sample progr ams assum e that you ha ve at lea st an e lemen tary gr asp of A NSI C.
If you do not, see the introductory pages of the Dynamic C User’s Manual for a sug- gested reading list.
File menu (if it is not still open), then compile
User’s Manual 15

3.2 Sample Programs

Of the many sample programs included with Dynamic C, several are specific to the RCM4200 modules. These programs will be found in the SAMPLES\RCM4200 folder.
CONTROLLED.C—Demonstrates use of the digital outputs by having you turn LEDs
DS2 and DS3 on the Prototyping Board on or off from the STDIO window on your PC. Parallel Port B bit 2 = LED DS2
Parallel Port B bit 3 = LED DS3 Once you compile and run CONTROLLED.C, the following display will appear in the
Dynamic C STDIO window.
Press “2” or “3” on your keyboard to select LED DS2 or DS3 on the Prototyping Board. Then follow the prompt in the Dynamic C
STDIO window to turn the LED ON
or OFF. A logic low will light up the LED you selected.
FLASHLED1.C—demonstrates the use of assembly language to flash LEDs DS2 and
DS3 on the Prototyping Board at different rates. Once you have compiled and run this program, LEDs DS2 and DS3 will flash on/off at different rates.
FLASHLED2.C—demonstrates the use of cofunctions and costatements to flash LEDs
DS2 and DS3 on the Prototyping Board at different rates. Once you have compiled and run this program, LEDs DS2 and DS3 will flash on/off at different rates.
16 RabbitCore RCM4200
TAMPERDETECTION.C—demonstrates how to detect an attempt to enter the bootstrap
mode. When an attempt is detected, the battery-backed onchip-encryption RAM on the Rabbit 4000 is erased. This battery-backed onchip-encryption RAM can be useful to store data such as an AES encryption key from a remote location.
This sample program shows how to load and read the battery-backed onchip-encryption RAM and how to enable a visual indicator.
Once this sample is compiled and running (you pressed the F9 key while the sample program is open), remove the programming cable and press the reset button on the Prototyping Board to reset the module. LEDs DS2 and DS3 will be flashing on and off.
Now press switch S2 to load the battery-backed RAM with the encryption key. The LEDs are now on continuously. Notice that the LEDs will stay on even when you press the reset button on the Prototyping Board.
Reconnect the programming cable briefly and unplug it again to simulate an attempt to access the onchip-encryption RAM. The LEDs will be flashing because the battery­backed onchip-encryption RAM has been erased. Notice that the LEDs will continue flashing even when you press the reset button on the Prototyping Board.
You may press switch S2 again and repeat the last steps to watch the LEDs.
TOGGLESWITCH.C—demonstrates the use of costatements to detect switch presses
using the press-and-release method of debouncing. LEDs DS2 and DS3 on the Proto­typing Board are turned on and off when you press switches S2 and S3. S2 and S3 are controlled by PB4 and PB5 respectively.
Once you have loaded and executed these five programs and have an understanding of how Dynamic C and the RCM4200 modules interact, you can move on and try the other sample programs, or begin building your own.
User’s Manual 17

3.2.1 Use of Serial Flash

The following sample programs can be found in the SAMPLES\RCM4200\Serial_Flash folder.
SERIAL_FLASHLOG.C—This program runs a simple Web server and stores a log of
hits on the home page of the serial flash “server.” This log can be viewed and cleared from a browser at http://10.10.6.100/. You will likely have to first “configure” your net­work interface card for a “10Base-T Half-Duplex,” “100Base-T Half-Duplex,” or an “Auto-Negotiation” connection on the “Advanced” tab, which is accessed from the control panel (
Connections
Start > Settings > Control Panel) by choosing Network
.
SFLASH_INSPECT.C—This program is a handy utility for inspecting t he contents of a
serial flash chip. When the sample program starts running, it attempts to initialize a serial flash chip on Serial Port C. Once a serial flash chip is found, the user can perform five different commands to print out the contents of a specified page, set all bytes on the specified page to a single random value, clear (set to zero) all the bytes in a speci­fied page, set all bytes on the specified page to a given value, or save user-specified text to a selected page.
18 RabbitCore RCM4200

3.2.2 Serial Co mmunication

The following sample programs are found in the SAMPLES\RCM4200\SERIAL folder.
FLOWCONTROL.C—This program demonstrates how to configure Serial Port D for
CTS/R TS flow control with serial data coming from Serial Port C (TxC) at 1 15,20 0 bps. The serial data received are displayed in the
STDIO window.
To set up the Prototyping Board, you will need to tie TxD and RxD together on the RS-232 header at J4, and you will also tie TxC and RxC together using the jumpers supplied in the Development Kit as
RxC TxC
TxD RxD
GND
shown in the diagram. A repeating triangular pattern should print out in the STDIO window.
The program will periodically switch flow contr ol on or off to demonstrate the ef fect of flow control.
If you have two Prototyping Boards with modules, run this sample program on the sending board, then disconnect the programming cable and reset the sending board so that the module is operating in the Run mode. Connect TxC, TxD, and GND on the sending board to RxC, RxD, and GND on the other board, then, with the programming cable attached to the other module, run the sample program.
PARITY.C—This program demonstrates the use of parity modes by
RxC
TxD
TxC
RxD GND
repeatedly sending byte values 0–127 from Serial Port C to Serial Port D. The program will switch between generating parity or not on Serial Port C. Serial Port D will always be checking parity, so parity errors should occur during every other sequence.
J4
J4
To set up the Prototyping Board, you will need to tie TxC and RxD together on the RS-232 header at J4 using one of the jumpers supplied in the Development Kit as shown in the diagram.
The Dynamic C STDIO window will display the error sequence.
SERDMA.CThis program demonstrates using DMA to transfer data from a circ ular
buffer to the serial port and vice versa. The Dynamic C
STDIO window is used to view o r
clear the buffer.
Before you compile and run the sample program, you will need to connect the RS-232 he ader a t J4 to y our PC as shown in the diagram using the serial to DB9 cable supplied in the Development Kit.
Colored
edge
Once you have compiled and run the sample program, start Tera Term or another terminal emulation program to connect to the selected PC serial port at a baud rate of
115,200 bps. You can observe the output in the Dynamic C
STDIO window as you type in T e ra Term, and you can
also use the Dynamic C STDIO window to clear the
J4
buffer.
The Tera Term utility can be downloaded from
hp.vector.co.jp/authors/VA002416/teraterm.html.
RxC
TxD
TxC
RxD
GND
User’s Manual 19
SIMPLE3WIRE.C—This program demonstrates basic RS-232 serial communication. Lower case characters are sent on TxC, and are received by RxD. The received characters are converted to upper case and are sent out on TxD, are received on RxC, and are displayed in the
RxC TxC
TxD RxD
J4
GND
Dynamic C STDIO window. To set up the Prototyping Board, you will need to tie TxD and RxC together on the
RS-232 header at J4, and you will also tie RxD 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 D and data flow on Serial Port C.
To set up the Prototyping Board, you will need to tie TxD and RxD together on the RS-232 header at J4, and you will also tie TxC and RxC together using the jumpers supplied in the Development Kit as
RxC TxC
TxD RxD
J4
GND
shown in the diagram. Once you have compiled and run this program, you can test flow con-
trol by disconnecting the TxD jumper from RxD while the program is running. Charac­ters will no longer appear in the STDIO window, and will display again once TxD is connected back to RxD.
If you have two Prototyping Boards with modules, run this sample program on the sending board, then disconnect the programming cable and reset the sending board so that the module is operating in the Run mode. Connect TxC, TxD, and GND on the sending board to RxC, RxD, and GND on the other board, then, with the programming cable attached to the other module, run the sample program. Once you have compiled and run this program, you can test flow control by disconnecting TxD from RxD as before while the program is running. Since the J4 header locations on the two Prototyping Boards are connected with wires, there are no slip-on jumpers at J4 on either Prototyping Board.
SWITCHCHAR.C—This program demonstrates transmitting and then receiving an
ASCII string on Serial Ports C and D. 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 TxD and RxC together on the RS-232 header at J4, and you will also tie RxD and TxC together using the jumpers supplied in the Development Kit as shown in the diagram.
RxC TxC
TxD RxD
J4
GND
Once you have compiled and run this program, press and release switches S2 and S3 on the Prototyping Board. The data sent between the serial ports will be displayed in the STDIO window.
20 RabbitCore RCM4200
IOCONFIG_SWITCHECHO.C—This program demonstrates how to set up Serial Port E,
which then transmits and then receives an ASCII string when switch S2 is pressed. The echoed serial data are displayed in the Dynamic C
STDIO window.
Note that the I/O lines that carry the Serial Port E signals are not the Rabbit 4000 defaults. The Serial Port E I/O lines are configured by calling the library function
serEconfig() that was generated by the Rabbit 4000 IOCONFIG.EXE utility pro-
gram. Serial Port E is configured to use Parallel Port E bi ts PD6 and PD7. These si gnals are available on the Prototyping Board's Module Extension Header (header J2).
Serial Port D is left in its default configuration, using Parallel Port C bits PC0 and PC1. These signals are available on the Prototyping Board's RS-232 connector (header J4). Serial Port D transmits and then receives an ASCII string when switch S3 is pressed.
Also note that there is one library generated by
IOCONFIG.EXE in the Dynamic C
SAMPLES\RCM4200\SERIAL folder for the 29 MHz RCM4210.
T o set up the Prototypi ng Board, you will need to tie TxD and RxD together on the RS-232 header at J4 using the jumpers supplied in the Development Kit; you will also tie TxE (PD6) and RxE (PD7) together with a soldered wire or with a wire jumper if you have soldered in the IDC header supplied with the accessory parts in the Development Kit.
+3.3 V
/RST_OUT
PE5 PE7
PD1/LN1
PD3/LN3 PD5/LN5 PD7/LN7
VREF
J2
GND /IORD
PE6
PD0/LN0 PD2/LN2 PD4/LN4 PD6/LN6 CVT AGND
TxD
RxD
GND
J4
RxC
TxC
Once you have compiled and run this program, press and release switches S2 or S3 on the Prototyping Board. The data echoed between the serial ports will be displayed in the STDIO window.
User’s Manual 21

3.2.3 A/D Converter Inputs (RCM4200 only)

The following sample programs are found in the SAMPLES\RCM4200\ADC folder.
AD_CAL_ALL.C—Demonstrates how to recalibrate all the single-ended analog input
channels with one gain using two known voltages to generate the calibration constants for each channel. The constants will be written into the user block data area.
Connect a positive voltage from 0–20 V DC (for example, the power supply positive out­put) to analog input channels LN0IN–LN6IN on the Prototyping Board, and connect the ground to GND. Use a voltmeter to measure the voltage, and follow the instructions in the Dynamic C
STDIO window once you compile and run this sample program. Remember
that analog input LN7 on the Prototyping Board is used with the thermistor and is not be used with this sample program.
NOTE: The above sample program will overwrite the existing calibration constants.
AD_CAL_CHAN.C—Demonstrates how to recalibrate one single-ended analog input
channel with one gain using two known voltages to generate the calibration constants for that channel. The constants will be rewritten into the user block data area.
Connect a positive voltage from 0–20 V DC (for example, the power supply positive out­put) to an analog input channe l on the Prototyping Board, and conne ct the ground to GND. Use a voltmeter to measure the voltage , and follow the instruct ions in the Dynamic C
STDIO
window once you compile and run this sample program. Remember that analog input LN7 on the Prototyping Board is used with the thermistor and is not be used with this sample program.
NOTE: The above sample program will overwrite the existing calibration constants for
the selected channel.
AD_RDVOLT_ALL.C—Demonstrates how to read all single-ended A/D input channels
using previously defined calibration constants. The constants used to compute equivalent voltages are read from the user bl ock dat a a rea , so t he sa mple pr ogram c annot be run u si ng the “Code and BIOS in RAM” compiler option.
Compile and run this sample program once you have connected a positive voltage from 0– 20 V DC (for example, the power supply positive output) to ana log input channels LN0IN– LN6IN on the Prototyping Board, and ground to GND. Follow the prompts in the Dynamic C
STDIO window. Raw data and the computed equivalent voltages will be displayed.
Remember that analog input LN7 on the Prototyping Boar d is used with the the rmistor and is not be used with this sample program.
AD_SAMPLE.C—Demonstrates how to how to use a low level driver on single-ended
inputs. The program will continuously display the voltage (averaged over 10 samples) that is present on an A/D converter channel (except LN7). The constants used to compute equivalent voltages are read from the user block data are a, so the sample program cannot be run using the “Code and BIOS in RAM” compiler option.
Compile and run this sample program once you have connected a positive voltage from 0– 20 V DC to an analog input (except LN7) on the Prototyping Board, and ground to GND. Follow the prompts in the Dynamic C
STDIO window. Raw data and the computed equiv-
alent voltages will be displayed. If you attach a voltmeter between the analog input and ground, you will be able to observe that the voltage in the Dynamic C
STDIO window
tracks the voltage applied to the analog input as you vary it.
22 RabbitCore RCM4200
THERMISTOR.C— Demonstrates how to use analog input LN7 to calculate temperature for display to the Dynamic C STDIO window. This sample program assumes that the thermistor is the one included in the Development Kit whose values for beta, series resistance, and resistance at standard temperature are given in the part specification.
Install the thermistor at location JP25 on the Prototyping Board before running this sample program. Observe the temperature changes shown in the Dynamic C
STDIO
window as you apply heat or cold air to the thermistor.
3.2.3.1 Downloading and Uploading Calibration Constan ts
The Tera Term utility called for in these sample programs can be downloaded from
hp.vector.co.jp/authors/VA002416/teraterm.html.
These sample programs must be compiled to flash memory. To do so, select Options >
Project Options
BIOS in Flash” for the
in Dynamic C, then select the “Compiler” tab, and select “Code and
BIOS Memory Setting.
Before you compile and run these sample programs, you will also need to connect the RS-232 header at J4 to your PC as shown in the diagram using the serial to DB9 cable supplied in the Development Kit.
DNLOADCALIB.C—Demonstrates how to retrieve
Colored
edge
analog calibration data to rewrite it back to the user block using a terminal emulation utility such as Tera Term.
RxC
TxC
Start T era Term or another terminal emulation program on your PC, and configure the serial parameters as
J4
TxD
RxD
GND
follows.
Baud rate 19,200 bps, 8 bits, no parity, 1 stop bit
Enable Local Echo opt io n
Feed options — Receive = CR, Transmit = CR + LF
Now compile and run this sample program. Verify that the message “Waiting, Please Send Data file” message is being display in the Tera Term display window before proceeding.
Within Tera Term, select
OPEN option within the dialog box. Once the data file has been downloaded, Tera
File-->Send File-->Path and filename, then select the
Term will indicate whether the calibration data were written successfully.
UPLOADCALIB.C—Demonstrates how to read the analog calibration constants from the user block using a terminal emulation utility such as Tera Term.
Start Tera Term or another terminal emulation program on your PC, and configure the serial parameters as follows.
User’s Manual 23
Baud rate 19,200 bps, 8 bits, no parity, 1 stop bit
Enable Local Echo opt io n
Feed options — Receive = CR, Transmit = CR + LF
Follow the remaining steps carefully in Tera Term to avoid overwriting previously saved calibration data when using same the file name.
Enable the File APPEND option at the bottom of the dialog box
Select the OPEN option at the right-hand side of the dialog box
T era Term is now ready to log all data received on the serial port to the file you specified. Y ou are now ready to compile and run this sample program. A message will be displayed
in the Tera Term display window once the sample program is running. Enter the serial number you assigned to your RabbitCore module in the Tera Term
display window, then press the ENTER key. The Tera Term display window will now display the calibration data.
Now select
CLOSE from within the Tera Term LOG window, which will likely be a
separate pop-up window minimized at the bottom of your PC screen. This finishes the logging and closes the file.
Open your data file and verify that the calibration data have been written properly. A sample is shown below.
Serial port transmission ========================
Uploading calibration table . . .
Enter the serial number of your controller = 9MN234
SN9MN234
ADSE
0 float_gain,float_offset,float_gain,float_offset,float_gain,float_offset,float_gain,float_offset, float_gain,float_offset,float_gain,float_offset,float_gain,float_offset,float_gain,float_offset, 1 float_gain,float_offset,float_gain,float_offset,float_gain,float_offset,float_gain,float_offset, float_gain,float_offset,float_gain,float_offset,float_gain,float_offset,float_gain,float_offset, | |
ADDF
0 float_gain,float_offset,float_gain,float_offset,float_gain,float_offset,float_gain,float_offset, float_gain,float_offset,float_gain,float_offset,float_gain,float_offset,float_gain,float_offset, 2 float_gain,float_offset,float_gain,float_offset,float_gain,float_offset,float_gain,float_offset, float_gain,float_offset,float_gain,float_offset,float_gain,float_offset,float_gain,float_offset, | |
ADMA
3 float_gain,float_offset, 4 float_gain,float_offset, | |
END
24 RabbitCore RCM4200
Loading...
+ 105 hidden pages