Section on Neurophysiology, NIMH/LSN

 

Small Footprint Cortex Computers

[Small Computers] [Digital I/O without cards] [Using a KVM switch] [Small keyboards] [ PCI serial cards]

 

One problem with Cortex is that two computers are needed to operate the system when graphical displays are needed.  Each computer requires a monitor, keyboard, and usually a mouse.  Keeping the size of Cortex to a minimum is difficult, but it can be done.  We have developed several small footprint systems for use with our training boxes. These systems are able to record data as well.

Small Computers
Digital I/O without cards
Using a KVM switch
Small keyboards

Using PCI mulit-port serial cards


Small Computers

The key to small footprint systems is finding a small computer.  We have found systems that dramatically reduce the space need to implement a Cortex system.  We have tested a number of computers.  Our best luck has been with Shuttle Computing XPC series for the main (send) Cortex computer and Stealth Computer LPC-301 for the Cortex display (receive) computer.  The original Shuttle XPC computers came with 2 PCI slots, which could handle a DAS1602/12 and a DIO24. Current models only have one PCI slot. The LPC-301 is slow by today's standards. We have not tried their newer models yet. They also make small computers that hold one or two PCI cards.

We tested a number of other computers for video display. We have be able to use a Dell ultra small form factor computer. Before chosing a computer, check to see that the video display of the computer has a mode that supports 640 x 480 with 256 colors. Some modern computers do not support this rather primative video display mode.
Shuttle Computers
Stealth Computers Corporation

1) PC-104 systems

PC-104 is an industry standard for building embedded personal computers.  The standard is based electrically on the ISA bus architecture, and mechanically on small, stackable printed circuit cards.  Each card is 3.6 x 3.8 inches.  You can buy a complete PC motherboard on a card, add a card for A/D and digital I/O data collection, and stack a third card for video, to make a complete Cortex computer.  Using a PC-104 design is not an off-the-shelf solution.  It takes experience and headaches to assemble and run such systems.  But, it is possible to make a very small system.

 


Using serial ports and parallel ports for digital I/O in DOS Cortex

One difficult part of building small systems for Cortex is the need for analog and digital I/O boards.  If your experiment does not depend on analog signals, and you need only one or two digital I/O ports, you can run DOS Cortex and without any special I/O boards. (This will not work for Windows XP.) Using DOS Cortex opens up the opportunity to build very low cost systems with old computers, or to build a very small footprint Cortex system.  

1) Using a COM port for digital I/O (DOS Cortex)

If you are connecting directly to switches, you can use this simple circuit to supply two switched inputs and one digital (open drain) output.  Be careful with the input signals.  The COM port inputs are not TTL or CMOS compatible.  You can, however, use regular switches or digital circuitry that has an open collector or open drain output. 

 

Using this circuit is easy.  Connect P1 to the serial port of your computer and set up the state file this way.


//  ****  Use COM port as an I/O port  **** //
#include <css_inc.h>
#define COM_BASE_ADR  COM_1            // select the com port (1-4)
#define MSR_ADR       COM_BASE_ADR+6
#define MCR_ADR       COM_BASE_ADR+4
#define RTSbit        0x2
#define DTRbit        0x1
#define ReadDSR(msr)  INV((msr>>5)&1)  // INV()defined in recent versions of Cortex
#define ReadCD(msr)   INV((msr>>7)&1)

int MCRshadow;    // Keep a local copy of the COM port MCR register 

main() {

   int MSR,input1,input2;

   MCRshadow=0;                  // Initialize MCR
   MCRshadow=MCRshadow|RTSbit;   // turn on RTS signal to provide a voltage source
   outp(MCR_ADR,MCRshadow); 

   // Now we can use the input bits //
   MSR=inp(MSR_ADR);             // Read MSR register
   input1=ReadDSR(MSR);          // look at status of input 1 (0 or 1)
   input2=ReadCD(MSR);           // look at status of input 2

   // Use the output bit to sound a beeper //
   MCRshadow=MCRshadow|DTRbit;         // turn on DTR
   outp(MCR_ADR,MCRshadow); 
   MS_TIMERset(1,500);                 // 500 ms beep
   while(MS_TIMERcheck(1)) ;           // wait
   MCRshadow=MCRshadow & INV(DTRbit);  // DTR off
   outp(MCR_ADR,MCRshadow); 
}

 

 

