MiniCom (OP6800)
User's Manual
PREV NEXT INDEX



4. Software

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 devices based on the Rabbit microprocessor.

Chapter 4 provides the libraries, function calls, and sample programs related to the OP6800.

You have a choice of doing your software development in the flash memory or in the static RAM included on the OP6800. The advantage of working in RAM is to save wear on the flash memory, which is limited to about 100,000 write cycles.

NOTE An application can be developed in RAM, but cannot run standalone from RAM after the programming cable is disconnected. All standalone applications can only run from flash memory.

The disadvantage of using flash memory for debug 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 memory or RAM is selected on the Options > Compiler menu.

Dynamic C Premier provides a number of debugging features. You can single-step your program, either in C, statement by statement, or in assembly language, instruction by instruction. You can set break points, where the program will stop, on any statement. You can evaluate watch expressions. A watch expression is any C expression that can be evaluated in the context of the program. If the program is at a break point, a watch expression can view any expression using local or external variables.

4.1 Programming Cable

The programming cable has a level converter board in the middle of the cable since the OP6800 programming port supports CMOS logic levels, and not the higher voltage RS-232 levels that are used by PC serial ports. When the programming cable is connected, Dynamic C running on the PC can hard-reset the OP6800 and cold-boot it. The cold boot includes compiling and downloading a BIOS program that stays resident while you work. If you crash the target, Dynamic C will automatically reboot and recompile the BIOS if it senses that a target communication error occurred or that the BIOS source code has changed.

4.1.1 Switching Between Program Mode and Run Mode

The OP6800 is automatically in Program Mode when the programming cable is attached, and is automatically in Run Mode when no programming cable is attached. See Figure 17.


Figure 17. OP6800 Program Mode and Run Mode Set-Up

4.1.2 Detailed Instructions: Changing from Program Mode to Run Mode

1. Disconnect the programming cable from header J1 of the OP6800 module.
2. Reset the OP6800 by unplugging the AC adapter, then plugging it back in.

The OP6800 is now ready to operate in the Run Mode.

4.1.3 Detailed Instructions: Changing from Run Mode to Program Mode

1. Attach the programming cable to header J1 of the OP6800 module.
2. Reset the OP6800 by unplugging the AC adapter, then plugging it back in. Alternatively, you may press <Ctrl-Y> on your PC if Dynamic C is running.

The OP6800 is now ready to operate in the Program Mode.

4.2 OP6800 Libraries

With Dynamic C running, click File > Open, and select Lib. The following list of Dynamic C libraries and library directories will be displayed.


Four library directories provide function calls that are specific to the OP6800 or to its features.

Other generic functions applicable to all devices based on the Rabbit 2000 microprocessor are described in the Dynamic C Premier User's Manual.

4.2.1 TCP/IP Libraries

The TCPIP directory contains libraries with generic TCP/IP functions for the OP6800.

The functions in these libraries are described in the Dynamic C TCP/IP User's Manual included in the manual set with the Dynamic C Premier User's Manual.

4.3 Sample Programs

Sample programs are provided in the Dynamic C Samples folder. The sample program PONG.C demonstrates the output to the STDIO window.

The various directories in the Samples folder contain specific sample programs that illustrate the use of the corresponding Dynamic C libraries.

The OP6800 folder provides sample programs specific to the OP6800. Each sample program has comments that describe the purpose and function of the program. Follow the instructions at the beginning of the sample program.

To run a sample program, open it with the File menu (if it is not still open), compile it using the Compile menu, and then run it by selecting Run in the Run menu. The OP6800 must be in Program mode (see Section 4.1, "Programming Cable,") and must be connected to a PC using the programming cable as described in Section 2.1, "Connections."

More complete information on Dynamic C is provided in the Dynamic C Premier User's Manual. TCP/IP specific functions are described in the Dynamic C TCP/IP User's Manual. Information on using the TCP/IP features and sample programs is provided in Section 5, "Using the TCP/IP Features."

4.3.1 Board ID

The following sample program can be found in the SAMPLES\OP6800 subdirectory.

4.3.2 Demonstration Board

The following sample programs are found in the DEMO_BD subdirectory in SAMPLES\OP6800.

4.3.3 Digital I/O

The following sample programs are found in the IO subdirectory in SAMPLES\OP6800.

4.3.4 Serial Communication

The following sample programs are found in the RS232 subdirectory in SAMPLES\OP6800.

The following sample programs are found in the RS485 subdirectory in SAMPLES\OP6800.

4.3.5 LCD/Keypad Module Sample Programs

The following sample programs are found in the 122x32_1x7 subdirectory in SAMPLES\LCD_Keypad.

- default ASCII keypad return values.
- custom ASCII keypad return values.
- keypad repeat functionality.
1. Set Date/Time
2. Display Date/Time
3. Turn Backlight OFF
4. Turn Backlight ON
5. Toggle LEDs
6. Increment LEDs
7. Disable LEDs
1. Font initialization.
2. Text window initialization.
3. Text window, end-of-line wraparound, end-of-text window clipping, line feed, and carriage return.
4. Creating 2 different TEXT windows for display.
5. Displaying different FONT sizes.

4.3.6 TCP/IP Sample Programs

TCP/IP sample programs are described in Chapter 5.

4.4 Font and Bitmap Converter

A Font and Bitmap Converter tool is available to convert Windows fonts and monochrome bitmaps to a library file format compatible with Z-World's Dynamic C applications and graphical displays. Non-Roman characters can also be converted by applying the monochrome bitmap converter to their bitmaps.

Start the Font and Bitmap Converter tool by double-clicking on the fbmcnvtr.exe file in the Dynamic C directory. You then select and convert existing fonts or bitmaps. Complete instructions are available via the Help menu that is in the Font and Bitmap Converter tool.

Once you are done, the converted file is displayed in the editing window. Editing may be done, but should not be necessary. Save the file as libraryfilename.lib, where libraryfilename is a file name of your choice.

Add the library file(s) to applications with the statement #use libraryfilename.lib, or by cutting and pasting from the library file(s) you created into the application program.

NOTE If you used the #use libraryfilename.lib statement, remember to enter libraryfilename.lib into lib.dir, which is located in your Dynamic C directory.

You are now ready to add the font or bitmap to your application using the glXFontInit or the glXPutBitmap function calls.


Z-World
http://www.zworld.com
Voice: (530) 757-3737
FAX: (530) 757-3792
sales@zworld.com
PREV NEXT INDEX