Using Harmony to setup ENC28J60 with PIC32MX795F512L
I'm trying to setup to use ENC28J60 SPI Ethernet Controller with a PIC32MX795F512L (100 pin package). I am using MPLAB X and Harmony and getting a bit confused (I have previously used the Ethernet starter kit successfully).
So when I select 'Use ENC28J70 Driver' under drivers in harmony, and then expand ‘ENC28J60 Driver Instance 0’ there are various options, this is where I am a little confused. I am unclear what 'SPI Slave Select Port Channel' actually refers to, it offers 'Port_Channel_A' through to 'Port_Channel_G' as options - should I assume Port_Channel_A is SPI bus 0? (The Data sheet for the PIC32MX795F512L shows 4 ports – SDO1/SDI1 to SDO4/SDI4 etc).
Then 'Slave Select Port Pin' has options for 'Ports_Bit_Pos_0' to 'Ports_Bit_Pos_15' which pin(s) would this refer to? Would that be referring to PortA to PortG pins so if selecting ‘Port_Channel_A’ above then 'Ports_Bit_Pos_0' would be PortA.0? In my case that would be Pin #17?
For ref I'm using 28Pin QFN ENC28J60 & 100Pin TQFP PIC32MX795F512L packages connected as follows:
ENC28J60 Pin 2 (SO) to PIC Pin 9 (SDI1) (RC4)
ENC28J60 Pin 3 (SI) to PIC Pin 72 (SDO1) (RD0)
ENC28J60 Pin 4 (SCK) to PIC Pin 70 (SCK1) (RD10)
ENC28J60 Pin 5 (CS) to PIC Pin 76 (RD1)
ENC28J60 Pin 6 (RST) to PIC Pin 77 (RD2)
ENC28J60 Pin 28 (/INT) to PIC Pin 67 (INT4) (RA15)
Have I connected SO & SI correctly I am assuming SO (Out) from ENC28J60 should connect SDI (In) on PIC - is this correct?
Also SDI1 on the PIC is on Port C whilst SDO1 is on Port D - again is this an issue?
All of which would lead me to believe I need to select ‘Port_Channel_D’ as 'SPI Slave Select Port Channel' but then ENC28J60 Pin 2 (SO) to PIC Pin 9 (SDI1) (RC4) is clearly wrong?
So as you can see I’m getting myself a bit tied up here! Any advice would be gratefully received
Thanks & Merry Christmas!
post edited by alex - 2019/12/19 04:10:20