beautypg.com

Rainbow Electronics DS1678 User Manual

Page 9

background image

DS1678

9 of 26

DS1678 EVENT ELAPSED TIME DURATION Figure 2b

ADDRESS

REGISTER

0000

Event 1 Elapsed Time from Last Event Counter LSB

0001

Event 1 Elapsed Time from Last Event Counter MSB

0002

Event 2 Elapsed Time from Last Event Counter LSB

0003

Event 2 Elapsed Time from Last Event Counter MSB

0004

¯

07FB

¯

07FC

Event 1023 Elapsed Time from Last Event Counter LSB

07FD

Event 1023 Elapsed Time from Last Event Counter MSB

07FE

Event 1024 Elapsed Time from Last Event Counter LSB

07FF

Event 1024 Elapsed Time from Last Event Counter MSB

EVENT LOGGING

When the DS1678 event logging function is enabled, the device is said to be on an “event log mission”
until the event logging is stopped.

An event can be triggered one of three ways depending on the settings of the TRx bits in the control
register. With TR0 bit set to a 1 and TR1 bit set to a 0, the

INT

signal will be activated on the falling

edge of the input signal. With the TR0 bit set to a 0 and the TR1 bit set to a 1, the

INT

pin will be

activated on the rising edge of the input signal. With both TR0 and TR1 bits set to 1, the

INT

pin will be

activated on both the falling and rising edges to allow for the measurement of on/off type events and their
duration’s. If TR0 and TR1 are both set to 0, nothing will happen when the

INT

pin is toggled and a

mission will not start. This is an illegal state and the mission will not start without a valid value in the
TRx bits prior to attempting to start the mission.

During an event log mission, every time the

INT

pin is activated, the elapsed time from the last event is

written to the event log memory pages. These memory pages are accessible through the data port in the
main memory. To access data via the data port, the LSB of the address location in the event log memory
is written into 41h, the main memory address pointer will automatically increment to 42h where the
event log memory address MSB data will be written. The data from the event log memory location
corresponding to the address written into main memory locations 41h and 42h will be available in
location 43h to be read. The event log data is located at addresses 0000h to 07FFh in the event log
memory. The LSB of the first event duration is written to address location 0000h. The MSB of the first
event duration is written to address location 0001h. The LSB of the second event is written to address
location 0002h. The MSB of the second event duration is written to address location 0003h (see figure
2b for more details). Likewise, the address is incremented with each additional event duration. A total of
2048 registers have been reserved for event log data, which will allow 1024 events to be logged.

A event log mission can be initiated via two different methods (See Figure 7); by a host writing a 1 to the
MIP bit of the status register over the serial interface which automatically sets the mission enable bit in
the control register to a 1 or by activating the

INT

input when the mission enable bit in the control

register is set to a one. The elapsed time between events recorded during an event log mission is equal to
the value written to the event logger memory multiplied by one second, minute, or hour depending on
which one of the three is selected in the DISx bits of the control register. Writing a 0 to the MIP bit in the
Status register completes the mission and automatically writes a 0 to the ME bit in the control register