Stuck on first attempt using MPLAB X (PICkit4)


+ Reply to Thread
Results 1 to 40 of 40

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,631


    1 out of 1 members found this post helpful. Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X

    You won't see a 1uS blink
    Code:
    START:  PORTD = 000001       
            PAUSE   500      
            PORTD = 000000
            GOTO    START
    you probably meant

    Code:
    START:  PORTD = 000001
            PAUSE   500      
            PORTD = 000000
            PAUSE   500  
            GOTO    START
    Warning I'm not a teacher

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X

    Quote Originally Posted by richard View Post
    You won't see a 1uS blink
    ...pulls out my manual, "I'm gonna show him I know the difference between PAUSE and PAUSEUS"...
    ... "I'm a programmer by trade, I know this sort of thing."...
    ...and then I glanced at my code...

    ARGH!!!

    I must have stepped on that last PAUSE 500 when I was "simplifying" my code, while I still hadn't put the pull-up on the harness.

    Thanks Richard, I feel like such a noob. I knew it had to be something funky cause an LCD program worked (kinda, but that's expected, it wasn't meant for the Lab X-1).

    Now if I could only get the PK4 to work on MCS+5 and I'd be a happy camper.

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    1 out of 1 members found this post helpful. Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X

    Today I talked to Evan at Anobium and he said that next week he will have news about Pickit4 after his meeting with Microchip.

    The (low-cost) Standalone Pickit Plus currently supports 2 and 3. Also there is a feature to check if there is new hex file and auto program the PIC with no intervention by the user.

    I use this tool a long time and am very happy with it. I had it with the MPLAB IDE/IPE and got rid off it.

    If interested I'll let you know what happens.

    Ioannis

  4. #4
    Join Date
    Aug 2011
    Posts
    453


    Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X

    Waiting for a reply from MeLabs forum to get the custom programmer working in MCS+5.
    Too many threads about the same topic.

    I just set up MPLABX 5.35, MCSP5, and installed the PICKit4 as a custom programmer.
    The only thing I changed was the commandline parameters
    Code:
    -TPPK4 -P$target-device$ -F$hex-filename$  -W3.3 -E -M -Y -OL -OB
    (TPPK4=use generic tool PK4 instead of 'BUR serial no', W3.3=power target from PK4 @ 3.3V)
    Those changes shouldn't matter much.

    Here's the output from the commandline window
    Code:
    *****************************************************
    Connecting to MPLAB PICkit 4...
    Currently loaded versions:
    Application version............00.09.46
    Boot version...................01.00.00
    Script version.................00.05.58
    Script build number............abbfe90327
    Tool pack version .............1.15.1688
    PICkit 4 is supplying power to the target (3.26 volts).
    Target device PIC18F26K22 found.
    Device Revision Id  = 0x4
    *****************************************************
    Erasing...
    Erase successful
    *****************************************************
    Calculating memory ranges for operation...
    Erasing...
    The following memory area(s) will be programmed:
    program memory: start address = 0x0, end address = 0x7f
    configuration memory
    Programming/Verify complete
     Program Report
    05-Apr-2023, 07:07:36
    Device Type:PIC18F26K22
    Program Succeeded.
    PK4 Verify Report
    05-Apr-2023, 07:07:36
    Device Type:PIC18F26K22
    *****************************************************
    The following memory area(s) will be verified:
    program memory: start address = 0x0, end address = 0xffff
    configuration memory
    EEData memory
    User Id Memory
    Verification successful.
    Verify Succeeded.
    
    Batch Mode Count : 1
    When you select 'Program' in MCSP, the command window opens and it takes a good 10 seconds before anything happens. That's just the way it it with ipecmd and MPLABX.

    If you've installed multiple versions of MPLABX, make sure you use the matching versions of ipecmd.exe and MPLABX IPE to test it with.
    Also, when you setup the custom programmer entry in MCSP I'd use the "find manually" option for setting the path, which for me was
    "D:\Programs\Microchip\MPLABX\v5.35\mplab_platform\ mplab_ipe" since I use custom installs. Be sure to test it using the IPE first... that way you know everythings working.

  5. #5
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X

    Quote Originally Posted by tumbleweed View Post
    Too many threads about the same topic.
    I started my woes in the Goodbye thread, but I wasn't making any headway in figuring what I was doing wrong. So I started my own thread, but removing my posts in the Goodbye thread would make Ioannis' posts talk to himself.


    I just set up MPLABX 5.35, MCSP5, and installed the PICKit4 as a custom programmer.
    The only thing I changed was the commandline parameters
    Code:
    -TPPK4 -P$target-device$ -F$hex-filename$  -W3.3 -E -M -Y -OL -OB
    (TPPK4=use generic tool PK4 instead of 'BUR serial no', W3.3=power target from PK4 @ 3.3V)
    Those changes shouldn't matter much.
    Using TPPK4 in MCS+5 worked even less in my case.


    When you select 'Program' in MCSP, the command window opens and it takes a good 10 seconds before anything happens.
    The command window opened and closed practically immediately, faster than when I used BUR; didn't have time to see anything.

  6. #6
    Join Date
    Aug 2011
    Posts
    453


    1 out of 1 members found this post helpful. Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X

    Don't know what to say... it works for me. If it closes immediately it sounds like the IDE can't find ipecmd.exe, but if that's the case you normally get a "searching for ..." message when you try and program. Sitting in the folder where the hex file is located, try opening a command prompt and entering the commandline in manually and see what happens. You'll probably have to use the full path to the ipecmd.exe file, and enclose it in quotes if there are spaces in the path.

    There's a step-by-step example of installing a PK4 using ipecmd.exe over on the Swordfish wiki at https://www.sfcompiler.co.uk/wiki/pm...rogrammingTool
    It's pretty much the same basic IDE as MCSP except for how you get into the "add custom programmer" step

  7. #7
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X

    Thanks for the ideas. You got me started playing with the command window directly, noticed differences by playing with parameter syntax.

    I've removed the ".X" suffix on the folder as well as replace a SPACE for an UNDERSCORE; just to be sure. I get identical results from the powershell window and MCS+5.

    I've also added the -W option; my PIC is not powered. It's on the MeLabs 8-40 pin ZIF adapter PCB.

    Code:
    C:\MPLABX\v6.05\mplab_platform\mplab_ipe\ipecmd.exe -TSBUR223673449 -P16F877 -FK:\Project_v2\PBP\Test_1_16F877_Blinky\Blinky_16F877.HEX -E -M -OB -OL -OV -W -Y
    
    DFP Version Used : PIC16Fxxx_DFP,1.3.42,Microchip
    Selected Programming Tool Sno: 
    BUR223673449
    *****************************************************
    Transmission on endpoint 2 failed (err = -109)
    A communication error with the debug tool has occurred. The tool will attempt to recover momentarily. A log of the error was created at C:\Users\Papa\queuelogs\debugtool
    Connection Failed.
    Transmission on endpoint 2 failed (err = -109)
    *****************************************************
    Transmission on endpoint 2 failed (err = -109)
    A communication error with the debug tool has occurred. The tool will attempt to recover momentarily. A log of the error was created at C:\Users\Papa\queuelogs\debugtool
    Connection Failed.
    Transmission on endpoint 2 failed (err = -109)
    Erase Target Failed.
    I'm including a PDF of the log file.

    debugtool.pdf

    NOTE FOR THE NEXT PERSON: look at CommandLineReadmes.htm in C:\MPLABX\v6.05\docs; the very first item is IPECMD.EXE, and it states that it supports PK4. The ReadMe has a detailed list of command line options available for IPECMD.EXE.
    Last edited by Demon; - 7th April 2023 at 03:09.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

Similar Threads

  1. Replies: 19
    Last Post: - 16th May 2023, 17:06
  2. My serial to parallel attempt
    By johndoug in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 4th January 2013, 04:15
  3. Upgraded to MPLAB IDE 8.14 and now I'm stuck
    By BlueHairBob in forum General
    Replies: 2
    Last Post: - 20th August 2008, 01:15
  4. MPLAB Quickbuild stuck on
    By RichardBowser in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 9th July 2006, 02:52
  5. First attempt at coding
    By bartman in forum mel PIC BASIC
    Replies: 0
    Last Post: - 10th November 2004, 17:52

Members who have read this thread : 10

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts