r8 - 15 Sep 2011 - 09:17:05 - TimoKorhonenYou are here: TWiki >  Main Web > AllCategories > EpicsDriverCategory > SIS3302Digitizer

SIS3302 Digitizer

Purpose of the driver

Provides waveform configuration and readout for a 100 MHz 16-bit VME Digitizer board.

Supported hardware

SIS3302 VME Board.

Driver maps 128 MB in A32 memory space.

Configuration

Startup script

   require "SIS3302"
   
   SIS3302Config(cardNr, baseAddress, intVect, intLevel)
   
   cardNr        unique number
   baseAddress   VME base address in A32 space
   intVector     interrupt vector
   intLevel      interrupt level

Examples

   SIS3302Config( 1,0x30000000 , 107, 3)      - card 1, base address 0x30000000, interrupt vector 107, interrupt level 3
   SIS3302Config( 2,0x40000000 , 107, 3)      - card 2, base address 0x40000000, interrupt vector 108, interrupt level 3

Note: waveform readout will not work if interrupts are not configured!

Record configuration

DTYP

field (DTYP, "SIS3302")

Format of INP / OUT link

For configuration and read/write PVs:

field (INP, "#C$(CARD)S$(CHAN)@$(Parameter)")
field (OUT, "#C$(CARD)S$(CHAN)@$(Parameter)")

For waveform PVs:

field (INP, "#C$(CARD)S$(CHAN)@")

CARD is cardNr from SIS3302Config.
CHAN is ADC channel number, 1..8.

Parameter

Parameter is either generic REG[byteOffset] or one of 'nice' names:

niceName acceptedPutValues
ACTUAL_VALUE no put (read only)
LOST_INT no put (read only)
ARM any, value is don't care
DISARM any, value is don't care
START any, value is don't care
STOP any, value is don't care
AUTOSTART_EN any, value is don't care
AUTOSTART_DIS any, value is don't care
MULTI_EN any, value is don't care
MULTI_DIS any, value is don't care
NSAMPLES_STOP_EN any, value is don't care
NSAMPLES_STOP_DIS any, value is don't care
TEST_DATA_EN any, value is don't care
TEST_DATA_DIS any, value is don't care
CLOCK 0=100MHz, 1=50MHz, 2=25MHz, 3=10MHz, 4=1MHz, 5=random extern, 6=extern LEMO
NEVENTS 1..1048575, if bigger, the driver will use 1048575 and restart when expires
NSAMPLES 4..16777215 (but only multiples of 4)
AVERAGE 1,2,4,8,16,32,64,128
DAC_OFFET 0..65535

Supported record types

record Parameter
ai REG[byteOffset], ACTUAL_VALUE
ao REG[byteOffset], DAC_OFFSET
longin REG[byteOffset], ACTUAL_VALUE, LOST_INT
longout REG[byteOffset], niceName
waveform  

With generic REG[byteOffset] any board register can be read or written.
For read, not-readable register will report an error.
For write, not-writable registers will not report an error, because VxWork's devWriteProbe() is not implemented properly.
It seems to me, that after writting (some) not-writable register, the whole board behaves strangly afterwards.
Well, one should not write not-writable registers anyhow.
Writing registers which would influence interrupt handling is rejected by driver.
Although read and write of any register is possible, one should use it cautiously.

For REG[byteOffset] the CHAN must be 0.
For niceName=ACTUAL_VALUE, the signal number, 1..8, is the ADC channel number.
For niceName=DAC_OFFSET, the signal number, 1..8, is the DAC channel number.

For waveform records the signal number is ADC channel number, 1..8.
There can be only one waveform for each channel.
Waveform's NELM is limited to 4 * 1024 * 1024 (because of internal page oriented memory access).
Driver will allways read NELM datapoints, regardless how many datapoints have actualy bean measured.
The driver will use DMA transfer for waveforms bigger or equal 400 data-points.

