Commit b2a74499 authored by locatelli's avatar locatelli
Browse files

update some dpp stuff

parent 035b44d6
......@@ -159,6 +159,8 @@ cfd_controller.25Value=0
cfd_controller.25Label=25
cfd_controller.50Value=1
cfd_controller.50Label=50
cfd_controller.75Value=2
cfd_controller.75Label=75
cfd_controller.100Value=3
cfd_controller.100Label=100
......
......@@ -82,7 +82,7 @@
<simple_label prefix="cfd_controller.cfdEnabled"/>
<check role="cfd_controller1" property="cfd_active" checkBoxValues="cfd_controller.enabled"/>
<simple_label prefix="cfd_controller.fraction"/>
<combo role="cfd_controller1" property="cfd_fraction" valuesAndLabels="cfd_controller.25,cfd_controller.50,cfd_controller.100"/>
<combo role="cfd_controller1" property="cfd_fraction" valuesAndLabels="cfd_controller.25,cfd_controller.50,cfd_controller.75,cfd_controller.100"/>
<simple_label prefix="cfd_controller.delay"/>
<text role="cfd_controller1" property="cfd_delay" suffix="cfd_controller.4nSecUnit"/>
<simple_label prefix="cfd_controller.signalZero"/>
......
......@@ -195,10 +195,10 @@ void RealCAENCfdDriver::init() {
}
// PN1 COINCIDENCE MODE =====> HACK EMILIO
// PN1 COINCIDENCE MODE =====> HACK EMILIO 19/01/2018
if (owner()->usePn1Coincidence() == 1) {
// Channel CTRL register (individual trigger, sequencial readout)
ret = CAEN_DGTZ_WriteRegister(m_boardHandle, 0x8000, 0x01000114);
ret = CAEN_DGTZ_WriteRegister(m_boardHandle, 0x8000, 0x010E0115);
if (ret) {
cerr << "Error CAEN_DGTZ_WriteRegister: " << ret << endl;
close();
......@@ -437,19 +437,20 @@ void RealCAENCfdDriver::readInfos() {
*/
void RealCAENCfdDriver::useCoincidence() {
open();
open(); // HACK Emilio 19/01/2018
uint32_t val;
uint32_t addr = 0x1180;
uint32_t addr = 0x1080;
ret = CAEN_DGTZ_ReadRegister(m_boardHandle, addr, &val);
if (ret) {
cerr << "Error CAEN_DGTZ_ReadRegister" << endl;
close();
return;
}
if (owner()->enableCoincidence() == 0) {
val = val & 0x80000;
} else {
if (owner()->enableCoincidence() == 1) {
val = val | (1 << 19);
} else {
//val = val & 0x80000;
}
ret = CAEN_DGTZ_WriteRegister(m_boardHandle, addr, val);
if (ret) {
......@@ -458,9 +459,42 @@ void RealCAENCfdDriver::useCoincidence() {
return;
}
addr = 0x8080;
if (owner()->enableCoincidence() == 1) {
ret = CAEN_DGTZ_WriteRegister(m_boardHandle, addr, 0);// signals from mother-board (inter-couple) are not used
if (ret) {
cerr << "Error CAEN_DGTZ_WriteRegister" << endl;
close();
return;
}
}
addr = 0x10A0;
if (owner()->enableCoincidence() == 1) {
ret = CAEN_DGTZ_ReadRegister(m_boardHandle, addr, &val);
if (ret) {
cerr << "Error CAEN_DGTZ_ReadRegister" << endl;
close();
return;
}
val = val | 0x00000077; // enable couple trgout // enable trg validation input
// trigger propagation between the channels in the couple // couple trgout = OR (NOTE: doesn't reflect the acq. trigger!!!)
ret = CAEN_DGTZ_WriteRegister(m_boardHandle, addr, val);
if (ret) {
cerr << "Error CAEN_DGTZ_WriteRegister" << endl;
close();
return;
}
}
// Channel Trigout Width (it determines the coincidence window).
if (owner()->enableCoincidence() == 1) {
val = owner()->coincidenceWindow();
addr = 0x1184;
addr = 0x1084;
ret = CAEN_DGTZ_WriteRegister(m_boardHandle, addr, val);
if (ret) {
cerr << "Error CAEN_DGTZ_WriteRegister" << endl;
......@@ -506,6 +540,7 @@ void RealCAENCfdDriver::setCfdParam() {
if (owner()->cfdActive.get(i) == 1) {
val = val | 0x00020000;
val = val & 0xFFFFFFBF;
} else {
val = val & 0xFFFDFFFF;
}
......@@ -554,6 +589,13 @@ void RealCAENCfdDriver::setCfdParam() {
val = val | 0x0001000;
val = val & 0xFFFDF00;
owner()->cfdFractionStr.set(i, "50");
} else if (owner()->cfdFraction.get(i) == 2) {
val = val & 0xFFFFEFF;
val = val | 0x0000200;
val = val & 0xFFFFBFF;
val = val | 0x0002000;
val = val & 0xFFFEF00;
owner()->cfdFractionStr.set(i, "75");
} else if (owner()->cfdFraction.get(i) == 3) {
val = val & 0xFFFFEFF;
val = val | 0x0000200;
......
......@@ -205,9 +205,46 @@ void RealCAENPhaDriver::init() {
return;
}
}
// // HACK EMILIO VIVALDI 20/10/2017
// // waveform mode -- trig-IN
//
// ret = CAEN_DGTZ_WriteRegister(m_boardHandle, 0x8000, 0x01070914);// VIVALDI disable dual trace
// if (ret) {
// cerr << "Error CAEN_DGTZ_WriteRegister: " << ret << endl;
// close();
// return;
// }
// //-- DISABLE EXTERNAL TRIGGER 0x817C
// ret = CAEN_DGTZ_WriteRegister(m_boardHandle, 0x817C, 0x0);
// if (ret) {
// cerr << "Error CAEN_DGTZ_WriteRegister Disable External Trigger: " << ret << endl;
// close();
// return;
// }
//
// //-- FRONT PANEL I/O CONTROL 0x811C
// ret = CAEN_DGTZ_WriteRegister(m_boardHandle, 0x811C, 0x801);
// if (ret) {
// cerr << "Error CAEN_DGTZ_WriteRegister FRONT PANEL I/O CONTROL: " << ret << endl;
// close();
// return;
// }
//
// //-- GLOBAL TRIGGER MASK 0x810C
// ret = CAEN_DGTZ_WriteRegister(m_boardHandle, 0x810C, 0x40000000);
// if (ret) {
// cerr << "Error CAEN_DGTZ_WriteRegisterGLOBAL TRIGGER MASK: " << ret << endl;
// close();
// return;
// }
//
// //-- TRIGGER VALIDATION MASK 0x8180
// ret = CAEN_DGTZ_WriteRegister(m_boardHandle, 0x8180, 0x40000000);
// if (ret) {
// cerr << "Error CAEN_DGTZ_WriteRegisterGLOBAL TRIGGER MASK: " << ret << endl;
// close();
// return;
// }
//
close();
......@@ -334,6 +371,27 @@ void RealCAENPhaDriver::writeParam() {
close();
return;
}
// Disable SElf TRigger HACK VIVALDI
// //uint32_t val;
// //uint32_t addr = PHA_FAKEEVTS_ROLLOVER_REG | (i<<8);
// bitMask = 0x01000000; // bit 24
//
// ret = CAEN_DGTZ_ReadRegister(m_boardHandle, addr, &val);
// if (ret) {
// cerr << "Error CAEN_DGTZ_ReadRegister" << endl;
// close();
// return;
// }
// val |= bitMask;
// //val &= bitMask;
// ret = CAEN_DGTZ_WriteRegister(m_boardHandle, addr, val);
// if (ret) {
// cerr << "Error CAEN_DGTZ_WriteRegister" << endl;
// close();
// return;
// }
}
}
......
......@@ -69,6 +69,8 @@ void RealCAENPsdDriver::init() {
reset();
readInfos();
open();
// Channel CTRL register (individual trigger, sequencial readout)
......@@ -146,6 +148,9 @@ void RealCAENPsdDriver::init() {
else if (owner()->dppAcqMode() == acquisition::DPPAcquisitionCommon::WAVEFORM_MODE) {
boardParams.EventAggr = 1; //10
}
else {
boardParams.EventAggr = 0;
}
ret = CAEN_DGTZ_SetDPPEventAggregation(m_boardHandle, boardParams.EventAggr, 0);
if (ret) {
......@@ -177,14 +182,14 @@ void RealCAENPsdDriver::init() {
ret = CAEN_DGTZ_ReadRegister(m_boardHandle, 0x8000, &data);
if (owner()->dppAcqMode() == acquisition::DPPAcquisitionCommon::LISTMODE_MODE) {
data = 0x000C0114;
data = 0x000E0110;
}
else if (owner()->dppAcqMode() == acquisition::DPPAcquisitionCommon::SCOPE_MODE) {
//data = 0x01870110;
data = 0x018D0110;
data = 0x018F0110;
}
else if (owner()->dppAcqMode() == acquisition::DPPAcquisitionCommon::WAVEFORM_MODE) {
data = 0x018D0110;
data = 0x018F0110;
}
ret = CAEN_DGTZ_WriteRegister(m_boardHandle, 0x8000, data);
if (ret) {
......@@ -201,7 +206,7 @@ void RealCAENPsdDriver::init() {
close();
readInfos();
//readInfos();
writeParam();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment