Table of Contents
Previous Chapter
The purpose of the Detector Electronics Assembly (DEA) Management classes are to manage access to the DEA CCD-controller and system boards.
The following lists the use of the DEA Manager:
Figure 114 illustrates the class relationships used by the Detector Electronics Assembly Manager class, DeaManager.
FIGURE 114. DeaManager Class Relationships
DeaManager - The DeaManager class is responsible for managing access to the Detector Electronics Assembly. It provides functions which read and write the contents of a CCD Controller board's Program and Sequencer RAM (readPram, readSram, writePram, writeSram), and to load complete images into the controller's RAM (loadSequencers). It provides functions to set control and digital-to-analog register values in one of the DEA boards and to query the values in the control and housekeeping registers (setRegister, queryDea). It provides functions to start and stop all of the DEA sequencers (invokeSequencer, stopSequencer). It also provides functions to individually power CCD-controller boards on and off and to determine if it has enabled power to a particular board (powerOn, powerOff, hasPower).
Semaphore - This class is supplied by the Executive class category. This class represents a resource lock or flag. Its implementation uses the underlying resource facilities of the RTX. The DeaManager contains an instance of this class, called lock, and uses this class to arbitrate access to the DEA interface. Prior to using the interface, the DeaManager attempts wait for exclusive access to the interface and reserve the semaphore (waitFor). Once the DeaManager has completed its action, it releases the semaphore (release).
DeaDevice - This class is supplied by the Devices class category. It is responsible for managing the physical interface between the Back End Processor and the Detector Electronics Assembly. The DeaManager uses this class to issue commands to the DEA and to retrieve status back from the DEA. This class provides functions which reset the DEA's interface board (reset() not shown), which indicate whether or not the command port to the DEA is ready to accept another command (isCmdPortReady), whether or not a status word has been received from the DEA (isReplyRead). It provides functions to write a command to be sent the DEA (sendCmd) and read status information sent back (readReply). The DeaDevice also provides a function which reads and returns the version of the science time-stamp, latched when the last command was issued to the DEA (readTimestamp).
TaskManager - This class is supplied by the Executive class category. It is responsible for managing the collection of tasks running within the Back End Processor. The DeaManager uses this class to obtain a pointer to the currently active task (queryCurrentTask).
Task - This class is supplied by the Executive class category. It represents and controls an active running task. The DeaManager uses this class to cause the current task to relinquish control to other tasks for a period of time (sleep).
This section describes how much time the DEA Manager must allow for commands to be transmitted to the DEA, and how much time it must allow for commands to be executed by the DEA. When issuing back-to-back commands, the DEA Manager must wait until the first command has been transmitted to the DEA and executed by the DEA before issuing a second command. If it sends the second command too close to the first, the DEA will ignore the second. Except for commands which demand a response from the DEA, there is no physical handshaking between the Back End Processor and the DEA. The command spacing requirements must be handled using time-delays.
The Back End Processor sends 24-bit commands to the DEA via a 1Mbps serial interface. It takes approximately 24us after the Back End writes a command word to the serial interface and the time at which it has been received by the DEA.
The time taken to execute a command varies from command to command. At a minimum, each command (including board and address selection) takes the DEA CCD Controllers 5us to execute.
The following tables list the various command types and their respective execution times:
TABLE 24. DEA CCD Controller Command Timing
----------------------------------------------------------------------------
Command Register Type Execution Time Reply Time Total Time
(including
transmission)
----------------------------------------------------------------------------
Select Card N/A 9µs N/A 33µs
Write N/A 9µs N/A 33µs
Address
Write Data PRAM/SRAM 9µs N/A 33µs
Write Data A/D Control Register 9.6ms N/A 9.6ms
Write Data Sequencer Control 19µs N/A 43µs
Read Data PRAM/SRAM 14µs 24µs 62µs
Read Data Housekeeping 56.5µs 45.5µs 121µs
Read Data Control Register 9µs 45.5µs 78.5µs
----------------------------------------------------------------------------
TABLE 25. DEA Interface Board Command Timing
-----------------------------------------------------------------------------
Command Execution Time Reply Timing Total Time
(including
transmission)
-----------------------------------------------------------------------------
Read CCD Controller Housekeeping 56.6µs 45.5µs 121µs
Read Interface Housekeeping 56.6µs 45.5µs 121µs
Write Focal Plane Temperature 9µs N/A 33µs
Write Back-out Temperature 9µs N/A 33µs
Enable Relay 1.024ms N/A 1.048ms
Switch CCD Controller Power 9µs(a) N/A 33µs
Calibrate A/D Converter 9.6ms N/A 9.6ms
Reset CCD Controllers 100ms N/A 100ms
-----------------------------------------------------------------------------
Assuming that the bulk of commanding to the DEA is to load Program and Sequencer RAM (PRAM and SRAM), the DEA Manager takes three approaches to command timing, fast commanding, and slow commanding. For commands which select boards, addresses and load RAM, the DEA Manager attempts to issue the commands as quickly as possible. For other commands which do not cause a response from the DEA, the DEA Manager adds the maximum delay between each command. For commands which request a response from the DEA, the DEA Manager blocks until the response has been received.
Refer to the "DPA/DEA Interface Control Document," MIT 36-02205 Rev. A for descriptions of the command and status formats, and the overall address map of the DEA CCD Controller boards. This version of the document also accurately lists the D/A Controller settings.
The following illustrates the 8-bit DEA CCD Controller Control Registers. Unless otherwise specified, all single-bit signals are active high (1 - enable, 0 - disable):
----------------------------------------------------------------------------------
Address (msb) 6 5 4 3 2 1 (lsb)
7 0
----------------------------------------------------------------------------------
0x10000 100KHz Sequencer Offset (0..63) Stop Start
Sequencer Sequencer
0x10001 100KHz Video ADC Offset (0..63) Stop Start
Video Video
ADC ADC
0x10002 - Hold - - Video Video Video Video
House Output Output Output Output
keeping Enable Enable Enable Enable
Address Channel Channel Channel Channel
D C B A
0x10003 - - - Status High Clock Back -
Enable Speed Swap Junction
Tap Enable Diode
(active Enable Enable
low) (active
low)
----------------------------------------------------------------------------------
NOTE: In order to ensure that all the sequencers start at the same time, ACIS always broadcasts the "Start Sequencer/Stop Sequencer" command word to all controllers being used for a run. This means that all of the controllers must use the same 100KHz Sequencer Offset value.
The following lists the CCD Controller Housekeeping Channels:
-------------------------------------------------------------------------
Index Description Min. Max. Conversion
Value Value
-------------------------------------------------------------------------
0 Parallel Image Array Voltage + 0 TBD Volts = TBD(value)
1 Parallel Image Array Voltage - 0 TBD Volts = TBD(value)
2 Parallel Framestore Voltage + 0 TBD Volts = TBD(value)
3 Parallel Framestore Voltage - 0 TBD Volts = TBD(value)
4 Serial Output Register Voltage + 0 TBD Volts = TBD(value)
5 Serial Output Register Voltage - 0 TBD Volts = TBD(value)
6 Reset Gate Voltage + 0 TBD Volts = TBD(value)
7 Reset Gate Voltage - 0 TBD Volts = TBD(value)
8 Output Gate Voltage 0 TBD Volts = TBD(value)
9 Scupper Voltage 0 TBD Volts = TBD(value)
10 Reset Diode Voltage 0 TBD Volts = TBD(value)
11 Drain Output Channel A Voltage 0 TBD Volts = TBD(value)
12 Drain Output Channel B Voltage 0 TBD Volts = TBD(value)
13 Drain Output Channel C Voltage 0 TBD Volts = TBD(value)
14 Drain Output Channel D Voltage 0 TBD Volts = TBD(value)
15 RTD4 - Board Temperature 0 TBD oC = TBD(value)
16 RTD3 - SRAM Temperature 0 TBD oC = TBD(value)
17 RTD2 - ADC Temperature 0 TBD oC = TBD(value)
18 RTD1 - Gate Array Temperature 0 TBD oC = TBD(value)
-------------------------------------------------------------------------
The DEA CCD Controllers are commanded using a small collection of control commands which can read and write a set of indexed control registers, D/A Converter settings, PRAM and SRAM memory locations, and A/D Converter housekeeping channels. The following describe the overall procedure for performing the indicated operation:
Writing to a Control Register, PRAM/SRAM or D/A Converter
Reading a Control Register, or PRAM/SRAM
Reading a housekeeping A/D Converter channel
Although the housekeeper query is being addressed to a CCD Controller card, the A/D converter on the DEA Interface card will be used to sample and transmit the signal back to the BEP. For this reason, all CCD Controller cards must have their "Status Enable" signals deasserted.
All commands to the DEA Interface card have the following overall format:
---------------------------------------------------------------------------
23 22 21 20 19 18 17 16 15 12 11 0
---------------------------------------------------------------------------
0 0 1 1 Execute = 0 Unused Off = 0 Task Task dependent data
Read = 1 On = 1 Number
---------------------------------------------------------------------------
The task numbers and data fields on the DEA Interface board are as follows:
-------------------------------------------------------------------------------------------------------------
Action Task Data Field
11 10 9 8 7 6 5 4 3 2 1 0
-------------------------------------------------------------------------------------------------------------
Read Interface 0xa Channel Number (0 - 39 decimal)
Housekeeping
Read Focal 0xb -
Plane Tempera
ture
Read Relay 0xc -
Positions
Set Focal Plane 0x1 12-bit temperature set-point
Temperature
Set Bakeout 0x2 12-bit temperature set-point
Tempearture
Set Spare D/A 0x3 Value
Set CCD Con 0x4 Board Power Selection Mask(a)
troller Power
Discrete Settings 0x5 - - - Hold - - - - - - Bake LED
Hk. Out
Addr.
Pulse Actions 0x6 - - - - - - - Reset CCD - - - Cal. A/D
Controllers
Signal Selects 0x7 - - - - Disable Disable Disable Disable - - - Signal
Video 100KHz Command Command Path
Clock Synch. Clock Data
Relay Enables 0x8 - - - - - - - R5 R4 R3 R2 R1
-------------------------------------------------------------------------------------------------------------
Unlike the DEA CCD Controllers, the DEA Interface Card does not rely on indexed registers for most of its functionalilty. Instead, it is commanded using a collection set of command opcodes, or "tasks." Each control function or collection of control functions is explicitly indicated by a command task number and possibly an item selection bit-field with the task-dependent data.
Setting a value (such as focal plane temperature)
Reading a value
Enabling a switch or state
Disabling a switch or state
Reading a Interface card housekeeping A/D converter channel
Reading a CCD Controller housekeeping A/D converter channel
See Section 26.4.2.4
Figure 115 illustrates the sequence of actions when a client instructs the DeaManager to load a section of Program RAM (PRAM). The scenario to load Sequencer RAM (SRAM) is the same except for the initial call to writeSram().
FIGURE 115. Load Program RAM Scenario
Figure 116 illustrates the sequence of actions when a client instructs the DeaManager to load a section of Program RAM (PRAM). The scenario to read Sequencer RAM (SRAM) is the same except for the initial call to readSram().
FIGURE 116. Read Program RAM Scenario
Figure 117 illustrates the sequence of actions when a client instructs the DeaManager to start the CCD sequencers.
FIGURE 117. Start Sequencer Scenario
Figure 118 illustrates the sequence of actions when a client instructs the DeaManager to halt the CCD sequencers.
FIGURE 118. Stop Sequencer Scenario
Figure 119 illustrates the sequence of actions when a client instructs the DeaManager to write a value to one of the DEA board registers.
FIGURE 119. Set DEA Register Scenario
Figure 120 illustrates the sequence of actions when a client instructs the DeaManager to read a value from one of the DEA board registers.
FIGURE 120. Query DEA Register Scenario
Figure 121 illustrates the sequence of actions when a client instructs the DeaManager to power on a single DEA CCD-controller board. The steps involved in powering off a single board are similar, except that a power-off command is sent to the DEA Interface board. TBD: How to detect and update system configurations on power-on?
FIGURE 121. CCD-Controller Power On Scenario
Hierarchy:
Superclasses:
none
Implementation Uses:
DeaDevice deaDevice
TaskManager taskManager
Task
Public Interface:
Operations:
DeaManager() hasPower() invokeSequencer() loadSequencers() powerOff() powerOn() queryDea() readPram() readSram() setRegister() stopSequencer() writePram() writeSram()
Protected Interface:
Operations:
getStatus() loadRam() readData() readRam() selectBoard() selectBroadcast() sendCommand() setAddress() waitForPort() waitForStatus() writeData()
Private Interface:
Timing Constants:
DEATIME_RAM_ITERATIONS = 1000 per sleep DEATIME_RAM_SLEEP = 2 ticks (0.2 seconds) DEATIME_LOCK_WAIT = 5 ticks (0.5 seconds) DEATIME_REG_SLEEP = 2 ticks (0.2 seconds) DEATIME_SEQ_SLEEP = 2 ticks (0.2 seconds) DEATIME_CMD_ITERATIONS = 100 (~50us) DEATIME_CMD_WAITLOOP = 500 (~250us) DEATIME_STAT_WAITLOOP = 1500 (~750us) DEATIME_POWER_ON_SLEEP = 10 (1 second) DEATIME_POWER_OFF_SLEEP = 10 (1 second)
Has-A Relationships:
Arguments:
unsigned semid
Documentation:
This is the constructor for the DEA Manager. semid is the Nucleus RTX semaphore id to use for the class's lock variable. The function initializes lock, sets curboard to DEAID_UNKNOWN, deasserts sequencerActive, and zeroes powermask. The body of the constructor calls deaDevice.reset() to reset the DEA interface board, and disable power to the DEA's CCD controller boards.
Arguments:
unsigned& status
Documentation:
This function busy-waits until a status is received from the DEA, and stores the read word into the status parameter. If the status word is read successfully, the function returns BoolTrue. If the wait expires before a status word is ready, the function returns BoolFalse.
Arguments:
DeaBoardId boardid
Documentation:
This function returns whether or not the DEA Manager has enabled power to the board, indicated by boardid, by examining the private powermask variable. If the board has been enabled, the function returns BoolTrue. If not, it returns BoolFalse.
Arguments:
unsigned& starttime
Documentation:
This function starts the DEA CCD Controller Sequencers. starttime is a copy of the science timestamp, latched when the command to start was issued. If the command is sent successfully, the function returns BoolTrue. If an error occurs, it returns BoolFalse.
Arguments:
DeaBoardId boardid
unsigned addr
const unsigned short* srcbuf
unsigned count
Documentation:
This function loads count words pointed to by srcbuf into the location specified by addr on the board specified by boardid. If the load succeeds, the function returns BoolTrue, otherwise it returns BoolFalse.
Arguments:
const DeaSequenceLoad& image
Documentation:
This function loads the sequencer images, specified by image, into the indicated CCD controller boards. If the load is successful, the function returns BoolTrue. If the load fails, the function returns BoolFalse.
Arguments:
DeaBoardId boardid
Documentation:
This function issues a command to turn off power to one of the DEA's CCD Controller boards. The function returns BoolTrue if successful, and BoolFalse if the command transmission fails.
Arguments:
DeaBoardId boardid
Documentation:
This function issues a command to enable power to the CCD controller board indicated by boardid. If the command is sent successfully, the function returns BoolTrue. If the command fails, it returns BoolFalse.
Arguments:
DeaBoardId boardid
unsigned queryid
unsigned& value
Documentation:
This function queries the housekeeping port or PRAM location, addressed by queryid, on the DEA board indicated by boardid, and places the returned item into value. If the query command and response is successful, the function returns BoolTrue, otherwise it returns BoolFalse.
Arguments:
DeaBoardId boardid
unsigned addr
unsigned& value
Documentation:
This function reads the field located at addr on DEA Board boardid and stores the result into value. If successful, the routine returns BoolTrue. If the read fails, it returns BoolFalse.
Arguments:
DeaBoardId pramid
unsigned index
unsigned short* dstbuf
unsigned valcnt
Documentation:
This function reads valcnt words of PRAM from the board specified by pramid, and starting from the location indicated by index into the array pointed to by dstbuf. If successful, the function returns BoolTrue. If a query fails, the function returns BoolFalse. This function adjusts index to the corresponding DEA address and calls readRam() to perform the read.
Arguments:
DeaBoardId boardid
unsigned addr
unsigned short* dstbuf
unsigned count
Documentation:
This function reads count words from the DEA RAM located at addr on board boardid into the buffer dstbuf. If successful, the function returns BoolTrue, otherwise it returns BoolFalse.
Arguments:
DeaBoardId sramid
unsigned index
unsigned short* dstbuf
unsigned valcnt
Documentation:
This function reads valcnt words of DRAM from the board specified by sramid, and starting from the location indicated by index into the array pointed to by dstbuf. If successful, the function returns BoolTrue. If a query fails, the function returns BoolFalse. This function adjusts index to the corresponding DEA address and calls readRam() to perform the read.
Arguments:
DeaBoardId boardid
Documentation:
This function selects boardid as the current board being written to and being queried. If the specified board has already been selected, or if the selection command succeeds, the function returns BoolTrue. Otherwise, the function returns BoolFalse.
Arguments:
unsigned command
Documentation:
This function sends a command word, command, to the DEA. If the word is sent, the function returns BoolTrue. If the wait for the command port expires, the function returns BoolFalse.
Arguments:
unsigned address
Documentation:
This function issues a command to copy address into current address register on the listening DEA board. If the command succeeds, the function returns BoolTrue. On error, it returns BoolFalse.
Arguments:
DeaBoardId boardid
unsigned regaddr
unsigned regval
Documentation:
This function writes regval to the register located on the DEA board, boardid, at the register address, regaddr. This function returns BoolTrue if the command is successfully sent, and BoolFalse if it fails to send the value. After issuing the command, the function sleeps the calling task for at least 0.2 seconds to allow the command to be executed.
Arguments:
DeaBoardId boardid
unsigned addr
unsigned value
Documentation:
This function writes value to the register located on the DEA board, boardid, at the register address, addr. This function returns BoolTrue if the command is successfully sent, and BoolFalse if it fails to send the value.
Arguments:
DeaBoardId pramid
unsigned index
const unsigned short* srcbuf
unsigned valcnt
Documentation:
This function writes valcnt words of PRAM from the source buffer pointed to by srcbuf, into the board specified by pramid, and starting at the location indicated by index into the array pointed to by dstbuf. If successful, the function returns BoolTrue. If a write fails, the function returns BoolFalse. This function maps index to the appropriate DEA address and uses loadRam() to perform the load.
Arguments:
DeaBoardId sramid
unsigned index
const unsigned short* srcbuf
unsigned valcnt
Documentation:
This function writes valcnt words of SRAM from the source buffer pointed to by srcbuf, into the board specified by sramid, and starting at the location indicated by index into the array pointed to by dstbuf. If successful, the function returns BoolTrue. If a write fails, the function returns BoolFalse. This function maps index to the appropriate DEA address and uses loadRam() to perform the load.