User should take care not to configure too fast measurements. I assume that CPU can handle up to 100 measurements per second. With less than 100 you would be on a safer side. CPU must also have enough time to read the data out.
I have measured cca 20 MB/s for DMA (D32) mode on MVME51xx, but it is slightly less for small buffers. But it seems that even the smallest DMA transfer needs cca 320 microseconds.
You can monitor your channel, declared as niceName=LOST_INT, to see if there are any skipped (ignored) interrupts. If it stays at zero, there are no problems, otherwise you have to reduce the board's data acquisition rate (to reduce number of interrupts), or decrease number of waveforms, or size of waveforms.

niceName registers

niceName byteOffset registerNAme user access with REG[byteOffset]
  0x8 SIS3302_IRQ_CONFIG rejected by driver
  0xC SIS3302_IRQ_CONTROL rejected by driver
  0x400 SIS3302_KEY_RESET rejected by driver
       
ARM 0x410 SIS3302_KEY_ARM not recomended
DISARM 0x414 SIS3302_KEY_DISARM not recomended
START 0x418 SIS3302_KEY_START not recomended
STOP 0x41C SIS3302_KEY_STOP not recomended
AUTOSTART_EN 0x10 SIS3302_ACQUISTION_CONTROL strongly not recomended
AUTOSTART_DIS 0x10 SIS3302_ACQUISTION_CONTROL strongly not recomended
MULTI_EN 0x10 SIS3302_ACQUISTION_CONTROL strongly not recomended
MULTI_DIS 0x10 SIS3302_ACQUISTION_CONTROL strongly not recomended
NSAMPLES_STOP_EN 0x01000000 SIS3302_EVENT_CONFIG_ALL_ADC strongly not recomended
NSAMPLES_STOP_DIS 0x01000000 SIS3302_EVENT_CONFIG_ALL_ADC strongly not recomended
TEST_DATA_EN 0x0100000C SIS3302_ADC_INPUT_MODE_ALL_ADC not recomended
TEST_DATA_DIS 0x0100000C SIS3302_ADC_INPUT_MODE_ALL_ADC not recomended
CLOCK 0x10 SIS3302_ACQUISTION_CONTROL strongly not recomended
NEVENTS 0x20 SIS3302_MAX_NOF_EVENT not recomended
NSAMPLES 0x01000004 SIS3302_SAMPLE_LENGTH_ALL_ADC not recomended
AVERAGE 0x01000000 SIS3302_EVENT_CONFIG_ALL_ADC strongly not recomended
DAC_OFFSET 0x54 SIS3302_DAC_DATA not recomended
       
  0x34 SIS3302_ADC_MEMORY_PAGE_REGISTER strongly not recomended
  0x50 SIS3302_DAC_CONTROL_STATUS not recomended

Note: 'strongly not recomended' should later be implemented in driver as 'rejected by driver' !

Note: some other registers should also not be written by user (like event configuration registers for each ADC group).

Examples

Atatched is my test template SIS3302.template. Delete whatever is not needed, and addapt the rest to your needs.

Example 1

Single shot mode.
Sample 128 * 1024 samples at 1 MHz internal clock, do some averaging (128 is max), and stop. Read out 1024 sampled data-points.
# optionaly, this are power-on or reboot defaults
caput SIS3302:STOP 1 ; \
caput SIS3302:DISARM 1 ; \
caput SIS3302:NSAMPLES_STOP_DIS 1 ; \
caput SIS3302:AUTO_DIS 1 ; \
caput SIS3302:MULTI_DIS 1

# configure measurement: 1 MHz internal clock, no multi-event,
#   N=1024 samples, stop after N samples, average 128 samples (128 * 1024 are sampled)
caput SIS3302:CLOCK 4 ; \
caput SIS3302:NEVENTS 0 ; \
caput SIS3302:NSAMPLES 1024 ; \
caput SIS3302:NSAMPLES_STOP_EN 1 ; \
caput SIS3302:AVERAGE 128

# for every new measurement you need just this
caput SIS3302:ARM 1 ; \
caput SIS3302:START 1

