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:

Yes
HEXNAMEUSEDDESCRIPTION
00RESETYesResets the camera to idle, clearing all settings.
01SETPARMSSets the temperature, window size and bin mode.
02GETPARMSYesReturns the temperature, window size and bin mode.
03STARTYesStops the idle clearing and waits for a STOPEXP command.
04STOPYesStops the exposure, and starts a transfer.
05OPENYesOpens the shutter.
06CLOSEYesCloses the shutter.
F0TESTF0YesGenerates simulated video until INIT raised.
F1TESTF1YesAs above, with reset clamp digitization.
F2TESTF2YesAs above, with digital CDS digitization.
F3TESTF3YesAs above, only reset digitized.
F4TESTF4YesCycles 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
}