Link here

Mosaic Terminal Users Guide

How to load code onto Mosaic Industries HC11 HCS12 microcontroller boards and use the QED-Forth microcontroller command line interface.

Mosaic Terminal was designed to allow communications between a PC and Mosaic's controllers including the QED Board, QCard, QScreen, Handheld and PDQ Board. The terminal program serves two basic purposes: it allows users to transfer programs to the controller and to save data sent by the controller to a file on a PC. Each menu item is described in this help file.

 

Cool New Features

New features of Mosaic Terminal include:

  • The ability to drag and drop text files to send to the controller.
  • Ability to send multiple files using: #include "c:\path\filename.ext"
  • The path in quotes can be absolute or relative to the present file.
  • Use of the up and down arrow keys to resend previous commands.
  • Progress bar to denote approximate time of downloads.
  • Ability to copy and paste text to and from the terminal window.
  • Ability to fully customize the user interface [font, font color, font style, font size, and background color]
  • Comment stripping for QED-Forth files.
  • Automatic termination of the download if an error occurs.
  • Long file name capability for sending and saving files.
  • File→ Reconnect menu item lets you restore a USB or serial connection after it has been interrupted.
  • TCP/IP raw "serial tunneling" connections to the Ethersmart Wildcard
 

Below each option in the menus located in the top menu bar of the Mosaic Terminal is explained.

 

File

SEND FILE

This option brings up a dialog box that allows you to specify the path, filename, and extension of a file to send to the controller. The file specified by you is sent to the controller using the flow control and settings specified in the Comm Settings Dialog box. The file name and extension can be typed into the File Name Box, or it can be selected from the file browser box above the "File name" Box. The default file extension filter that is used includes the "*.dlf", "*.4th", and "*.txt" extensions.

Software flow control is used when sending a file to the controller. Once a line of text has been sent from the PC to the controller, the PC waits until the line feed character is received from the controller before sending the next line. The terminal will wait for a maximum of 120 seconds.

Windows (CR+LF) and Unix (LF) end of line formats are supported; Macintosh classic (CR) is not.

 

SEND BINARY FILE

This option brings up a dialog box that allows you to specify the path, filename, and extension of a binary file to send. No flow control is used for binary transfers but an inter-character delay can be specified under the Comm Settings Dialog box. The inter-character delay is specified in seconds or fractions of a second. For example, to delay for 1 millisecond, enter 0.001 for the inter-character delay value. The resolution for the inter-character delay is approximately 1 millisecond. No error checking is performed on the inter-character delay time. File navigation is the same as the Send File dialog box. The default file extension filter that is used includes the "*.bin*" extension. Xon/Xoff software flow control is also disabled when sending a binary file.

Note that the QED Board does not accept binary file transfers. Use Send File to transfer files to the QED Board.

 

SEND AGAIN

This option resends the last non-binary file sent to the QED Board.

 

STOP TRANSFER

This option terminates the file transfer to the QED Board and closes the file.

 

SAVE FILE

This option brings up a dialog box that allows you to specify the path, filename, and extension of the file to save. You can type the file name and extension into the File Name Box or select a file from the List Box found above the "File name" Box. If the file already exists, you will be asked if you want to overwrite the file. Directory and drive navigation is exacty the same as the Send File dialog box. Once the Save File option is selected, the Close File option must be used to allow other programs to access the file.

 

CLOSE FILE

This option closes the file specified by SAVE FILE. The file must be closed before other programs can access it.

 

RESET TERMINAL

If the Mosaic terminal becomes unresponsive, use this option to initialize it to a known state. If you are saving a file, it will be closed cleanly. If you are sending a file, the transfer will be aborted.

 

EXIT

This option closes the serial port (if open), closes any open files, writes all of the current comm settings (port, baud rate, data bits, parity, stop bits, and Xon/Xoff setting) and terminal settings (window size, window location, font name, font size, font color, font style, and background color) to the registry, then exits.

 

Edit

COPY

This option copies the selected text from the terminal window to the clipboard.

 

PASTE

