Table of ContentsConnecting To Mosaic Controller RS422/485 Configuration Jumpers Protocol Configuration and Direction Control Registers Overview of the Software Device Driver Functions Installing the UART Module Driver Software Using the Driver Code with Forth UART Direction Control in a Multitasking System C Demonstration Program (in pdf) |
UART Wildcard User GuideDemo Illustrates Initialization and Revectoring of Serial I/OThe demonstration program presents constants and functions that illustrate how to use the serial channels. The function named Default_UART_Init accepts a Wildcard number parameter, and initializes both serial channels to default values specified by the constants DEFAULT_BITS_PER_CHAR, DEFAULT_STOP_BITS, DEFAULT_PARITY, DEFAULT_BAUDRATE, DEFAULT_PROTOCOL, and DEFAULT_MODEM_SUPPORT. The values of these constants can be edited, and a more versatile initialization function can be crafted to meet the needs of your application. The multitasking operating system on the Mosaic controller allows each task to access its own distinct serial I/O channel by pointing the three primitives Emit, Ask_Key (called ?KEY in Forth), and Key to the desired serial I/O handler functions. The advantage of revectoring is that higher level serial management functions that accept and print characters and strings will then use the designated serial channel. The Ch1_Monitor and Ch2_Monitor functions in the demonstration perform the revectoring, and then call functions that perform interactive echoing via the specified serial channel on the UART Wildcard. The Run_Demo function (or the main function in C) starts and runs the multitasking demonstration using both channels of the UART Wildcard. The demonstration program source code is presented in a later section. Installing the UART Wildcard Driver SoftwareThe UART Wildcard device driver software is provided as a pre-coded modular runtime library, known as a "kernel extension" because it enhances the on-board kernel's capabilities. The library functions are accessible from C and Forth. Mosaic Industries can provide you with a web site link that will enable you to create a packaged kernel extension that has drivers for all of the hardware that you have on your system. In this way the software drivers are customized to your needs, and you can generate whatever combination of drivers you need. Make sure to specify the UART Wildcard Drivers in the list of kernel extensions you want to generate, and download the resulting "packages.zip" file to your hard drive. For convenience, a separate pre-generated kernel extension for the UART Wildcard is available from Mosaic Industries on the Demo and Drivers media (diskette or CD). Look in the Drivers directory, in the subdirectory corresponding to your hardware (the Mosaic Controller of your choice), in the UART_Wildcard folder. The kernel extension is shipped as a "zipped" file named "packages.zip". Unzipping it (using, for example, winzip or pkzip) extracts the following files:
Library.c and library.h are only needed if you are programming in C. Library.4th is only needed if you are programming in Forth. The uses of all of these files are explained below. We recommend that you move the relevant files to the same directory that contains your application source code. To use the kernel extension, the runtime kernel extension code contained in the install.txt file must first be loaded into the flash memory of the Mosaic Controller. Start the Terminal software with the Mosaic Controller connected to the serial port and turned on. If you have not yet tested your Mosaic Controller and terminal software, please refer to the documentation provided with the Terminal software. Once you can hit enter and see the 'ok' prompt returned in the terminal window, type COLD to ensure that the board is ready to accept the kernel extension install file. Use the "Send File" menu item of the terminal to download the install.txt to the Mosaic Controller. Now, type COLD again and the kernel has been extended! Once install.txt has been loaded, it need not be reloaded each time that you revise your source code. |
Home|Site Map|Products|Manuals|Resources|Order|About Us
Copyright (c) 2006 Mosaic Industries, Inc.
Your source for single board computers, embedded controllers, and operator interfaces for instruments and automation