Hot!pic32mz harmony problem with tcpip encx24j600

Author
pguido
Junior Member
  • Total Posts : 109
  • Reward points : 0
  • Joined: 2008/07/25 07:43:01
  • Location: italy
  • Status: offline
2018/04/11 08:19:43 (permalink)
0

pic32mz harmony problem with tcpip encx24j600

Hello
i'm developing a project on custom board, based on PIC32 controller and ethernet controller ENCX24J600.
i use MPLABX IDE 3.40 and HARMONY 2.05 and XC32
My first step was to use a demo app (web_server_sdcard_fatfs) with PIC32MX795F512H and ENCX24J600; this work fine.
My second step will be to (simply) change processor, using PIC32MZ2048EFH064; but this don't work at all.
TCPIP initialization take place but don't end (machine status don't go ahead). All HARMONY parameters remain the same (except clock parameters). SPI interface appear to work correctly but ethernet connection don't take place.
Other "demo" projects take the same result: works fine on PIC32MX+ENCX24, don't work on PIC32MZ+ENCX24.
Hardware work fine, it work correctly with an old adapted version of tcpip stack.
"TCPIP STACK Status" remain always 1 (STATUS_BUSY) and no messages come out from ethernet port.
Have someone successfully tryied similar configuration? PIC32MZ ENCX24J600 (spi mode) and HARMONY 2.05 ?
Any suggestion?
thanks
Guido
#1

