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

Power I/O Wildcard Hardware

Plugging in the Power I/O Wildcard

Selecting a Wildcard Address

Setting Outputs and Reading Inputs

Connecting High-Current Loads to the Outputs

Maximum Ratings: Current, Power and Switching Frequency

Heat Sinking

Connecting to the Inputs

Power I/O Wildcard Field Header

Software

Hardware Schematics

Power I/O Wildcard User Guide

<< Previous |

Software

To control the eight high current, isolated MOSFET outputs use the software primitives StoreChar, ToggleBits, ChangeBits, SetBits, or ClearBits (C!, TOGGLE.BITS, CHANGE.BITS, SET.BITS, or CLEAR.BITS in FORTH). To read back the state of the eight outputs or the four inputs, use the software primitive FetchChar (C@ in FORTH). The hexadecimal address of the output port is 0xC000 and the address of the input port is 0xC001. The page corresponds to the wildcard address. Code Listings 1-1 and 1-2 provide functions that set, clear, and read the high current isolated outputs, and a function that reads the high voltage isolated inputs.

Listing 1-1 C Code to control the Power I/O Wildcard.

#include

#define OUTPUT_REGISTER 0xC000
#define INPUT_REGISTER 0xC001

\\ module_num = the hardware jumper setting described in Table 1-2.
\\ valid module numbers are 0 tp 7.
\\ bit = a bit mask with 1’s in the position of bits to be set.
void SetOutput( uchar bit, uchar module_num )
{
  EXTENDED_ADDR module_addr;
  module_addr.sixteen_bit.page16 = module_num;
  module_addr.sixteen_bit.addr16 = OUTPUT_REGISTER;
  SetBits(bit,module_addr.addr32);
}

\\ module_num = the hardware jumper setting described in Table 1-2.
\\ valid module numbers are 0 tp 7.
\\ bit = a bit mask with 1’s in the position of bits to be cleared.
void ClearOutput( uchar bit, uchar module_num )
{
  EXTENDED_ADDR module_addr;
  module_addr.sixteen_bit.page16 = module_num;
  module_addr.sixteen_bit.addr16 = OUTPUT_REGISTER;
  ClearBits(bit,module_addr.addr32);
}

\\ module_num = the hardware jumper setting described in Table 1-2.
\\ valid module numbers are 0 tp 7.
uchar ReadOutput( uchar module_num )
{
  EXTENDED_ADDR module_addr;
  uchar output_status;
  module_addr.sixteen_bit.page16 = module_num;
  module_addr.sixteen_bit.addr16 = OUTPUT_REGISTER;
  output_status = FetchChar( module_addr.addr32 );
  return( output_status );
}

\\ module_num = the hardware jumper setting described in Table 1-2.
\\ valid module numbers are 0 tp 7.
uchar ReadInput( uchar module_num )
{
  EXTENDED_ADDR module_addr;
  uchar input_status;
  module_addr.sixteen_bit.page16 = module_num;
  module_addr.sixteen_bit.addr16 = INPUT_REGISTER;
  input_status = FetchChar( module_addr.addr32 );
  return( input_status );
}

Listing 1-2 Forth Code to control the Power I/O Wildcard.

HEX
C000 CONSTANT OUTPUT_REGISTER
C001 CONSTANT INPUT_REGISTER

\ bit = a bit mask with 1’s in the position of the bits to be set.
\ module_num = the hardware jumper setting described in Table 1-2.
\ Valid module numbers are 0 to 7.
: SETOUTPUT ( b1/b2 -- | b1 = bit, b2 = module_num )
locals{ &module &bit }
&bit OUTPUT_REGISTER &module SET.BITS
;

\ bit = a bit mask with 1’s in the position of bits to be cleared.
\ module_num = the hardware jumper setting described in Table 1-2.
\ Valid module numbers are 0 to 7.
: CLEAROUTPUT ( b1/b2 -- | b1 = bit, b2 = module_num )
locals{ &module &bit }
&bit OUTPUT_REGISTER &module CLEAR.BITS
;

\ module_num = the hardware jumper setting described in Table 1-2.
\ Valid module numbers are 0 to 7.
: READOUTPUT ( b1 -- b2 | b1 = module_num, b2 = output_status )
OUTPUT_REGISTER SWAP C@
;

\ module_num = the hardware jumper setting described in Table 1-2.
\ Valid module numbers are 0 to 7.
: READINPUT ( b1 -- b2 | b1 = module_num, b2 = input_status )
INPUT_REGISTER SWAP C@
;

<< Previous |


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