Link here

Chapter 1 - Introduction


Welcome to QED-Forth™! This manual explains the extensive software environment that will help speed your instrument development project to completion. We have designed the QED Board™ and language to provide you with a complete programming environment on a compact I/O-rich card. The interactive QED-Forth software resides right on the board in a 64K ROM. It delivers programming and mathematical tools typically found only on desktop computers or workstations, and its comprehensive set of over 1000 pre-programmed functions provides a highly productive development environment.

The QED Board and the QED-Forth development language were designed to meet five goals:

  • Provide a Complete Solution

    Many embedded control computers force you to search for your own high level language compiler, assembler, debugger and multitasking executive before you can start programming your application. The QED Board provides everything you need to start programming.

  • Tight Integration of Hardware and Software

    The programming of embedded controllers requires the control of many I/O devices. With most controller boards you must write and debug the required device drivers yourself. QED-Forth includes device drivers for keypad, display, analog and digital I/O, serial communications, time keeping, and interrupt handling. These pre-coded routines let you concentrate on the unique aspects of your application.

  • Creation of a Fast Interactive Programming Environment

    The programming of embedded controllers for real-time instruments is challenging. Many tasks must be debugged in real time on the hardware itself. With most controllers you are stuck compiling and trying to debug the required control code on a remote PC, and the debugging cycle is very long and tedious. We have found that the development process goes much faster when the interactive compiler and debugger are right on the controller board itself, and you can talk to the board directly in a high level language. As soon as you define a new function (for example, to move a robot arm to a particular location), you can interactively execute the routine and see how it works. If the function doesn't work correctly, you can enter the built-in interactive debugger to find the problem.

  • Provide a Superb Library of Computational Functions

    We put a complete floating point library on the QED Board. Included are fractional arithmetic, trigonometry, log and exponential functions, and formatted real number input and output. We added a complete matrix algebra package that solves simultaneous equations, calculates curve fits and Fast Fourier Transforms (FFTs), and manipulates rows and columns of information just as you would in a spreadsheet program.

  • Take the Hassle Out of Getting an Instrument into Production

    Instead of burning a new PROM each time you make a change during program development, you just flip a switch to convert onboard battery-backed RAM to "emulated ROM". Instead of having to re-download all of your code after a bug causes a crash, you just execute RESTORE and continue programming. When your application is complete, an AUTOSTART function lets your program automatically start when power is applied. Built-in utilities help you to burn the single application PROM, and plugging your completed application PROM into any QED Board puts you into production.

Figure 1.1 along with the information presented here summarizes the main elements of the built-in QED programming environment that support your application.

legacy-products:qed2-68hc11-microcontroller:software:qed_pyramid.jpg

Figure 1.1. Pyramid of built-in QED programming tools that support your final application program.

 

What You Need To Get Started Programming

Please read the booklet titled "Getting Started With the QED Board". It explains how to set up your QED Board and demonstrates how easy it is to get started using its hardware and software.

The QED Board is programmed via an RS232 serial port that connects the QED Board to your PC-based terminal. You type your source code (that is, your QED-Forth commands and definitions) from the terminal, or better yet, edit your source code into a file and use the terminal to transfer the file to the QED Board. The terminal should be configured as follows:

  • 9600 baud
  • 1 start bit
  • 8 data bits
  • 1 stop bit
  • no parity
  • wait for linefeed before sending next line
  • XON/XOFF handshaking enabled

Your terminal program must wait at the end of each line for a linefeed character before sending the next line. Depending on the terminal program, the linefeed character can be denoted as LF, ˆJ, ascii decimal 10, or ascii hex A. Most terminals allow you to specify a "prompt character" (in this case a linefeed) that must be received before sending each line. These options are typically associated with the "file transfer" or "text transfer" menu of your terminal program. In addition, XON/XOFF protocol should be enabled if it is available; this ensures smooth reception of data dumps from the QED Board.

See Appendix A of the "Getting Started with the QED Board" booklet for a detailed discussion of how to set up an editor and terminal for easy programming of the QED Board.

You can type characters directly into the terminal window, and they will be accepted by the QED Board's line editor and interpreter. This mode of interaction is convenient when debugging or typing short code fragments. If you are sending source code to the QED Board, it is best to create a file using your favorite editor. The file can be saved to disk to provide a record of your work, and the terminal program can be used to download the file to the QED Board. You can also configure your terminal to record your debugging sessions and save them as a file on disk.

