Skip to content
Tom Collins edited this page Dec 26, 2023 · 7 revisions

Rabbit Core Module 2000, 3000, 4000

This port is mostly from Erik Brage. It has been currently tested only on Linux environments only.

@feilipu - Updated in August 2023.

Introduction

The //Rabbit Core Modules// are near-Z80 compatible boards still produced. The boards were manufactured by a Davis, California based company called Z-World, starting in the early 2000's, using processors they created under the Rabbit Semiconductor brand name.

Rabbit was swallowed by Digi International's Embedded Solutions division around 2010. All data is still available, at https://www.digi.com/products/browse/rabbit/

Using Z88DK

If you have a Unix/Linux system you can compile the utilities in z88dk/support/rcmx000 with the make command.

Example programs

The example programs are in z88dk/examples/rcmx000. A Makefile is provided for the Unix users.

The download utility (boot)

You should be able to run the boot program, either directly or by including this also into your PATH.

'boot' on its own on a command line will give a short hint of its usage. The lines run_example: and run_baudmeas in the Makefile should also give you a hint on how to use this tool.

Obtaining your baudrate

Since the Rabbit serial boot loader derives its clock speed from the CPU clock it is necessary to measure the baud rate in order to set it to some other speed than the hw supported bootstrap speed of 2400 baud. The bootstrap baudrate is always the same since it is derived from other means.

What needs to be set is the baudrate divisor, which will be different for different clocks.

The baudmeas.c and baudmeas.asm routines will do this for you, replace the ttyXXX in the Makefile and run 'make run_baudmeas', NOTE This will download several kBytes of data at 2400 baud so it will take about 19-20 seconds to complete. Be Patient!!! The good news is that this needs to be run only once for each new target!

If it takes longer than that, you might want to check your cabling the power supply to the rabbit board, if you are using the correct serial port etc. It has also proved necessary in some cases to initialize the serial port, via the 'minicom' program once after each reboot.

If all goes well you should see a few lines of text and after that a number will be presented to you, it will be 120 for clocks of 9.216 MHz and 192 for clocks of 14.745600 MHz etc.

Example programs

Now that you know your baudrate divisor you can patch that into the Makefile at the run_example line.

Run this example via the 'make run_example' command line. The example.c program will ask you to enter a few characters and then <enter>

The example.c program will then echo the characters one-by-one including the newline character, thus demonstrating rudimentary stdio capabilities.

Another example program, valid only for the Rabbit 2000 boards, is the twinkle2000.c It will set the output bits of port "A" on the processor to flash on and off each second (using the RTC to get the timing).

The final example program will flash the diodes on the Rabbit 3000 dev boards, located on port PGx, surprisingly named twinkle3000.c ;-)

Hardware notes

Rabbit development boards

There are a number of evaluation and development boards available. If you need info, lookup here.

Download cable

The download cable converts between the hosts rs232 line to logic levels suitable for the Rabbit boards.

Build your own stuff

Just by taking a Core module and some 0.1" adaptor wings it is quite simple for the average home-electronic-hobbyist.

Just solder together the adaptor wings that convert from the Core modules 1.0 mm spacing to 0.1" suitable for a breadboard.

The only pins on the breadboard that need connecting for the Core module to start is the VCC and GND pins (and the programming cable of course ;-) )

Beware!! the voltage required is different for different Core modules. Some, like the RCM2000 series requires 5V and others, like the RCM3000 requires 3.3V, if you fry something, don't blame us !!!

The download cable is not rocket-science either, it is possible to use some simple logic converter, like a MAX232, the most troublesome part might be to find a 1.27 or 2mm spaced 10-pin connector.

Digi International sells FTDI-based USB programming cables:

To test the module you can run the example.c program provided in the examples/rcmx000/ directory. If you want something more visible, it is easy to connect a LED to one of the port pins, using a suitable current limiting resistor of about 330 Ohm

Implementation features

Rabbit specific mnemonic support

Support has been completed in both sccz80 and z80asm and the intrinsic library support (l_ functions) has been extended wherever possible.

Several differences between the R2000/R3000 and Z80/Z180 opcodes exist. Summarised by Section 19 in this document.

Native integer and floating point support

The Rabbit has a number of nice features not found in the Z80 series, such as 16-bit signed hardware multiplication. Fast integer multiplication has been provided using the native 32_16x16 signed multiply instruction, and has been extended to 64_64x64 long long support.

The math32 floating point library has been extended to use native Rabbit instructions wherever possible, and the mantissa multiply process (used for both multiplication and division) is optimised to use the native 32_16x16 signed multiply where possible.

Todo's

Warning: This section might be partially outdated since the Rabbit platform support is being improved.

Persistent storage (flash)

When using the almost-native compiler, Dynamic-C, for the Rabbit boards, it automatically stores any program written into the on-board flash so that if the rabbit is disconnected from the programming cable it will start to execute that code by itself when power is applied. No code to handle the flash has so far been written.

>64k memory model

The Rabbit processors are capable of addressing 1M of total memory using an efficient bank-switching scheme. This is not used currently and the programs are limited to max 64k. See the www.rabbitsemiconductor.com site for more documentation on the segment registers.

Drivers

Only rudimentary support for stdio has been implemented so far; in order to use any other cool features, such as ethernet, PWM modulation or just simple bit-banging I/O, driver code has to be written. The #asm directive of the z88dk can be used for writing to registers setting up interrupts etc.

Debugging

Always a hot issue, the best solution is to implement the NoICE protocol ( http://www.noicedebugger.com ) to enable assembler, or at least hex-monitor debugging. This is not so much work, but one also might want C-level debugging which is a larger project.

Support for other host-OS than Linux

It should not be that hard to make this run on any machine with a decent C-compiler and a serial port, the code for downloading via serial line is not so large. One needs to be able to change the baudrate on-the-fly and also to control the DTR line directly since it resets the target.

Clone this wiki locally