Table of Contents


1 Installing Dynamic C

1.1 Requirements
1.2 Assumptions

2 Introduction to Dynamic C

2.1 The Nature of Dynamic C
Speed
2.2 Dynamic C Enhancements and Differences
2.3 Dynamic C Differences Between Rabbit and Z180

3 Quick Tutorial

3.1 Run DEMO1.C
Single-Stepping
Watch Expression
Breakpoint
Editing the Program
3.2 Run DEMO2.C
Watching Variables Dynamically
3.3 Run DEMO3.C
Cooperative Multitasking
3.4 Summary of Features

4 Language

4.1 C Language Elements
4.2 Punctuation and Tokens
4.3 Data
Data Type Limits
4.4 Names
4.5 Macros
Restrictions
4.6 Numbers
4.7 Strings and Character Data
String Concatenation
Character Constants
4.8 Statements
4.9 Declarations
4.10 Functions
4.11 Prototypes
4.12 Type Definitions
4.13 Aggregate Data Types
Array
Structure
Union
Composites
4.14 Storage Classes
4.15 Pointers
4.16 Pointers to Functions, Indirect Calls
4.17 Argument Passing
4.18 Program Flow
Loops
Continue and Break
Branching
4.19 Function Chaining
4.20 Global Initialization
4.21 Libraries
4.22 Support Files
4.23 Headers
4.24 Modules
The Key
The Header
The Body
Function Description Headers

5 Multitasking with Dynamic C

5.1 Cooperative Multitasking
5.2 A Real-time Problem
Solving the Real-time Problem With a State Machine
5.3 Costatements
Solving the Real-time Problem With Costatements
Costatement Syntax
Control Statements
5.4 Advanced Costatement Topics
The CoData Structure
CoData Fields
Pointer to CoData Structure
Functions for Use With Named Costatements
isCoDone
isCoRunning
CoBegin
CoPause
CoReset
CoResume
Firsttime Functions
Shared Global Variables
5.5 Cofunctions
Syntax
Calling Restrictions
CoData Structure
Firsttime functions
Types of Cofunctions
Types of Cofunction Calls
Special Code Blocks
Solving the Real-time Problem With Cofunctions
5.6 Patterns of Cooperative Multitasking
5.7 Timing Considerations
waitfor Accuracy Limits
5.8 Overview of Preemptive Multitasking
5.9 Slice Statements
Syntax
Usage
Restrictions
Slice Data Structure
Slice Internals
5.10 Summary

6 The Virtual Driver

6.1 Default Operation
6.2 Calling _GLOBAL_INIT()
6.3 Global Timer Variables
6.4 Watchdog Timers
Hardware Watchdog
Virtual Watchdogs
6.5 Preemptive Multitasking Drivers

7 The Slave Port Driver

7.1 Slave Port Driver Protocol
Overview
Registers on the Slave
Polling and Interrupts
Communication Channels
7.2 Functions
7.3 Examples
Example of a Status Handler
Example of a Serial Port Handler
Example of a Byte Stream Handler

8 Run-Time Errors

8.1 Run-Time Error Handling
Error Code Ranges
Fatal Error Codes
8.2 User-Defined Error Handler
Replacing the Default Handler
8.3 Run-Time Error Logging
Error Log Buffer
Initialization and Defaults
Configuration Macros
Error Logging Functions
Examples of Error Log Use

9 Memory Management

9.1 Memory Map
Memory Mapping Control
9.2 Extended Memory Functions
Code Placement in Memory

10 The Flash File System

10.1 General Usage
Maximum File Size
Using SRAM
Wear Leveling
Low-level Implementation
Multitasking and the File System
10.2 Application Requirements
FS1 Requirements
FS1 and Use of the First Flash
FS2 Requirements
FS2 Configuration Macros
FS2 and Use of the First Flash
10.3 Functions
FS1 API
FS2 API
10.4 Setting up and Partitioning the File System
Initial Formatting
Logical Extents (LX)
Logical Sector Size
10.5 File Identifiers
File Numbers
File Names
10.6 Skeleton Program Using FS1
10.7 Skeleton Program Using FS2

