manufacturer of I/O-rich SBCs, operator interfaces, handheld instruments, and development tools for embedded control low cost single board computers, embedded controllers, and operator interfaces for scientific instruments & industrial control development tools for embedded control order our low cost I/O-rich embedded control products embedded controller manufacturer profile single board computers & embedded controllers development tools & starter kits for your embedded design operator interfaces with touchscreens and graphical user interface plug-in expansion modules for digital & analog I/O C language & Forth language integrated development tools, IDE single board and embedded computer accessories embedded controller enclosures, bezels, environmental gaskets
Table of Contents

Introduction

Digital I/O Wildcard Hardware

Connecting To Mosaic Controller

Selecting the Digital I/O Wildcard Address

Current Capability of the Digital Output Lines

Protecting the Input and Output Pins

Connecting to the Field Header

Digital I/O Wildcard Software

Setting the Direction of the I/O Lines

C Code to initialize the Digital I/O Wildcard

Forth Code to initialize the Digital I/O Wildcard

Controlling the I/O Lines

C Code to control the Digital I/O Wildcard

Forth Code to control the Digital I/O Wildcard

Digital I/O Wildcard Schematics (pdf)

Digital I/O Wildcard User Guide

<< Previous | Next>>

Forth Code to initialize the Digital I/O Wildcard
HEX
4 USE.PAGE \ Initialize the memory map.
15 WIDTH ! \ Avoid non-unique names.
ANEW DIO.CODE \ Forget marker for easy re-loading.
 
C005 CONSTANT DIRECTION_REGISTER
 
1 CONSTANT NIBBLE_0 \ Lines 0-3
2 CONSTANT NIBBLE_1 \ Lines 4-7
4 CONSTANT NIBBLE_2 \ Lines 8-11
8 CONSTANT NIBBLE_3 \ Lines 12-15
 
1 CONSTANT OUTPUT
0 CONSTANT INPUT
 
: Init_IO_Direction ( byte1\u\byte2 -- )
\ byte1 = module number, byte2 = nibble, byte3 = direction
\ Valid module numbers are 0-7. Valid nibbles are NIBBLE_0 to NIBBLE_3
\ Valid directions are INPUT or OUTPUT.
\ --------------------------------------------------------------------------
\ The module number depends on the module select jumpers. See Table 1 for
\ the jumper settings and associated addresses.
\ --------------------------------------------------------------------------
\ No error checking is done on the input parameters!
\ --------------------------------------------------------------------------
\ This routine initializes the direction of a nibble of I/O lines on the Digital I/O Wildcard.
 
locals{ &direction &nibble &module }
 
&direction
IF
   &nibble DIRECTION_REGISTER &module SET.BITS \ set nibble as output
ELSE
   &nibble DIRECTION_REGISTER &module CLEAR.BITS \ set nibble as input
ENDIF
;

<< Previous | Next>>


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