High Energy Particle Physics

High Energy Particle Physics

Decoding The Code

Decoding the Code: Understanding and Using the Data from the QuarkNet DAQ Board 

 Jeff Pesula

Sebastian River High School

Sebastian, FL

QuarkNet Summer 2003 Program – Florida Tech

July 2003

Rev. February 2004 

Decoding the Code

            The data output by the QuarkNet DAQ looks cryptic.   However, there is a large amount of information in it that can be used if the operator knows how to interpret it.   This guide will give some insight into the data and how to extract useful meaning from it.

            The data is put out in hexadecimal format (see appendix A) and split up into “words”.   The first word (8 numbers/letters) is the clock count from the microprocessor.   This starts at 0x00000000 and runs up to 0xFFFFFFFF and then starts over again (‘0x' means that the following letters/numbers are in hexadecimal or base 16 notation).   Each count is 24 nsec in duration.   These clock counts are used to determine when a muon strikes a detector and how long the event lasts.   The clock can also be used for coincidences – i.e., having the scintillating paddles stacked over each other and looking for muons that pass through both paddles.

            The next eight words are for the channels on the board, and there are four pairs of two words.   The first word in the pair is for the rising (or leading) edge of the pulse and the second word of the pair is for the falling (or trailing) edge of the pulse.   Since the units usually have only two paddles, only two channels are needed (usually 0 and 1).

            The next word (8 letters/numbers) is when the clock was last checked against the 1 Pulse Per Second GPS clock.   The word after that is the time (UTC) of the event from the GPS receiver.   The date is the next word.   The next character is either a ‘V' or ‘A' – A means that GPS data is valid and V means that it is not.   The next 2 numbers indicate the number of satellites that are in view by the GPS receiver, and the following number/letter (0-F) represents any error with the DAQ with respect to triggers and the 1 PPS signal.   The final numbers represent the difference between the 1 PPS clock and the GPS clock in milliseconds; + means the 1PPS is ahead of the GPS and – means the 1PPS is behind the GPS.

            Below are some examples of actual data and how to interpret it.   It should be noted that often an event begins in one clock cycle and ends in another.   This is analogous to starting a problem during one hour and finishing it in the next hour.   Most of the time the desired result is the length of the event.   However, with some mathematical manipulation, the actual time of the event can be determined to nanoseconds (resolution of the GPS time is milliseconds).

n.b. – for all of this data, the command “ WC 00 13” was sent to the DAQ.   This forces the board to only look for a coincidence between channels 0 and 1 and to ignore the other channels.   For this setup, channel 0 was the upper paddle and channel 1 was the lower paddle.

 

Bit numbering:

7 6 5 4 3 2 1 0

bit 7 means event boundary marker

 

            This is in the first word of the channel data (Rising Edge for channel 0 in this case).   It does not mean that the rising edge is necessarily triggered by channel 0 – it could be caused by channel 1 (see examples below).  

 

bit 5 sets validity for rising edge (RE) or falling edge (FE)

 

            If bit 5 = 1, then the data is valid.   If bit 5 = 0, then the data is not valid or not present.   The five bits following bit 5 are the ‘time clicks' since the beginning of the clock cycle to the pulse edge.   Since there are 5 bits and each clock cycle is 24 nsec, each ‘time click' equals 0.75 nsec since the beginning of a particular clock cycle.

 

            A question arises – how can the lower channel have a rising and falling edge within one clock cycle while the upper channel is spans two clock cycles?   The answer lies in the discrimination settings of the paddles.   If the lower paddle is set to reject more pulses with a higher threshold or different bias setting, it appears that muons come from some unknown source.   Example 1 illustrates this occurrence.   The muon passes through the upper paddle and then the lower paddle, but the paddles discrimination settings were such that it looks like the muon passed from the bottom through the top.   It is extremely important, therefore, to make sure that all of the equipment is properly calibrated and that both paddles are set to look for equally sized events (via the oscilloscope).
Example 1

 

1F7F31B3 BD 01 33 3D 00 01 00 01 1E705220 135455.257 120603 A 04 2 +0609

1F7F31B4 01 2B 00 01 00 01 00 01 1E705220 135455.257 120603 A 04 0 +0609

 

Time/Date: 13:54:55.257 UTC 12Jun03 (local time was 9:54 AM)

4 satellites in view, valid GPS data (1 PPS differs by +0.609 seconds)

So, actual time is 13:54:55.527 + 0.609 = 13:54:56.136 UTC

 

Actual trigger time: subtract 1 PPS time from trigger time

1F7F31B3 = 528429491 (decimal)

1E705220 = 510677536 (decimal)

528429491 – 510677536 = 17751955 clock ticks since last 1PPS

17751955 * 24 ns = 0.426046920 seconds

Therefore, time is 13:54:56.136 + 0.426046920 =  

    13:54:56.562046920 UTC

 

conversion of the data for channel 0 and 1:

 

1011 1101    0000 0001    0011 0011    0011 1101 (BD 01 33 3D)

0000 0001    0010 1011    0000 0000    0000 0001 (01 2B 00 01)

 

cycle 31B3:

 

RE for Channel 0 valid - begins at 1 1101 or 0x1D

no FE this cycle for Channel 0

RE for Channel 1 valid - begins at 1 0011 or 0x13

FE for Channel 1 valid – ends at 1 1101 or 0x1D

 

cycle 31B4:

 

no RE for Channel 0

FE for Channel 0 valid - ends at 0 1011 or 0x0B

no RE for Channel 1

no FE for Channel 1

 

The five bits must be converted to a value from 0 to 31 (App. B)

 

In this example, the pulses start in 31B3  

Then, RE on channel 0 begins at (29*0.75) = 21.75 nsec and RE on Channel 1 begins at (19*0.75) = 14.25 nsec

 

The pulses end in 31B3 for Channel 1 and 31B4 for Channel 0

FE on Channel 0 ends at (11*0.75) = 8.25 nsec and FE on Channel 1 ends at (29*0.75) = 21.75 nsec

 

The total time for Channel 0 = 10.50 nsec ((24 + 8.25) – 21.75)

The total time for Channel 1 = 7.50 nsec (21.75 – 14.25)

 

Example 2

 

42804F84 80 01 3E 01 00 01 00 01 413546F6 135510.257 120603 A 02 2 -0351

42804F85 22 01 01 2C 00 01 00 01 413546F6 135510.257 120603 A 02 2 -0351

42804F86 01 24 00 01 00 01 00 01 413546F6 135510.257 120603 A 02 0 –0351

 

Time/Date: 13:55:10.257 UTC 12Jun03 (local time was 9:55 AM)

3 satellites in view, valid GPS data (1 PPS differs by -0.351 seconds)

So, actual time is 13:55:10.257 – 0.351 = 13:55:09.906 UTC

 

Actual trigger time: subtract 1 PPS time from trigger time

42804F84 = 1115705220 (decimal)

413546F6 = 1094010614 (decimal)

1115705220 - 1094010614 = 21694606 clock ticks since last 1PPS

21694606 * 24 ns = 0.520670544 seconds

Therefore, time is 13:55:10.257 + 0.520670544 =  

    13:55:10.777670544 UTC

 

conversion of the data for channel 0 and 1:

1000 0000    0000 0001    0011 1110    0001 0000 (80 01 3E 01)

0010 0010    0000 0001    0000 0001    0010 1100 (22 01 01 2C)

0000 0001    0010 0100    0000 0000    0000 0001 (01 24 00 01)

  

cycle 4F84:

 

no RE this cycle for Channel 0

no FE this cycle for Channel 0

RE for Channel 1 valid - begins at 1 1110 or 0x1E

no FE this cycle for Channel 1

 

cycle 4F85:

 

RE for Channel 0 valid – begins at 0 0010 or 0x02

no FE for Channel 0

no RE for Channel 1

FE for Channel 1 valid - ends at 0 1100 or 0x0C

 

Cycle 4F86:

 

No RE for Channel 0

FE for Channel 0 valid – ends at 0 0100 or 0x04

No RE for Channel 1

No FE for Channel 1

 

Each clock cycle = 24 nsec, and there are 32 divisions (0x00 to 0x1F), so each division = 24/32 = 0.75 nsec

 

In this example, the pulses start in 4F84.  

The pulse for Channel 0 does not start in 4F84 but Channel 1 does

RE on Channel 1 begins at (30*0.75) = 22.50 nsec

 

The pulse for Channel 0 starts in 4F85

The pulse for Channel 1 ends in 4F85

RE on Channel 0 beings at (2*0.75) = 1.50 nsec

FE on Channel 1 ends at (12*0.75) = 9.00 nsec

 

The pulse for Channel 0 ends in 4F86

FE on Channel 0 ends at (4*0.75) = 3.00 nsec

 

The total time for Channel 0 = 25.5 nsec ((24.00+3.00)-(1.50))

The total time for Channel 1 = 10.50 nsec ((24.00-22.50)+9.00)

 

Appendix A

 

Hexadecimal to binary conversion

 

                                   

Hexadecimal

Binary

Hexadecimal

Binary

0

0000

8

1000

1

0001

9

1001

2

0010

A

1010

3

0011

B

1011

4

0100

C

1100

5

0101

D

1101

6

0110

E

1110

7

0111

F

1111

 

Binary counts from right to left.   The most significant bit is the first bit (left most bit).   They bits have the following values:

 

8 4 2 1

 

Therefore, C is represented as 1100 or has a value of 1*8 + 1*4 + 0*2 + 0*1 = 12 in decimal

Appendix B

5 bit time conversions

 

11111

31

01111

15

11110

30

01110

14

11101

29

01101

13

11100

28

01100

12

11011

27

01011

11

11010

26

01010

10

11001

25

01001

9

11000

24

01000

8

10111

23

00111

7

10110

22

00110

6

10101

21

00101

5

10100

20

00100

4

10011

19

00011

3

10010

18

00010

2

10001

17

00001

1

10000

16

00000

0


Appendix C

This document was developed from the QuarkNet website run by Hans Berns and Sten Hansen at the University of Washington and from email correspondence with these individuals. Other documents about the DAQ Board and its workings are also available; the web address is

http://www.phys.washington.edu/~berns/WALTA/Qnet2/

            This document was written in an effort to convert the technical aspect of the DAQ Board and its equally technical support into a usable format for high school teachers.   As of February 2004, I am currently working with a student on muon detection.   This student is also working with me to write a program in C/C++ to take the raw data from the text files and to do the work that is currently done by hand (i.e., Examples 1 and 2).