• AVR Freaks

Hot!Using Harmony to setup ENC28J60 with PIC32MX795F512L

Author
alex
Starting Member
  • Total Posts : 62
  • Reward points : 0
  • Joined: 2007/01/18 05:19:13
  • Location: 0
  • Status: offline
2019/12/19 02:55:56 (permalink)
0

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

Attached Image(s)

#1

3 Replies Related Threads

    karan123
    Super Member
    • Total Posts : 912
    • Reward points : 0
    • Joined: 2009/02/02 11:11:21
    • Location: 0
    • Status: offline
    Re: Using Harmony to setup ENC28J60 with PIC32MX795F512L 2019/12/19 03:20:08 (permalink)
    0
    Hi,

    Can you please share your complete schematic ?
    #2
    alex
    Starting Member
    • Total Posts : 62
    • Reward points : 0
    • Joined: 2007/01/18 05:19:13
    • Location: 0
    • Status: offline
    Re: Using Harmony to setup ENC28J60 with PIC32MX795F512L 2019/12/19 04:12:09 (permalink)
    0
    karan123
    Hi,

    Can you please share your complete schematic ?



    Have added to my orginal post - I dont really have a complete schematic as it is kind of evolving on the bench (sort of cut and shut) but this shows the critical stuff. Power is from bench power supply.
     
    I'm not so fussed about hardware at this stage, really trying to undertstand relationship between harmony settings and the pins they refer to on the PIC.
     
    All of that said I guess the other question I should ask is what is the best way to test it? I am prevented from connecting anything to my companies network (until it can be verified 100% it will not cause any dissruption). So do I need to purchase a cheap router to take care of assinging IP addresses? or can i plug a laptop straight into my board?
    post edited by alex - 2019/12/19 05:27:07
    #3
    karan123
    Super Member
    • Total Posts : 912
    • Reward points : 0
    • Joined: 2009/02/02 11:11:21
    • Location: 0
    • Status: offline
    Re: Using Harmony to setup ENC28J60 with PIC32MX795F512L 2019/12/19 21:48:26 (permalink)
    0
    Hi,

    Please check below readymade demo : 
    C:\microchip\harmony\v2_06\apps\tcpip\tcpip_tcp_client\firmware\src\system_config
    and change pin according to hardware.
     
     
    Also check this note in  C:\microchip\harmony\v2_06\doc\help_harmony.chm
    "Note: The tcpip_tcp_client demonstration using the ENC24xJ600 or the ENC28J60 configurations does not work properly if the SPI Driver enables DMA. Please disable the SPI DMA option for these configurations. This will be corrected in a future release of MPLAB Harmony"
     
     
     
    --
    Karan
    #4
    Jump to:
    © 2020 APG vNext Commercial Version 4.5