News:

;) This forum is the property of Proton software developers

Main Menu

DsPIC33EP512MU810 PPS_Input/PPS_Output

Started by Wimax, Aug 05, 2024, 06:16 PM

Previous topic - Next topic

Wimax

Hello everybody !

I am trying to familiarise myself, very slowly, with the little monster DsPic33EP512MU810 and its peripherals that (one day) I will have to 'migrate' to.
Is the .def file with the definitions for the PPS_Input and PPS_Output macros for this device complete or correct ?

trastikata

Hello Wimax,

I briefly explained how to use the PPS registers directly here:
https://protoncompiler.com/index.php?msg=17216

It is not really anything complex and you don't need any macros... for example this is all the code you need to set-up SPI2 in dsPIC33EP128MC504:

'RP55 to SCK2 / RP54 To SDO2 / RPI51 to SDI2
        RPOR5.Byte1 = %00001001     'RP55
        RPOR5.Byte0 = %00001000     'RP54
        RPINR22.Byte0 = %00110011   'SDI2
        RPINR22.Byte1 = %00110111   'SCK2

Wimax

Hello Trastikata  ;)

thanks again for your valuable advice ! I was going crazy because I was not getting the register values right by poking around in the relevant .def file:

i.e. I see these

$define cOut_Fn_U1TX $03    ' RPn tied to UART1 Transmit
$define cOut_Fn_U2TX $05    ' RPn tied to UART2 Transmit
$define cOut_Fn_SDO1 $07    ' RPn tied to SPI1 Data Output

(...)

instead of

$define cOut_Fn_U1TX $01    ' RPn tied to UART1 Transmit
$define cOut_Fn_U2TX $03    ' RPn tied to UART2 Transmit
$define cOut_Fn_SDO1 $05    ' RPn tied to SPI1 Data Output

(...)