This option sends text from the clipboard to the controller. Note: if you are pasting less than 1024 characters the "Wait For Echo" option is automatically enabled.

 

Settings -> Comm

This option brings up a dialog box that allows you to specify the comm settings. All aspects of the serial port interface are specified here.

 

Comm Options

Port is the serial RS-232 interface that connects the PC to the controller. Valid settings are 1 to 15. Port settings depend on the hardware within a system.

Baud Rate is the speed which information is transferred between the computer and the controller, and must match the baud rate setting on the controller. See the documentation for the various Mosaic controllers to determine the default setting for your product. Options are 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, and 256000.

Data Bits are the number of bits that are sent between the start and stop bits of a packet. The default setting is 8 data bits. Options are 4, 5, 6, 7, and 8 data bits.

Parity is an extra bit that is added to a packet to reveal errors in transmission. If even parity is selected, the parity bit is set only when there are an odd number of one bits in a packet (not including the start and stop bits). Similarly if odd parity is selected, the parity bit is set only when there are an even number of one bits in a packet. The default setting is no parity meaning that no parity bit is sent. Options are even, odd, and no parity.

Stop Bits are the number of bits that are used to signify the end of a packet. The default setting is one stop bit. Options are 1, 1.5, and 2 stop bits.

Xon\Xoff enables or disables software flow control while sending or receiving a file from the controller. The default option is XON/XOFF enabled. When sending a file to the controller, the controller will send an xoff character to the PC when its buffer is ¾ full, stopping the PC from sending additional data. When the controller is ready to receive more data, it sends an xon character. When receiving a file from the controller, the PC sends an xoff character to the controller when its buffer is ¾ full, stopping the controller from sending additional data. When the PC is ready to receive more data, it sends an xon character to the controller. This option is disabled when sending a binary file.

 

Control Options

Strip Comments removes all comments and extra spaces from FORTH source code. Comments are preceded with the backslash character "\".

Stop On Error terminates the current download if an error message is received from the controller.

Show Non-printable ASCII Characters displays a box for all non-ASCII characters received from the serial port. This option is useful for debugging purposes.

Char Delay specifies the inter-character delay for binary file transfers. The inter-character delay is specified in seconds or fractions of a second. For example, to delay for 1 millisecond, enter 0.001 for the inter-character delay value. The resolution on the inter-character delay is approximately 1 millisecond. No error checking is performed on the inter-character delay time.

Wait For Echo sends a single character and then waits for the echo before sending the next character. This option will permit downloads when another task is running in the background of the forth interpreter.

Display Waring About Long Lines scans the file about to be sent and pops up a dialog box if any lines have more than 95 characters. Lines should not be longer than 95 characters.

Stop On Non-Unique Warnings causes the current transfer to halt when a non-unique warning occurs.

 

Settings -> Other Items

HOTKEYS

This option brings up a dialog box that allows you to send serial commands with a special key combination. The following key combinations are already used:

ctrl + 1 Changes the comm port to 1
ctrl + 2 Changes the comm port to 2
ctrl + 3 Changes the comm port to 3
ctrl + 4 Changes the comm port to 4
ctrl + 5 Changes the baud rate to 2400
ctrl + 6 Changes the baud rate to 4800
ctrl + 7 Changes the baud rate to 9600
ctrl + 8 Changes the baud rate to 19200
ctrl + 9 Changes the baud rate to 57600
ctrl + 0 Changes the baud rate to 115200
ctrl + a Send the last file again
ctrl + c Copy the selected text to the clipboard
ctrl + e Close current file that's being saved
ctrl + f Bring up the send file dialog box
ctrl + h Bring up the help dialog box
ctrl + r Reset the state of the termial
ctrl + t Toggle the echoing of characters
ctrl + s Bring up the save file dialog box
ctrl + v Send the text from the clipboard
ctrl + x Stop the current file transfer
ctrl + q Toggle handshaking to recover from XOFF character. Use this
option after a crash sends out 0x13 (the XOFF character) to
recover from the terminal "locking up".
 

FONT

This option brings up a dialog box that allows you to change the font, font size, font color, and font sytle of the terminal window. A fixed space font such as courier is recommended for easy viewing.

