This is only a preview of the October 2001 issue of Silicon Chip. You can view 30 of the 96 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Items relevant to "Build Your Own MP3 Jukebox; Pt.2":
Items relevant to "Super-Sensitive Body Detector":
Items relevant to "An Automotive Thermometer":
Items relevant to "Programming Adapter For Atmel Microcontrollers":
|
Run
RABBIT
Run
Rabbits usually have long ears, four
legs, lots of fur and can run very
fast. This earless rabbit has 100 legs,
no fur and runs much faster than a
Z180 microprocessor.
So is this some form of super mutant
rabbit? Nope – it’s a microprocessor
that runs rings around the old Z180
but uses an updated Z180-style instruction set to make things easy for
experienced Z80/Z180 assembly language programmers.
If you can program a Z180, you can
program this baby! – or should that
be bunny?
Going back in time, the Rabbit 2000
Microprocessor was first let out of its
hutch by Rabbit Semiconductor in the
US in 1999 and immediately spread
out, recently arriving Down Under
after a long swim across the Pacific. It’s
a robust little critter that’s completely
unaffected by the Calisi virus and is
supported by several very impressive
development kits that in
clude the
Dynamic C programming language.
And no, that’s not a trial version
The RCM2100 Ethernet Core module includes
both the Rabbit microcontroller and a Realtek
RTL8019AS ethernet IC. You can talk to
this unit directly via a LAN or via the
Internet.
6 Silicon Chip
of Dynamic C – it’s a fully-working
version that’s supplied with the core
modules and the development kits.
What’s in the burrow?
There’s more than one Rabbit running around in this warren. Apart
from the Rabbit 2000 microprocessor
itself, there’s also the Rabbit 2000 and
RabbitCore 2000 development kits; the
RabbitCore RCM 2100 & 2200 Ethernet
Core modules; the two development
kits associated with these core modules; plus a host of other Rabbit-based
products, including the “Jackrabbit”
development board, the “RabbitLink”
card and the “Rabbit Cloning Board”.
The “RabbitLink” card lets you program and debug your Rabbit-based
system via a network or the Internet – see Fig.1. What’s more, an
inbuilt miniature web server
and SMTP client can be
controlled by any embedded
system via the RabbitLink’s serial
port. This allows the system to send
information to the network using
either email or easily-updated static
HTML pages.
Want to breed Rabbits? – the Rabbit
Cloning Board lets you do just that. It
www.siliconchip.com.au
copies compiled software programs
from one Rabbit 2000-based board to
another without the need for a PC.
Rabbit stew
The main ingredient in the Rabbit
stew is, of course, the Rabbit 2000
microprocessor. This is a high-performance, 8-bit microprocessor with
a “C-friendly” instruction set, fast
number crunching ability and numerous on-chip peripherals. It boasts four
serial ports, a slave port, remote bootstrap capability, advanced clocking
options (five 8-bit timers & two 10-bit
timers), and “glueless” interfacing to
both memory and I/O – making hardware design easy.
(Note: “glueless interfacing” means
that all the interface logic is built into
the microprocessor).
This Rabbit is fast, with clock
speeds up to 30MHz. And because it’s
optimised for a C-oriented instruction
set, the 8-bit Rabbit 2000 is claimed
to be a viable alternative to existing
16-bit and 32-bit processors in many
situations but at a much lower cost.
It runs about three times faster than
the Z180 for the same memory speed
when running C code.
In practice, you can load up to
50,000 or more lines of Dynamic C
into the Rabbit’s 1MB of code space.
The Dynamic C provides an interactive compiler, editor and source-level
debug
ger and eliminates the need
for external emulator hardware. Numerous application libraries are also
The RabbitCore RCM2100 Developer’s Kit includes an RCM2100 Ethernet core
module with 512KB of flash memory and 512KB of static RAM; a prototyping
board; an RS232 programming cable (10-pin header to DB9); a Dynamic C SE
CD-ROM (includes royalty-free TCP/IP stack with source plus complete product
documentation); a plugpack power supply; and a “Getting Started Manual”.
included, thereby shortening development time and making programming
easier.
The instruction set
The Rabbit 2000 features an updated
Z180-style architecture for improved
performance. At the same time, a
number of obsolete Z180 instructions
have been dropped to allow efficient
1-byte operation codes for new instructions. This means that existing
Z180 assembly language programs
can be ported to the Rabbit 2000 with
minimal changes.
New “C-friendly” instructions are
included for fetching and storing 16bit words located at a computed memory address or on the stack. These new
instructions perform fetches, stores,
calls, returns and jumps over a full
megabyte of address space.
The new instructions are claimed
to improve communication between
Programming The Rabbit With Dynamic C
The supplied Dynamic C for the
Rabbit 2000 includes a powerful
editor, compiler, linker, loader and
debugger, along with hundred of
functions in source-code libraries.
In fact, compiling, linking and loading are all one function. Dynamic C
does not use an in-circuit emulator
(ICE) – instead, programs being
developed are downloaded to and
“executed” from the “target” system
via the serial port connection.
This makes for faster program
development and debugging of errors. Breakpoints, single stepping,
observation of variables in a running
program, complex watch expressions
and “printf” com
mands to the Dynamic C console are all supported
www.siliconchip.com.au
to aid debugging. Other features of
Dynamic C include:
(1) An easy-to-use inbuilt text editor. Programs can be executed and
debugged interactively at sourcecode or machine-code level. Pull
down menus and keyboard shortcuts
for most commands help make Dynamic C easy to use.
(2) Dynamic C supports assembly
language programming and it is not
necessary to leave C or the development system to write assembly
language code. In addition, both C
and assembly language can be mixed
together.
(3) Dynamic C provides extensions
to the C language (such as shared
and protected variables, co-state-
ments and co-functions) that support
real-world embedded system development. Interrupt service routines
can be written in C and both cooperative and pre-emptive multitasking
are supported.
(4) Dynamic C is supplied with
many function libraries, all in source
code. These libraries support real-time programming and machine
level I/O and provide string and maths
functions.
(5) Dynamic C can be compiled
directly to memory. Functions and
libraries and compiled, linked and
downloaded on the fly. On a fast PC,
Dynamic C can load 30,000 bytes of
code in five seconds at a baud rate
of 115,500 bps.
October 2001 7
the registers, effectively enlarging the
register set. Other new instructions
provide 16-bit logical and arithmetic
operations. Software floating point
routines for add, subtract and multiply
require less than 12µs at maximum
clock speed.
An interesting feature is that memory access instructions can be turned
into I/O access instructions by using
a prefix. As a result, I/O access is
faster and more flexible than on the
Z180.
Battery backup
The Rabbit 2000 has a special
support feature for battery-backed
RAM. At the same time, a hardware
memory write-protect feature protects
battery-backed RAM and flash memory
from inadvertent write operations.
TCP/IP
RABBIT
LINK
On-chip peripherals
SERIAL
DATA
RCM2100
CORE
MODULE
RJ45
Fig.1: the Rabbit Link interface
module lets you program the
RCM2100 Core Module directly
via a LAN or via the Internet.
Programming Point-to Point Protocol (PPP)
If you want an embedded system
to use the Internet for communications, PPP (Point-to-Point Protocol)
is required. Included as an extension
to the stand Rabbit 2000 TCP/IP
stack, PPP provides the connection
to an Internet Service Provider (ISP).
The PPP source code is included in
Dynamic C Premier (an extra-cost
upgrade from Dynamic C SE).
One of the most common uses
of PPP is the transfer of IP packets
8 Silicon Chip
between a remote host and an ISP
over a modem connection. The
interface between the Rabbit 2000
controller and the modem is either a
true RS232 interface or a variation on
RS232 that uses TTL voltage levels
for the signals.
The Rabbit implementation for PPP
uses serial port C on the Rabbit chip.
Hardware flow control is implemented
and follows the RS-232 convention of
using the RTS and CTS lines.
There are more on-chip peripherals
on this Rabbit than fleas on its furry
namesake. The accompanying panel
shows you what’s there but we’ll list
them anyway. There’s a slave interface
which allows the Rabbit 2000 to be
treated as an intelligent peripheral
device; remote bootstrap (so that it can
be remotely cold-booted via a serial or
parallel slave port); four serial ports
plus 40 I/O pins grouped as five 8-bit
ports; a low-power “sleep” mode for
battery-powered applications; an onboard oscillator based on a standard
32.768kHz crystal; and six timers (four
8-bit and two 10-bit, as mentioned
previously).
Up to six static memory ICs can be
hung off the Rabbit via those 40 I/O
lines, without the need for interfacing
logic.
Take a look at the accompanying
panel if you want more information
on these on-chip peripherals.
Rabbit on Ethernet
OK, now that we’ve looked at the
www.siliconchip.com.au
The Rabbit’s On-Chip Peripherals
Slave interface: the slave port allows the Rabbit 2000 to be treated
as an intelligent peripheral device.
The slave port has six I/O registers,
three of each direction. Handshaking
flags and mutual interrupt capability
are supported.
Remote bootstrap: the Rabbit 2000
may be remotely booted by an external device via a serial port or slave
port with no pre-existing pro
gram.
This allows complete reprogramming
of soldered-in flash memory. It also
allows RAM-only configurations with
external boot and program initialisation.
I/O interface and ports: there are
40-plus I/O pins grouped in five 8-bit
ports. Eight external programmable
I/O interface signals can be config
ured as I/O chip selects, I/O write
strobes, I/O read strobes and I/O
read/write strobes. Standard I/O read
and I/O write enable signals are also
available. I/O devices can be directly
connected to the I/O interfaces, and
often without glue logic.
Four asynchronous serial ports
are on-chip. Two of the ports also
have synchronous communication
capability. The asynchronous ports
operate at speeds up to 1/32 of the
clock frequency, while synchronous
mode allows baud rates up to 1/8th
of the clock frequency.
Low power sleepy mode: a unique
sleepy mode of operation is available on the Rabbit 2000. Normally,
the main oscillator is implemented
by directly connecting a crystal or
ceramic resonator with a frequency
in the range of 1.8-30MHz. The frequency can be double of divided by
eight internally to modulate power
consumption and speed of execution.
In sleepy mode, the main oscillator
is turned off and the main clock is
taken from the Rabbit’s 32.768kHz
oscillator. Roughly 3000 instructions
per second can be executed with
a current consumption of around
200µA. The sleepy mode is far more
flexible than sleep modes of other
microprocessors because instruction
execution and decision making capability are maintained. This feature is
excellent for many battery-powered
applications.
Clock speed: the Rabbit 2000 performs 1-byte reads (and most 1-byte
operations) in two clock cycles, and
1-byte writes in three clock cycles. It
requires 55ns memory to operate at
30MHz with no wait states.The Rabbit
2000 runs at 24MHz with 70ns flash
memory and no wait states.
Time/date oscillator: the 32.678kHz
oscillator uses an external quartz
crystal. This 32.768kHz clock is used
to drive a battery-backable internal
48-bit counter or real-time clock.
Timers: the Rabbit 2000 has two
sets of timers, as well as a general
purpose clock interrupt. The periodic
interrupt is driven by the 32.768kHz
oscillator divided by 16, giving an
interrupt every 488 microseconds if
enabled.
Timer A consists of five 8-bit reloadable down counters. The output
of flour of the timers is used to provide
baud clocks for the serial ports. These
timers can also cause interrupts and
clock the timer synchronized parallel
output ports.
Timer B consists of a 10-bit free
running counter and con
tains two
10-bit match registers. The timer
generates an output pulse whenever the counter reaches the match
value. This output pulse can be programmed to generate an interrupt.
Silicon Chip
Binders
REAL
VALUE
AT
$12.95
PLUS
P&P
Heavy board covers with 2-tone
green vinyl covering
Rabbit’s innards, let’s take a look at
the RCM 2100/2200 Ethernet Core
Modules and the development kits.
Ethernet? – you bet your furry ears.
You can plug a RabbitCore module
directly into a standard computer
network and “talk” to it via your
LAN. Alternatively, you can connect
www.siliconchip.com.au
it directly to your PC’s network card
using a crossover cable. You can even
program the Rabbit via a LAN, using
the RabbitLink interface card (Fig.1).
So how do they get it to talk to a
network? Simple – by incorporating a Realtek RTL8019AS Ethernet
IC directly onto the module. This
Each binder holds up to 14
issues
Price: $A12.95 plus $A5 p&p each
(Australia only)
Just fill in & mail the handy order
form in this issue; or fax (02) 9979
6503; or ring (02) 9979 5644 & quote
your credit card number.
October 2001 9
allows any faults to be remotely corrected.
It can also serve as a portal for
downloading updated software to the
main system.
Developer’s kits
Fig.2: the Dynamic C development environment. Shown here are the main
editing window, the assembly code window, the register window, the stack
window and the watch window (which lets you watch variables).
Fig.3: this simple LED demonstration
program is supplied on the CD-ROM.
Fig.4: the CD-ROM includes the source
code for the demonstration programs.
NE2000-compatible chip has all the
hardware “smarts” necessary for network communication and is interfaced
to an RJ-45 socket that accepts a standard Cat.5 network cable connector.
That means that your RabbitCore
module doesn’t even have to be connected directly to your PC in order to
talk to it. Instead, it can be anywhere
on the local LAN or even “somewhere
out there” on the Internet.
SMTP email server right into this
unit. Think of what you could do with
that for industrial process control and
monitoring applications.
The core module can also be mount
ed on a user-designed motherboard
and can act either as the controlling
microprocessor or as a satellite processor to relay network communications.
A satellite processor allows remote
monitoring of system operation and
Web server
It’s got other advantages as well.
The software CD-ROM included with
the core module includes a complete
TCP/IP stack (including source code)
plus a web server that can be compiled
in Dynamic C and downloaded to the
Rabbit’s flash memory.
Yes, that’s right – you can build
an embedded web page server or an
10 Silicon Chip
Fig.5: source files for the various networking protocols are on the CD-ROM.
There are five developer’s kits
available for the Rabbit; (1) Rabbit
2000 TCP/IP Developer’s Kit; (2) RabbitCore RCM2000 Developer’s Kit; (3)
RabbitCore RCM2100 Developer’s Kit;
(4) RabbitCore RCM 2200 Developer’s
Kit; and (5) the RabbitCore RCM2300
Development Kit.
The developer’s kit pictured in this
article is the RabbitCore RCM2100. It’s
supplied with the following items:
(1). The RCM2100 Ethernet core module with 512KB of flash memory and
512KB of static RAM;
(2). A prototyping board complete with
power supply circuitry, LEDs, switch
es and prototyping area;
(3). An RS232 programming cable (10pin header to DB9);
(4). Dynamic C SE CD-ROM – includes
royalty-free TCP/IP stack with source
plus product documentation;
(5). A plugpack power supply; and
(6). A “Getting Started Manual”.
The “Getting Started Manual” is
quite comprehensive and details the
hardware setup and the Dynamic C
software installation. It also includes
several sample Dynamic C programs
with full instructions on how to compile and run these, so that you can
quickly familiarise yourself with the
RabbitCore module.
The manual concludes with full
circuit diagrams of the RabbitCore
RCM2100 module and the RCM2100
prototyping board.
Catching your Rabbit
You can catch your very own silicon
Rabbit at Dominion Electronics, Suite
201, 82 Christie St, St Leonards 2065.
Phone (02) 9906 6988 or email sales<at>
dominion.net.au
The RCM 2100 Ethernet Core
Module costs $223.00, while the
lower-specced RCM2200 retails
for $126.00. The development kits,
which include the core modules,
cost $682 and $580 respectively. The
Rabbit 2000 Basic Development Kit is
$379.50, while the Rabbit 2000 TCP/
IP Development Kit is $489.50.
For more information on what’s in
the Rabbit burrow, point your browser
SC
to www.dominion.net.au
www.siliconchip.com.au
|