User`s manual

16 RabbitCore 2000
3.1 More About Dynamic C
Dynamic C has been in use worldwide since 1989. Dynamic C is specially designed for
programming embedded systems. Dynamic C features quick compile and interactive
debugging in the real environment. A complete reference to Dynamic C is contained in
the Dynamic C Reference Manual.
Dynamic C for Rabbit
processors uses the standard Rabbit programming interface. This
is a 10-pin connector that connects to the Rabbit serial port A. It is possible to reset and
cold-boot a Rabbit processor via the programming port. No software needs to be present
in the target system. More details are available in the Rabbit 2000 Microprocessor Users
Manual.
Dynamic C cold-boots the target system and compiles the BIOS. The BIOS is a basic pro-
gram of a few thousand bytes in length that provides the debugging and communication
facilities that Dynamic C needs. Once the BIOS has been compiled, the user can compile
his own program and test it. If the BIOS fails because the program stops running, a new
cold boot and BIOS compile can be done at any time.
The BIOS can be customized by using #define options.
Dynamic C does not use
include files, rather it has libraries that are used for the same
purpose, that is, to supply function prototypes to programs before they are compiled.
Libraries are much easier to use compared to include files.
Dynamic C supports assembly language, either as separate functions or as fragments
embedded in C programs. Interrupt routines may be written in Dynamic C or in assembly
language.
3.1.1 Operating System Framework
Dynamic C does not include an operating system in the usual sense of a complex software
system that is resident in memory. The user has complete control of what is loaded as a
part of his program, other than those routines that support loading and debugging (which
are inactive at embedded run time). However, certain routines are very basic and normally
should always be present and active.
Periodic interrupt routine. This interrupt routine is driven by the Rabbit periodic inter-
rupt facility, and when enabled creates an interrupt every 16 ticks of the 32.768 kHz
oscillator, or every 488 µs. This routine drives three long global variables that keep
track of the time:
SEC_TIMER, MS_TIMER, and TICK_TIMER that respectively count
seconds, milliseconds, and 488 µs ticks. These variables are needed by virtually all
functions that measure time. The SEC_TIMER is set to seconds elapsed since 1 Jan
1980, and thus also keeps track of the time and date. The periodic interrupt routine
must be disabled when the microprocessor enters sleepy mode and the processor clock
is operating at 32.768 kHz. The interrupt routine cannot complete at this slow speed
before the next tick of the periodic interrupt. In this situation, the hardware real-time
clock can be read directly to provide the time.