pps

Peripheral Pin Select (PPS) library

Author Sebastien Lelong, Copyright (c) 2011, all rights reserved.
Adapted-by
Compiler >=2.4o

Description

This library provides several utility functions to deal with
Peripheral Pin Select (PPS) module. PPS is a special feature implemented on
recent PIC (currently 18FXXJ11, 18FXXJ13, 18FXXJ50, 18FXXJ53). PPS allows
to dynamically assign function to pins known as "remappable pins". These pins are
easily identified as they're name "RPn".
.
Assigning function to pins is done differently wheter function is an input
or output. When function is an input (eg. serial RX), PPS is used by
specifying, for this function, what is the RP pins to be used. On the other
side, when function is an output (eg. serial TX), PPS is used by
specifying, for this RP pin, what is the function it should
carry. As a consequence, several RP pins can carry the same output function.
.
In order to configure RP pins, PPS module must be unlocked using pps_begin(),
pins should be remapped calling corresponding procedure and setting
appropriate function ID number, then locked again using pps_commit().
This is a security guard used to prevent any unintentional changes.
When PPS uses 1-way locking (default behavior), pins can be remapped only
once (when PPS is becoming locked again, any further changes are ignored).
When PPS don't use 1-way locking, several unlock/lock sequences can occur
at runtime. If this behavior is wanted, the following fuse setting should be
used:
         pragma target IOL1WAY disabled
.
Please refer to datasheet in order to have a better overview of PPS.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

  • pps_control_lock(bit in state)

    Lock/unlock PPS module, allowing pins to be remapped. If 1-way locking is used
    this procedure must only be called once. Once remappable pins are configured
    PPS must be locked again to apply changes
    Note: interrupts are temporarily disabled. When pps_lock(true) is called
    interrupts are restored back to previous state
    

Functions


Related samples

Here are the list of samples which use this library:

18f27j5318f27j53_pps_rx2tx2.jal