i am trying to use the new Pic Clicker II with the PIC18F67K40 with a micro SD Card Click, but initialization of SPI makes trouble. As I See it, SPI1 must be Mapped using “Peripheral Pin Select Library“ the Problem is, that the new PIC18F67K40 pin mapping parameters don’t fit to the microcontrollers Reference manual. So my problem is, that I can’t name Miso, Mosi and SCK in the PPS_Mapping routine because I don^t know where to look it up. PIC Help library description is not up to date for that uController and Code assistant shows anything, but its not clear, which descriptor does suit Dou, Din and SCK.
Could anyone provide me with a simple SPI init code for this PIC18F67K40 ???
Please find attached my Example Code.
Code: Select all
PPS_Mapping(_RC4, _INPUT, _SSP1DAT); // SPI - MISO - data in le
PPS_Mapping(_RC5, _OUTPUT, _SDO1_SDA1); // SPI - MOSI - data out -> sda means input?
PPS_Mapping(_RC3, _OUTPUT, _SCK1_SCL1); // SPI - SCK
/*
PPS_Mapping(_RC4, _INPUT, _SDO1_SDA1); // SPI - MISO - data in -> input mapping not possible
PPS_Mapping(_RC5, _OUTPUT, _SSP1DAT); // SPI - MOSI - data out
PPS_Mapping(_RC3, _OUTPUT, _SCK1_SCL1); // SPI - SCK - sck
*/
SPI1_Remappable_Init_Advanced(_SPI_REMAPPABLE_MASTER_OSC_DIV4, _SPI_REMAPPABLE_DATA_SAMPLE_MIDDLE, _SPI_REMAPPABLE_CLK_IDLE_LOW, _SPI_REMAPPABLE_LOW_2_HIGH);
SPI_Set_Active(&SPI1_Remappable_Read, &SPI1_Remappable_Write);