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>>

C Code to initialize the Digital I/O Wildcard
#include <allqed.h>   // Include QED header files
#define DIRECTION_REGISTER 0xC005
#define NIBBLE_0 1 // Lines 0-3
#define NIBBLE_1 2 // Lines 4-7
#define NIBBLE_2 4 // Lines 8-11
#define NIBBLE_3 8 // Lines 12-15
#define OUTPUT 1  
#define INPUT 0  
void Init_IO_Direction ( uchar module_number, uchar nibble, uchar 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.
{
 EXTENDED_ADDR module_addr;
 module_addr.sixteen_bit.page16 = module_number;
 module_addr.sixteen_bit.addr16 = DIRECTION_REGISTER;
 if(direction)
 {
   SetBits( nibble, module_addr.addr32 );   // set nibble as output
 }
 else
 {
   ClearBits( nibble, module_addr.addr32 );   // set nibble as input
 }
}

<< 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