Refclock mode (optional), Timestamp status, Reading out timestamp data – Spectrum Brands MC.31XX User Manual

Page 84: Functions for accessing the data, Timestamp status reading out timestamp data

Advertising
background image

84

MC.31xx Manual

Timestamp Status

Option Timestamp

RefClock mode (optional)

The counter is split in a HIGH and a LOW part and an additional seconds signal, that affects both parts of the counter (TTL pulse with f = 1
Hz) must be fed in externally.

The HIGH part counts the seconds that have elapsed since the last counter reset with the reset command TS_RESET. The LOW part is reset to
zero on every seconds signal and is clocked with the actual sample rate. The edge of the external secondssignal must be set seperately as
described below.

This mode allows the recording of an absolute time of a trigger event. This even allows the synchronization of data that has been recorded
with different boards.

The edge of the external TTL seconds signal can be programmed by the following register either to detect the rising or falling edge.

To get recordings in relation to each other it is importent to know the absolute start time. This time can be easily read out by the following
register. The time is given back in seconds since midnight (00:00:00), January 1, 1970, which is the standard ’time_t’ in C/C++.

Timestamp Status

The timestamp module has its own status register for the timestamp FIFO. You can easily read out the FIFO status with the help of the timestamp
status register shown in the table below.

Reading out timestamp data

Functions for accessing the data

There are two possibilities to access the timestamps that have been stored in the timestamp FIFO.

Reading out a single timestamp
You can read out one 32 bit value from the timestamp FIFO by using the register shown in the table below.

Because accessing the timestamp with this function will be done with single accesses, getting the value(s) this
way is much slower than using the SpcGetData function as described below.

TS_MODE_STARTRESET

11

Must be written to enable the StartReset timestamp mode. The counter is reset on each start of the board. The times-
tamps values are relative to the board start.

Register

Value

Direction

Description

SPC_TIMESTAMP_CMD

47000

w

Writes a command to the timestamp command register.

SPC_TIMESTAMP_CMD

47000

r

Reads out the actual timestamp mode.

TS_RESET

0

Resets the whole counter of the timestamp module to zero. Waits for synchronization to an external seconds signal.
This may last up to 1 second. The lower part of the counter can be reset with the external fed in second signal. The
edge of the reset signal can be programmed with the SPC_TIMESTAMP_RESETMODE register as shown in the table
below.

TS_MODE_DISABLE

10

Disables the timestamp module. No timestamps are recorded.

TS_MODE_REFCLOCK

13

Must be written to enable the RefClock timestamp mode. The counter must be manually reset by writing the command
TS_RESET to the command register. The counter is splitted into two parts. The upper part counts the seconds of an
external reference clock. The lower part is reset on each second signal and counts the samples.

Register

Value

Direction

Description

SPC_TIMESTAMP_RESETMODE

47050

r/w

Defines the active edge of the external fed in seconds signal to reset the lower part of the counter. The
values written here do not affect the timestamp command TS_RESET.

TS_RESET_POS

10

The lower part of the counter will be reset on every rising edge of the external reset signal (seconds signal).

TS_RESET_NEG

20

The lower part of the counter will be reset on every falling edge of the external reset signal (seconds signal).

Register

Value

Direction

Description

SPC_TIMESTAMP_STARTTIME

47030

r

Reads out the start time of the RefClock mode. Return value is the number of seconds since midnight
(00:00:00), January 1, 1970, which is the standard ’time_t’ in C/C++.

Register

Value

Direction

Description

SPC_TIMESTAMP_STATUS

47010

r

Reads the status of the timestamp FIFO.

TS_FIFO_EMPTY

0

The timestamp FIFO is still empty.

TS_FIFO_LESSHALF

1

There are values in the timestamp FIFO but less than half of the FIFO is filled.

TS_FIFO_MOREHALF

2

More than half of the FIFO is filled with timestamps.

TS_FIFO_OVERFLOW

3

The timestamp FIFO is full and possibly data has been lost.

Register

Value

Direction

Description

SPC_TIMESTAMP_FIFO

47040

r

Get one 32 bit value from the timestamp FIFO. If the FIFO is empty a zero will be returned.

Advertising