2) Using a parallel (printer) port for digital I/O in DOS Cortex

The printer port has true TTL inputs and outputs.  There are 12 output bits and 5 input bits that can be used.  This example shows how to use 3 of the input pins and 8 output pins.  Here are the pin connections:

Inputs
bit0   pin 15
bit1   pin 13
bit2   pin 12

Outputs
bit 0   pin 2
bit 1   pin 3
bit 2   pin 4
bit 3   pin 5
bit 4   pin 6
bit 5   pin 7
bit 6   pin 8
bit 7   pin 9


Here is an example Cortex program.  Sorry, I did not test this program.  I have, however, tested similar programs with the printer port and they worked as expected. 

//  ******** WARNING, THIS CODE IS UNTESTED ****** //
//  ****  Use Printer port as an I/O port  **** //
#include <css_inc.h>
#define LPT_BASE_ADR  0x378            // LPT1 address 
#define LPT_STATUS    LPT_BASE+1
#define LPT_DATA      LPT_BASE

#define LPT_READ        ((inp(LPT_STATUS)>>3)&7)
#define Read_bit0(stat) (stat&1)
#define Read_bit1(stat) ((stat>>1)&1)
#define Read_bit2(stat) ((stat>>2)&1)

#define LPT_WRITE(data) (outp(LPT_DATA,data))

main() {

   int status,input1,input2,input3;

   // Reading data //
   status=LPT_READ;   // Read the input port //
   input1=Read_bit0(status);   // get one bit at a time.
   input2=Read_bit1(status);
   input3=Read_bit3(status);

   // Write 8 bits at once //
   LPT_WRITE(0xC3);       // arbitrary data

}

 

 


Reducing the size of your Cortex system using a KVM or mechanical A/B switch

Remote Cortex uses two computers, each requiring a keyboard, mouse and display.  The added keyboard for the visual display computer is a special headache, since it is unused 95% of the time. Using two monitors takes up enormous desk space.  One way to reduce the space requirements of a Cortex system is to employ a KVM switch.  "KVM" stands for "keyboard, video, mouse."  All three peripherals are simultaneously switched between the two computers at the touch of a button.  With the aid of a KVM switch, only one keyboard, one display, and one mouse are needed.  We have tested a number of KVM switches. The short story is that KVM switches will switch among Windows computers, but don't include a DOS computer in the mix.  If you use the Windows XP version of Cortex (VCortex 2.x) on both computer, the KVM switch works ok. If you use DOS Cortex for the send computer, you can still use VCortex for the display computer, and use a KVM switch with some other Windows computer in your experimental setup. We use a KVM switch to share peripherals between the Cortex display computer and an eye tracking computer.


Small keyboards

Standard PC keyboards take up too much desk space.  Several companies have address this problem and offer small footprint keyboards. The BTC 5100 keyboards work well and most people prefer the key layout. The new BTC 5139 series is simiar.


PCI multi-port serial cards

Sometimes Cortex needs extra serial ports. If you have an available ISA slot, use an ISA serial card (e.g., TC-200-55 or TC-400-550).  The ISA operation is much easier to set up and use than PCI operation.  These days, however, you may be forced to use a PCI card. We have had success with the Byterunner TC-200H PCI serial card.  The setup for this card is critical.  Here is a configuration that has worked.

 

 


Disclaimer:
The equipment and companies discussed here may or may not be suitable for your needs.  The comments reflect our experiences, not any sort of timely, fair, or exhaustive testing.  The short lists of products are not exhaustive.  They are provided as a starting point for further research.  See the numerous on-line magazines or contact the manufacturers for more complete, detailed and possibly more correct information.  Statements regarding good or bad experiences with these items are anecdotal and informational; they are not intended to be promotional.   


[Home][DIRP] [NIMH] [NIH]

Return to the Home Page
Send web site comments to the WEBMASTER.

last updated 29 July 2009