RabbitCore RCM2000
User's Manual
PREV NEXT INDEX



3. Software Reference

Dynamic C Premier is an integrated development system for writing embedded software. It runs on an IBM-compatible PC and is designed for use with Z-World single-board computers and other single-board computers based on the Rabbit microprocessor. Chapter 3 provides the libraries, function calls, and sample programs related to the RCM2000.

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 Premier User's Manual.

Dynamic C for RabbitTM 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 User's Manual.

Dynamic C cold-boots the target system and compiles the BIOS. The BIOS is a basic program 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. See Section 4.24, "Modules," in the Dynamic C Premier User's Manual for more information.

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.

3.1.2 Using Dynamic C

You have a choice of doing your software development in the flash memory or in the static RAM. There are 256K bytes of flash and 128K SRAM memory. The advantage of working in RAM is to save wear on the flash, which is limited to about 100,000 writes.

NOTE Note that an application can be developed in RAM, but cannot run standalone from RAM after the programming cable is disconnected. All applications can only run from flash.
NOTE Do not depend on the flash sector size remaining constant on all boards. Due to the volatility of the flash market, the RCM2000 and Dynamic C were designed to accommodate flash devices with various sector sizes.

When using flash EPROM, the compile to a file is followed by a download to the flash EPROM. The disadvantage of using flash EPROM is that interrupts must be disabled for approximately 5 ms whenever a break point is set in the program. This can crash fast interrupt routines that are running while you stop at a break point or single-step the program. Flash EPROM or RAM is selected with the Dynamic C Options > Compiler menu.

3.2 I/O

The RCM2000 was designed to interface with other systems, and so there are no drivers written specifically for this purpose. 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.

The sample programs in the Dynamic C SAMPLES directory provide further examples.

3.2.1 PCLK Output

The PCLK output is controlled by bits 7 and 6 of the Global Output Register (GOCR) on the Rabbit 2000 microprocessor, and so can be enabled or disabled in software. Starting with Dynamic C v 7.02, the PCLK output is disabled by default at compile time to minimize radiated emissions; the PCLK output is enabled in earlier versions of Dynamic C.

Use the following code to set the PCLK output as needed.

PCLK output driven with peripheral clock:

	 WrPortI(GOCR, &GOCRShadow, (GOCRShadow&~0xc0));
PCLK output driven with peripheral clock ÷ 2:

	 WrPortI(GOCR, &GOCRShadow, ((GOCRShadow&~0xc0)| 0x40));	 
PCLK output off (low):

	 WrPortI(GOCR, &GOCRShadow, ((GOCRShadow&~0xc0)| 0x80));
PCLK output on (high):

	 WrPortI(GOCR, &GOCRShadow, (GOCRShadow | 0xc0));

3.3 Serial Communication Drivers

Library files included with Dynamic C provide a full range of serial communications support. The RS232.LIB library provides a set of circular-buffer-based serial functions. The PACKET.LIB 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. For more information, see the Dynamic C Premier User's Manual and Technical Note 213, Rabbit 2000 Serial Port Software.


PREV NEXT INDEX


Z-World
http://www.zworld.com
Voice: (530) 757-3737
FAX: (530) 753-5141
sales@zworld.com
Rabbit Semiconductor
http://www.rabbitsemiconductor.com
Voice: (530) 757-8400
FAX: (530) 757-8402
sales@rabbitsemiconductor.com