118
M3i.48xx / M3i.48xx-exp Manual
Reading out ABA data
ABA mode (dual timebase)
Example for setting ABA mode:
The following example will program the standard ABA mode, will set the fast sampling rate to 100 MHz and acquire 2k segments with 1k
pretrigger and 1k posttrigger on every rising edge of the trigger input. Meanwhile the inputs are sampled continuously with the ABA mode
with a ABA divider set to 5000 resulting in a slow sampling clock for the A area of 100 MHz / 5000 = 20 kHz:
Reading out ABA data
General
The slow „A“ data is stored in an extra FIFO that is located in hardware on the card. This extra FIFO can read out slow „A“ data using DMA
transfer similar to the DMA transfer of the main sample data DMA transfer. The card has two completely independent busmaster DMA engines
in hardware allowing the simultaneous transfer of both „A“ and sample data. The sample data itself is read out as explained before using
the standard DMA routine.
As seen in the picture the extra FIFO is holding ABA and timestamp data as the same time. Nevertheless it is not necessary to care for the
shared FIFO as the extra FIFO data is splitted inside the driver in the both data parts.
The only part that is similar for both kinds of data transfer is the handling of the DMA engine. This is similar to the main sample data transfer
engine. Therefore additional information can be found in the chapter explaining the main data transfer.
Commands and Status information for extra transfer buffers.
As explained above the data transfer is performed with the same command and status registers like the card control and sample data transfer.
It is possible to send commands for card control, data transfer and extra FIFO data transfer at the same time
// setting the fast sampling clock as internal 100 MHz
spcm_dwSetParam_i32 (hDrv, SPC_CLOCKMODE, SPC_CM_INTPLL);
spcm_dwSetParam_i64 (hDrv, SPC_SAMPLERATE, 100000000);
// enable the ABA mode and set the ABA divider to 5000 -> 100 MHz / 5000 = 20 kHz
spcm_dwSetParam_i32 (hDrv, SPC_CARDMODE, SPC_REC_STD_ABA);
spcm_dwSetParam_i32 (hDrv, SPC_ABADIVIDER, 5000);
// define the segmentsize, pre and posttrigger and the total amount of data to acquire
spcm_dwSetParam_i32 (hDrv, SPC_MEMSIZE, 16384);
spcm_dwSetParam_i32 (hDrv, SPC_SEGMENTSIZE, 2048);
spcm_dwSetParam_i32 (hDrv, SPC_POSTTRIGGER, 1024);
// set the trigger mode to external with positive edge
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_ORMASK, SPC_TMASK_EXT0);
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_EXT0_MODE, SPC_TM_POS);
Register
Value
Direction
Description
SPC_M2CMD
100
write only
Executes a command for the card or data transfer
M2CMD_EXTRA_STARTDMA
100000h
Starts the DMA transfer for an already defined buffer.
M2CMD_EXTRA_WAITDMA
200000h
Waits until the data transfer has ended or until at least the amount of bytes defined by notify size are available. This
wait function also takes the timeout parameter into account.
M2CMD_EXTRA_STOPDMA
400000h
Stops a running DMA transfer. Data is invalid afterwards.
M2CMD_EXTRA_POLL
800000h
Polls data without using DMA. As DMA has some overhead and has been implemented for fast data transfer of large
amounts of data it is in some cases more simple to poll for available data. Please see the detailed examples for this
mode. It is not possible to mix DMA and polling mode.