# and then read the measured data
caget SIS3302:WF:1

Example 2

Do measurements in multi-event mode.
Repeate 314 times (hardware handles it): take 2000000 samples at 1 MHZ internal clock, do not average

# optionaly, this are power-on or reboot defaults
caput SIS3302:STOP 1 ; \
caput SIS3302:DISARM 1 ; \
caput SIS3302:NSAMPLES_STOP_DIS 1 ; \
caput SIS3302:AUTO_DIS 1 ; \
caput SIS3302:MULTI_DIS 1

# enable test ADC data mode

# configure measurement: 1 MHz clock, multi-event,
#   2000000 samples, stop on n samples, average 128 samples
#   for NEVENTS > 1048575 driver will use 1048575 and do itself software-re-trigger (small delay between waveforms)
caput SIS3302:MULTI_EN 1
caput SIS3302:CLOCK 4 ; \
caput SIS3302:NEVENTS 314 ; \
caput SIS3302:NSAMPLES 2000000 ; \
caput SIS3302:NSAMPLES_STOP_EN 1 ; \
caput SIS3302:AUTO_EN 1 ; \
caput SIS3302:AVERAGE 1

# optionaly, enable test ADC data mode (instead of real data)
caput SIS3302:TEST_DATA_EN 1000

# for every new measurement you need just this (when all 314 events done)
caput SIS3302:ARM 1 ; caput SIS3302:START 1

# readout the data (or use camonitor in another window to get all 314 measurements)
caget SIS3302:WF:1

Example 3

Do measurements in multi-event mode.
Repeate forever (hardware handles it 1048575 times, then driver re-starts): take 1000000 samples at 1 MHZ internal clock, average 128 samples (total sampled = 2000000 * 128 on each event)

# optionaly, this are power-on or reboot defaults
caput SIS3302:STOP 1 ; \
caput SIS3302:DISARM 1 ; \
caput SIS3302:NSAMPLES_STOP_DIS 1 ; \
caput SIS3302:AUTO_DIS 1 ; \
caput SIS3302:MULTI_DIS 1

# enable test ADC data mode

# configure measurement: 1 MHz clock, multi-event,
#   1000000 samples, stop on n samples, average 128 samples
#   for NEVENTS > 1048575 driver will use 1048575 and do itself software-re-trigger (small delay between waveforms)
caput SIS3302:MULTI_EN 1
caput SIS3302:CLOCK 4 ; \
caput SIS3302:NEVENTS 9999999 ; \
caput SIS3302:NSAMPLES 1000000 ; \
caput SIS3302:NSAMPLES_STOP_EN 1 ; \
caput SIS3302:AUTO_EN 1 ; \
caput SIS3302:AVERAGE 128

# optionaly, enable test ADC data mode (instead of real data)
caput SIS3302:TEST_DATA_EN 1000

# for every new measurement you need just this (when all 314 events done)
caput SIS3302:ARM 1 ; caput SIS3302:START 1

# readout the data (or use camonitor in another window to get all measurements, forever)
caget SIS3302:WF:1

Old known problems

Waveform returns each two successive data-points swapped.
TimoKorhonen will request from manufacturer to provide new firmware.
This problem is now solwed (06.01.2009), if appropriate firmware revision is used (0x010D or above)

Known problems

No known problems at the time.


Keywords:

See also:

ProjectForm
Category EpicsDriverCategory
Goal Driver for SIS3302 100Mhz 16-bit VME Digitizer
Originator DamirAnicic
Responsible DamirAnicic
Crew

Clients GaudenzJud
Status Supported
Work

Start

End

Budget

Problems

Documentation SIS3302 Manual
CVS Location CVS:G/DRV/SIS3302
Comments

Topic attachments
I Attachment Action Size Date Who Comment
elsetemplate SIS3302.template manage 16.7 K 10 Mar 2009 - 10:21 DamirAnicic My test template
Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r8 < r7 < r6 < r5 < r4 | More topic actions
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback