Development of a Pipeline
CAMAC controller
with PC104plus single
board computer

March 2003

Y.YasuProject team
Yoshiji Yasu(1), Eiji Inoue(1), Hirofumi Fujii(1),Youichi Igarashi(1), Masahiro Ikeno(1),Manobu Tanaka(1), Kazuo Nakayoshi(1), Hideyo Kodama(1),Shuichi Harada(2) and Haruyuki Kyoo(3)(1) High Energy Accelerator Research Organization( KEK )
(2) TOYO Corporation(3) Fird, Co.

March 2003

Y.YasuContents• Architecture of Pipeline CAMAC Controller• Overview of the CAMAC controller• CAMAC/DAQ Frame format• PCI operation• Performance measurement• Current status and plan

March 2003

Y.YasuArchitecture ofPipeline CAMACController

March 2003

Y.YasuPipeline CAMAC Controller
CAMAC reply frames

TX

Pipeline
CAMACController

CAMAC command frames

RXThe controller gets a command frame from RX via CAMAC command FIFO,
executes the frame in a 1 usec. andputs a reply frame to TX via CAMAC reply FIFO.
The command frame and the reply frame contain CAMAC N, A, F,
Status (Q,X) and 24-bit data.

March 2003

Y.YasuPipeline Object Controller
Pipeline
ObjectController

RXTX

Point to Point link

Object commandObject reply
DST SRCDST SRCN x M network

Object commandObject reply

Examples of configuration
CAMAC

March 2003

PC

FADC
FADC
FADC
CAMAC
Y.YasuNETW
ORKPCPCFPGA

Overview of the
CAMAC controller

March 2003

Y.YasuPipeline CAMAC Controller
Fast Ethernet

PC104plus PC board computer
PCM-9370's Crusoe TM5400,
Memory, Flash Disk, Ethernet,
USB, …
ALTERA FPGA for PCI
ALTERA FPGA for CAMAC
March 2003

Y.YasuCAMAC/DAQ
functions• Basic CAMAC operation• LAM interrupt function• Trigger Input and Busy Out withEvent counter• Trigger Interrupt function

March 2003

Y.YasuPCI registers for CAMACRegisters
2 32-bit TX/RX data registers
TX/RX Control and Status registers
TX/RX Memory Address registers
TX/RX Preset Transfer counters
TX/RX Actual Transfer counters
TX/RX FIFO count registers
Operation modes
Programmed I/O
Block transfer
March 2003

Y.YasuPCI logic
Altera FPGA
TX
FIFO
CAMAC/
DAQlogic

TX
PCI
Engine
PCI
MUX

RX
FIFO

RX
PCI
EnginePCI logic

March 2003

Y.YasuPCICAMAC/DAQ logic
Altera FPGADAQMarch 2003

CAMAC
executor
CAMAC
Interrupt
DAQexecutor

Packet control

CA
MAC

DAQ
Interrupt
Y.Yasu

CMD
FIFO

REPLY
FIFO

PCIlogic

CAMAC/DAQ
Frame format

March 2003

Y.YasuFrame format
64-bit fixed-length

Basic CAMAC operationTX
cmdNA

FRXrplyNAF24-bit DATA

ST

24-bit DATA

N:station, A:sub-address, F:function, ST:status(Q,X,...)
Read : data(tx) has no meaning.
Write : data(rx) has no meaning.
NDT : data(tx) and data(rx) have no meaning.

RX LAM(interrupt) CAMAC operationrply
24-bit LAM information
March 2003

Y.YasuFrame format(cont.)
64-bit fixed-length

DAQ function( read event counter)
TX
cmdRX
rply

32-bit Event Counter
DAQ function( Trigger Interrupt)

RX
rply
March 2003

32-bit Event Counter
Y.YasuPCI operation

March 2003

Y.YasuPCI operation
Programmed I/O :Generate CAMAC codes for CAMAC write/read/NDT;
check whether TX FIFO is available;for(i=0;i<N;i++) {write data to TX data1/2 registers;}
check whether RX FIFO is available;for(i=0;i<N;i++) {read data from RX data1/2 registers;}
Extract CAMAC data and the status;

March 2003

Y.YasuPCI operation (cont.)
Block transfer :Generate CAMAC code for CAMAC write/read/NDT;
check whether TX FIFO is available;
start reading data with non-blocking;write data with blocking.
wait for the completion interrupt of the read operation;
Extract CAMAC data and the status;
This algorithm makes CAMAC write and the read operate concurrently.

March 2003

Y.YasuPerformance
Measurement

March 2003

Y.YasuCAMAC timing
Busy

S1

March 2003

Y.YasuCAMAC timing (cont.)
Busy

S1

March 2003

Y.YasuCurrent status and Plan

March 2003

Y.YasuCurrent status and Plan
• CAMAC/DAQ functions basicallyworked on the prototype of Pipeline
CAMAC controller• The prototype for mass production
will be checked soon.
• USB interface for the CAMAC
controller without board computer
will be developed.
March 2003

Y.YasuRelated URLs
• http://www-online.kek.jp/~yasu/Parallel-CAMAC/• http://www-online.kek.jp/~inoue/

March 2003

Y.Yasu