Datasheet

2009-2011 Microchip Technology Inc. DS41365E-page 235
PIC18(L)F1XK22
19.0 SR LATCH
The module consists of a single SR latch with multiple
Set and Reset inputs as well as selectable latch output.
The SR latch module includes the following features:
Programmable input selection
SR latch output is available internally/externally
Selectable Q and Q output
Firmware Set and Reset
19.1 Latch Operation
The latch is a Set-Reset latch that does not depend on a
clock source. Each of the Set and Reset inputs are
active-high. The latch can be Set or Reset by CxOUT,
INT1 pin, or variable clock. Additionally the SRPS and
the SRPR bits of the SRCON0 register may be used to
Set or Reset the SR latch, respectively. The latch is
reset-dominant, therefore, if both Set and Reset inputs
are high the latch will go to the Reset state. Both the
SRPS and SRPR bits are self resetting which means
that a single write to either of the bits is all that is
necessary to complete a latch Set or Reset operation.
19.2 Latch Output
The SRQEN and SRNQEN bits of the SRCON0 register
control the latch output selection. Both of the SR latch’s
outputs may be directly output to an independent I/O
pin. Control is determined by the state of bits SRQEN
and SRNQEN in registers SRCON0.
The applicable TRIS bit of the corresponding port must
be cleared to enable the port pin output driver.
19.3 Effects of a Reset
Upon any device Reset, the SR latch is not initialized.
The user’s firmware is responsible to initialize the latch
output before enabling it to the output pins.
FIGURE 19-1: SR LATCH SIMPLIFIED BLOCK DIAGRAM
SRPS
S
R
Q
Q
Note 1: If R = 1 and S = 1 simultaneously, Q = 0, Q = 1
2: Pulse generator causes a 2 Q-state pulse width.
3: Output shown for reference only. See I/O port pin block diagram for more detail.
4: Name denotes the source of connection at the comparator output.
Pulse
Gen
(2)
SR
Latch
(1)
SRQ pin
(3)
SRQEN
SRLEN
SRSPE
SRSC2E
INT1
SRSCKE
SRCLK
SYNCC2OUT
(4)
SRSC1E
SYNCC1OUT
(4)
SRPR
Pulse
Gen
(2)
SRRPE
SRRC2E
INT1
SRRCKE
SRCLK
SYNCC2OUT
(4)
SRRC1E
SYNCC1OUT
(4)
SRNQEN
SRLEN
SRNQ pin
(3)