Fundamental Technologies

Cassini MIMI Pages

Control by Serial Communication (continued)

1.2 Structure of LEMMS Test Program

For sending the command each 2/3 seconds, the timer interrupt of the PC is used. After having 11 timer interrupts, the command is sent. If the command was sent, the program is waiting for a start bit of incoming data.

The start bit will be detected by sampling three times when the clock is high. If two of these samples are high, the data receiving is enabled. If no start bit occurs during 20 clock periods after sending the last command bit, a Timeout Error is detected. If the start bit has been detected, each data bit of the incoming byte is sampled three times when the clock is low. After sampling the whole byte with parity, the data is proofed and stored to memory.

1.2.1 Receiving PHA Data

The PHA data receive is done by an interrupt procedure. If all data bytes were sent, the interrupt is enabling a flip-flop on the i/o card.  If a start bit of the PHA is received, the flip-flop is set and causes an interrupt on the i/o card, which sets a hardware interrupt on the PC.  The sampling and storing of the PHA byte is then done as described previously. After storing, the next PHA byte is enabled by resetting the FF.

1.2.2 Storing Data to Disk

After having received a complete set of data--124 data bytes and the unknown number of PHA data--the data set is stored to disk. This is done directly before sending the next command.

1.2.3 Structure of the Stored Data

0. word: sent command  
1. word: Hibyte: status byte Lobyte: no. of received bytes+parity error
(if parity error 80 is added to the number)
2. word: Hibyte: 1.counter (MSB) Lobyte: see above
3. word: Hibyte: 1.counter (LSB)
     |
     |  120 blocks
     |
Lobyte: see above
121. word: Hibyte: 120th counter (MSB) Lobyte: see above
122. word: Hibyte: 120th counter (LSB) Lobyte: see above
123 word: Hibyte: HSK byte   
124 word: Hibyte: Threshold readout byte   
125 word: Hibyte: No. of received bytes Lobyte: Errorcode
(Timeout=80h, NoError=0
126 word: Hibyte: First PHA byte Lobyte: Parity error
127 word: Hibyte: No. of received PHA bytes
     |
     |
     |
  
  xx word: FFFF (sign for end of this data set)
xx+1: FFFF   

1.2.4 Displaying the Data

To display the received data, there is simply read one data set from disk. This gives the possibility to work with the data, even if the experiment does not run.

The data are of course available in real time during the running of LEMMS, but it is possible to look back to what has happened before by choosing the dataset that shall be displayed.

Next: Input Pulses for the Nine Energy Channels

Return to Historical MIMI Memos and Notes main page.
Return to Cassini MIMI table of contents page.
Return to Fundamental Technologies Home Page.

Updated 6/16/08, T. Hunt-Ward
tizby@ftecs.com