English
Language : 

PIC18F44J50-I Datasheet, PDF (153/562 Pages) Microchip Technology – 28/44-Pin, Low-Power, High-Performance USB Microcontrollers
PIC18F46J50 FAMILY
10.7.3.3 Mapping Limitations
The control schema of the PPS is extremely flexible.
Other than systematic blocks that prevent signal con-
tention caused by two physical pins being configured
as the same functional input, or two functional outputs
configured as the same pin, there are no hardware
enforced lock outs. The flexibility extends to the point of
allowing a single input to drive multiple peripherals or a
single functional output to drive multiple output pins.
10.7.4
CONTROLLING CONFIGURATION
CHANGES
Because peripheral remapping can be changed during
run time, some restrictions on peripheral remapping
are needed to prevent accidental configuration
changes. PIC18F devices include three features to
prevent alterations to the peripheral map:
• Control register lock sequence
• Continuous state monitoring
• Configuration bit remapping lock
10.7.4.1 Control Register Lock
Under normal operation, writes to the RPINRx and
RPORx registers are not allowed. Attempted writes will
appear to execute normally, but the contents of the
registers will remain unchanged. To change these reg-
isters, they must be unlocked in hardware. The register
lock is controlled by the IOLOCK bit (PPSCON<0>).
Setting IOLOCK prevents writes to the control
registers; clearing IOLOCK allows writes.
To set or clear IOLOCK, a specific command sequence
must be executed:
1. Write 55h to EECON2<7:0>.
2. Write AAh to EECON2<7:0>.
3. Clear (or set) IOLOCK as a single operation.
IOLOCK remains in one state until changed. This
allows all of the PPS registers to be configured with a
single unlock sequence, followed by an update to all
control registers, then locked with a second lock
sequence.
10.7.4.2 Continuous State Monitoring
In addition to being protected from direct writes, the
contents of the RPINRx and RPORx registers are
constantly monitored in hardware by shadow registers.
If an unexpected change in any of the registers occurs
(such as cell disturbances caused by ESD or other
external events), a Configuration Mismatch Reset will
be triggered.
10.7.4.3 Configuration Bit Pin Select Lock
As an additional level of safety, the device can be
configured to prevent more than one write session to
the RPINRx and RPORx registers. The IOL1WAY
(CONFIG3H<0>) Configuration bit blocks the IOLOCK
bit from being cleared after it has been set once. If
IOLOCK remains set, the register unlock procedure will
not execute and the PPS Control registers cannot be
written to. The only way to clear the bit and re-enable
peripheral remapping is to perform a device Reset.
In the default (unprogrammed) state, IOL1WAY is set,
restricting users to one write session. Programming
IOL1WAY allows users unlimited access (with the
proper use of the unlock sequence) to the PPS
registers.
10.7.5
CONSIDERATIONS FOR
PERIPHERAL PIN SELECTION
The ability to control Peripheral Pin Selection intro-
duces several considerations into application design
that could be overlooked. This is particularly true for
several common peripherals that are available only as
remappable peripherals.
The main consideration is that the PPS is not available
on default pins in the device’s default (Reset) state.
Since all RPINRx registers reset to ‘11111’ and all
RPORx registers reset to ‘00000’, all PPS inputs are
tied to RP31 and all PPS outputs are disconnected.
Note:
In tying PPS inputs to RP31, RP31 does
not have to exist on a device for the
registers to be reset to it.
This situation requires the user to initialize the device
with the proper peripheral configuration before any
other application code is executed. Since the IOLOCK
bit resets in the unlocked state, it is not necessary to
execute the unlock sequence after the device has
come out of Reset.
For application safety, however, it is best to set
IOLOCK and lock the configuration after writing to the
control registers.
The unlock sequence is timing-critical. Therefore, it is
recommended that the unlock sequence be executed
as an assembly language routine with interrupts
temporarily disabled. If the bulk of the application is
written in ‘C’ or another high-level language, the unlock
sequence should be performed by writing in-line
assembly.
 2011 Microchip Technology Inc.
DS39931D-page 153