Rabbit processor
From Wikipedia, the free encyclopedia
The Rabbit processor is a Z80 like 8-bit processor with 4 serial ports,5 parallel ports, timers, Real time clock, wide extended address bus, and other wizbang features. It is made by a company called rabbit semiconductor, a subsidiary of Zworld. Zworld has made a line of embedded controllers based on the Zilog Z80 style microprocessors and now of coarse the rabbit processor. And of course Zilog copied this design from the Intel 8085 processor long ago.
It needs 2 oscillators. Upon RESET all the processor will be initialized except the Real time clock.
These pages are intended to share some information regarding these boards with other developers.
Zworlds latest products include a number of small processor boards which include the rabbit processor, flash and ram memory. These boards are sold for around $30.00 to $100.00.
Generally speaking, I really like these boards. They've got enough flash and ram, the price is good, the hardware has got the essentials that I'm looking for: battery backed ram, flash for code, real time clock, lots of serial ports, lots of programmable IO, and I hope reliable watchdog operation. Older Zworld boards used a standalone watchdog reset chip, the new boards don't, and hopefully have reliable watchdog circuitry built in to the rabbit processor. A separate brown out reset chip is used. I've been skeptical about built in watchdogs, hopefully this is a good one.
Zworld bundles in with their developers kit a proprietary C compiler called Dynamic C.
I've recently ported some C code over to the Dynamic C environment. The code had been compiled previously with the Microsoft 32-bit compiler, Borlands 16 bit compiler for DOS as well as GCC under Linux.
Dynamic C doesn't use header files, it uses library files with the prototypes embedded as comments. I don't like this part of Dynamic C, but was able to work around it, maintaining my code base with the more standard .h & .c files. Following is a description of what I have done with this so you too can enjoy standard C code for your rabbit processor boards.
The standard Dynamic C arrangement, is to compile a single .c file in your project directory. It isn't setup to compile multiple .c files. It can compile multiple .lib files, but it needs to have a list of these in a configuration file which is read in when you start up Dynamic C. The .lib files contain standard C code, with non-standard function interface prototypes embedded within comments within the same .lib module the code lies.
My work around involves creating a single batch file which I run whenever I make changes to my source code. The batch file copies the modules associated .h header file followed by the .c file into one conglomerate .c file in the Dynamic C bin directory. The batch file also modifies the startup initial file which lists all the .lib files to include these .c files.
I have found that individual custom prototypes in comments are not required, as long as there is at least one of these in each module. So I declare a single dummy subroutine in each of my .c files. So for my utils.c file, I added a function like this:
void utils_dync(void) { }
In the utils.h header file, add a standard prototype along with the custom dynamic c export label between the comments, like this:
/* BeginHeader utils_dync */ void utils_dync(void); ... other prototypes and .h stuff /* EndHeader */
Do this for each module. Then I create a dcmain.c module which looks something like this:
#use dcmain.h char *our_argv[2] = {"", ""}; void main(void) { int stat; // these are all empty routines which do nothing but trick the // dynamic c compiler into linking all the modules and pulling // in all the module routine function prototypes. utils_dync(); init_dync(); /* ... for all modules */ stat = dync_main (1, our_argv); }
The dcmain.h looks something like this:
/*------------------------------------------------------------------------ | dcmain.h - This is used as a common include base for the dynamic c compiler. Since we can't use #include statements, we put our common dynamic c's #use statements in here, then specify a single #use dcmain.h in the various .c source modules. |-------------------------------------------------------------------------*/ /*** BeginHeader */ #define const #define __cdecl #define USE_DYNC #use init.c #use utils.c /* ... for all modules */ /*** EndHeader */
There are other nuances about the Dynamic C compiler which may cause you work porting. No support for bit fields. Its assumption that initialized variables in functions are to be put in ROM, etc. A number of quirks that need to be coded around, but nothing too horrible. Once I got threw these my code compiled and ran great. And I can still compile the same code with my favorite PC compilers.