![]() |
| RabbitCore RCM3000 User's Manual |
5. Software Reference
Dynamic C is an integrated development system for writing embedded software. It runs on an IBM-compatible PC and is designed for use with Rabbit Semiconductor controllers and other controllers based on the Rabbit microprocessor. Chapter 4 provides the libraries and function calls related to the RCM3000.
5.1 More About Dynamic C
Dynamic C has been in use worldwide since 1989. It is specially designed for programming embedded systems, and features quick compile and interactive debugging. A complete reference guide to Dynamic C is contained in the Dynamic C User's Manual.
You have a choice of doing your software development in the flash memory or in the static RAM included on the RCM3000. The flash memory and SRAM options are selected with the Options > Project Options > Compiler menu.
The advantage of working in RAM is to save wear on the flash memory, which is limited to about 100,000 write cycles. The disadvantage is that the code and data might not both fit in RAM.
The RCM3000 model has two 256K flash memories. By default, Dynamic C will use only the first flash memory for program code in the RCM3000 model. Uncomment he BIOS
USE_2NDFLASH_CODEmacro to allow the second flash memory to hold any program code that is in excess of the available memory in the first flash.Developing software with Dynamic C is simple. Users can write, compile, and test C and assembly code without leaving the Dynamic C development environment. Debugging occurs while the application runs on the target. Alternatively, users can compile a program to an image file for later loading. Dynamic C runs on PCs under Windows 95 or later. Programs can be downloaded at baud rates of up to 460,800 bps after the program compiles.
Dynamic C has a number of standard features.
- Full-feature source and/or assembly-level debugger, no in-circuit emulator required.
- Royalty-free TCP/IP stack with source code and most common protocols.
- Hundreds of functions in source-code libraries and sample programs:
u Exceptionally fast support for floating-point arithmetic and transcendental functions.
u RS-232 and RS-485 serial communication.
u Analog and digital I/O drivers.
u LCD display and keypad drivers.
- Powerful language extensions for cooperative or preemptive multitasking
- Loader utility program to load binary images into Rabbit targets in the absence of Dynamic C.
- Provision for customers to create their own source code libraries and augment on-line help by creating "function description" block comments using a special format for library functions.
- Standard debugging features:
u BreakpointsSet breakpoints that can disable interrupts.
u Single-steppingStep into or over functions at a source or machine code level, µC/OS-II aware.
u Code disassemblyThe disassembly window displays addresses, opcodes, mnemonics, and machine cycle times. Switch between debugging at machine-code level and source-code level by simply opening or closing the disassembly window.
u Watch expressionsWatch expressions are compiled when defined, so complex expressions including function calls may be placed into watch expressions. Watch expressions can be updated with or without stopping program execution.
u Register windowAll processor registers and flags are displayed. The contents of general registers may be modified in the window by the user.
u Stack windowshows the contents of the top of the stack.
u Hex memory dumpdisplays the contents of memory at any address.
u STDIO window
printfoutputs to this window and keyboard input on the host PC can be detected for debugging purposes.printfoutput may also be sent to a serial port or file.5.2 Dynamic C Functions
5.2.1 Digital I/O
The RCM3000 was designed to interface with other systems, and so there are no drivers written specifically for the I/O. 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.
When using the auxiliary I/O bus on the Rabbit 3000 chip, add the line
#define PORTA_AUX_IO // required to enable auxiliary I/O busto the beginning of any programs using the auxiliary I/O bus.
The sample programs in the Dynamic C
SAMPLES/RCM3000folder provide further examples.5.2.2 Serial Communication Drivers
Library files included with Dynamic C provide a full range of serial communications support. The
RS232.LIBlibrary provides a set of circular-buffer-based serial functions. ThePACKET.LIBlibrary 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, allowing other functions to be performed between calls. For more information, see the Dynamic C Function Reference Manual and Technical Note TN213, Rabbit Serial Port Software.5.2.3 TCP/IP Drivers
The TCP/IP drivers are located in the
LIB\TCPIPfolder. Complete information on these libraries and the TCP/IP functions is provided in the Dynamic C TCP/IP User's Manual.5.2.4 Prototyping Board Functions
The function described in this section is for use with the Prototyping Board. The source code is in the RCM3000
.LIBlibrary in the Dynamic CSAMPLES\RCM3000folder if you need to modify it for your own board design.Other generic functions applicable to all devices based on Rabbit microprocessors are described in the Dynamic C Function Reference Manual.
5.2.5 Board Initialization
void brdInit (void);
- Call this function at the beginning of your program. This function initializes Parallel Ports A through G for use with the RCM3000/31/32XX Prototyping Board.
Return Value
- This function also sets any unused configurable port pins as outputs with a high output, and assumes that only one RCM3000 module is installed in the MASTER position on the Prototyping Board.
- None.
5.3 Upgrading Dynamic C
Dynamic C patches that focus on bug fixes are available from time to time. Check the Web sites www.rabbit.com/support/ for the latest patches, workarounds, and bug fixes.
The default installation of a patch or bug fix is to install the file in a directory (folder) different from that of the original Dynamic C installation. Rabbit Semiconductor recommends using a different directory so that you can verify the operation of the patch without overwriting the existing Dynamic C installation. If you have made any changes to the BIOS or to libraries, or if you have programs in the old directory (folder), make these same changes to the BIOS or libraries in the new directory containing the patch. Do not simply copy over an entire file since you may overwrite a bug fix; of course, you may copy over any programs you have written. Once you are sure the new patch works entirely to your satisfaction, you may retire the existing installation, but keep it available to handle legacy applications.
5.3.1 Upgrades
Dynamic C installations are designed for use with the board they are included with, and are included at no charge as part of our low-cost kits. Dynamic C is a complete software development system, but does not include all the Dynamic C features. Rabbit Semiconductor also offers add-on Dynamic C modules containing the popular µC/OS-II real-time operating system, as well as PPP, Advanced Encryption Standard (AES), and other select libraries. In addition to the Web-based technical support included at no extra charge, a one-year telephone-based technical support module is also available for purchase.
| Rabbit Semiconductor www.rabbit.com |