News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

SPI.INC equivalent

Started by RGV250, Mar 14, 2021, 06:08 PM

Previous topic - Next topic

RGV250

Hi,
I am trying to convert a PIC18 program to PIC24. In the original there was an include file SPI.INC and then I just used OpenSPI and WriteSPI. Is there an equivalent for the PIC24 as it will make life so much easier.

Regards,
Bob

RGV250

Hi,
I have found SPI_33.INC in the includes folder, does anyone know if this is the equivalent. Also is there a sample of setting it up / using it.

Regards,
Bob

RGV250

Hi,
I think there is a small error in the 24HJ128GP502.def file
In this part of the documentation is shows CLK & SS with OUT as part of the text.
Quote' Macro        : PPS_Output(pPin, pFunction)
' Overview      : The macro assigns a given pin as output pin by configuring register RPORx.
' Parameters    : pPin - pin number(x) for which functionality has to be assigned
'                  ccOut_Pin_RPx
'              : pFunction - function to be assigned for particular pin
'                  cOut_Fn_NULL
'                  cOut_Fn_CxOUT
'                  cOut_Fn_UxTX
'                  cOut_Fn_UxRTS
'                  cOut_Fn_SDOx
'                  cOut_Fn_SCKxOUT
'                  cOut_Fn_SSxOUT
'                  cOut_Fn_OCx
'                  cOut_Fn_CTMU
'                  etc.....

After a bit of head scratching I found the correct wording later on here.
Quote$define cOut_Fn_SCK1 $08                    ' RPn tied to SPI1 Clock Output
$define cOut_Fn_SS1 $09                    ' RPn tied to SPI1 Slave Select Output

Bob