V2 Prototype
The host now has four control lines:
HDTA Host Data Available
HACK Host Acknowledge
HGNT Host Grant ( dual purpose )
INIT Host is bringing up the link
The camera has three handshake lines back to the PC:
CACK Camera Acknowledge
CDTA Camera Data Available
CREQ Camera Request
The additional host line (INIT) is to negotiate the start up. One of the devices will be running before the other, so the camera starts up offline, and when the host signals it to come online, it brings the interface up.
The camera supports interlocking handshake with the PC. With interlocking handshake, a deadlock can occur at any time. To prevent this from happening, the camera looks for a signal indicating it has the line during each loop. If the line goes low, the camera aborts the current command, and goes back to the idle mode.
It takes 2.136 uS to transfer a single byte from the camera to the PC. Since this time overlaps the digitization time, it does not add to the time required to download a frame. Each pixel requires two transfers, which makes it 4.273 uS. If this is less than the time required to set up the signal to digitize, then things will work out great.
It is interesting to note that there are 5 I/O instructions (minimum) required of the PC in order to make one complete transfer. This corresponds to an I/O cycle time of 427 nS. I had earlier determined my I/O cycle time to be 400 - 450 nS. This would mean that the several dozen lines of assembly and C code are executing in the same time it takes to do the I/O instructions.
COMMANDS:
| HEX | NAME | USED | DESCRIPTION |
| 00 | RESET | Yes | Resets the camera to idle, clearing all settings. |
| 01 | SETPARMS | Yes | Sets the temperature, window size and bin mode. |
| 02 | GETPARMS | Yes | Returns the temperature, window size and bin mode. |
| 03 | START | Yes | Stops the idle clearing and waits for a STOPEXP command. |
| 04 | STOP | Yes | Stops the exposure, and starts a transfer. |
| 05 | OPEN | Yes | Opens the shutter. |
| 06 | CLOSE | Yes | Closes the shutter. |
| F0 | TESTF0 | Yes | Generates simulated video until INIT raised. |
| F1 | TESTF1 | Yes | As above, with reset clamp digitization. |
| F2 | TESTF2 | Yes | As above, with digital CDS digitization. |
| F3 | TESTF3 | Yes | As above, only reset digitized. |
| F4 | TESTF4 | Yes | Cycles specified clock signal every 10 uS. |
NOTE: The temperature is not implemented on this version, because the CPU doesn´t support it. The next version will have a PIC17C756 CPU, and will support up to four temperature probes, and two temperature control outputs.
The camera accepts and returns a parameter array consisting of the following values:
struct parms {
int TargetTemp[2]; // Desired temps (controlled)
int ActualTemp[4]; // Measured temps
int LeftColumn; // First digitized column
int Width; // Total digitized columns
int TopLine; // First digitized line
int Height; // Total digitized lines
int BinMode; // One of 1, 2, 3
int ShutterMode; // 0=Independent, 1=Synchronized
int TempMode[2]; // 0=Disable temp control
// 1=Always active
// 2=Disable during readout
int ADCMode; // 0=VideoClamp, 1=DCDS,
// 2= ADCS, 3=ResetOnly
int Offset; // Future:Offset adjustment value
int Gain; // Future:Gain adjustment value
}
