Author | Sebastien Lelong, Copyright (c) 2011, all rights reserved. |
Adapted-by | |
Compiler | >=2.4o |
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.
No dependency found
const byte RP18 = 18
const byte RP15 = 15
const byte RP12 = 12
const byte RP19 = 19
const byte RP10 = 10
const byte RP6 = 6
const byte RP8 = 8
const byte RP2 = 2
const byte RP5 = 5
const byte RP24 = 24
const byte RP1 = 1
const byte RP20 = 20
const byte RP11 = 11
const byte RP22 = 22
const byte RP0 = 0
const byte RP21 = 21
const byte RP16 = 16
const byte RP14 = 14
const byte RP4 = 4
const byte RP7 = 7
const byte RP3 = 3
const byte RP23 = 23
const byte RP13 = 13
const byte RP9 = 9
var bit _pps_gie_state = INTCON_GIE
const byte RP17 = 17
const byte RP18 = 18
No documentation found
const byte RP15 = 15
No documentation found
const byte RP12 = 12
No documentation found
const byte RP19 = 19
No documentation found
const byte RP10 = 10
No documentation found
const byte RP6 = 6
No documentation found
const byte RP8 = 8
No documentation found
const byte RP2 = 2
No documentation found
const byte RP5 = 5
No documentation found
const byte RP24 = 24
No documentation found
const byte RP1 = 1
No documentation found
const byte RP20 = 20
No documentation found
const byte RP11 = 11
No documentation found
const byte RP22 = 22
No documentation found
const byte RP0 = 0
No documentation found
const byte RP21 = 21
No documentation found
const byte RP16 = 16
No documentation found
const byte RP14 = 14
No documentation found
const byte RP4 = 4
No documentation found
const byte RP7 = 7
No documentation found
const byte RP3 = 3
No documentation found
const byte RP23 = 23
No documentation found
const byte RP13 = 13
No documentation found
const byte RP9 = 9
No documentation found
var bit _pps_gie_state = INTCON_GIE
No documentation found
const byte RP17 = 17
No documentation found
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
18f27j53 | 18f27j53_pps_rx2tx2.jal |