In general, we use the <qpio12output16> device in DMDX which provides two 8-bit output ports. We use Port C (the lower 8-bits; Pins 29 – 22 on I/O Card) to control the shock box b/c Port C is configured as two 4-bit ports which can cause intermittent problems if used for Neuroscan event codes. Our shock boxes have been modified to handle the very slight delay in setting bit patterns across these two 4-bit ports.
The shock box has 8 intensity bits (labeled 0-7 or A0-A7 depending on the shock box) that provide for 255 unique intensity levels. In addition, it requires one line to +5 volts and one line to ground. Finally there is one line* that triggers the administration of a shock, which is labeled ON.
Although there are 255 intensities, we typically only use 25 of those intensities in increments of 10, starting at 1 (e.g, 1, 11, 21, 31, ……251). The advantage of this is that we can completely control the shock box with Port C without requiring an additional bit from Port A. To do this, we connect intensity bit 0 to +5 volts so that it is always set (therefore we will always have odd intensities). Then we connect the ON line to C0. This way, when we output an odd intensity, C0 will go high and the shock will be triggered. Full connection is described below
|
Shock Box Line
Label |
I/O Card Pin
Number |
I/O Card
Function |
|
Intensity 0 |
20 |
+5V |
|
Intensity 1 |
28 |
C1 |
|
Intensity 2 |
27 |
C2 |
|
Intensity 3 |
26 |
C3 |
|
Intensity 4 |
25 |
C4 |
|
Intensity 5 |
24 |
C5 |
|
Intensity 6 |
23 |
C6 |
|
Intensity 7 |
22 |
C7 |
|
ON |
29 |
C0 |
|
+5V |
20 |
+5V |
|
GND |
21 |
GND |
* Actually it’s a bit more complicated. There are actually two lines that are used to trigger a shock. One must be high and one must be low to administer the shock. However, we have set one of the two lines to be permanently low so that we only need one line high to administer the shock.