-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add featuring masks/enable #124
* Merge pull request #124 from agaget/add-feat-masks * This PR adds mask (and enable) functionalities for the sequencer. * It adds the possibility of the software mask/enable (register SQSWMASK and SQSWENA) and mask attached to physical input. * It works with an MTCA EVM300 and MTCA EVR300U.
- Loading branch information
Showing
11 changed files
with
583 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
TOP = ../.. | ||
include $(TOP)/configure/CONFIG | ||
ARCH = linux-x86_64 | ||
TARGETS = envPaths | ||
include $(TOP)/configure/RULES.ioc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
#!../../bin/linux-x86_64/mrf | ||
|
||
< envPaths | ||
|
||
## Register all support components | ||
dbLoadDatabase("../../dbd/mrf.dbd") | ||
mrf_registerRecordDeviceDriver(pdbbase) | ||
|
||
epicsEnvSet("IOCSH_PS1","EVM SeqMask> ") | ||
epicsEnvSet("P","Ether-Realm:EVM") | ||
epicsEnvSet("ENGINEER","agaget") | ||
epicsEnvSet("LOCATION","Etheric Realm") | ||
|
||
epicsEnvSet("EPICS_CA_MAX_ARRAY_BYTES","10000000") | ||
|
||
epicsEnvSet("EVM_PCI","0000:0e:00.0") | ||
epicsEnvSet("PORT","EVM-MTCA") | ||
epicsEnvSet(FREQ, "88") | ||
|
||
mrmEvgSetupPCI("$(PORT)", "$(EVM_PCI)") | ||
|
||
## Load record instances | ||
cd $(TOP) | ||
dbLoadRecords("db/evm-mtca-300.uv.db","P=$(P):,s=,EVG=$(PORT),FRF=$(FREQ),FEVT=$(FREQ)") | ||
dbLoadRecords("db/evm-mtca-300-evr.uv.db","P=$(P)U:,EVG=$(PORT),T=U,FRF=$(FREQ),FEVT=$(FREQ)") | ||
dbLoadRecords("db/evm-mtca-300-evr.uv.db","P=$(P)D:,EVG=$(PORT),T=D,FRF=$(FREQ),FEVT=$(FREQ)") | ||
|
||
iocInit() | ||
|
||
##### Configure the EVM | ||
dbpf $(P):Mxc0Frequency-SP 1 | ||
dbpf $(P):Mxc0Prescaler-SP 88000000 | ||
## Configure the sequencer | ||
dbpf $(P):SoftSeq0TrigSrc0-Sel "Mxc0" | ||
dbpf $(P):SoftSeq0TsResolution-Sel "uSec" | ||
dbpf $(P):SoftSeq0RunMode-Sel "Normal" | ||
|
||
dbpf $(P):SoftSeq0Timestamp-SP "[100, 200]" | ||
#Can't dbpf waveform of UCHAR so we use this. Change architecture if needed. | ||
#Event 11 is just used for example | ||
system("$(EPICS_BASE)/bin/linux-x86_64/caput -a $(P):SoftSeq0EvtCode-SP 2 1 11") | ||
system("$(EPICS_BASE)/bin/linux-x86_64/caput -a $(P):SoftSeq0EvtMask-SP 2 1 0") | ||
# Due to this 'enable' settings, event 11 will not b triggered by default | ||
system("$(EPICS_BASE)/bin/linux-x86_64/caput -a $(P):SoftSeq0EvtEna-SP 2 0 3") | ||
|
||
# To fully understand mask and enable I suggest you to play with software mask an enable an watch counter of the EVR: | ||
# $(P):SoftSeq0SwMask-Sel | ||
# $(P):SoftSeq0SwEna-Sel | ||
# If you put soft mask to 1 or 3 or 5 etc... it will mask event 1 of the sequence | ||
# because mask of the sequencer is 1, and it's (binary) included in the software mask number | ||
# For enable, soft ena to 3 or 7 or 11.. will enable event 11 of the sequencer | ||
# because ena of the sequencer is 3 and it's (binary) included in the software ena number | ||
|
||
## Configure the EVRU | ||
dbpf $(P)U:DlyGen0EvtSet0-SP 13 | ||
dbpf $(P)U:DlyGen0EvtReset0-SP 14 | ||
dbpf $(P)U:OutFP0SrcPulse-SP "Pulser 0" | ||
# FP0 of the EVRU is the equivalent of Univ8 of the EVM | ||
# So this triggered the Mask 1 when FP0/Univ8 is High. | ||
dbpf $(P):InpUniv8FPMask-Sel "1" | ||
|
||
|
||
epicsThreadSleep(1) | ||
|
||
dbtr $(P):SoftSeq0Commit-Cmd | ||
|
||
epicsThreadSleep(1) | ||
|
||
dbpf $(P):SoftSeq0Load-Cmd 1 | ||
dbpf $(P):SoftSeq0Enable-Cmd 1 | ||
|
||
# dbpf $(P):TrigEvt1TrigSrc0-Sel Mxc0 | ||
# dbpf $(P):TrigEvt0EvtCode-SP 1 | ||
|
||
## Push event 13 just to see that upstream/downstream is working | ||
dbpf $(P):TrigEvt1TrigSrc1-Sel Univ8 | ||
dbpf $(P):TrigEvt1EvtCode-SP 13 | ||
|
||
## | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#!../../bin/linux-x86_64/mrf | ||
|
||
< envPaths | ||
|
||
## Register all support components | ||
dbLoadDatabase("../../dbd/mrf.dbd") | ||
mrf_registerRecordDeviceDriver(pdbbase) | ||
|
||
epicsEnvSet("IOCSH_PS1","EVR SeqMask> ") | ||
epicsEnvSet("P","Ether-Realm:EVR") | ||
epicsEnvSet("ENGINEER","agaget") | ||
epicsEnvSet("LOCATION","Etheric Realm") | ||
|
||
epicsEnvSet("EPICS_CA_MAX_ARRAY_BYTES","10000000") | ||
|
||
epicsEnvSet("EVR_PCI","0000:0c:00.0") | ||
|
||
|
||
mrmEvrSetupPCI("EVR-MTCA", "$(EVR_PCI)") | ||
|
||
cd $(TOP) | ||
## Load record instances | ||
dbLoadRecords("db/evr-mtca-300u.uv.db","P=$(P):,EVR=EVR-MTCA,PNDELAY=PNDELAY,PNWIDTH=PNWIDTH,FRF=88,FEVT=88") | ||
|
||
|
||
iocInit() | ||
|
||
## we use Backplane of the MTCA card here to upstream event through input, like that no need for any other phyical installation. | ||
## Events 2 and 3 will be use to mask and unmask the event 1 in the sequencer. You can send them softwarely through the EVM. | ||
## Indeed You can remove that part and use analogic signal in other inputs if you prefer. | ||
### When we receive event 2 Pulser 1-> backplane 1 is triggered | ||
dbpf $(P):DlyGen1Width-SP 100 | ||
dbpf $(P):DlyGen1Width-RB | ||
dbpf $(P):DlyGen1EvtTrig0-SP 2 | ||
dbpf $(P):OutBack1SrcPulse-SP "Pulser 1" | ||
|
||
#When we receive event 3 Pulser 2-> backplane 2 is triggered | ||
dbpf $(P):DlyGen2Width-SP 100 | ||
dbpf $(P):DlyGen2Width-RB | ||
dbpf $(P):DlyGen2EvtTrig0-SP 3 | ||
dbpf $(P):OutBack2SrcPulse-SP "Pulser 2" | ||
|
||
###Backplane channel 1 use for masking | ||
dbpf $(P):BPIn1TrigBack-Sel "Edge" | ||
dbpf $(P):BPIn1CodeBack-SP 13 | ||
|
||
###Backplane channel 2 use for unmasking | ||
dbpf $(P):BPIn2TrigBack-Sel "Edge" | ||
dbpf $(P):BPIn2CodeBack-SP 14 | ||
|
||
## Monitoring events. When your sequencer is running normally, counter A should increment at 1Hz. | ||
## When event 2 is send to this EVR, counterA will stop incrementing, counterB will increment + 1, and counterD will increment +1 | ||
## When event 3 is send to this EVR, counterA will restart incrementing, counterC will increment + 1 | ||
dbpf $(P):EvtA-SP.OUT "@OBJ=EVR-MTCA,Code=1" | ||
dbpf $(P):EvtB-SP.OUT "@OBJ=EVR-MTCA,Code=2" | ||
dbpf $(P):EvtC-SP.OUT "@OBJ=EVR-MTCA,Code=3" | ||
dbpf $(P):EvtD-SP.OUT "@OBJ=EVR-MTCA,Code=13" | ||
dbpf $(P):EvtE-SP.OUT "@OBJ=EVR-MTCA,Code=11" | ||
|
||
## | ||
|
Oops, something went wrong.