This page describe only a subset of the commands
Packet format
The packet is aligned to 16-bit words, rather then 8-bit byte. This might also lead to a confusion of the packet byte ordering.
There are 2 kind of frames:
- fast commands
- block transfer commands
Fast commands
Fast commands are intended as a dedicated komma sequence, that can be even interleaved in the slower-priority packets. The DIF implemnts following fast commands:
pkt | meaning | note |
---|---|---|
0xE311 | Start acquisition | starts the acquisition. Issued by cmd_rx |
0xE313 | Stop acquisition | Stops the acquisition. Is handled by an acq_stop module |
0xE0-- | Sync | 5 MHz derived clock synchronization. Handled by lda2dif module |
Block transfer commands
Packet structure:
bytes | default | ||
---|---|---|---|
0-1 | packet_type | 0xCC02 | generic command header |
2-3 | packet_ID | 0x0000 | number of packets (for checking lost packets) |
4-5 | type_modifier | ||
6-7 | specifier | ||
8-9 | data_length | 0 | |
len*2 | (data - if any) | - | |
(10-11)+len*2 | CRC | 0xABAB |
Default answer:
field | content | |
---|---|---|
packet_type | 0xCC02 | |
packet_ID | RO_cycle << 8 + 0x0F | |
type_modifier | type_modifier | |
specifier | specifier | |
data_length | 0 or 1 | 0 or 1 bytes |
data | data | only if data_length==1 |
CRC | 0xABAB |
Type modifiers:
- x"0002" -- power control commands
- x"0003" -- switch SPIROC1/SPIROC2
- x"0004" -- reset control commands
- x"0005" -- clock enable/disable commands
- x"0006" -- set DIF commands
- x"0007" -- no_trig enable/disable
- x"0008" -- power pulsing (select)commands
- x"0010" -- set control register
- x"0012" -- (re) initialization
- x"000F" -- readout time (length of acquisition)
- x"0022" -- set power pulsing timing
- x"0024" -- set sc_select signal
- x"0030" -- set trigger
- x"0080" -- set analog probe
- x"0081" -- set DIF ID
- x"0082" -- set digital probe #1 or #2
Updates:
Timing configuration
BXID width:
bytes | |||
---|---|---|---|
0-1 | packet_type | 0xCC02 | generic command header |
2-3 | packet_ID | 0x0000 | number of packets (for checking lost packets) |
4-5 | type_modifier | 0x0021 | |
6-7 | specifier | 0xRRLL (0x00A0) | RR: reserved LL: BXID width |
8-9 | data_length | 0 | |
len*2 | (data - if any) | - | |
(10-11)+len*2 | CRC | 0xABAB |
Default answer:
TODO
Data packets:
bytes | word | even byte | odd byte | |
---|---|---|---|---|
0,1 | 0 | 0x41 | 0x43 | |
2,3 | 1 | packet_cnt | acq_cycle | |
4,5 | 2 | 0x48 | 0x41 | |
6,7 | 3 | length | 00 | dif packet data length (kind of - 0x36, 0x18, 0x1C, 0x33...) |
8,9 | 4 | ASIC index in chain | readout chain | |
10,11 | 5 | 2nd packet counter | packet order | rendundant pkt counter. Order: First = 0xB0, middle = 0xFF, last = 0xE0 |
12,13 | 6 | DIF ID (7 downto 0) | DIF ID (15 downto 8) | |
14,15 | 7 | Data (first byte)..... | ... | |
... | ... | ... | ... | |
... | ... | AB | AB | reserved for CRC |