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

Re: OS stuff

droege@wwa.com wrote:

> Start:
> Do Until Column Count = 512
> Do Until Row Count = 768 Pixels + overscan desired
>     Send Shift and Start ADC
>         Test Done:  If READY = 1 THEN Test Done
>     Read High Byte
>     Read Low Byte
>     Row Count = Row Count + 1
> Loop
> Column Count = Column Count + 1
> Loop
> One can speed this up a little by reading out the previous High and Low
> byte after sending the Shift and Start ADC.  There is about 27 us to get it
> done.  Above is fool proof.  According to my drawings, there is about
> 30 us between sending the Shift and Start ADC and the return of a READY.
> This gives a minimum line read out time of about 25 milliseconds.  The
> best one can then do for a full read out is then about 12+ seconds.  Reading
> out all three cameras will almost tripple this.

FYI here is how the code it the RT Linux driver works.  The approach
is a little diferent.  Credit Norman for the design.  The key
diference here is that the software _never waits_  There are three
main tasks (plus some minor ones not shown.)  The main line logic
of each task is given below.

1) This routine is tied to a 8KHz timmer interrupt.  Notice there is
   no loop.  The periodic interrupt provides this feature.

   Send Shift and Start ADC for pixel N
   Read High Byte, Low Byte for pixel N-1
   Row Count = Row Count + 1
   if  Row Count == limit then set ROW_DONE

   Notice there is no delay between the first two lines.  The 125u-sec
   period is such that we don't realy have to test the ADC ready bit.

2) This routine runs at a fixed rate of 10Hz.  Again there is
   no loop.

   If ROW_DONE is set then
       Move row into the FIFO queue.  
       set Row Count = 0

   The FIFO can hold up to about 12 seconds worth of data.
   So the next task need not keep up in real-time

3) This task runs at it's own rate

   loop (forever)
       If (there is data present in the FIFO queue) then
           Read one row from FIFO queue
           Append row to current output file(s)
   end loop

Timming is fixed by the 8KHz interrupt rate.  For a tripplet
there are 2400 pixels per line (800/CCD)  So it takes 2400/8192
(.29) seconds to read out one line.   The RT Linux driver does
not drive the hardware at it's maximum rate.  The intent of
the design was to use the minimum number of CPU cycles per pixel.

   --Chris Albertson             home: chrisa@wavenet.com           
     Redondo Beach, California   work: chris@topdog.logicon.com