• AVR Freaks

Hot!Microchip PIC32 First Design

Author
PowersOf12
Starting Member
  • Total Posts : 14
  • Reward points : 0
  • Joined: 2019/09/06 09:44:50
  • Location: 0
  • Status: offline
2019/09/10 12:52:00 (permalink)
0

Microchip PIC32 First Design

Although I have done tons of embedded work on everything from MSP430's to Cortex M4 to PowerPC to ARM9 to i.MX6 Dual Cores with and without embedded Linux, Amazon Free RTOS, other paid for RTOS, to Qt, I have never had the pleasure of using a PIC part. Now is my time. 
 
PIC32MX795F512L is my part with Pick It 3 wiggler and I will need Ethernet, USB, SPI, I2C, COM, and minor I/O contol. 
I have an old Ethernet Starter Kit Dev board or some older custom HW boards very similar to the Dev board.
 
I would like to start with any step by step document to get my first blinky led program going preferably using the latest IDE and latest Harmony and soon after latest Amazon Free RTOS. From download this then this then this to open this then this then this. I have some legacy code on this chip but I will just take what I need after I am an expert on the tools.
 
Any help / thoughts / directions. I just don't want to start out down an old path or an old way of doing Microchip designs. Basically if you know what you are doing and started over today with this part, what tools / path would you take.
#1

7 Replies Related Threads

    mpgmike
    Super Member
    • Total Posts : 472
    • Reward points : 0
    • Joined: 2014/01/23 17:27:06
    • Location: NJ
    • Status: offline
    Re: Microchip PIC32 First Design 2019/09/11 08:46:24 (permalink)
    +1 (1)
    Microchip has developed online classes that cover the basics for quite a few topics.  You might want to browse through the listings:
     
    http://microchipdeveloper.com/training-self:start

    I don't need the world to know my name, but I want to live a life so all my great-grandchildren proudly remember me.
    #2
    katela
    Super Member
    • Total Posts : 1861
    • Reward points : 0
    • Joined: 2013/06/11 05:25:18
    • Location: South Africa
    • Status: offline
    Re: Microchip PIC32 First Design 2019/09/11 09:03:45 (permalink)
    0
    You can also check their YouTube channel.

    Free online Microcontroller Tutorials and Projects for Hobbyists and students. From beginners to advanced. Website: www.studentcompanion.co.za
    YouTube Tutorials: https://www.youtube.com/StudentCompanionSA
    #3
    PowersOf12
    Starting Member
    • Total Posts : 14
    • Reward points : 0
    • Joined: 2019/09/06 09:44:50
    • Location: 0
    • Status: offline
    Re: Microchip PIC32 First Design 2020/08/02 04:30:55 (permalink)
    0
    Ok, this project finally got funding and I am evaluating the tools to decide to accept the contract or not on such an old CPU. I installed MPLAB-X, C-Compiler, and Harmony2. Apparently Harmony3 does not support this PIC chip.
     
     
    Then, I started a blink LED project and found out "hover over for variable content" did not work on my old Windows 10 PC. Then, the code was not single stepping properly in a SPI serial flash library. (Optimizations turned on? Usually these are off in Debug mode).
     
    So, I have reinstalled a fresh Windows 10 and starting over today and hoping for a reliable development environment.
    #4
    PowersOf12
    Starting Member
    • Total Posts : 14
    • Reward points : 0
    • Joined: 2019/09/06 09:44:50
    • Location: 0
    • Status: offline
    Re: Microchip PIC32 First Design 2020/08/02 12:23:47 (permalink)
    +1 (1)
    Windows 10 had nothing to do with  my issues. 
     
    I think I cannot debug properly because the free C compiler has optimizer forced to 1 which is good for compiled code but maybe causing the "stepper" F8 to hop around and also cause the "hover variable value" to not work right (shows zero most of the time even when I know variables are set correctly).
     
    These issues combined with the "state machine" coding style makes debugging pretty difficult.
    #5
    NKurzman
    A Guy on the Net
    • Total Posts : 18898
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: Microchip PIC32 First Design 2020/08/02 12:32:20 (permalink)
    +1 (1)
    You can use Nop() to force the optimizer to placefixed points. There’s also a Debug macro you can use to force or software breakpoint
    You can use static and or volatile so that the optimizer will not optimize away your variables.
    You want to remove all of these after you finish the buggy otherwise your code will be bigger and slower.
    #6
    PowersOf12
    Starting Member
    • Total Posts : 14
    • Reward points : 0
    • Joined: 2019/09/06 09:44:50
    • Location: 0
    • Status: offline
    Re: Microchip PIC32 First Design 2020/08/02 15:51:32 (permalink)
    0
    Thanks, the Nop() is working to at least keep the broken breakpoints away.
     
    Now, I am just going to stop using much of the harmony stuff as I can code the stuff quicker vs debugging. I also put in Amazon Free RTOS because I have a lot of experience with that and it sort of replaces the SYS and APP tasks with real tasks.
    #7
    dan1138
    Super Member
    • Total Posts : 3825
    • Reward points : 0
    • Joined: 2007/02/21 23:04:16
    • Location: 0
    • Status: offline
    Re: Microchip PIC32 First Design 2020/08/02 16:35:26 (permalink)
    +1 (1)
    After taking a stroll down memory lane to get my DM320004 / Ethernet Starter Kit out. I have found some things you may need to know.
     
    My DM320004 is real old and has one of the original SKDE implementations. This one was awful with MPLAB v8.92 while it does work as a device programmer with MPLABX v5.40 I could not get the debugger to actually work.
     
    A point to remember the SKDE tool uses different USB host drivers for MPLABX and MPLAB 8 so you do need to use the driver switcher application to activate the USB host driver for the IDE you're going to run.
     
    I did get the PICkit3 to work well enough.
     
    Unless Microchip, the PIC32MX795F512L or Harmony are required by the client you should seriously consider the more current controllers from Microchip not based on the MIPS architecture.
     
    From post #7 you seem to have chosen to get some distance from Harmony. Good idea.
     
    If you persist with the Microchip MIPS controllers you will want something faster and not so obsolete as a PICkit3. A PICkit4, ICD4 or one of the JTAG debuggers available for newer controllers.
     
    One last thing, find attached a standalone LED blinky project for the DM320004.

    Attachment(s)

    Attachments are not available: Download requirements not met
    #8
    Jump to:
    © 2020 APG vNext Commercial Version 4.5