stimul.exe - open source video stimulator for visual elctrophysiology
=====================================================================

Features:
=========
Stimulus type:  luminance and pattern

Pattern types:	checkerboard, vertical and horizontal bars, windmill and dartboard

Stimulation mode: reversal and onset

Synchronisation occurs during vertical retrace

Synchronisation of external devices: TTL-compatible synch out signal generated on the parallel (printer) port

Vertical refresh rate: programmable using the vbehz utility (works only with VBE 3.0 compatible VGA cards)

Remote control over RS232 (Com1 / 9600 Baud, CTS/RTS protocol) 


System requirements:
====================
PC with PCI or AGP slot
Operating system: DOS (tested with DOS V6.2). 
Only a minimal operating system is needed, e.g.: a bootdisk from www.bootdisk.com.
VGA card with VESA BIOS 3.0 VBE 3.0 or higher (required for programmable vertical 
refresh rate). 
The program was tested with different versions of Nvidia TNT2, Geoforce2 grapic cards.

Additional information about VBE 3.0 can be found on www.vesa.org/vbe3.pdf


Compilation:
============
This program was developed using the Microsoft C-Compiler (7.0) for DOS.
To compile the program:
1. jump into the subdirectory where the source files are stored
2. type make

Cable for remote control (RS232):
=================================

DB9 female				DB9 female
Pin No.					Pin No.
1--4					1--4
6--8------------------------------------7
7---------------------------------------6--8
2---------------------------------------3
3---------------------------------------2
5---------------------------------------5

Commands:
=========
Command line options: stimul -h will list the options

Keyboard commands:    
      pressing the + key will increase the fixation point size
                   - key decrease the fixation point size
                   D key disables fixation point
                   E enables the fixation point
                   R change fixation point color to red
                   G change fixation point color to green
                   B change fixation point color to blue
                   C change fixation point color to cyan
                   M change fixation point color to magenta
                   Y change fixation point color to yellow

Remote control (over Com1):    
===========================
protocol: command arg<term> ,e.g., pattern 5<term>
command -> the name of the command
arg     -> an integer number
<term>  -> is the terminator character CR or LF (carriage return or line feed)

Supported commands:
pattern n      0 Luminance    (white flashes)
               1 Checkerboard (default)
               2 Vertical bars, 3 Horizontal bars
               4 Windmill, 5 Windmill (full screen)
               6 Dartboard, 7 Dartboard (full screen)
mode n         0 = reversal (default), 1 = pattern onset/offset
size n         pattern size (60 default)
period n       period time of the stimulation
               1/stimulation frequency in frames, default = 100
onsetwidth n   width of the pattern onset in frames, default = 10
               (has no effect during pattern reversal)
width  n       horizontal resolution (default = 1024)
height n       vertical resolution (default = 768)
fixcolor n     0 red
               1 green
               2 blue                      
               3 cyan                      
               4 magenta                      
               5 yellow                      
fixradius n    radius of the fixation point (in pixels)
draw           redraws pattern on the screen. After changing one or multiple parameters,
               "draw" must be sent to redraw the screen.

Synchronisation signal for the data acquision system:
=====================================================
Parallel (printer) port -> TTL compatible signal
Pattern reversal: square wave, each edge of the signal signal signalize a pattern 
                  reversal.
Pattern onset:    The rising edge (0 to 5 V) signalize pattern onset,
                  the falling edge (5 to 0 V) pattern ofset.

Synchronisation cable:
======================
DB 25 Male
2-------------------synch out (TTL)
25------------------Ground


Latest Version:
===============
http://www.torok.info
http://www.augenklinik-stgallen/torok


Contact:
========
New users: please send me an email! Just to know where the program is used.
Please send bug reports, improvements, etc. to:

bela@torok.info
   or
bela.torok@kssg.ch

Co-developers welcome!

Known problems:
===============
This version is stable. (With polling-mode serial communication.)

The version with interrupt-driven serial communication crashes after receiving several
command over the serial line? Buffer overflow? Can somebody take a look at that?
