Mikroelektronika MIKROE-442 Datenbogen
414
mikoBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
PPS_Mapping
Direction Parameters
Input Functions
Prototype
sub function PPS_Mapping(dim rp_num, input_output, funct_name as byte)
Description Sets desired internal MCU module to be mapped on the requested pins.
Parameters -
Parameters -
rp_num
: Remappable pin number. Consult the appropriate datasheet for adequate values.
-
direction
: Sets requested pin to be used as an input or output. See Direction Parameters for
adequate values.
-
funct_name
: Selects internal MCU module function for usage. See Input Functions or Output
Functions for adequate values.
Returns
-
0
- if non-existing peripheral pin is selected.
-
1
- if desired function is not implemented for the chosen MCU.
-
2
- if any of the other RPOUT registers is configured to output the SCK1OUT function while SCK1CM
is set (only for P24FJ256GA110 Family).
-
255
- if peripheral pin mapping was successful.
Requires
Nothing.
Example
PPS_Mapping(15, _INPUT, _RX2_DT2) ‘ Sets pin 15 to be Input, and maps
RX2/DT2 Input to it
PPS_Mapping(5, _OUTPUT, _TX2_CK2) ‘ Sets pin 5 to be Output, and maps
EUSART2 Asynchronous Transmit/Synchronous Clock Output to it
Notes
None.
Direction Parameter
Description
_INPUT
Sets selected pin as input
_OUTPUT
Sets selected pin as output
Function Name
Description
_CIRX
ECAN1 Receive
_COFSI
DCI Frame Sync Input
_CSCKI
DCI Serial Clock Input
_CSDI
DCI Serial Data Input
_FLTA1
PWM1 Fault
_FLTA2
PWM2 Fault
_FLTA3
PWM3 Fault
_FLTA4
PWM4 Fault
_FLTA5
PWM5 Fault
_FLTA6
PWM6 Fault
_FLTA7
PWM7 Fault
_FLTA8
PWM8 Fault
_IC1
Input Capture 1
_IC2
Input Capture 2
_IC3
Input Capture 3
_IC4
Input Capture 4
_IC5
Input Capture 5
_IC6
Input Capture 6
_IC7
Input Capture 7
_IC8
Input Capture 8
_IC9
Input Capture 9
_INDX1
QEI1 Index
_INDX2
QEI2 Index
_INT1
External Interrupt 1
_INT2
External Interrupt 2
_INT3
External Interrupt 3
_INT4
External Interrupt 4