English
Language : 

PIC16LF18854 Datasheet, PDF (245/668 Pages) Microchip Technology – C Compiler Optimized RISC Architecture
PIC16(L)F18856/76
13.3 Bidirectional Pins
PPS selections for peripherals with bidirectional
signals on a single pin must be made so that the PPS
input and PPS output select the same pin. Peripherals
that have bidirectional signals include:
• EUSART (synchronous operation)
• MSSP (I2C)
Note:
The I2C SCLx and SDAx functions can be
remapped through PPS. However, only
the RB1, RB2, RC3 and RC4 pins have
the I2C and SMBus specific input buffers
implemented (which have different
thresholds compared to the normal
ST/TTL input levels of the other general
purpose I/O pins). If the SCLx or SDAx
functions are mapped to some other pin
(other than RB1, RB2, RC3 or RC4), the
general purpose TTL or ST input buffers
(as configured based on INLVL register
setting) will be used instead. In most
applications, it is therefore recommended
only to map the SCLx and SDAx pin
functions to the RB1, RB2, RC3 or RC4
pins.
13.4 PPS Lock
The PPS includes a mode in which all input and output
selections can be locked to prevent inadvertent
changes. PPS selections are locked by setting the
PPSLOCKED bit of the PPSLOCK register. Setting and
clearing this bit requires a special sequence as an extra
precaution against inadvertent changes. Examples of
setting and clearing the PPSLOCKED bit are shown in
Example 13-1.
EXAMPLE 13-1: PPS LOCK/UNLOCK
SEQUENCE
; suspend interrupts
BCF
INTCON,GIE
; BANKSEL PPSLOCK ; set bank
; required sequence, next 5 instructions
MOVLW 0x55
MOVWF PPSLOCK
MOVLW 0xAA
MOVWF PPSLOCK
; Set PPSLOCKED bit to disable writes or
; Clear PPSLOCKED bit to enable writes
BSF
PPSLOCK,PPSLOCKED
; restore interrupts
BSF
INTCON,GIE
13.5 PPS Permanent Lock
The PPS can be permanently locked by setting the
PPS1WAY Configuration bit. When this bit is set, the
PPSLOCKED bit can only be cleared and set one time
after a device Reset. This allows for clearing the
PPSLOCKED bit so that the input and output selections
can be made during initialization. When the
PPSLOCKED bit is set after all selections have been
made, it will remain set and cannot be cleared until after
the next device Reset event.
13.6 Operation During Sleep
PPS input and output selections are unaffected by
Sleep.
13.7 Effects of a Reset
A device Power-On-Reset (POR) clears all PPS input
and output selections to their default values. All other
Resets leave the selections unchanged. Default input
selections are shown in pin allocation Table 13-1 and
Table 13-2.
 2016 Microchip Technology Inc.
Preliminary
DS40001824A-page 245