Hot!How to connect PIC32 USB Starter kit II (DM320003-2) to MPLAB X IDE V4.01

Author
mmk471
New Member
  • Total Posts : 12
  • Reward points : 0
  • Joined: 2017/11/21 03:20:55
  • Location: 0
  • Status: offline
2017/11/21 19:39:26 (permalink)
0

How to connect PIC32 USB Starter kit II (DM320003-2) to MPLAB X IDE V4.01

Hi all, please help/suggest me to connect the PIC32 USB Starter kit II to MPLAB X IDE V4.01.
 
i want to program and debug the PIC32MX795F512L microcontroller with MPLAB Harmony project code using MPLAB X IDE V4.01. when i'm selecting programming options in the  MPLAB X IDE, the board is not detected. and when i'm referring the user guide or PIC32 USB Starter kit II, i found that the starter kit will support MPLAB IDE v8.44 and above only. please suggest me how to connect PIC32 USB Starter kit II to MPLAB X IDE V4.01 and how to program. and also i have a doubt like do we need any debigger/programmer to connect the starter kit with IDE because the starter kit is having mini USB port on board to program and debug. and it doesn't have the any other port to program/debug.
 
please help me to figure it out.
 
 
Regards
Krishna
#1

7 Replies Related Threads

    davekw7x
    Entropy++
    • Total Posts : 1669
    • Reward points : 0
    • Joined: 2012/01/16 12:01:07
    • Location: Left Coast, USA
    • Status: offline
    Re: How to connect PIC32 USB Starter kit II (DM320003-2) to MPLAB X IDE V4.01 2017/11/21 21:54:45 (permalink)
    4.5 (2)
    mmk471
    Hi all, please help/suggest me to connect the PIC32 USB Starter kit II to MPLAB X IDE V4.01.
     

    Yes, you connect a USB cable from your PC to the Mini-B connector on the top of the board.  It shows up in the Hardware Tool window under Legacy Starter Kits->SDKE PIC32.
     
    I have attached a screen shot from my Linux system.  It works the same on my Windows 7 PC, but the appearance is slightly different.
     
    On the Windows system it shows up (under "Devices and Printers") as "Custom Microchip USB Device"
    On Linux, lsusb reports "ID 04d8:00e0 Microchip Technology, Inc. PIC32 Starter Board"
     
    I haven't tested with any other PC operating systems, but with these it works as expected: No external programmer needed. 
     
    Bottom line: Once attached it acts like a PICkit 3.  Programming has been perfect, but I don't use (i.e. haven't used) the debug functionality.
     
    One other thing:
    I will say that for some versions of MPLABX I noticed that certain PKOB devices aren't recognized unless they are connected to the PC before starting MPLABX.  It seems not to make a difference whether you plug it in before or after starting MPLABX version 4.01 and 4.05, but I thought I would mention it.  Sometimes things are a little inconsistent.  Or at least that's what I hear from time to time.
     
     
    Regards,

    Dave
     
    post edited by davekw7x - 2017/11/21 22:05:32

    Attached Image(s)


    Sometimes I just can't help myself...
    #2
    mmk471
    New Member
    • Total Posts : 12
    • Reward points : 0
    • Joined: 2017/11/21 03:20:55
    • Location: 0
    • Status: offline
    Re: How to connect PIC32 USB Starter kit II (DM320003-2) to MPLAB X IDE V4.01 2017/11/21 22:56:34 (permalink)
    0
    Hi Dave,
     
    Thank you for your reply.
     
    as you suggested, i have connected the USB starter kit before opening MPLAB X IDE(v4.01). IDE is detected the Board, i'm able to program it. 
    [image]D:\MMK\Apex LCD\USB_STR_KIT__DEMO_PROJECTS\Obeservations\programming.png[/image]
    but my question is after programming the board, in MPLAB X IDE it is showing as running target.(please check the attached image). but actually it is not running the program which i have downloaded and all the three leds went to off state.
     
    please tell me, how we can confirm whether the programmed application is running or not on the board.
     

    Attached Image(s)

    #3
    mmk471
    New Member
    • Total Posts : 12
    • Reward points : 0
    • Joined: 2017/11/21 03:20:55
    • Location: 0
    • Status: offline
    Re: How to connect PIC32 USB Starter kit II (DM320003-2) to MPLAB X IDE V4.01 2017/11/22 04:26:07 (permalink)
    0
    Thank you DAVE finally i'm able to program the Starter kit.
     
     
    Regards
    Krishna
    #4
    davekw7x
    Entropy++
    • Total Posts : 1669
    • Reward points : 0
    • Joined: 2012/01/16 12:01:07
    • Location: Left Coast, USA
    • Status: offline
    Re: How to connect PIC32 USB Starter kit II (DM320003-2) to MPLAB X IDE V4.01 2017/11/22 15:21:35 (permalink)
    0
    mmk471
    please tell me, how we can confirm whether the programmed application is running or not on the board.
     



    The programmer verifies, byte by byte that the upload to the device was successful.
    I suggest you start with a bare-metal (i.e. non-Harmony) app that just blinks an LED.  I always start at the bottom and work my way up.  (But that's just me; I'm funny that way.)
     
    One thing crosses my mind:
    I can't remember which version of MPLABX or which on-board programmer had a problem with not automatically resetting the target after programming.  There is an ICON at the top of the MPLABX window to Reset and Release From Reset the target.  You might try that, just for kicks.  If it can Reset and Release, then you have to assume it's running.  Maybe something in the code is not working.  (It's hard for me to admit, but it happens from time to time that my programs actually have bugs.  Really.)
     
    Anyhow, with any application:
    Then back up to the beginning of main() and introduce something visual (like a blinking LED) that shows some progress.  You don't have to go all the way back to the Harmony configurator to instrument your code with stuff like this.  Just write the code!
     
    mmk471
    ...finally i'm able to program the Starter kit.

     
    So: Is everything OK now?  Or are there still problems running code?
     
     
    Regards,

    Dave
     

    Sometimes I just can't help myself...
    #5
    mmk471
    New Member
    • Total Posts : 12
    • Reward points : 0
    • Joined: 2017/11/21 03:20:55
    • Location: 0
    • Status: offline
    Re: How to connect PIC32 USB Starter kit II (DM320003-2) to MPLAB X IDE V4.01 2017/11/23 04:29:03 (permalink)
    0
    yes dave, it is working fine. no problem with LEDS.
     
    i have started working on SPI using PIC32 USB starter kit II. i just used the existing SPI (SPI Loop back) code (which comes in MPLAB harmony examples after installation) to test SPI channels. SPI it is getting failed. as per my knowledge, the loop back is working as SDO is connected to SDI line of SPI. can you please suggest with some example codes to test SPI. and also why SPI loop back is getting failed?
     
    #6
    davekw7x
    Entropy++
    • Total Posts : 1669
    • Reward points : 0
    • Joined: 2012/01/16 12:01:07
    • Location: Left Coast, USA
    • Status: offline
    Re: How to connect PIC32 USB Starter kit II (DM320003-2) to MPLAB X IDE V4.01 2017/11/23 09:54:02 (permalink)
    0
    mmk471
    why SPI loop back is getting failed?

    I am assuming you have read the Harmony Examples documentation and you see that LED2 is lit, indicating failure.
     
    Well, the thing that I don't remember seeing explicitly stated in the documentation is that in order to do the loopback test you have to connect SDO1 to SDI1 externally.  Maybe they thought it was obvious that a loopback project requires you to loop something back.  I think it should have been Step 0 in the three-step sequence (thus making it a four-step sequence).
     
    Bottom line for this part of your question:  When I connect SDO1 (RD0) to SDI1 (RC4), LED3 is lit, indicating success.  Remove the external connection, click the MPLABX toolbar icon for "Hold in Reset" then "Release from Reset" and LED2 is lit.  Reconnect the external jumper, Reset and Release, and LED3 is lit.
     
    Now, if you aren't working with a Starter Kit I/O Expansion Board (or something else that your USKII is plugged into), I don't know how the heck you would make the external connection, but if you are, you can look up the connections on the USK2 schematic and the Expansion Board schematic to see what pins on J10 and/or J11 correspond to RD0 and RC4.
    I use a PICTail prototype board plugged into the Expansion Board and, for these signals, the marked names work for this.  (Beware: For some few Signals and some few Starter Kit modules, the names marked on the PICtail protype board have been scrambled slightly, so always check the schematics.)
     
    mmk471
    ...can you please suggest with some example codes to test SPI...

    I'm not a Harmony guy. I say this not meaning to disparage Harmony, but I mean that I simply don't have enough experience to try to help others.  There is a Harmony subforum.  Maybe you can ask Harmony-specific questions there.
     
    If you just want to test SPI, you can write a bare-metal (non-Harmony) project that initializes a SPI module and exercises it.
     
    Finally, an opinion or two (see Footnote):
    [/Begin Opinion]
    • I hate it that the USKII board doesn't have a reset button.  I always need a reset button during development, even if the final product doesn't have a reset function.  I (almost) always lay out the PCB to accommodate a Reset switch, or at least with pads to which I can connect wires to an external reset button.
    • I hate one-and-done tests like this.  I (almost) always put tests like this in a loop so that I can connect and disconnect the external jumper and see the LED pattern change. Can observe bit patterns on a 'scope to see what the heck is going on.
    [/End Opinion]
     
    Regards,

    Dave
     
    Footnote:
       The opinions expressed here are not necessarily my own.
       It's these dang voices in my head.
    post edited by davekw7x - 2017/11/23 10:08:24

    Sometimes I just can't help myself...
    #7
    EmbeddedEngineer
    New Member
    • Total Posts : 21
    • Reward points : 0
    • Joined: 2016/02/24 06:56:35
    • Location: 0
    • Status: offline
    Re: How to connect PIC32 USB Starter kit II (DM320003-2) to MPLAB X IDE V4.01 2019/02/18 09:06:27 (permalink)
    0
    I am new to PIC32 harmony for PIC32MZ EF family. please help with useful materials for Harmony  coding and calling APIs . thanks
    #8
    Jump to:
    © 2019 APG vNext Commercial Version 4.5