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.
A.2 Rabbit 4000 DC Characteristics........................................................................................................94
A.3 I/O Buffer Sourcing and Sinking Limit.............................................................................................95
A.4 Bus Loading ......................................................................................................................................95
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 system. 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 management 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 Manual1
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
2RabbitCore RCM4200
There are two RCM4200 production models. Table 1 summarizes their main features.
Table 1. RCM4200 Features
FeatureRCM4200RCM4210
Microprocessor
Data SRAM512K
Fast Program-Execution
SRAM
Flash Memory (program)512K
Flash Memory
(mass data storage)
A/D Converter12 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 MHzRabbit® 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 Manual3
1.2 Advantages of the RCM4200
• Fast time to market using a fully engineered, “ready-to-run/ready-to-program” microprocessor 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.
4RabbitCore 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, allowing 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
21C
U6
56
C21
C1
U2
81R
R8R6R4R3R5R
R37
R21
0
1
C8C7C
C
U5
16
XR
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
31P
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
11
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 Manual5
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 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.
6RabbitCore 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 information 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 selection is COM1. You may select any available port for Dynamic C’s use. If you are not certain 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 desktop. 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 Manual7
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 Development 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
8RabbitCore 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
C19C20
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 damage 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 standoffs from the top using the remaining two screws and washers.
User’s Manual9
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
C28C29
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
C19C20
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
JP4JP3
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
C43RCM1
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
PD1LN1
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.
10RabbitCore RCM4200
If you are using a USB programming cable, your PC should recognize the new USB hardware, 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 connector 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 Manual11
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 display 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 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 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
12RabbitCore 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 Manual13
14RabbitCore 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 Manual15
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.
16RabbitCore 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 batterybacked 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 Prototyping 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 Manual17
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 network 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 specified page, set all bytes on the specified page to a given value, or save user-specified text
to a selected page.
18RabbitCore 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.C—This 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 Manual19
• 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. Characters 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.
20RabbitCore 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 Manual21
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 output) 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 output) 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.
22RabbitCore 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 Manual23
• 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
If you plan to use the real-time clock functionality in your application, you will need to set
the real-time clock. Set the real-time clock using the SETRTCKB.C sample program from
the Dynamic C SAMPLES\RTCLOCK folder, using the onscreen prompts. The
RTC_TEST.C sample program in the Dynamic C SAMPLES\RTCLOCK folder provides
additional examples of how to read and set the real-time clock.
User’s Manual25
26RabbitCore RCM4200
4. HARDWARE REFERENCE
Chapter 4 describes the hardware components and principal hardware
subsystems of the RCM42 00. Appendix A, “RC M4200 Specific ations,” provides complete physical and electrical specifications.
Figure 5 shows the Rabbit-based subsystems designed into the RCM4200.
Headers J2 is a standard 2 × 25 IDC header with a nominal 1.27 mm pitch.
28RabbitCore RCM4200
Figure 7 shows the use of the Rabbit 4000 m icroprocessor ports in the RC M4200 mo dules.
PC0, PC2
PC1, PC3
PB1, PC6, STATUS
PC7, /RES,
SMODE0, SMODE1
PC4
PC5
PA0PA7
Port A
Port C
(Serial Ports C & D)
Serial Ports E & F
(RCM4210 only)
Programming
Port
(Serial Port A)
A/D Converter
(Serial Port B)
RAM
PB2PB7
Port B
R
ABBIT
®
4000
Real-Time Clock
Watchdog
11 Timers
Slave Port
Clock Doubler
Backup Battery
Support
PD0PD7
Port D
(RCM4210 only)
Port E
Misc. I/O
Flash
PE0PE7
/RES_IN
/RESET_OUT
/IORD
/IOWR
Figure 7. Use of Rabbit 4000 Ports
The ports on the Rabbit 4000 microprocessor used in the RCM4200 are configurable, and
so the factory defaults can be reconfigured. Table 2 lists the Rabbit 4000 factory defaults
and the alternate configurations.
User’s Manual29
Table 2. RCM4200 Pinout Configurations
PinPin NameDefault UseAlternate UseNotes
1+3.3 V_IN
2GND
Reset output from Reset
3/RES_OUTReset outputReset input
4/IORDOutput External I/O read strobe
5/IOWROutputExternal I/O wri te st r obe
6/RESET_INInputInput to Reset Generator
7VBAT_EXTBattery input
Slave port data bus
8–15PA[0:7]Input/Output
(SD0–SD7)
External I/O data bus
(ID0–ID7)
Generator or external reset
input
16PB0Input/Output
17PB1Input/Output
18PB2Input/Output
19PB3Input/Output
20PB4Input/Output
21PB5Input/Output
22PB6Input/Output
23PB7Input/Output
SCLKB
External I/O Address IA6
SCLKA
External I/O Address IA7
/SWR
External I/O Address IA0
/SRD
External I/O Address IA1
SA0
External I/O Address IA2
SA1
External I/O Address IA3
/SCS
External I/O Address IA4
/SLAVATN
External I/O Address IA5
SCLKB (used by RCM4200
A/D converter — see
Section 4.2.1)
1.15 V/2.048 V/2.500 V
on-chip ref. voltage
(RCM4200 only)
4.1.1 Memory I/O Interface
The Rabbit 4000 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, and are also used by the
RCM4200.
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 auxiliary I/O bus for any reason, you must add the following line at the
beginning of your program.
#define PORTA_AUX_IO // required to enable auxiliary I/O bus
Selected pins on Parallel Ports D and E as specified in Table 2 may be used for input
capture, quadrature decoder, DMA, and pulse-width modulator purposes.
4.1.2 Other Inputs and Outputs
The PE5–PE7 pins can be brought out to header J2 instead of the STATUS and the two
SMODE pins, SMODE0 and SMODE1, as explained in Appendix A.6.
/RESET_IN is normally associated with the programming port, but may be used as an
external input to reset the Rabbit 4000 microprocessor and the RCM4200 memory.
/RESET_OUT is an output from the reset circuitry that can be used to reset other
peripheral devices.
34RabbitCore RCM4200
4.2 Serial Communication
The RCM4200 module does not have any serial driver or receiver chips directly on the
board. However, a serial interface may be incorporated on the board the RCM4200 is
mounted on. For example, the Prototyping Board has an RS-232 transceiver chip.
4.2.1 Serial Ports
There are five serial ports designated as Serial Ports A, B, C, D, and E. All five 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 Port A is normally used as a programming port, but may be used either as an asynchronous or as a clocked serial port once application development has been completed and
the RCM4200 is operating in the Run Mode.
Serial Port B is shared by the RCM4200 module’s A/D converter, and is set up as a
clocked serial port. Since this serial port is set up for synchronous serial communication
on the RCM4200 model, you will lose the A/D converter’s functionality if you try to use
the serial port in the asynchronous mode. Serial Port B is available without any restrictions
on the RCM4210.
Serial Port C is shared with the serial flash, and is set up as a clocked serial port. PE7 is set
up to provide the SCLKC output to the serial flash, but PD2 also provides the SCLKC
ouput automatically when Serial Port C is used as a clocked serial port. Since this serial
port is available for synchronous serial communication on either RCM4200 model, you
will lose the serial flash’s funct ionality if you try to use the serial port in the asynchronous
mode.
NOTE: Since Serial Port C is shared with the serial flash, exercise care if you attempt to
use Serial Port C for ot her serial communication. Your application will hav e t o manag e
the sharing negotiations to avoid conflicts when reading or writing to the serial flash.
Serial Port D may also be used as a clocked serial port. Note that PD0 provides the
SCLKD ouput automatically when Serial Port D is set up as a clocked serial port.
Serial Port E, which is available only on the RCM4210, can also be configured as an
SDLC/HDLC serial port. The IrDA protocol is also supported in SDLC format by Serial
Port E. Serial Port E must be configured before it can be used. The sample program
IOCONFIG_SWITCHECHO.C in the Dynamic C SAMPLES\RCM4200\SERIAL folder
shows how to configure Serial Port E.
User’s Manual35
Table 3 summarizes the possible parallel port pins for the serial ports and their clocks.
Table 3. Rabbit 4000 Serial Port and Clock Pins
Serial Port A
(programming port)
Serial Port B
(used by A/D
converter on
RCM4200)
Serial Port C
(shared by
serial flash)
TXAPC6, PC7, PD6
RXAPC7, PD7, PE7RXDPC1, PD1, PE1
SCLKAPB1SCLKDPD0, PE0, PE3, PC3
TXBPC4, PC5, PD4
RXBPC5, PD5, PE5RXEPD7, PC7, PE7
SCLKBPB0RCLKEPD5, PC5, PE5
TXCPC2, PC3TCLKEPD4, PC4, PE4
RXCPC3, PD3, PE3
SCLKCPD2, PE2, PE7, PC7
Serial Port D
Serial Port E
(RCM4210
only)
RCLKE must be selected to be on the same parallel
port as TXE.
TXDPC0, PC1
TXEPD6, PC6, PE6
4.2.1.1 Using the Serial Ports
The receive lines on the RCM4200 serial ports do not have pull-up resistors. If you are
using the serial ports without a receiver chip (for example, for RS-422, RS-232, or RS-485
serial communication), the absence of a pull-up resistor on the receive line will likely lead
to line breaks being generated since line breaks are normally generated whenever the
receive line is pulled low. If you are operating a serial port asynchronously , you can inhibit
character assembly during breaks by setting bit 1 in the corresponding Serial Port
Extended Register to 1. Should you need line breaks, you will have to either add a pull-up
resistor on your motherboard or use a receiver that incorporates the circuits to have the
output default to the nonbreak levels.
The Dynamic C RS232.LIB library requires you to define the macro RS232_
NOCHARASSYINBRK
#define RS232_NOCHARASSYINBRK
to inhibit break-character assembly for all the serial ports.
This macro is already defined so that it is the default behavior for the sample programs in
the Dynamic C SAMPLES\RCM4200\SERIAL folder.
36RabbitCore RCM4200
4.2.2 Ethernet Port
Figure 8 shows the pinout for the RJ-45 Ethernet port (J3). Note that some Ethernet connectors are numbered in reverse to the order used here.
ETHERNET
RJ-45 Plug
1
RJ-45 Jack
1. E_Tx+
2. E_Tx
3. E_Rx+
6. E_Rx
8
Figure 8. RJ-45 Ethernet Port Pinout
Three LEDs are placed next to the RJ-45 Ethernet jack, one to indicate Ethernet link/activity
(LINK/ACT), one to indicate when the RCM4200 is connected to a functioning 100B ase-T
network (
SPEED), and one (FDX/COL) to indicate that the current connection is in full-
duplex mode (steady on) or that a half-duplex connection is experiencing collisions
(blinks).
The RJ-45 connector is shielded to minimize EMI effects to/from the Ethernet signals.
User’s Manual37
4.2.3 Programming Port
The RCM4200 is programmed via the 10-pin header labeled J1. The programming port
uses the Rabbit 4000’ s Serial Port A for commun ication. Dynamic C uses the programming
port to download and debug programs.
Serial Port A is also used for the following operations.
• Cold-boot the Rabbit 4000 on the RCM4200 after a reset.
• Fast copy designated portions of flash memory from one Rabbit-based board (the
master) to another (the slave) using the Rabbit Cloning Board.
Alternate Uses of the Programming Port
All three 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 via the DIAG connector on the
programming cable.
In addition to Serial Port A, the Rabbit 4000 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 4000 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 output once a program has been downloaded and
is running.
The reset pin is an external input that is used to reset the Rabbit 4000.
Refer to the
Rabbit 4000 Microprocessor User’s Manual for more information.
38RabbitCore RCM4200
4.3 Programming Cable
The programming cable is used to connect the programming port of the RCM4200 to a PC
serial COM port. The programming cable converts the RS-232 voltage levels used by the
PC serial port to the CMOS voltage levels used by the Rabbit 4000.
When the
port on the RCM4200, programs can be downloaded and debugged over the serial interface.
The DIAG connecto r of the pr o g r am ming cab l e m a y b e u s ed o n h e a d er J 1 o f th e RCM4200
with the RCM4200 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
PROG connector on the programming cable is connected to the programming
The RCM4200 is automatically in Program Mode when the
PROG connector on the pro-
gramming cable is attached, and is automatically in Run Mode when no programming
cable is attached. When the Rabbit 4000 is reset, the operating mode is determined by the
status of the SMODE pins. When the programming cable’s
PROG connector is attached,
the SMODE pins are pulled high, placing the Rabbit 4000 in the Program Mode. When the
programming cable’s PROG connector is not attached, the SMODE pins are pulled low,
causing the Rabbit 4000 to operate in the Run Mode.
RESET RCM4200 when changing mode:
Press RESET button (if using Prototyping Board),
OR
Cycle power off/on
after removing or attaching programming cable.
3-pin
power connector
Programming
Cable
To
or USB port
PC COM port
PROG
Colored
edge
J1
J1
PWR
R1
J1
U1
DS1
C1
R2
GND
D1
J3
DS1
C24
LINK
JP16
R47
FDX
R49
R13
R14
DS3
R12
U4
DS2
R48
C25
R52
SPEED
C31
C33
C32
C34
C30
C35
C36
C37
C38
R19
C28C29
Q1
C19
R50
U3
C26
C18
C20
R4
RX43
RX47
R18
R21
RX97
U7
R10
R1
C21
C27
R15
C23
R23
U6
R22
Y2
R16
GND
C2
DIAG
C5
L1
C58
C67
C88
C81
C57
R34
U13
C18
R35
U3
R33
R32
C65
C72
C87
L7
C19C20
C5
C77
Q3
Y4
C15
Q1
R36
C85
R29
C7
R29
C8
C9
C10
C6
C11
C12
U5
JP8
C13
C14
U2
C39
R9
D1
RX55
RX49
C15
R27
UX33UX31
R11
RX89
UX3
JP1
C4
C3
D2
C6
4
1
C17
C78
U15
JP2
/RST_OUT
C43
L2
RCM1
Y3
/IOWR
3
PROG
VBAT
EXT
U2
C82
PA1
J1
R3
PA3
R31
R20
JP16
R51
JP6
PA5
R2
R5
JP5
C76
JP12
PA7
JP4JP3
JP14
PB1
JP8
C16
JP7
PB3
R41
R40
JP18
C75
JP9
JP10
PB5
JP11
PB7
JP10
R25
JP12
PC1
JP1
R26
JP14
U14
R20
R10
JP24
UX41
UX37 UX42
JP15
JP13
C74
JP23
RX57
JP11
JP15
JP19
C17
C16
R18
R16
R8R6R4R3R5
C86
L1
C14
C12
C10
RX59
R7
C1
U1
R44
R39
R42
PC3
JP2
PC5
JP9
JP6
PC7
JP7
JP21
JP22
JP20
JP17
PE1
JP3
JP13
PE3
JP5
R19
JP4
C3
C2
R14
R13
R15
R17
PE5
R8
R6
R9
R7
PE7
PD1LN1
C8C7C9
C11
C13
PD3LN3
PD5LN5
PD7LN7
R46
VREF
R45
RX61
R43
RX65
J3
RX63
UX47
J2
+3.3 V
+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
CVT
AGND
LN6IN
LN4IN
LN2IN
RESET
1
S1
BT1
RESET
UX49
UX4
RXD TXD
TXC RXC
GND
J4
RX81
RX83
RX11
RX67
RX75
CX25
DS2
JP25
AGND
R12
R11
LN0IN
RX85
CX27
RX73
RX77
RX79
CX23
DS3
R21
R22
R24
R23
1
R27
R28
GND
S3S2
UX29
RX87
CX41
CX39
UX30
UX45
UX10
CX17
UX12
UX14
CX29
UX16
GND
1
GND
Figure 9. Switching Between Program Mode and Run Mode
User’s Manual39
A program “runs” in either mode, but can only be downloaded and debugged when the
RCM4200 is in the Program Mode.
Refer to the
Rabbit 4000 Microprocessor User’s Manual for more information on the pro-
gramming port.
4.3.2 Standalone Operation of the RCM4200
Once the RCM4200 has been programmed successfully, remove the programming cable
from the programming connector and reset the RCM4200. The RCM4200 may be reset by
cycling, the power off/on or by pressing the
RESET button on the Prototyping Board. The
RCM4200 module may now be removed from the Prototyping Board for end-use installation.
CAUTION: Power to the Prototyping Board or other boards should be disconnected
when removing or installing your RCM4200 module to protect against inadvertent
shorts across the pins or damage to the RCM4200 if the pins are not plugged in correctly. Do not reapply power until you have verified that the RCM4200 module is
plugged in correctly.
40RabbitCore RCM4200
4.4 A/D Converter (RCM4200 only)
The RCM4200 has an onboard ADS7870 A/D converter whose scaling and filtering are
done via the motherboard on which the RCM4200 module is mounted. The A/D converter
multiplexes converted signals from eight single-ended or four differential inputs to Serial
Port B on the Rabbit 4000.
The eight analog input pins, LN0–LN7, each have an input impedance of 6–7 MΩ,
depending on whether they are used as single-ended or differential inputs. The input signal
can range from -2 V to +2 V (differential mode) or from 0 V to +2 V (single-ended mode).
Use a resistor divider such as the one shown in Figure 10 to measure voltages above 2 V
on the analog inputs.
R0
LN0
LN1
AGND
Figure 10. Resistor Divider Network for Analog Inputs
R0
R1
C
C
R1
ADC
(RCM4200)
ADC
3
1
BVREF
The R1 resistors are typically 20 kΩ to 100 kΩ, with a lower resistance leading to more
accuracy, but at the expense of a higher current draw. The R0 resistors would then be
180 kΩ to 900 kΩ for a 10:1 attenuator. The capacitor filters noise pulses on the A/D
converter input.
The actual voltage range for a signal going to the A/D converter input is also affected by
the 1, 2, 4, 5, 8, 10, 16, and 20 V/V software-programmable gains available on each channel
of the ADS7870 A/D converter. Thus, you mus t scale the analog signal with an attenuator
circuit and a software-programmable gain so that the actual input presented to the A/D
converter is within the range limits of the ADS7870 A/D converter chip (-2 V to + 2 V or
0 V to + 2 V).
The A/D converter chip can only accept positive voltages. Wit h the R1 resistors connected
to ground, your analog circuit is well-suited to perform positive A/D conversions. When
the R1 resistors are tied to ground for differential measurements, both differential inputs
must be referenced to analog ground, and both inputs must be positive with respect to analog ground.
User’s Manual41
If a device such as a battery is
connected across two channels
for a differential measurement,
and it is not referenced to
analog ground, then the current
from the device will flow
through both sets of attenuator
resistors without flowing back
Device
AIN0
+
-
AIN1
R0
2.2 nF
I
2.2 nF
R0
R1
+
R1
LN0
LN1
ADC
to analog ground as shown in
Figure 11. This will generate a
negative voltage at one of the
inputs, LN1, which will almost
Figure 11. Current Flow from Ungrounded
or Floating Source
certainly lead to inaccurate A/D
conversions. T o make such diff erential measurements, connect the R1 resistors to the A/D
converter’s internal reference voltage, which is software-configurable for 1.15 V, 2.048 V,
or 2.5 V. This internal reference voltage is available on pin 49 of header J2 as VREF, and
allows you to convert analog input voltages that are negative with respect to analog ground.
NOTE: The amplifier inside the A/D converter’s internal voltage reference circuit has a
very limited output-current capability. The internal buffer can source up to 20 mA and
sink only up to 200 µA. Use a separate buffer amplifier if you need to supply any load
current.
The A/D converter’s CONVER T pin is available on pin 48 of header J2 and can be used as
a hardware means of forcing the A/D converter to start a conversion cycle at a specific time.
The CONVERT signal is an edge-triggered event and has a hold time of two CCLK periods
for debounce.
A conversion is started by an active (rising) edge on the CONVERT pin. The CONVERT
pin must stay low for at least two CCLK periods before going high for at least two CCLK
periods. Figure 12 shows the timing of a conversion start. The double falling arrow on
CCLK indicates the actual start of the conversion cycle.
Conversion starts
CCLK
BUSY
CONV
Figure 12. Timing Diagram for Conversion Start Using CONVERT Pin
Appendix B explains the implementation examples of these features on the Prototyping
Board.
42RabbitCore RCM4200
4.4.1 A/D Converter Power Supply
The analog section is isolated from digital noise generated by other components by way of a
low-pass filter composed of C1, L1, and C86 on the RCM4200 as shown in Figure 13. The
+V analog power supply powers the A/D converter chip.
+3.3 V
L1
C1
100 nF
+V
C86
100 nF
Figure 13. Analog Supply Circuit
User’s Manual43
4.5 Other Hardware
4.5.1 Clock Doubler
The RCM4200 takes advantage of the Rabbit 4000 microproces sor’s internal clock doubler.
A built-in clock doubler allows half-frequency crystals to be used to reduce radiated
emissions. The 58.98 MHz frequency specified for the RCM4200 model is generated
using a 29.49 MHz crystal.
The clock doubler may be disabled if 58.98 MHz clock speeds are not required. Disabling
the Rabbit 4000 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.5.2 Spectrum Spreader
The Rabbit 4000 features a spectrum spreader, which helps to mitigate EMI problems. The
spectrum spreader is on by default, 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 not recommended since it may limit
the maximum clock speed or the maximum baud rate. It is unlikely that the strong setting will be used in a real application.
3. Click OK to save the macro. The spectrum spreader will now remain of f whenever you
are in the project file where you defined the macro.
NOTE: Refer to the Rabbit 4000 Microprocessor User’s Manual for more infor mat ion
on the spectrum-spreading setting and the maximum clock speed.
44RabbitCore RCM4200
4.6 Memory
4.6.1 SRAM
All RCM4200 modules have 512K of battery-backed data SRAM installed at U10, and the
RCM4200 model has 512K of fast SRAM installed at U12.
4.6.2 Flash EPROM
All RCM4200 modules also have 512K of flash EPROM installed at U11.
NOTE: Rabbit Semiconductor rec ommends that any c ustomer applica tions shou ld 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 discouraged. Instead, define a
“user block” area to store persistent data. The functions writeUserBlock and
readUserBlock are provided for this. Refer to the
Designer’s Handbook
for additional information.
4.6.3 Serial Flash
Up to 8 Mbytes of serial flash memory is available to store data and Web pages. Sample
programs in the SAMPLES\RCM4200\Serial_Flash folder illustrate the use of the
serial flash memory.
Rabbit 4000 Microprocessor
User’s Manual45
46RabbitCore RCM4200
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 sing le-board computers and other devices
based on the Rabbit microprocessor. Chapter 5 describes the
libraries and function calls related to the RCM4200.
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. 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 static
SRAM included on the RCM4200. The flash m emory and SR AM op tions are sel ected with
the Options > Program 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 can be compi led di rectl y to the ba tter y-backe d d ata SRAM on the
RCM4200 module, but should b e run from t he fa st SRAM afte r the seri al pr ogramming
cable is disconnect e d. Your final code must a l wa ys be s t or e d in flash me mor y f or
reliabl e op er ati on . RCM4200 modul es have a fast pro gram exe cution SRAM that is not
battery-backed. Select
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 RCM4200 modules running at
58.98 MHz.
NOTE: Do not depend on the flash memory sector size or type in your program logic.
The RCM4200 and Dynamic C were designed to accommodate flash devices with
various sector sizes in response to the volatility of the flash-memory market.
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 95 and later.
Programs can be downloaded at baud rates of up to 460,800 bps after the program compiles.
User’s Manual47
Code and BIOS in Flash, Run in RAM from the Dynamic C
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.
2
X I
C, 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 reg isters and f lags are disp layed. The con tents of gener al regist ers
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—
detected for debugging purposes.
printf outputs to this window and keyboard input on the host PC can be
printf output may also be sent to a serial port or file.
48RabbitCore RCM4200
5.2 Dynamic C Function Calls
5.2.1 Digital I/O
The RCM4200 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 auxiliary I/O bus on the Rabbit 4000 chip, add the line
#define PORTA_AUX_IO // required to enable auxiliary I/O bus
to the beginning of any programs using the auxiliary I/O bus.
The sample programs in the Dynamic C
SAMPLES/RCM4200
folder provide further
examples.
5.2.2 Serial Co mmunication Drive rs
Library files included with Dynamic C provide a full range of serial communications support. The
PACKET.LIB
RS232.LIB
library provides a set of circular-buffer-based serial functions. The
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, allowing other functions to be performed between calls. For more information, see
the Dynamic C Function Reference Manual and Technical Note TN213, Rabbit Serial Port Software.
5.2.3 User Block
Certain function calls involve reading and storing calibration constants from/to the simulated
EEPROM in flash memory located at the top 2K of the reserved user block memory area
(3800–39FF). This leaves the address range 0–37FF in the user block available for your
application.
These address ranges may change in the future in response to the volatility in the flash
memory market, in particular sector size. The sample program
USERBLOCK_INFO.C in
the Dynamic C SAMPLES\USERBLOCK folder can be used to determine the version of the
ID block, the size of the ID and user blocks, whether or not the ID/user blocks are mirrored, the total amount of flash memory used by the ID and user blocks, and the area of the
user block available for your application.
The USERBLOCK_CLEAR.C sample program shows you how to clear and write the contents of the user block that you are using in your application (the calibration constants in
the reserved area and the ID block are protected).
User’s Manual49
5.2.4 SRAM Use
The RCM4200 module 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 maintains two
copies of each protected variable in the battery-backed SRAM. The co mpiler also gene rates
a flag to ind icat e whic h copy of the protected variable is valid at the current time. This flag
is also stored in the battery-backed SRAM. When a protected variable is updated, the
“inactive” copy is modified, and is made “active” only when the update is 100% complete.
This assures the integrity of the data in case a reset or a power failure occurs during the
update process. At power-on the application program uses the active copy of the variable
pointed to by its associated flag.
The sample code below shows how a protected variable is defined and how its value can
be restored.
main() {
protected int state1, state2, state3;
...
_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.
5.2.4.1 SRAM Chip Select Considerations
The basic SRAM memory on Rabbit-based boards is always connected to /CS1, /OE1, and
/WE1. Both the data SRAM and the program execution fast SRAM on the RCM4200
share /OE1.
The BIOS-defined macro,
CS1_ALWAYS_ON
, is set to 0 by default to disable /CS1 (set it
high). The macro may be redefined in the BIOS to 1, which will set a bit in the MMIDR
register that forces /CS1 to stay enabled (low). This capability is normally used to speed up
access time for battery-backed SRAM as long as no other memory chips are connected to
/OE1 and /WE1. Therefore, the
CS1_ALWAYS_ON
macro must remain at i ts def ault se tti ng
of 0 to avoid conflicts between the data SRAM and the program execution fast SRAM.
50RabbitCore RCM4200
5.2.5 RCM4200 Cloning
The RCM4200 does not have a pull-up resistor on the PB1 (CLKA) line of the programming port. Because of this, the procedure to generate clones from the RCM4200 differs
from that used for other RabbitCore modules and single-boards computers. You must set
the
CL_FORCE_MASTER_MODE
macro to 1 in the Dynamic C
CLONECONFIG.LIB
library
to use the RCM4200 as a master for cloning. An RCM4200 master will not run the application, and further debugging is not possible as long as the
CL_FORCE_MASTER_MODE
macro is set to 1. Any cloned RCM4200 modules will be “sterile,” meaning that they cannot be used as a master for cloning. To develop and debug an application on an RCM4200,
comment out the
NOTE: Instead of defining this macro is your application, you may simply add the line
CL_FORCE_MASTER_MODE=1
Options “Defines” tab, then click OK. When you recompile your program, this will
have the same effect as setting the macro to 1 within the CLONECONFIG.LIB library.
CL_FORCE_MASTER_MODE
under the Dynamic C Options > Project
macro or set it to 0.
See Technical Note TN207, Rabbit Cloning Board, for additional information on Rabbit
Semiconductor’s cloning board and how cloning is done.
5.2.6 Serial Flash Drivers
The Dynamic C LIB\SerialFlash\SFLASH.LIB and LIB\SerialFlash\
SFLASH_FAT.LIB
libraries provide the function calls needed to use the serial flash. The
FAT file system function calls are in the Dynamic C LIB\FileSystem\
FAT_CONFIG.LIB
library.
User’s Manual51
5.2.7 Prototyping Board Function Calls
The functions described in this section are for use with the Prototyping Board features.
The source code is in the Dynamic C
LIB\RCM4xxx\RCM42xx.LIB library if you need
to modify it for your own board design.
NOTE: The analog input fun ction c alls are supp orted o nly by th e RCM4200 mode l sinc e
the RCM4210 does not have an A/D converter.
The sample programs in the Dynamic C
SAMPLES\RCM4200
folder illustrate the use of
the function calls.
Other generic functions applicable to all devices based on Rabbit microprocessors are
described in the Dynamic C Function Reference Manual.
5.2.7.1 Board Initialization
brdInit
void brdInit(void);
DESCRIPTION
Call this function at the beginning of your program. This function initializes Parallel
Ports A through E for use with the Prototyping Board, and on the RCM4200 model
loads the stored calibration constants for the A/D converter . 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 outputs.
3. RS-232 is not enabled.
4. LEDs are off.
5. The slave port is disabled.
RETURN VALUE
None.
52RabbitCore RCM4200
5.2.7.2 Alerts
These function calls can be found in the Dynamic C LIB\RCM4xxx\RCM4xxx.LIB library .
timedAlert
void timedAlert(unsigned long timeout);
DESCRIPTION
Polls the real-time clock until a timeout occurs. The RCM4200 will be in a low-power
mode during this time. Once the timeout occurs, this function call will enable the normal
power source.
PARAMETER
timeoutthe duration of the timeout in seconds
RETURN VALUE
None.
digInAlert
void digInAlert(int dataport, int portbit, int value,
unsigned long timeout);
DESCRIPTION
Polls a digital input for a set value or until a timeout occurs. The RCM 4400W will be
in a low-power mode during this time. Once a timeout occurs or the correct byte is
received, this function call will enable the normal po wer source and exit.
PARAMETERS
dataportthe input port data register to poll (e.g., PADR)
portbitthe input port bit (0–7) to poll
valuethe value of 0 or 1 to receive
timeout
RETURN VALUE
None.
the duration of the timeout in seconds (enter 0 for no timeout)
User’s Manual53
5.2.8 Analog Inputs (RCM4200 only)
The function calls used with the Prototyping Board features and the A/D converter on the
RCM4200 model are in the Dynamic C LIB\RCM4xxx\ADC_ADS7870.LIB library.
Dynamic C v. 10.07 or later is required to use the A/D converter function calls.
anaInConfig
unsigned int anaInConfig(unsigned int instructionbyte,
unsigned int cmd, long brate);
DESCRIPTION
Use this function to configure the A/D converter. This function will address the A/D
converter chip in Register Mode on ly, and will retur n an error if you try the Direct
Mode. Appendix B.4.3 provides additional addressing and command information.
RISE/FALLInputPulled up for SCLK active on rising edge
I/O0InputPulled down
I/O1InputPulled down
I/O2InputPulled down
I/O3InputPulled down
CONVERTInputPulled down when not driven
BUSYOutputPE0 pulled down; logic high state converter is busy
CCLKCNTRLInputPulled down; 0 state sets CCLK as input
CCLKInputPulled down; external conversion clock
SCLKInputPB0; serial data transfer clock
SDIInputPC4; 3-wire mode for serial data input
SDOOutputPC5; serial data output /CS driven
/CSInputBUFEN pulled up; active-low enables serial interface
BUFINInputDriven by VREF
VREFOutputConnected to BUFIN and BUFOUT
BUFOUTOutputDriven by VREF
54RabbitCore RCM4200
PARAMETERS
anaInConfig (continued)
instructionbyte
cmd
brate
RETURN VALUE
0 on write operations
data value on read operations
the instruction byte that will initi ate a read or write operation
at 8 or 16 bits on the designated register addres s. For example,
checkid = anaInConfig(0x5F, 0, 9600);
// read ID and set byte rate
the command data that configure the registers addressed by the instruction byte. Enter 0 i f you are p erfo rming a rea d oper ati on. For
example,
i = anaInConfig(0x07, 0x3b, 0);
// write ref/osc reg and enable
the serial cl ock t rans fer rate of 9600 to 1 1 5,20 0 byt es p er s econd.
brate
must be set the first time this function is called. Enter 0 for
this parameter thereafter, for exampl e,
anaInConfig(0x00, 0x00, 9600);
// resets device and sets byte rate
SEE ALSO
anaInDriver, anaIn, brdInit
User’s Manual55
anaInDriver
int anaInDriver(unsigned int cmd);
DESCRIPTION
Reads the voltage of an analog input channel by serial-clocking an 8-bit command to
the A/D converter by its Direct Mode method. This fun ction assumes that Mode1 (mos t
significant by te fi rst) a nd the A/D co nverter o scill ator ha ve been enable d. See
Config()
The conversion begins immediately after the last data bit has been transferred. An exception error w ill occur if Direct Mo de bit D7 is not set.
An exception error will occur if Direct Mode bit D7 is not set.
PARAMETERS
cmdcontains a gain code and a channel code as follows.
for the setup.
D7—1; D6–D4—Gain Code; D3–D0—Channel Code
Use the following calculation and the tables below to determinecmd:
* Negative input is ground.
† Not accessible on Prototyping Board
‡ Not accessible on Prototyping Board
RETURN VALUE
A value corresponding to the voltage on the analog input channel:
0–2047 for 11-bit conversions
-2048–2047 for 12-bi t con versions
ADTIMEOUT
ADOVERFLOW
Differential Input
Lines
+AIN6 -AIN711AIN3AIN3
-AIN6 +AIN715AIN7AIN7*
Channel Code
Single-Ended
Input Lines
*
(-4095) if the conversion is incomplete or busy bit timeout
(-4096) for overflow or out of range
4–20 mA
Lines
SEE ALSO
anaInConfig, anaIn, brdInit
User’s Manual57
anaIn
int anaIn(unsigned int channel, int opmode, int gaincode);
DESCRIPTION
Reads the value of an analog input channel using the Direct Mode method of a ddressing
the A/D converter. Note that it takes about 1 second to ensure an internal capacitor on
the A/D conve rter is charged when the function is called th e first time.
A value corresponding to the voltage on the analog input channel:
0–2047 for single-ended conversions
-2048–2047 for differential conve rsions
ADTIMEOUT
ADOVERFLOW
SEE ALSO
anaIn, anaInConfig, anaInDriver
anaIn (continued)
(-4095) if the conversion is incomplete or busy bit timeout
(-4096) for overflow or out of range
User’s Manual59
anaInCalib
int anaInCalib(int channel, int opmode, int gaincode,
int value1, float volts1, int value2, float volts2);
DESCRIPTION
Calibrates the re spons e of the des ired A/D conve rter cha nnel as a l inear f unction using
the two conversion points provided. Four values are calculated and placed into global
tables
_adcCalibS, _adcCalibD
ed EEPROM using the funct i on
stant and a voltage offset.
PARAMETERS
channelthe channel number (0 to 7) corresponding to LN0 to LN7.
A voltage value corresponding to the voltage differential on the analog input channel.
anaInDiff (continued)
ADTIMEOUT
ADOVERFLOW
SEE ALSO
anaInCalib, anaIn, anaInmAmps, brdInit
(-4095) if the conversion is incomplete or busy bit timeout.
(-4096) for overflow or out of range.
User’s Manual65
anaInmAmps
float anaInmAmps(unsigned int channel);
DESCRIPTION
Reads the state of an analog input channel and uses the previously set calibration constants to convert it to current.
PARAMETERS
channelthe channel number (0 to 7) corresponding to LN0 to LN7.
RETURN VALUE
A current value between 4.00 and 20.00 mA corresponding to the current on the analog
input channel.
ADTIMEOUT
Channel Code
0+AIN0
1+AIN1
2+AIN2
3
4+AIN4*
5+AIN5*
6+AIN6*
7+AIN7
* Negative input is ground.
† Applies to Prototyping Board.
4–20 mA
Input Lines
†
+AIN3
*
(-4095) if the conversion is incomplete or busy bit timeout.
ADOVERFLOW
SEE ALSO
(-4096) for overflow or out of range.
anaInCalib, anaIn, anaInVolts
66RabbitCore RCM4200
anaInEERd
root int anaInEERd(unsigned int channel, unsigned int opmode,
unsigned int gaincode);
DESCRIPTION
Reads the cali br at ion constants, gai n, and offs et for an input ba sed on their desig na te d
position in the flash memory, and places them into global tables
_adcCalibD
following macros can be used to identify the starting address for these locations.
ADC_CALIB_ADDRS, address start of single-ended analog input channels
ADC_CALIB_ADDRD, address start of differential analog input channels
ADC_CALIB_ADDRM, address start of milliamp analog input channels
NOTE: This function cannot be run in RAM.
PARAMETER
channelthe channel number (0 to 7) corresponding to LN0 to LN7.
, and
_adcCalibM
for analog inputs. Dependi ng on th e flas h siz e, the
—single-ended input
—differential input
—4–20 mA input
+AIN0
*
User’s Manual67
anaInEERd (continued)
gaincodethe gain code of 0 to 7. The gaincode parameter is ignored when
channel is ALLCHAN.
RETURN VALUE
0 if successful.
-1 if address is invalid or out of range.
SEE ALSO
anaInEEWr, anaInCalib
Gain Code
0
1
2
3×50–4.5
4
5
6
7
Gain
Multiplier
×10–22.5
×20–11.25
×40–5.6
×80–2.8
×100–2.25
×160–1.41
×200–1.126
* Applies to Prototyping Board.
Voltage Range
(V)
*
68RabbitCore RCM4200
anaInEEWr
int anaInEEWr(unsigned int channel, int opmode,
unsigned int gaincode);
DESCRIPTION
Writes the calibration constants, gain, and offset for an input based from global tables
_adcCalibS, _adcCalibD
memory . Depe nding on th e flash si ze, the fo llowing macros can be used to ide ntify the
starting address for these locations.
ADC_CALIB_ADDRS, address start of single-ended analog input channels
ADC_CALIB_ADDRD, address start of differential analog input channels
ADC_CALIB_ADDRM, address start of milliamp analog input channels
NOTE: This function cannot be run in RAM.
PARAMETER
channelthe channel number (0 to 7) corresponding to LN0 to LN7.
Dynamic C patches that focus on bug fixes are available from time to time. C heck the Web
site www.rabbit.com/support/ for the latest patches, workarounds, and bug fixes.
5.3.1 Add-On Modules
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. Rabbit Semiconductor offers for
purchase add-on Dynamic C modules including the popular µC/OS-II real-time operating
system, as well as PPP, Advanced Encryption Standard (AES), FAT file system, RabbitWeb, and other select libraries.
NOTE: Version 2.10 or later of the Dynamic C FAT file system module is required for
the RCM4200 modules.
Each Dynamic C add-on module has complete documentation and sample programs to
illustrate the functionality of the software calls in the module. Visit our Web site at
www.rabbit.com for further information and complete documentation for each module.
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.
User’s Manual71
72RabbitCore RCM4200
6. USINGTHE TCP/IP FEATURES
6.1 TCP/IP Connections
Programming and development can be done with the RCM4200 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 doi ng Ethernet-enabled develo pment, you should conn ect
the RCM4200 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.
• Two RJ-45 straight-through Ethernet cables and a hub, or an RJ-45 crossover Ethernet
cable.
Figure 14 shows how to identify the two Ethernet cables based on the wires in the transparent RJ-45 connectors.
Same
color order
in connectors
Different
color order
in connectors
StraightThrough
Cable
Figure 14. How to Identify Straight-Through and Crossover Ethernet Cables
Ethernet cables and a 10Base-T Ethernet hub are available from Rabbit Semiconductor in
a TCP/IP tool kit. More information is available at www.rabbit.com.
Now you should be able to make your connections.
User’s Manual73
Crossover
Cable
1. Connect the AC adapter and the serial programming cable as shown in Chapter 2, “Getting Started.”
2. Ethernet Connections
There are four options for connecting the RCM4200 module to a network for develop-
ment 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 RCM4200
module’s Ethernet port directly to the PC’s network interface card using an RJ-45
crossover cable. A crossover cable is a special cable that flips some connections
between the two connectors and permits direct connection of two client systems. A
standard RJ-45 network cable will not work for this purpose.
Micro-LAN — Another simple alternative for desktop development. Use a small Eth-
•
ernet 10Base-T hub and connect both the PC’s network interface card and the
RCM4200 module’s Ethernet port to it using standard network cables.
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 RCM4200 module’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 RCM4200 is capable of direct connection to the Internet and other W ide
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 does not need to be the PC with the Ethernet card.
3. Apply Power
Plug in the AC adapter. The RCM4200 module and Prototyping Board are now ready to
be used.
74RabbitCore RCM4200
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 RCM4200 using an Ethernet crossover
cable or a simple arrangement with a hub. (A crossover cable should not be confused with
regular straight through cables.)
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 RCM4200 uses a 10Base-T type of Ethernet connection, which is the most common
scheme. The RJ-45 connectors are similar to U.S. style telephone connectors, except they
are larger and have 8 contacts.
An alternative to the direct connection using a crossover cable is a direct 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 readil y availa ble . The R CM4200 us es 10 Mbp s Ethernet, so the hub or
Ethernet adapter can be a 10 Mbps unit or 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 RCM4200 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 Manual75
Hub(s)
T1 in
Adapter
Ethernet
Typical Corporate Network
Firewall
Proxy
Server
Network
Ethernet
RCM4200
System
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 RCM4200. 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.
76RabbitCore RCM4200
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 adja-
N
cent IP addresses. There are always 2
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 2
8
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 Manual77
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 Ethernet 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.
Some IP address ranges are reserved for use on internal networks, and can be allocated
freely as long as no two internal hosts have the same IP address. These internal IP
addresses are not routed to the Internet, and any internal hosts using one of these reserved
IP addresses cannot communicate on the external Internet without being connected to a
host that has a valid Internet IP address. The host would either translate the data, or it
would act as a proxy.
Each RCM4200 RabbitCore module has its own unique MAC address, which consists of
the prefix 0090C2 followed by a code that is unique to each RCM4200 module. For example, a MAC address might be 0090C2C002C0.
TIP: You can always obtain the MAC address on your module by running the sample
program DISPLAY_MAC.C from the SAMPLES\TCPIP folder.
78RabbitCore RCM4200
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 RCM4200 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 NT or later you can run the ipconfig command (Start > Run >cmd)
while you are connected and look at the interface used to connect to the Internet.
Many networks use 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 RCM4200 from the Internet, you can place
the RCM4200 on the internal network using an IP address assigned either statically or
through DHCP.
User’s Manual79
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 RCM4200, you have
several options. You can either place the RCM4200 directly on the Internet with a real
Internet address or place it behind the firewall. If you place the RCM4200 behind the firewall, you need to configure the firewall to translate and forward packets from the Internet
to the RCM4200.
80RabbitCore RCM4200
6.4 Running TCP/IP Sample Programs
We have provi ded a numb er of samp le prog rams de mons tratin g vari ous us es of TCP/ IP for
networking embedded systems. These programs require you to connect your PC and the
RCM4200 module 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.
RCM4200
System
User’s PC
Ethernet
crossover
cable
Direct Connection
(network of 2 computers)
Ethernet
cables
RCM4200
System
To additional
Hub
network
elements
Direct Connection Using a Hub
User’s Manual81
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. 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
MASK
, MY_GATEWAY, and MY_NAMESERVER macros in each program.
TCPCONFIG macro with individual MY_IP_ADDRESS, MY_NET-
2. You can leave TCPCONFIG at the usual default of 1, which will set the IP configurations
10.10.6.100, the netmask to 255.255.255.0, and the nameserver and gateway
to
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 RCM4200 module, 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
library in the
There are some other “standard” configurations for
LIB\TCPIP directory.
TCPCONFIG that let you select differ-
ent features such as DHCP. Their values are documented at the top of the TCP_CON-
FIG.LIB
library in the LIB\TCPIP directory. More information is available in the
Dynamic C TCP/IP User’ s Manual.
82RabbitCore RCM4200
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”):
4. Click <OK> or <Close> to exit the various dialog boxes.
RCM4200
IP 10.10.6.101
Netmask
255.255.255.0
System
User’s PC
Ethernet
crossover
cable
Direct Connection PC to RCM4200 Module
User’s Manual83
6.5 Run the PINGME.C Sample Program
Connect the crossover cable from your computer’s Ethernet port to the RCM4200 module’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. The crossover
cable is connected from your computer’s Ethernet adapter to the RCM4200 module’s RJ-45
Ethernet connector. When the program starts running, the green LINK light on the RCM4200
module should be on to indicate an Ethernet connection is made. (Note: If the LINK light
does not light, you may not be using a crossover cable, or if you are using a hub with
straight-through cables perhaps the power is off on the hub.)
The next step is to ping the module from your PC. This can be done by bringing up the
MS-DOS window and running the pingme program:
ping 10.10.6.101
or by Start > Run
and typing the entry
ping 10.10.6.101
The ping routine will ping the module four times and write a summary message on the
screen describing the operation.
6.6 Running Additional Sample Programs With Direct Connect
The following sample programs are in the Dynamic C SAMPLES\RCM4200\TCPIP\
folder.
• BROWSELED.C—This program demonstrates a basic controller running a Web page.
Two “device LEDs” are created along with two buttons to toggle them. Users can use
their Web browser to change the status of the lights. The DS2 and DS3 LEDs on the
Prototyping Board will match those on the W eb 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.
• PINGLED.C—This program demonstrates ICMP by pinging a remote host. It will flash
LEDs DS2 and DS3 on the Prototyping Board when a ping is sent and received.
• SMTP.C—This program demonstrates using the SMTP library to send an e-mail when
the S2 and S3 switches on the Prototyping Board are pressed. LEDs DS2 and DS3 on
the Prototyping Board will light up when e-mail is being sent.
84RabbitCore RCM4200
6.7 Where Do I Go From Here?
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/.
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 Manu al 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 Manual85
86RabbitCore RCM4200
APPENDIX A. RCM4200 SPECIFICATIONS
Appendix A provides the sp ecifications for the RCM4200, and
describes the conformal coating.
User’s Manual87
A.1 Electrical and Mechanical Characteristics
Figure A-1 shows the mechanical dimensions for the RCM4200.
1.84
(47)
R16
0.125
(3.2)
dia
× 2
(5)
0.19
J1
R43
R45
R46
R6
R8
R2
0.50
(13)
R42
R39
R44
U1
R7
C1
L1
C86
C3
C2
JP4
C17
C16
JP5
JP3
JP7
JP6
JP9
JP2
JP1
JP12
JP10
JP11
C75
R40
R41
C76
R5
R51
R31
R3
C82
3
Y3
L2
C43
R11
R27
C15
U15
C74
JP13
C85
U14
JP15
JP14
C78
L7
C72
C65
U13
R20
C57
1
C81
4
0.72
(18)
Y2
C27
C21
R1
R10
D1
R9
C39
U2
C14
C13
JP8
U5
C12
C11
C6
C10
C8
C9
C7
C18
R29
U3
Q1
R36
U4
R12
R14
Y4
Q3
C77
C5
C87
R32
R33
R35
R34
C88
C67
C58
R22
U7
R18
R4
C20
C19
C25
R13
JP16
C24
0.62
(16)
C29
C28
U6
R23
R15
C23
R19
R21
C38
C36
C37
C35
C30
C34
C33
C32
C31
C26
R50
SPEED
R52
R48
DS2
DS3
R49
FDX
R47
LINK
DS1
(16.8)
0.661
J3
(8.9)
0.35
0.10
(2.5)
(28)
1.10
(61)
2.42
0.54
Please refer to the RCM4200
footprint diagram later in this
appendix for precise header
locations.
(13.7)
(21)
0.84
J2
1.84
(47)
2.42
(61)
(12)
0.47
(1.6)
0.064
(2.8)
0.11
(1.6)
0.064
0.23
0.11
(5.8)
(2.8)
(20)
0.77
(5.8)
0.23
Figure A-1. RCM4200 Dimensions
NOTE: All measurements are in inc hes fo llowed b y milli meters enclos ed in pa renthe ses.
All dimensions have a manufacturing tolerance of ±0.01" (0.25 mm).
88RabbitCore RCM4200
It is recommended that you allow for an “exclusion zone” of 0.04" (1 mm) around the
RCM4200 in all directions when the RCM4200 is incorporated into an assembly that
includes other printed circuit boards. An “exclusion zone” of 0.08" (2 mm) is recommended below the RCM4200 when the RCM4200 is plugged into another assembly.
Figure A-2 shows this “exclusion zone.”
2.50
(63)
(15)
0.58
2.42
(61)
(2)
0.08
Exclusion
1.92
(49)
Zone
(15)
0.58
(2)
0.08
J3
1.84
(47)
Figure A-2. RCM4200 “Exclusion Zone”
User’s Manual89
T ableA-1 lists the electrical, mechanical, and environmental specifications for the RCM4200.
Table A-1. RCM4200 Specifications
ParameterRCM4200RCM4210
Microprocessor
EMI ReductionSpectrum spreader for reduced EMI (radiated emissions)
Ethernet Port10/100Base-T, RJ-45, 3 LEDs
Data SRAM512K (8-bit)
Program Execution Fast
SRAM
Flash Memory512K (8-bit)
Serial Flash Memory8 Mbytes4 Mbytes
Backup Battery
General Purpose I/O
Additional Inputs2 startup mode, reset in, CONVERT2 startup mode, reset in
Additional OutputsStatus, reset out, analog VREFStatus, reset out
Analog Inputs
1, 2, 4, 5, 8, 10, 16, and 20 V/ V
®
Rabbit
25 parallel digital I/O lines:
• configurable with four layers of
4000 at 58.98 MHzRabbit® 4000 at 29.49 MHz
512K (8-bit)—
Connection for user-supplied backup battery
(to support RTC and data SRAM)
alternate functions
8 channels single-ended
or 4 channels differential
Programmabl e gain
35 parallel digital I/O lines:
• configurable with four layers
of alternate functions
—
• A /D Converter
Resolution
• A /D Conversion Time
(including 120 µs raw
Auxiliary I/O Bus
Serial Ports
12 bits (11 bits single-ended)
180 µs
Can be configured for 8 data lines and
6 address lines (shared with parallel I/O lines), plus I/O read/write
4 shared high-speed, CMOScompatib le p o rts:
• all 4 configurable as asynchronou s
(with IrDA), 4 as clocked serial
(SPI)
• 1 as ynchronous clocked seri al port
shared with programming port
• 1 clocked serial port shared with
serial flash
5 shared high-speed, CMOScompatible ports:
• all 5 configurable as asynchronou s
(with IrDA), 4 as clocked serial
(SPI), and 1 as SDLC/HDLC
• 1 clocked serial port shared with
serial flash
• 1 as ynchronous clocked se rial port
dedicated for programming
• 1 clocked serial port shared with
A/D converter
90RabbitCore RCM4200
Table A-1. RCM4200 Specifications (continued)
ParameterRCM4200RCM4210
Serial RateMaximum asynchronous baud rate = CLK/8
Slave Interface
Real Time ClockYes
Timers
W atchdog/SupervisorYes
Slave port allows the RCM4200 to be used as an intelligent peripheral device
slaved to a master processor
Ten 8-bit timers (6 cascadable from the first),
one 10-bit timer with 2 match registers, and
one 16-bit timer with 4 ou tputs and 8 set /reset registers
• 3 channels synchronized PWM
with 10-bit counter
Pulse-Wi dth Modulators
Input Capture
Quadrature Decoder
Power
(pins unloaded)
• 3 channels variable-phase or syn-
chronized PWM with 16-bit
counter
2 input capture channels can be used to time input signals from various port
pins
3.0–3.6 V DC, 200 (typ.) mA @ 3.3 V,
225 mA @ 3.6 V and 85°C (max.)
Operating Temperature-40°C to +85°C
Humidity5% to 95%, noncondensing
Connectors
Board Size
One 2 × 25, 1.27 mm pitch IDC signal header
One 2 × 5, 1.27 mm pitch IDC programming header
1.84" × 2.42" × 0.84"
(47 mm × 61 mm × 21 mm)
User’s Manual91
A.1.1 A/D Converter
Table A-2 shows some of the important A/D converter specifications. For more details,
refer to the ADC7870 data sheet.
Table A-2. A/D Converter Specifications
ParameterTest ConditionsTypMax
Analog Input Characteristics
Input Capa citance
Input Impedance
Common-Mode
Differential Mode
Static Accuracy
Resolution
Single-Ended Mode
Differential Mode
Integral Linearity
Differential Linearity
Dynamic Characteristics
Throughput Rate52 ksamples/s
Voltage Reference
V
Accuracy
Buffer Amp Source Current
Buffer Amp Sink Current
Short-Circuit Current
= 2.048 V and 2.5 V
ref
4 – 9.7 pF
6 MΩ
7 MΩ
11 bits
12 bits
±1 LSB
±0.5 LSB
±0.05%
20 mA
200 µA
20 mA
±2.5 LSB
±0.25%
92RabbitCore RCM4200
A.1.2 Headers
The RCM4200 uses a header at J2 for physical connection to other boards. J2 is a 2 × 25
SMT header with a 1.27 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 RCM4200 to be plugged into. These
reference design values are relative to one of the mounting holes.
RCM4200 Series
Footprint
0.016
(0.4)
0.050
0.91
(23)
sq.
(1.27)
0.19
(5)
J2
0.875
(22.2)
J1
0.284
0.334
(7.2)
(8.5)
Figure A-3. User Board Footprint for RCM4200
0.72
(18)
0.62
(16)
User’s Manual93
A.2 Rabbit 4000 DC Characteristics
Table A-3. Rabbit 4000 Absolute Maximum Ratings
SymbolParameterMaximum Rating
T
V
VDD
Operating Temperature-40° to +85°C
A
T
Storage Temperature-55° to +125°C
S
Maximum Input Voltage
IH
Maximum Operating Voltage3.6 V
IO
VDD
+ 0.3 V
IO
(max. 3.6 V)
Stresses beyond those listed in Table A-3 may cause permanent damage. The ratings are
stress ratings only, and functional operation of the Rabbit 4000 chip at these or any other
conditions beyond those indicated in this section is not implied. Exposure to the absolute
maximum rating conditions for extended periods may affect the reliability of the Rabbit
4000 chip.
Table A-4 outlines the DC characteristics for the Rabbit 4000 at 3.3 V over the recommended operating temperature range from T
Table A-4. 3.3 Volt DC Characteristics
SymbolParameterMinTypMax
VDD
I/O Ring Supply Voltage, 3.3 V3.0 V3.3 V3.6 V
IO
I/O Ring Supply Voltage, 1.8 V1.65 V1.8 V1.90 V
= –40°C to +85°C, VDDIO = 3.0 V to 3.6 V.
A
V
V
V
V
I
I
DRIVE
94RabbitCore RCM4200
High-Level Input Voltage
IH
(VDD
= 3.3 V)
IO
Low-Level Input Voltage
IL
(VDD
= 3.3 V)
IO
High-Level Output Voltage
OH
(VDD
= 3.3 V)
IO
Low-Level Output Voltage
OL
(VDD
I/O Ring Current @ 29.4912 MHz,
IO
3.3 V, 25°C
= 3.3 V)
IO
All other I/O
(except TXD+, TXDD+, TXD-, TXDD-)
2.0 V
0.8 V
2.4 V
0.4 V
12.2 mA
8 mA
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.