It is most convenient if you can quickly switch from the editor window to the terminal window to facilitate rapid interactive debugging and editing of your source code. For example, the TERMINAL and WRITE programs that come with the Microsoft Windows™ program work very well and allow you to quickly switch between editing your code and interacting with the QED Board via the terminal program. If you do not own Microsoft Windows, you can use an accessory program such as Sidekick™ which provides an editor that can be used simultaneously with any other application, including a terminal program.

In short, if you provide a terminal and editor running on your personal computer, we provide everything else you need, including the controller board with development software, power supply and cables.

 

How To Use This Manual

This Software Manual describes the QED-Forth language and development environment. It is part of a documentation package that is shipped with each QED Developer System or QED Product Design Kit. We recommend that you read this manual after reading the booklet titled "Getting Started with the QED Board".

The accompanying QED-Forth Glossary provides a categorized word list and a complete description of each pre-coded function in the language. We recommend that you browse through the categorized word list to get an idea of the many types of pre-coded functions that are available in QED-Forth. The QED Hardware Manual describes how to use the variety of hardware resources on the QED Board, and two Motorola 68HC11 reference books complete the documentation package.

We highly recommend that you read Chapters 2 and 3 of this manual; they provide essential information about programming in QED-Forth. The final chapter in this manual, titled "Putting It All Together: A Complete Turnkeyed Application" is also highly recommended. It puts much of the software features in perspective and shows how they can be used in a production instrument.

Chapter 2, titled "QED-Forth Basics", explains many of the fundamental concepts of programming in QED-Forth. Even experienced FORTH programmers will want to examine this chapters because QED-Forth is different from other FORTHs, most notably in its memory access operations and the availability of local variables to simplify coding. Chapter 3, titled "Program Development Techniques", provides key information that will help you set up the memory map, smoothly download and debug your code, and easily recover in case your software crashes.

The following is a summary of the topics explained in the remaining chapters in this manual:

  • Chapter 4 introduces and explains the floating point math library.
  • Chapter 5 describes the heap memory manager. Typically found only on much larger machines, the memory manager facilitates optimal use of available RAM for arrays, matrices, and other data structures. QED-Forth's advanced array and matrix math routines make extensive use of the heap memory manager, but they do it transparently. To use these features you need only a cursory familiarity with the information in this chapter.
  • Chapter 6 explains the built-in library of functions that make it easy to manipulate data structures and arrays. It also explains the comprehensive matrix algebra library.
  • Chapter 7 presents some of the most powerful functions in the matrix math library. These can solve simultaneous equations, perform curve fits, and fast calculate Fast Fourier Transforms.
  • Chapter 8 describes the structure defining words that can be used to create structured data bases.
  • Chapters 9 and 10 present an informative introduction to multitasking and explain QED-Forth's multitasking executive. Many instruments require the performance of multiple simultaneous tasks such as managing keypad and display, acquiring data from sensors, performing calculations, and controlling external devices. In a multitasked system you can code and debug each of these functions as a separate and well defined task. The built-in multitasking executive then confers the proper real-time behavior on the system and executes the tasks simultaneously.
  • Chapter 11 explains from a software perspective the use of interrupts and the initialization of some key registers. It also describes how to generate a final application PROM and set up the completed application program to autostart each time power is applied to the instrument.
  • Chapter 12 presents the device drivers that control the "user interface" I/O including the keypad, display, and serial ports.
  • Chapter 13 presents the in-line assembler. The assembler can be used to speed the operation of time-critical routines.
  • Chapter 14 discusses a virtual memory interface that can be used to access a disk drive or other external memory. This "blocks" interface facilitates listing, loading, and interpreting source code files that are stored in the mass memory.
  • Chapters 15 and 16 describe what's going on "under the hood" of the QED-Forth language and operating system. Chapter 15 describes the user variables that control Forth's operation, and Chapter 16 describes a variety of advanced topics.
  • Chapter 17 presents and explains a complete "turnkeyed" application program. This informative chapter is very useful to anyone who is putting together a complete application. An example application is presented complete with code and a detailed commentary. It discusses setting up the memory map, using interrupts, accessing I/O, writing a multitasked application, setting up an autostart routine, and making the final application PROM to go into production.
 
This page is about: Introduction to Forth Computer Language – Welcome to QED Forth™! This manual explains extensive software environment that will help speed your instrument development project to completion. We have designed QED Board™ and language to provide you with complete programming environment on compact I/O …
 
 
Navigation