[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: request for help from other Mark IV users



Here's what I do:

long CImageCommand::ReadCCD()
{
	// reset the memory card
	long err = ERROR_NO_ERROR;
	
	if (!theStampIO.Reset())
	{
		err = ERROR_UNABLE_TO_RESET_STAMP;
	}

	if (err == ERROR_NO_ERROR)
	{
		_outp(0x300, 0x80);
		_outp(0x300, 0x05);
		_outp(0x300, 0x00);
		if (!theStampIO.Pulse(17))
		{
			err = ERROR_UNABLE_TO_RESET_MEMORY;
		}
	}

	// wait a little between pulses
	Sleep(500);

	if (err == ERROR_NO_ERROR && !theStampIO.Pulse(4))
	{
		err = ERROR_UNABLE_TO_SCAN_CCD;
	}

	// wait for block done
	if (err == ERROR_NO_ERROR)
	{
		int count = 0;

		Sleep(750);	// allow time for memory to set up
		bool bDone = false;
		do
		{
			Sleep(250);	// allow other tasks to execute

			bDone = (_inp(0x300) & 128) != 0;

			count++;

		} while (!bDone && count < 240);	// wait a maximum of 60 seconds

		Sleep(250);	// this takes care of the current prom set which puts out
					// a block done while a line or two is still reading out

		if (!bDone)
		{
			err = ERROR_BLOCK_DONE_TIMEOUT;
		}
	}

	return err;
}

BOOL CStampIO::Reset()
{
	// lock the critical section
	CSingleLock lock(&m_criticalSection, TRUE);

	// resets registers and turns off all motors
	return Send("81?200") && Send("8159??");
}


Hope this helps!

Mike G.

-----Original Message-----
From: owner-tass@listserv.wwa.com [mailto:owner-tass@listserv.wwa.com]On
Behalf Of Stupendous Man
Sent: Saturday, August 10, 2002 9:46 PM
To: tass@listserv.wwa.com
Cc: mwrsps@rit.edu
Subject: request for help from other Mark IV users



  Sorry to bother most of the readers of the list with this, 
but it may be useful to archive the message for later reference.

  I've replaced the STAMP board on the Mark IV here in Rochester
with one that Tom sent last fall.  There were a number of changes
which needed to be made to the communications between the computer
and Mark IV as a result .... and I've managed to make most of 
them.  I can control the Mark IV motors, for example.  

  However, there is one problem: I can't read out the CCDs.
For some reason, when I request that the CCDs be scanned, either
for clearing or for readout, nothing happens, as far as I can tell.
No new data is placed into the memory card.

  So, the request: would any Mark IV users out there please 
tell me _exactly_ how they are sending a message to scan the
CCDs?  It would be best if you could send me snippets of code
which 

          a) prepare the memory card
          b) initiate the scan

  In Tom's BASIC code, this appears in routines like "ScanIt1",
or "TakeIt", or "TestIt".

  Thanks very much in advance.

                                         Michael