12 Replies Related Threads

    sergeydub
    New Member
    • Total Posts : 2
    • Reward points : 0
    • Joined: 2008/07/21 10:08:59
    • Location: 0
    • Status: offline
    Re: pic32mz harmony problem with tcpip encx24j600 2018/04/12 21:11:17 (permalink)
    0
    In your MHC pin diagram
    1) Check to make sure that SPI pins are properly configured
    2) Check to make sure that ENC28J60 chip select line is set to GPIO_OUT and reset line is set to GPIO_IN
     
    In your MHC Options, Harmony Framework Configuration, Driver, SPI
    1) Make sure that SPI Module ID is properly selected.
    2) Set Clock Mode to DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FAL
    3) Set Input Phase to SPI_INPUT_SAMPLING_PHASE_AT_END
     
    In your MHC Options, Harmony Framework Configuration, Driver, ENC28J60
    1) Make sure that slave select references proper pin.
     
    In your MHC Options, Harmony Framework Configuration, TCPIP Stack
    1) Make sure that you referencing ENC28J60 in your instance.
    2) I would also recommend unchecking DHCP and DNS from your network startup flags.
    3) Make sure that ICMP server is selected. 
     
    #2
    pguido
    Junior Member
    • Total Posts : 109
    • Reward points : 0
    • Joined: 2008/07/25 07:43:01
    • Location: italy
    • Status: offline
    Re: pic32mz harmony problem with tcpip encx24j600 2018/04/23 06:40:32 (permalink)
    0
    tank you for your suggestions.
    i had verified the configuration and all is right.
    please note that i don't use ENC28J60 but ENC624J600.
    also note that same project/configuration work fine with PIC32MX microcontroller...
     
    I'm curious to know if someone had a positive result in using a tcpip demo application (or real tcpip application) using PIC32MZ controller and ENCx24J600... (and Harmony)
    post edited by pguido - 2018/04/23 07:14:13
    #3
    rainad
    Moderator
    • Total Posts : 926
    • Reward points : 0
    • Joined: 2009/05/01 13:39:25
    • Location: 0
    • Status: offline
    Re: pic32mz harmony problem with tcpip encx24j600 2018/04/23 08:45:57 (permalink)
    5 (1)
    We don't distribute a PIC32MZ demo app with the ENC24J600 in the Harmony distribution because the PIC32MZ has the internal Ethernet controller which should be the default choice.
    Anyway, to make some progress with your project, try first to do some read/write operations of the MAC or PHY well known registers on the ENC, using the SPI driver in you project - daon't call the TCP/IP stack initialization for now.
    If SPI and the I/O are configured properly, then all the read/write operations will perform properly.
    Otherwise you can investigate to see where the problem is.
     
    #4
    pguido
    Junior Member
    • Total Posts : 109
    • Reward points : 0
    • Joined: 2008/07/25 07:43:01
    • Location: italy
    • Status: offline
    Re: pic32mz harmony problem with tcpip encx24j600 2018/04/24 12:49:37 (permalink)
    0
    thank for your help.
    i have now focalized my attention on spi communication. with an oscilloscope i have discovered that CS pin (rc14) don't work properly. the cause is an incoherency between ENC driver definition and device configuration (SOSCEL was defined and thus RC14 was reserved for secondary oscillator).
    HARMONY don't signal any warning for this misalignement.
    now i can go ahead.
    thank you.
     
    my choose was for ENC24 because this project is an evolution from a previous project that use ENC24.
    i can evaluate other solution, but i need a communication with a low number of wires, like SPI interface, and a device not too small because my board is hand-made and minimum pitch for my chips must be 0.4mm (TQFP).
     
    what other PHY is suitable for this purpose?
    #5
    rainad
    Moderator
    • Total Posts : 926
    • Reward points : 0
    • Joined: 2009/05/01 13:39:25
    • Location: 0
    • Status: offline
    Re: pic32mz harmony problem with tcpip encx24j600 2018/04/24 13:15:21 (permalink)
    0
    If you're going to use an external PHY then you'd need 10/18 (RMII/MII) I/O pins to connect to it.
    If this is the important factor in your design, then the SPI approach is the best.
     
    #6
    RISC
    Super Member
    • Total Posts : 5109
    • Reward points : 0
    • Status: offline
    Re: pic32mz harmony problem with tcpip encx24j600 2018/04/24 14:20:55 (permalink)
    0
    Hi,
     
    Why do you use ENC624J600 if you use SPI mode ?
    ( ENC424J600 would be a better choice )
     
    Regards
    #7
    pguido
    Junior Member
    • Total Posts : 109
    • Reward points : 0
    • Joined: 2008/07/25 07:43:01
    • Location: italy
    • Status: offline
    Re: pic32mz harmony problem with tcpip encx24j600 2018/04/25 02:06:25 (permalink)
    0
    my mistake...
    i use enc424j600, not enc624j600...
    grin: grin
    #8
    mrpackethead
    packet mangler
    • Total Posts : 952
    • Reward points : 0
    • Joined: 2007/04/01 23:33:39
    • Location: 0
    • Status: offline
    Re: pic32mz harmony problem with tcpip encx24j600 2018/04/25 02:14:25 (permalink)
    0
    Why not use something like an LAN8742 or similar?   Much cheaper, and more appropriate for using with a PIC32MZ?
     
    #9
    pguido
    Junior Member
    • Total Posts : 109
    • Reward points : 0
    • Joined: 2008/07/25 07:43:01
    • Location: italy
    • Status: offline
    Re: pic32mz harmony problem with tcpip encx24j600 2018/04/25 05:40:12 (permalink)
    0
    LAN8742 is an interesting device.
    Difficulties can regards the number of connections required (9 instead of 4) and the package outline of the device (QFN, not TQFP).
    At the moment i don't know if the connections would be remappable on PIC32MZ device or not...
    I will try...
    #10
    pguido
    Junior Member
    • Total Posts : 109
    • Reward points : 0
    • Joined: 2008/07/25 07:43:01
    • Location: italy
    • Status: offline
    Re: pic32mz harmony problem with tcpip encx24j600 2018/04/28 07:39:32 (permalink)
    0
    project is now in progress...
    but some strange things appear using SD card...
    mount of file system don't take place.
    SD and SPI frequency was setted at 10Mhz on MHC
    setting SD frequency and SPI frequency at 200Khz mount take place.
    (SD initialization really need 200Khz at startup time and 10-20Mhz at work time, but no explanation of this on Harmony doc)
    setting SD frequency at 10Mhz and SPI frequency at 200Khz it work, but only one time, then no answer on USB port...
    returning at 10Mhz on SPI and SD and silence continue... nothing work...
    re-setting SD frequency at 10Mhz and SPI frequency at 200Khz - TCPIP initialization error...
    AARRGHHH...
    The HARMONY NIGHTMARE !!!
     
    #11
    pguido
    Junior Member
    • Total Posts : 109
    • Reward points : 0
    • Joined: 2008/07/25 07:43:01
    • Location: italy
    • Status: offline
    Re: pic32mz harmony problem with tcpip encx24j600 2018/04/29 09:05:45 (permalink)
    0
    now i have resumed the old version, that work fine with ENCx24 and fail with SD initialization, version saved 2 days ago.
    first time it work as two days ago.
    but un-powering and re-powering the board i have an error:
    "ENCX24J600 driver 0 already IN USE"
    I have learned now that it's not a good practice to evolve the software, recompile, reload, retry without un-power and re-power the board; maybe some devices remains in an old state in their registers...
    This explain my previous SD problems.
    But this don't explain all my problems.
    The error "ENCX24J600 driver 0 already IN USE" seems like  some RAM variables are un-initialized.
    Is there a compiler or linker option that reset to zero the un-initialized variables in ram?
    Or what other can be cause this problem?
     
    #12
    pguido
    Junior Member
    • Total Posts : 109
    • Reward points : 0
    • Joined: 2008/07/25 07:43:01
    • Location: italy
    • Status: offline
    Re: pic32mz harmony problem with tcpip encx24j600 2018/04/30 02:36:20 (permalink)
    0
    resumed old version of 3 days ago, re-modified...
    Now ENCX24J600 driver work.
    SD don't work...
    Setting SD and SPI frequency at 200Khz
    FS mount now take place... Power off, power on, FS mount work !!!
    Tryed some minor changes... FS mount don't work...
    Commented my changes... FS mount don't work...
    Really it's a nightmare...
    But, HARMONY works?
     
    #13
    Jump to:
    © 2018 APG vNext Trial Version 4.5