11 Using Assembly Language

11.1 Mixing Assembly and C
Embedded Assembly Syntax
Embedded C Syntax
Setting a Breakpoint in an Assembly Block
11.2 The Assembler and the Preprocessor
Comments
Defining Constants
Multiline Macros
Labels
Special Symbols
C Variables
11.3 Stand-Alone Assembly Code
Stand-Alone Assembly Code in Extended Memory
Example of Stand-Alone Assembly Code
11.4 Embedded Assembly Code
The Stack Frame
Example of Embedded Assembly Code
Local Variable Access
11.5 C Functions Calling Assembly Code
Passing Parameters
Location of Return Results
11.6 Assembly Code Calling C Functions
11.7 Interrupt Routines in Assembly
11.8 Common Problems

12 Keywords

13 Operators

14 Graphical User Interface

14.1 Editing
14.2 Menus
File Menu
New
Open
Save
Save As
Close
Project
Print Preview
Print
Print Setup
Exit
Edit Menu
Undo
Redo
Cut
Copy
Paste
Find
Replace
Find Next
Goto
Previous Error
Next Error
Edit Mode
Compile Menu
Compile to Target
Compile to .bin file
Include Debug Code/RST 28 Instructions
Run Menu
Run
Run w/ No Polling
Stop
Reset Program
Trace into
Step over
Source Trace into
Source Step over
Toggle Breakpoint
Toggle Hard Breakpoint
Clear All Breakpoints
Toggle Interrupt Flag
Toggle Polling
Reset Target
Close Serial Port
Inspect Menu
Add/Del Watch Expression
Clear Watch Window
Update Watch Window
Disassemble at Cursor
Disassemble at Address
Dump at Address
Options Menu
Editor
Compiler
Run-Time Checking
BIOS Memory Setting
User Defined BIOS File
User Defined Libraries File
Watch Expressions
Type Checking
Warning Reports
Optimize For
Max Shown
Defines
Debugger
Enable Breakpoints
Enable Watch Expressions
Enable Instruction Level Single Stepping
Display
Communications
TCP/IP Option
Serial Options
Define Target Configuration
Other Menu Choices
Show Tool Bar
Save Environment
Window Menu
Message
Watch
Stdio
Assembly
Registers
Stack
Information
Help Menu
Online Documentation
Keywords
Operators
HTML Function Reference
Function Lookup/Insert
Instruction Set Reference
Keystrokes
Contents
Tech Support Bulletin Board
Tip of the Day
About

15 Command Line Interface

15.1 Default States
15.2 User Input
15.3 Saving Output to a File
15.4 Command Line Switches
Switches Without Parameters
Switches Requiring a Parameter
15.5 Examples
Example 1
Example 2
Example 3

16 Project Files

16.1 Particular Project Files
Factory.dcp
Default.dcp
Active Project
16.2 Updating a Project File
16.3 Menu Selections
16.4 Command Line Usage

17 Hints and Tips

17.1 Efficiency
Nodebug Keyword
Static Variables
17.2 Run-time Storage of Persistent Data
User Block
Flash File System
WriteFlash2
Battery Backed RAM
17.3 Root Memory Usage Reduction Tips
Increasing Available Root Code Space
Increasing Available Root Data Space

18 µC/OS-II

18.1 Changes to µC/OS-II
Ticks per Second
Task Creation
Restrictions
18.2 Tasking Aware Interrupt Service Routines (TA-ISR)
Interrupt Priority Levels
Possible ISR Scenarios
General Layout of a TA-ISR
18.3 Library Reentrancy
18.4 How to Get a µC/OS-II Application Running
Default Configuration
Custom Configuration
Examples
18.5 Compatibility with TCP/IP
Socket Locks
18.6 Debugging Tips

A Macros and Global Variables

Compiler-Defined Macros
Global Variables
Exception Types
Rabbit 2000 Internal registers

B Map File Generation

Grammar

C Utility Programs

Index