Note that the Strikeout Font Effect and the Underline Font Effect are not implemented.

 

BACKGROUND

This option brings up a dialog box that allows you to change the background color of the terminal window.

 

DIRECTIVES

Directives are text phrases that recognized by the terminal program that runs or turns on or off a terminal feature. Directives are case insensitive, must be the only text on a line, and must start at the beginning of the line. All directives override settings from the Comm Settings Menu.

There are two sets of directives; most of the directives are parsed by Mosaic Terminal in files being sent to the controller. Another set of directives is parsed by Mosaic Terminal only in output from the controller, and are ignored in files sent to the controller.

The following directives are parsed in files sent to the controller:

#Include "path\file" Send the file at the specified path to the controller.
#StripComments Strip comments out of the download file.
#NoStripComments Do not strip out comments from the download file.
#StopOnError Stop the download after an error.
#NoStopOnError Do not stop the download after an error.
#StopOnNonUnique Stop on non-unique errors.
#NoStopOnNonUnique Do not stop on non-unique errors.
#WarnLongLines Show a warning for long lines.
#NoWarnLongLines Do not show a warning for long lines.
#WaitForEcho *Wait for each character to be echoed.
#NoWaitForEcho *Wait only for newlines to be echoed.
#IfInclude Decide whether to send a file based on the result of the
SEGMENT.PRESENT function.
#SendAndWait X Ignore linefeeds for X seconds, then resume download.
#ExecuteAndReplace Place this command on a line by itself. This command
also includes the following two lines.
The first line that follows will be sent to the board normally.
This line should print out a string you would like to use.
It should begin and end with the forth word 'CR' so the output
string is on its own line.
The second line can be any normal line, including a terminal command.
The second line is searched for the token "[OUTPUT]" without the quotes.
This token will be replaced by the output from the first line.

*The #WaitForEcho and #NoWaitForEcho directives are available in Mosaic Terminal versions 1.32 and later.

The following directives are parsed in output lines received from the controller:

#SaveTo "path\file" Save the following terminal communications to file.
#EndSaveTo Close the file opened with the #Saveto directive.

The #Saveto and #Endsaveto directives may only be used when a file is not also being sent to the controller, i.e. when the terminal is in interactive mode. This means that either these directives must be emitted by a function on the controller triggered by a user, or they must be emitted by a function that is called at the end of downloading a file, with a built-in delay to allow the terminal to return to interactive mode. For example, the following Forth word may be defined at the end of a download file to save output to another file. This is useful with the DUMP.S2 word for extracting compiled programs to load onto other controllers.

SaveTo Example

DECIMAL
 
\ This is a demonstration of using the #saveto directive to save
\ output from Mosaic Terminal after a file has been downloaded to
\ the controller.  If this is at the end of the last file sent, the
\ terminal will revert to the interactive state before the #saveto
\ directive is emitted by the controller, functioning as expected.
: DO.SAVETO
    \ Terminal needs to see a line ending when this word is executed
    \ in order to return to interactive mode.
    CR ." Please wait two seconds."
    \ Delay two seconds while terminal closes input file.
    32 0 DO 62500 MICROSEC.DELAY LOOP
    CR \ Two newlines needed immediately before #saveto.
    CR ." #saveto " ASCII " EMIT ." testing-saveto.txt" ASCII " EMIT
    CR ." This is a test of the #saveto directive."
    CR ." #endsaveto" CR CR
;
 
DO.SAVETO
 

Feedback

To report bugs or request modifications to Mosaic Terminal, please contact Mosaic Industries.



See also →


This namespace contains:
Recent Changes
in this namespace

The following pages were changed recently.

You're currently watching the changes inside the c-ide-software-development:microcontroller-terminal namespace. You can also view the recent changes of the whole wiki.

 
This page is about: Using Mosaic Terminal and QED-Forth Microcontroller Command Line Interface – How to load code onto Mosaic Industries HC11 HCS12 microcontroller boards and use the QED-Forth microcontroller command line interface.
 
 
Navigation