Dynamic C is an integrated development system for writing embedded software. It is designed for use with Rabbit controllers and other controllers based on the Rabbit microprocessor.
Dynamic C integrates the following development functions into one program:
Editing
Compiling
Linking
Loading
Debugging
Dynamic C has an easy-to-use, built-in, full-featured text editor. Dynamic C programs can be executed and debugged interactively at the source-code or machine-code level. Pull-down menus and keyboard shortcuts for most commands make Dynamic C easy to use.
Dynamic C also supports assembly language programming. It is not necessary to leave C or the development system to write assembly language code. C and assembly language may be mixed together.
Debugging under Dynamic C includes the ability to use printf commands, watch expressions, breakpoints and stack tracing. Watch expressions can be used to compute C expressions involving the target’s program variables or functions. Watch expressions can be evaluated while stopped at a breakpoint or while the target is running its program. Stack tracing shows function call sequences and parameter values.
Dynamic C provides extensions to the C language (such as shared and protected variables, costatements and cofunctions) that support real-world embedded system development. Dynamic C supports cooperative and preemptive multitasking.
Dynamic C comes with many function libraries, all in source code. These libraries support real-time programming, machine level I/O, and provide standard string and math functions.
Dynamic C compiles directly to memory. Functions and libraries are compiled and linked and downloaded on-the-fly. On a fast PC, Dynamic C might load 30,000 bytes of code in five seconds at a baud rate of 115,200 bps.
New features from ANSI/ISO C90 are gradually being added to Dynamic C.
The following features were introduced in Dynamic C 10.60:
Variable initializer support: Variables can now be initialized within a declaration.
Preprocessor support for the "defined" keyword: The "defined" keyword can now be used in #if / #elif expressions to determine whether a macro has been previously defined.
#include support: The standard C mechanism of using "#include" to include other source files is now supported.
The following feature was introduced with Dynamic C 10.62:
Function pointer parameter list checking: Function pointers may now contain a parameter list, and the compiler will check the parameters and perform automatic type promotion when a function is called through the function pointer.
The following features were introduced with Dynamic C 10.64:
"File Scoping: In projects using multiple .C files, each C source file now defines a new scope separate from all other C files. Using the static keyword ensures that file-scope variables and functions are visible only within the file in which they are defined. Omitting the static or using extern will link those symbols to other files where they are used. The new functionality obeys the ANSI-C rules for file scoping for .C and .H files. The Dynamic C extension #use (which works with .LIB files) works with the new scoping with some important caveats noted in section 4.7 "Libraries".
"Nested/block Scoping: Nested, or block, scoping allows the declaration of variables within a curly-brace-delimited block. Previously, Dynamic C only allowed declarations at the beginning of a function block (as defined by the original K&R C specification). In addition, #asm assembly blocks now each have their own local (function) block scope preventing name collisions between global and local assembly labels.
"Const Correctness: Dynamic C now handles the functionality of the const keyword as it is defined in the ANSI-C89/ISO-C90 specification. See Section 4.4 “The const Keyword” for information on the differences between the older Dynamic C functionality and the new ANSI functionality.
"signed Keyword: The signed keyword is now supported. Variables of type char can also now be signed; previously, char variables could only be unsigned.
Dynamic C offers a number of extensions to the standard C language. These extensions are targeted for making your embedded development easier.
Many enhancements have been added to Dynamic C. Some of these are listed below.
Dynamic C 10.54 introduces remote firmware updates for some board types. Please see AN421 “Remote Program Update” for more information. This document is available on the Dynamic C software CD and on the Rabbit Support web site.
Function Chaining, a concept unique to Dynamic C, allows special segments of code to be embedded within one or more functions. When a named function chain executes, all the segments belonging to that chain execute. Function chains allow software to perform initialization, data recovery, or other kinds of tasks on request. Dynamic C also provides a special function chain called _GLOBAL_INIT which can be used for initialization code. The _GLOBAL_INIT function chain is executed at the start of the program. Dynamic C also provides a special function chain called _GLOBAL_INIT which can be used for initialization code. The _GLOBAL_INIT function chain is executed at the start of the program.
Costatements allow cooperative, parallel processes to be simulated in a single program.
Cofunctions allow cooperative processes to be simulated in a single program.
Slice Statements allow preemptive processes in a single program.
Dynamic C supports embedded assembly code and stand-alone assembly code.
Dynamic C has keywords that help protect data shared between different contexts (shared) or stored in battery-backed memory (protected).
Dynamic C has a set of features that allow the programmer to make the fullest use of xmem (extended memory). Up until the release of Dynamic C 10.21, the compiler supported a 1 MB physical address space. Starting with Dynamic C 10.21, the compiler supports up to the 16 MB of physical memory; up to 16 MB can be used for data and up to 1 MB can be used for code. (Dynamic C has been verified to work with Rabbit-based boards with up to 4.5 MB of memory.)
Normally, Dynamic C takes care of memory management, but there are instances where the programmer will want to take control of it. Dynamic C has keywords and directives to help put code and data in the proper place, such as: root, xmem, and #memmap for code and far for data.
See Chapter 10 for further details on memory management.
The #use statement allows you to create library files that include your function declarations and definitions together. Starting with Dynamic C 10.60, you can use the standard #include mechanism instead.
The main differences in Dynamic C are summarized in the list below and discussed in detail in Chapter 4. “Language” and Chapter 14. “Keywords.”
Bit fields are not supported.
Separate compilation of different parts of the program is not supported.