[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Mark IV Stamp Code
At 10:01 AM 1/27/98 -0600, Chris wrote:
(snip)
>>
>>I also wrote that I couldn't figure out how to do an exposure.
>>I had expected commands to clear charge from the CCD and start
>>a readout. I'd also like to know how data gets stuffed inti the
>>memory board. I gues the details of that don't mater for now.
The only way I can see to clear the CCD is to read it out. You
probably have to do it several times at the start. This seems to
be a common problem for CCDs. I hear grumbling from the Sloan
worker bees about this. Each read out takes 40 seconds. You can
determine when it is done by polling on the memory done bit. Or
later an interrupt. If it works.
One does a read out by sending a message to the stamp that says
"read out the CCD". All the stamp does, is send a single pulse
to the read out circuitry. It is off and running for the next
40 seconds.
To open or close the shutter, one sends a command to the stamp.
It then sends out a pulse train to the model airplane servo for
the next several hundred milliseconds, and then returns a message
to the PC when it is done. The PC will know that the shutter
operation is complete when it receives this message. Note that
all serial messages to the stamp work the same way. When the
return is received you know the operation is done. But "done"
may mean "started", or whatever. But a command like "move in
RA to the limit" won't send back the return message until
complete the way I have the stamp coded. A minimum stamp
serial message takes about .3 seconds. Don't see why it takes
this long, but if I don't put in a minimum pause the PC will
hang. Note that a command like "move in RA to the limit"
must have the usual time out checks in case of a mechanical
hang.
>
>>In general I don't see much I'd change. I think I'd add some
>>way to send informative error messages back to the PC. and
>>maybe a power on test of some kind. I have downloaded the STAMP
>>documentation from the Parallax web site, a lot of reading.
The way I have it set up, every string sent to the stamp gets
back either the same string, or one with information coded into
it. If the stamp can detect an error, there is a place to put
it. Note that I have built in a "dead man". The stamp must
receive at least a dummy message at intervals or else it
restarts itself. This keeps it watching for commands from the
PC. It will send a message to the PC saying "I have not heard
from you lately" if it does not hear from the PC. This means
that loops like "step to a limit" have to have code that limits
how many steps are taken or a hang is possible.
Back to "I also wrote that I couldn't figure out how to do an
exposure." One has to be intelligent about overlaping read out
with moving the RA drive back to the starting point, opening
and closing the shutter, etc.. I have tried to set up all of
these things so the desired simultaneous operations are possible.
Once the read out is started by a single pulse from the stamp,
all (up to ) four CCDs are read out and stuffed into the memory.
The stuffing is interleaved by high and low bytes and for the 4
CCDs. Not pretty, but a simple loop will unscramble it. The
bytes are stuffed in starting from memory location zero (reset).
You can only start stuffing from zero. (Well, if you don't reset
it will stuff from where you left off.) To read out, you reset
and start reading bytes from zero. You cannot set the memory
address register to an arbitrary value. No. You can't do it.
OK enough already.
Tom Droege