beautypg.com

Rainbow Electronics DS2182A User Manual

Page 6

background image

DS2182A

041995 6/22

SERIAL PORT READ/WRITE Figure 3

CS

SCLK

SDI
SDO

R/W

A0

A1

A2

A3

0

0

BM

D0

D1

D2

D3

D4

D5

D6

D7

ADDRESS/COMMAND

DATA INPUT/OUTPUT

NOTES:

1. SDI is sampled on rising edge of SCLK.

2. SDO is updated on falling edge of SCLK.

OPERATION OF THE COUNTERS

All four of the counters in the DS2182A can be preset by
the user to establish an event count interrupt threshold.
The counters count up from the preset value until they
reach saturation. At saturation, each additional event
occurrence sets the appropriate bit in RSR2 and gener-
ates an interrupt if enabled by RIMR2.

The DS2182A contains an auto counter reset feature in
the burst read mode. If RCR1.4 is set, then the user can
burst read the four counters (five registers), and all four
counters will be automatically reset to 0 after the read
takes place. Since the burst mode can be terminated at
any time by taking CS high, the user has the option of

reading all of the registers or only the counters. If
RCR1.4 is set, then any read of the registers, burst
mode or not, will clear the count in all four counters. If the
user wishes to read the port and not clear the counters,
then RCR1.4 must be cleared first.

The counter registers can be read or written to at any
time with the serial port, which operates totally asynch-
ronously with the monitoring of the T1 line. Reading a
register will not affect the count as long as RCR1.4 is
cleared. The dual buffer architecture of the DS2182A in-
sures that no error events will be missed while the serial
port is being accessed for reads.

BVCR1: BIPOLAR VIOLATION COUNT REGISTER 1;
BVCR2: BIPOLAR VIOLATION COUNT REGISTER 2
Figure 4

(MSB)

(LSB)

BV7

BV6

BV5

BV4

BV3

BV2

BV1

BV0

SYMBOL

POSITION

NAME AND DESCRIPTION

BV7

BVCR.7

MSB of bipolar violation count

BV0

BVCR.0

LSB of bipolar violation count

Bipolar Violation Count Register 1 (BVCR1) is the most
significant word and BVCR2 is the least significant word
of a presettable 16-bit counter that records individual bi-
polar violations. If the B8ZS mode is enabled (RCR2.2 =
1), then B8ZS code words are not counted. The BVCR
can also be programmed to count excessive zeros by
setting the RCR2.5 bit. In this mode, the BVCR will

count occurrences of 8 consecutive zeros when B8ZS is
enabled or 16 consecutive zeros when B8Z5 is dis-
abled. This counter increments at all times and is not
disabled by a loss of sync condition (RLOS = 1). The
counter saturates at 65,535 and generates an interrupt
for each occurrence after saturation if RIMR2.0 is set.

NOTE:

1. In order to properly preset the Bipolar Violation Count Register, BVCR2 must be written to before BVCR1 is

written to.