Using the time-of-day parameter – Measurement Computing Data Acquisition Systems rev.10.4 User Manual

Page 356

Advertising
background image

daq9513SetCtrMode

function). When either the output control is high, the terminal count pulsed, or

the terminal count toggled, then the output will be high while the comparator is true. When the output
control is low and terminal count pulsed, the output will be low while the comparator is true.

Using the Time-Of-Day Parameter

Time-of-Day Configuration

The time-of-day (tod) parameter is used to enable or disable the time-of-day operation. The time-of-day
operation is a special mode which causes counters 1 and 2 to turn over at counts that generate 24-hour time-of-day
accumulations. A 10 Hz clock source is needed to drive the time-of-day clock. Therefore, if a 100 Hz, 60 Hz or 50
Hz signal is applied to the input of counter 1 (P3 pin 36), the appropriate divide-by mode (DtodDivideBy10,
DtodDivideBy6

and DtodDivideBy5, respectively) must be activated. So, if a 60 Hz signal is being used, the

tod

parameter must be set to divide by 6 (DtodDivideBy6). The resolution of the time-of-day operation is 0.1

seconds. The hold registers of counters 1 and 2 will hold the 24-hour time.

The following steps must be performed to use the time-of-day operation:

1. Set the master mode register as described above.

2. For general-purpose time keeping, configure counter 1 using daq9513SetCtrMode with the following

parameters: no gating, count on rising edge, special gating disabled, reload from hold only, count repetitively,
BCD counting and count up. The count source can be any of the available sources. The output control does not
affect time-of-day operation.


3. Set the mode of counter 2 with the same settings as counter 1, except that the count source should be TC toggled

of the previous (N-1) counter. This allows internal concatenation of counter 1 to counter 2.


4. Set the load registers of counter 1 and 2 to zero, using the daq9513SetLoad function.

5. Initialize the current 24-hour time-of-day by setting the load registers of counters 1 and 2, using the format

shown in the figure above (again using daq9513SetLoad).


6. Repeat step 4.

D-16 9513 Counter-Timer

938295

Programmer’s Manual

Advertising