Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Wed May 24, 2017 12:55 am |
|
|
and as a further comment, I refer to my previous post pointing out that what signals are affected by PPS is also in the include file. Both T0CK and T1CK are selectable, so:
#PIN_SELECT T0CK=PIN_A4
#PIN_SELECT T1CK=PIN_C0
will ensure these are on the pins you want.
Code: |
////////////////////////////////////////////////////////////////// PIN_SELECT
// #pin_select function=pin
// Valid Pins:
// PIN_A0,PIN_A1,PIN_A2,PIN_A3,PIN_A4,PIN_A5,PIN_A6,PIN_A7,PIN_B0,PIN_B1,
// PIN_B2,PIN_B3,PIN_B4,PIN_B5,PIN_B6,PIN_B7,PIN_C0,PIN_C1,PIN_C2,PIN_C3,
// PIN_C4,PIN_C5,PIN_C6,PIN_C7,PIN_E3
// Input Functions:
// INT0,T0CK,T1CK,T1G,T3CK,T3G,T5CK,T5G,T2CK,T4CK,T6CK,CCP1,CCP2,CCP3,CCP4,
// CCP5,SMT1WIN,SMT1SIG,SMT2WIN,SMT2SIG,CWG1IN,CWG2IN,CWG3IN,MDCARL,MDCARH,
// MDSRC,CLCIN0,CLCIN1,CLCIN2,CLCIN3,ADCACT,SCK1IN,SCL1IN,SDI1,SDA1IN,SS1IN,
// SCK2IN,SCL2IN,SDI2,SDA2IN,SS2IN,U1RX,U1CKIN,T0CKI,T1CKI,T3CKI,T5CKI,T2CKI,
// T4CKI,T6CKI,CCP1IN,CCP2IN,CCP3IN,CCP4IN,CCP5IN,RX1
// Output Functions:
// NULL,CLC1OUT,CLC2OUT,CLC3OUT,CLC4OUT,CWG1OUTA,CWG1OUTB,CWG1OUTC,CWG1OUTD,
// CCP1OUT,CCP2OUT,CCP3OUT,CCP4OUT,CCP5OUT,PWM6OUT,PWM7OUT,U1TX,U1DT,C1OUT,
// C2OUT,SCK1OUT,SCL1OUT,SDA1OUT,SDO1,SCK2OUT,SCL2OUT,SDA2OUT,SDO2,T0OUT,
// NCO1OUT,CLKROUT,DSMOUT,CWG2OUTA,CWG2OUTB,CWG2OUTC,CWG2OUTD,CWG3OUTA,
// CWG3OUTB,CWG3OUTC,CWG3OUTD,ADGRDA,ADGRDB,PWM6,PWM7,TX1,DT1,SCK1,SCL1,SDA1,
// SCK2,SCL2,SDA2,NCO1
//
|
This gives, first the RP pins (so pins to which things can be mapped), then the input signals that can be mapped, followed by the output signals that can be mapped.
Now the data sheet will tell you that certain pins are the 'default' for signals. Problem is that the compiler does not always seem to 'know' this, and doesn't necessarily setup the TRIS etc. correctly. So for PPS peripherals it is safer to explicitly set all relocatable functions where you want them to be, then the compiler knows from the 'select' lines that this is where the signals are. |
|