• AVR Freaks

Hot!PIC32MZ Curiosity 2 Ethernet

Author
ibbro
Starting Member
  • Total Posts : 86
  • Reward points : 0
  • Joined: 2015/10/22 07:34:56
  • Location: 0
  • Status: offline
2020/01/25 09:13:03 (permalink)
0

PIC32MZ Curiosity 2 Ethernet

Has anyone gotten a PIC32MZ Curiosity 2 board working with ethernet? Microchip doesn't have a demo I have found. I started with an PIC32MZ EF Starter kit demo and confirmed same pins are used on the Curiosity 2.  It doesn't work. The EF board has UART to USB built in and the demo uses UART for console. The Curiosity board doesn't do this and Harmony 3 doesnt support USB_CDC console yet. (Confirmed in some forum discussions)  So no console easily available for debugging. I'll try making a new project next.
 
-IB
 
 
#1

12 Replies Related Threads

    ibbro
    Starting Member
    • Total Posts : 86
    • Reward points : 0
    • Joined: 2015/10/22 07:34:56
    • Location: 0
    • Status: offline
    Re: PIC32MZ Curiosity 2 Ethernet 2020/01/25 11:31:37 (permalink)
    0
    I got the Curiosity 2 working using a Harmony 2 Curiosity 1 udp_server example, which has a USB_CDC for the console. Have not been able to create a Harmony 3 udp_server project that works and unable to modify a Harmony 3 example for the PIC32MZ EF starter kit. Watching in the debugger _TCPIPStackHandleToNetLinked returns 0 and thats as far as it gets. 
    #2
    ibbro
    Starting Member
    • Total Posts : 86
    • Reward points : 0
    • Joined: 2015/10/22 07:34:56
    • Location: 0
    • Status: offline
    Re: PIC32MZ Curiosity 2 Ethernet 2020/01/25 13:13:32 (permalink)
    5 (1)
    I got this working. In Harmony 3 tcpip examples for for the pic32_ef_sk pin 27 is defined as ERXCLK. Changing it to EREFCLK makes the examples work with a Curiosity 2. I don't know why, and haven't delved into the generated code yet. The Curiosity 2 schematics do label that pin as EREFCLK. FMIIEN and FETHIO are set to RMII so I would think the proper selection is EREFCLK but it works on the EF Starter kit as ERXCLK. Interesting that with no code changes that makes the difference. Any input there would be appreciated.
    You will also need to change clock configs to match the Curiosity 2, it has a 12mhz crystal, not the 24mhz on the EF starter kit. Also change the chip to the EFM.
    -IB
    post edited by ibbro - 2020/01/25 13:23:18
    #3
    Keaton
    Junior Member
    • Total Posts : 70
    • Reward points : 0
    • Joined: 2013/04/01 14:34:05
    • Location: Chandler AZ
    • Status: offline
    Re: PIC32MZ Curiosity 2 Ethernet 2020/01/27 13:26:03 (permalink)
    0
    ibbrowning
    Has anyone gotten a PIC32MZ Curiosity 2 board working with ethernet? Microchip doesn't have a demo I have found. I started with an PIC32MZ EF Starter kit demo and confirmed same pins are used on the Curiosity 2.  It doesn't work. The EF board has UART to USB built in and the demo uses UART for console. The Curiosity board doesn't do this and Harmony 3 doesnt support USB_CDC console yet. (Confirmed in some forum discussions)  So no console easily available for debugging. I'll try making a new project next.
     
    -IB
     
     


    in Harmony 3 if you grab the STDIO block and connect it to the UART #6 (RF2 & RF13) you should get the console through the PKoB4 CDC
     
    For USB CDC through the Target USB path (PICMZ not the debugger) look here:
    \\usb\apps\device\cdc_com_port_single\firmware\pic32mz_ef_curiosity_2.X
    #4
    ibbro
    Starting Member
    • Total Posts : 86
    • Reward points : 0
    • Joined: 2015/10/22 07:34:56
    • Location: 0
    • Status: offline
    Re: PIC32MZ Curiosity 2 Ethernet 2020/01/27 15:38:28 (permalink)
    0
    I've got the target USB CDC working based on that demo app (cdc_com_port_single). I'll take a look at using the STDIO block as you suggested. Are you saying that the PKoB4 is connected to RF2 & RF13 onboard? So I just need to enable UART6 in harmony, connect to STDIO, and setup the pins? I will check the schematic of course, just being lazy by asking...


    post edited by ibbro - 2020/01/27 15:39:37
    #5
    Keaton
    Junior Member
    • Total Posts : 70
    • Reward points : 0
    • Joined: 2013/04/01 14:34:05
    • Location: Chandler AZ
    • Status: offline
    Re: PIC32MZ Curiosity 2 Ethernet 2020/01/27 15:48:07 (permalink)
    0
    ibbrowning
    I've got the target USB CDC working based on that demo app (cdc_com_port_single). I'll take a look at using the STDIO block as you suggested. Are you saying that the PKoB4 is connected to RF2 & RF13 onboard? So I just need to enable UART6 in harmony, connect to STDIO, and setup the pins? I will check the schematic of course, just being lazy by asking...




    yes, The PKoB4 has a dedicated UART path from the PIC32 MZ EF to the PKoB4 for doing Printf. if you look at your device manager you should see a new COM port show up when PKoB4 is plugged in. 
    So set RF2 & RF13 as UART (UART#6) in the pin manager.
    add the block to your project graph and connect to STDIO.
    Generate your code then add a printf where you would like to see a message and program.
    then open up your favorite terminal window (I prefer RealTerm) and connect it to the new COM port.
    should be that simple.
     
     
    #6
    ibbro
    Starting Member
    • Total Posts : 86
    • Reward points : 0
    • Joined: 2015/10/22 07:34:56
    • Location: 0
    • Status: offline
    Re: PIC32MZ Curiosity 2 Ethernet 2020/01/27 15:51:53 (permalink)
    0
    Perfect, Thanks
    #7
    ibbro
    Starting Member
    • Total Posts : 86
    • Reward points : 0
    • Joined: 2015/10/22 07:34:56
    • Location: 0
    • Status: offline
    Re: PIC32MZ Curiosity 2 Ethernet 2020/01/28 10:12:05 (permalink)
    0
    I gave that a try. UART6 in MHC connected to STDIO, I do see a com port and have a term program connected which is happy, but not seeing anything from printf's. I have double checked pins, RF2 is U6TX, RF13 is U6RX. 1 stop bit, 8 bit data, 115200 baud. Anything else I could be missing?
    #8
    Keaton
    Junior Member
    • Total Posts : 70
    • Reward points : 0
    • Joined: 2013/04/01 14:34:05
    • Location: Chandler AZ
    • Status: offline
    Re: PIC32MZ Curiosity 2 Ethernet 2020/01/28 10:59:26 (permalink)
    0
    are you adding it to an existing project?
     
    Dumb question but did you hit generate after adding the block to the project graph? (I have made this mistake several times)
    #9
    ibbro
    Starting Member
    • Total Posts : 86
    • Reward points : 0
    • Joined: 2015/10/22 07:34:56
    • Location: 0
    • Status: offline
    Re: PIC32MZ Curiosity 2 Ethernet 2020/01/28 11:08:46 (permalink)
    0
    Not such a dumb question. That kind of thing is often the problem with my attempts at Harmony. But in this case I have generated code several times in Harmony, turned UART6 interrupts on/off etc. and checked to make sure init code exists.
     
    And yes, I added to an existing project. I will go back and make a new one and see if it works there next.
    #10
    ibbro
    Starting Member
    • Total Posts : 86
    • Reward points : 0
    • Joined: 2015/10/22 07:34:56
    • Location: 0
    • Status: offline
    Re: PIC32MZ Curiosity 2 Ethernet 2020/01/28 12:04:25 (permalink)
    0
    Got it going. Works as you stated. Turns out the PKoB4 is at 9600 baud. Thnx.
    #11
    Keaton
    Junior Member
    • Total Posts : 70
    • Reward points : 0
    • Joined: 2013/04/01 14:34:05
    • Location: Chandler AZ
    • Status: offline
    Re: PIC32MZ Curiosity 2 Ethernet 2020/01/29 15:36:24 (permalink)
    0
    ibbrowning
    Got it going. Works as you stated. Turns out the PKoB4 is at 9600 baud. Thnx.


    I run it at 115200 often. is the block set that way in harmony and in your terminal window?
    as part of CDC spec there are 3 end points RX, TX, & control
    #12
    ibbro
    Starting Member
    • Total Posts : 86
    • Reward points : 0
    • Joined: 2015/10/22 07:34:56
    • Location: 0
    • Status: offline
    Re: PIC32MZ Curiosity 2 Ethernet 2020/01/31 08:34:56 (permalink)
    0
    I've found the PC terminal ignores baud rate (it is set to 115200) since it is a cdc com port but I didn't see any printf's on the terminal till I set the Harmony UART6 baud rate to 9600. If it works for you with Harmony UART6 set to 115200 I would think that means there is a setting somewhere for the PKoB4 baud rate from the PICMZ or it can somehow autosense. I don't know how it would autosense, I've never seen that.
     
    With harmony set to 115200 I occasionally saw a single weird character on the terminal after sending a long string which made realize it was doing something and prompted me to try 9600, which worked immediately. 
     
    I'll look through PKoB4 docs, it would make sense baud is somehow settable.
     
     
    #13
    Jump to:
    © 2020 APG vNext Commercial Version 4.5