Stuck on first attempt using MPLAB X


Closed Thread
Results 1 to 38 of 38
  1. #1
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,598

    Default Stuck on first attempt using MPLAB X

    SOLVED: Result in post 35.

    SUMMARY:

    - no SPACES in folder and file name.
    - use IPECMD.EXE with command line options (read CommandLineReadmes in C:\MPLABX\v6.05\docs for details).
    - use W command line option when PIC is powered by programmer, this was probably the most important thing, my PIC wasn't powered.
    - use tool serial number or generic name in command line.

    -----------------------------------------------------------------------

    Trying to get a simple program working using PBP3, MPLAB X with PICKIT4 and a 16F877 on the Lab X1, but keep getting:

    make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
    make[1]: Entering directory 'C:/PBP3/Test_programs/Test1_16F877_LabX1'
    make[1]: *** No rule to make target '.build-subprojects', needed by '.build-conf'. Stop.
    make: *** [.build-impl] Error 2
    make[1]: Leaving directory 'C:/PBP3/Test_programs/Test1_16F877_LabX1'
    nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed

    BUILD FAILED (exit value 2, total time: 104ms)
    .

    Code:
    REM   ASM
    REM       @ DEVICE PIC16F877, HS_OSC, WDT_OFF, PWRT_ON, BOD_ON, LVP_OFF, CPD_OFF, WRT_OFF, DEBUG_OFF, PROTECT_OFF
    REM   ENDASM
    
    #CONFIG
        __config _XT_OSC & _WDT_OFF & _WRT_ON & _BODEN_ON & _LVP_OFF  & _CPD_OFF & _PWRTE_OFF & _DEBUG_ON
    #ENDCONFIG
    
    DEFINE  OSC     20
    
    TRISD = %00000000
    
    LED0    VAR     PortD.0
    
            LOW LED0
    
    START:  HIGH    LED0
            PAUSE   500
            LOW     LED0
            GOTO    START
    
    Finish: end
    I converted ASM to CONFIG, but that didn't help. I've used that youtube video to include the compiler in MPLAB X, that went super well until I tried an example.

    Does our code have to sit in a special folder now?

    I read that PBP3 migration PDF, can't see what else I forgot. I'd really like to stick with MPLAB and not return to MCSP+.
    Last edited by Demon; - 8th April 2023 at 00:05.
    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!

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


    Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X

    Pic of the stuff on the left, and loading error.

    Name:  MPLABX first attempt.png
Views: 1565
Size:  98.9 KB

    Name:  MPLABX first attempt b.png
Views: 1492
Size:  17.7 KB
    Last edited by Demon; - 4th April 2023 at 02:29.

  3. #3
    Join Date
    May 2013
    Location
    australia
    Posts
    2,389


    Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X

    to the best of my knowledge the last mplabx that was pbp3 compliant was ver 2.35 [and just barely at that] , from ver 5.5 on
    mplabx no longer uses the mpasm [mpasmwin] assembler that pbp can only compile from
    Warning I'm not a teacher

  4. #4
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,598


    Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X

    Then I don't get at all why we can select PBP3 as compiler without getting some sort of incompatibility warning...?

    (distant sound of rummaging in a box for MCS+...)

    Oh great, MCS+v4 isn't compatible with PBP3, I'd need MCS+ v5.

    Might as well check if I can use PICKIT4 with that...
    Last edited by Demon; - 4th April 2023 at 02:53.
    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!

  5. #5
    Join Date
    May 2013
    Location
    australia
    Posts
    2,389


    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

    its compatible in that smoke is not released when connected
    Warning I'm not a teacher

  6. #6
    Join Date
    May 2013
    Location
    australia
    Posts
    2,389


    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

    Might as well check if I can use PICKIT4 with that...
    i use mplabx 5.50 with my pk4 , i use mplabx_ipe to pgm with, there probably is a cmdline version that
    mcs could use but i cannot be bothered fussing with that junk any longer
    Warning I'm not a teacher

  7. #7
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,598


    Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X



    Aaaaaaand I learn on google that MPLAB and MPLAB X is not the same thing. I always thought MPLAB X was just a latest thing, apparently it's not.

    Found a post by Acetronics on MeLabs that points to MPLAB.

    https://support.melabs.com/forum/pic...=8877#post8877

    Gonna try that and see how things go.
    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!

  8. #8
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,598


    Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X

    i use mplabx 5.50 with my pk4 , i use mplabx_ipe to pgm with, there probably is a cmdline version that
    mcs could use but i cannot be bothered fussing with that junk any longer
    Ok, so my dream of using PBP3, MPLAB X and PICKIT4 are not extinguished ... yet.

    I must be missing some setting in MPLAB X, or a file somewhere...

    These are fresh installs.

    I don't want to go back to MCS+, that whole "license only good for a year" bugs me.
    Last edited by Demon; - 4th April 2023 at 03:07.
    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!

  9. #9
    Join Date
    May 2013
    Location
    australia
    Posts
    2,389


    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

    Ok, so my dream of using PBP3, MPLAB X and PICKIT4 are not extinguished ... yet.
    mplabx is not a viable ide for pbp3. its useful to get mpasm and the mplab ipe only for mcs use.
    if you want to use it as an ide for pbp3 then use ver 2.35 or older , none of which will allow use a pk4 of course

    or use xc8 "C" with latest mplabx
    Warning I'm not a teacher

  10. #10
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,598


    Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X

    Quote Originally Posted by richard View Post
    mplabx is not a viable ide for pbp3. its useful to get mpasm and the mplab ipe only for mcs use.
    if you want to use it as an ide for pbp3 then use ver 2.35 or older , none of which will allow use a pk4 of course

    or use xc8 "C" with latest mplabx
    Yeah, just found out the latest MPLAB stops at PICKIT3. What a freaking mess.

    Name:  MPLAB first attempt.png
Views: 1403
Size:  38.3 KB

    I was out of the game for nearly 15 years; the talk of losing MPASM confused me. I thought they were talking about PM, so I just hunched my shoulders and kept on trying.

    Going to dish out $50 for MCS+ v5 and give that a try. At least they seem intent on supporting us for now.

  11. #11
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,598


    Did you find this post helpful? Yes | No

    Exclamation Re: Stuck on first attempt using MPLAB X

    So I get MCS+ v5, compiles like a charm, things are so simple again, tried to program, no PICKIT4 from dropdown.

    Name:  MCS+5 first attempt.png
Views: 1349
Size:  79.3 KB

    ARGH...

  12. #12
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,598


    Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X

    Quote Originally Posted by richard View Post
    mplabx is not a viable ide for pbp3. its useful to get mpasm and the mplab ipe only for mcs use.
    if you want to use it as an ide for pbp3 then use ver 2.35 or older , none of which will allow use a pk4 of course

    or use xc8 "C" with latest mplabx

    Ah, that's why you use MPLAB IPE, as a programmer software to use PICKIT4. I don't get how you do in-circuit debugging though...?

    MPLAB IPE keeps saying
    The configuration is set for the target board to supply its own power but no voltage has been detected on VDD. Please ensure you have your target powered up and try again.
    My Lab-X1 is powered, the LCD displays the old text from my last project on it. I must have something wired wrong, or I'm not configuring the IPE properly.

    Gonna check that tomorrow. Time for bed. I can't even imagine how confusing this must be for newcomers.
    Last edited by Demon; - 4th April 2023 at 05:26.
    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!

  13. #13
    Join Date
    May 2013
    Location
    australia
    Posts
    2,389


    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

    The configuration is set for the target board to supply its own power but no voltage has been detected on VDD. Please ensure you have your target powered up and try again.
    Name:  ipe.jpg
Views: 1381
Size:  116.7 KB

    the only over priced dev boards i have are a easypic7 and a handful of curiosity boards [ i usually home brew them ] so you are on your own re dev board connections and settings.
    I don't get how you do in-circuit debugging though...?
    that has been impossible since mplabx 2.35 [for a poor result] , you need to go back to mplab to do it well


    xc8 is the answer , forget pbp
    Last edited by richard; - 4th April 2023 at 06:02.
    Warning I'm not a teacher

  14. #14
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    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

    If you want all the goodies a modern IDE provides, as Richard noted, forget ancient basic laguage. Go for a new C compiler that supports all new and wonderfull PIC that i wish could use right now. Such as the 18F06Q41.

    But PBP3.1 can work with MPLABX 5.35, not beyond that version.

    There are other compilers, for example Swordfish that supports only 18F series, but is updating regularly the PIC that it supports. Also Proton Compiler is also a nice solution as it gets support by a large group of users and supports even dsp and 24 series.

    I am very sorry to say that PBP is dead and we have to accept that. It won't evolve any more. It was a great compiler and could be the greater of all but people are getting old, retired or leaving this vain world...

    Ioannis

  15. #15
    Join Date
    May 2013
    Location
    australia
    Posts
    2,389


    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

    re icsp directly from mcs see below, a snap is pretty much a pk4, microchip cmd-line i/f for programmers is pretty standard(ish) [for microchip]
    not difficult just awkward
    https://www.picbasic.co.uk/forum/sho...t=command+line
    also
    https://support.melabs.com/forum/pic...ity-board-pkob

    and hardly worth the effort
    Warning I'm not a teacher

  16. #16
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,598


    Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X

    Thanks for the links Richard!


    UPDATE:

    I've since simpified things further to a single blink using internal oscillator.

    Code:
    #CONFIG
        __config _HS_OSC & _WDT_OFF & _WRT_ON & _BODEN_ON & _LVP_OFF  & _CPD_OFF & _PWRTE_OFF & _DEBUG_OFF
    #ENDCONFIG
    
    DEFINE  OSC     4
    
    ADCON1 = 7              ' A/D off, all digital
    
    TRISD = %00000000
    
    LED0    VAR     PortD.0
    
            LOW LED0
    
    START:  HIGH    LED0
            PAUSE   500
            LOW     LED0
            GOTO    START
    
    Finish: end
    I've added a custom programmer in MCS+5 using the instructions for IPECMD.EXE.

    I now compile and program in MCS+5. A black command box appears, everything seems normal, than FLASH, a message shows up for a millisecond about HEX FILE NOT FOUND (pretty sure that's what it says).

    Not sure what's going on, cause I delete all objects in my folder except the source right before I compile, just to make sure everything gets created. The HEX and ASM are right there, I opened them, they look "normal".

    The light stays blue on the PICkit4; it doesn't go red like when I tried with MPLAB IPE. I must be messing up my connection to the adapter board. I also remember reading about resistors and capacitors for the PK4, gotta find that again...

    UPDATE SOME MORE:

    I went back to update the command line to keep the command line window open like this.

    And I noticed that it's not letting me complete the EDIT process, the NEXT button doesn't come on, I must have missed that the first time around.

    Name:  PICkit4 custom pgmer.png
Views: 1284
Size:  9.5 KB
    Last edited by Demon; - 4th April 2023 at 16:12.
    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!

  17. #17
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,598


    Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X

    So I deleted and created the custom programmer again and paid attention to the NEXT button.

    Code:
    -TSBUR223673449 -P$target-device$ -F$hex-filename$ -E -M -Y -OL -OB
    Nope, NEXT button never comes on, and the command line seems complete if I EDIT the programmer again.

    Name:  PICkit4 custom pgmer B.png
Views: 1364
Size:  24.2 KB

    I compile and program again, I see HEX FILE NOT FOUND blink, and the command line window keeps closing despite the new command line.

    Via the PICKit3 programmer
    -TSBUR171738083 -P$target-device$ -F$hex-filename$ -E -M -Y -OL -OB
    or
    -TPPK3 -P$target-device$ -F$hex-filename$ -E -M -Y -OL -OB

    Command Line Options:
    -E erase before programming
    -M program entire memory
    -Y verify after programming
    -OL release from reset
    -OB batch mode (leaves cmd line window open)
    I'm starting to think the command lines for the PK4 are different...?

  18. #18
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,598


    Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X

    I started a thread over at MeLabs with my latest findings.

    Hoping someone there can fix me up; I bought my PK4 and MCS+5 from them.

    https://support.melabs.com/forum/pic...-5-and-pickit4

  19. #19
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X

    I am sorry for the troubles you face Robert.

    I do not have Pickit4 (yet) and for the 2 or 3 I use a very nice standalone program (https://pickitplus.co.uk).

    I asked if they will support Pickit 4 too. Will report back.

    I think you can update you PBP license to the latest 3.1.6. See melabs site.

    Ioannis

  20. #20
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,598


    Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X

    Quote Originally Posted by Ioannis View Post
    I am sorry for the troubles you face Robert.

    I do not have Pickit4 (yet) and for the 2 or 3 I use a very nice standalone program (https://pickitplus.co.uk).

    I asked if they will support Pickit 4 too. Will report back.

    I think you can update you PBP license to the latest 3.1.6. See melabs site.

    Ioannis
    Yeah, but I've already spent enough and can't even get a blinky working. Updating PBP isn't going to get this solved either, and I'm not likely to use whatever chip they've added since v3.0.8.4.

    Hoping to get some help from MeLabs.

  21. #21
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X

    Its free for you!

    Ioannis

  22. #22
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,598


    Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X

    Quote Originally Posted by Ioannis View Post
    Its free for you!

    Ioannis
    Nope, $50. Or am I missing out on "special promotion to forum moderators"?

    https://store.melabs.com/cat/PBPUP.html
    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!

  23. #23
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X

    Well, there is no moderator offer.

    Did you try to down load and install the later version and then auto activate it?

    I do not really remember when was my upgrade that I had to pay. Then on, I just updated the compiler and it auto activated.

    Ioannis

  24. #24
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,598


    Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X

    I was missing a pull-up on MCLR, and my soldering job was dodgey. I made a new harness, looks much nicer.

    Still going nowhere in MCS+5; keep seeing HEX FILE MISSING before the command line window closes.


    Managed to program using MPLAB IPE, I just don't get any blinky action on my Lab X-1.

    Connecting to MPLAB PICkit 4

    Currently loaded versions:
    Application version...........00.08.54
    Boot version..................01.00.00
    Script version................00.05.35
    Script build number...........86fedc5c2e
    Tool pack version ............1.13.1519
    PICkit 4 is supplying power to the target (5.00 volts).
    Target device PIC16F877 found.
    Device Revision Id = 0x6
    Device Id = 0x9a0
    2023-04-04 19:42:56 -0400 - Programming...
    ************************************************** ***
    Calculating memory ranges for operation...

    Erasing...

    The following memory area(s) will be programmed:
    program memory: start address = 0x0, end address = 0x39
    configuration memory

    Programming/Verify complete
    2023-04-04 19:42:59 -0400 - Programming complete
    *** Release From Reset mode is enabled ***
    I'm gonna set up a breadboard, got a feeling something is wonky on my Lab-X1 (either OSC setting, jumpers, or that programmer header.

  25. #25
    Join Date
    Aug 2011
    Posts
    412


    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

    Get rid of the config DEBUG_ON.
    If you ever get to the point of hdw debugging that will be managed by the tool for you.

    Also, when you were creating the IDE custom programmer entry, once you get to the step of setting the parameters there is no "Next" step... just "Finish"

  26. #26
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,598


    Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X

    Quote Originally Posted by tumbleweed View Post
    Get rid of the config DEBUG_ON.
    If you ever get to the point of hdw debugging that will be managed by the tool for you.

    Also, when you were creating the IDE custom programmer entry, once you get to the step of setting the parameters there is no "Next" step... just "Finish"

    Thanks, had already turned it off. Waiting for a reply from MeLabs forum to get the custom programmer working in MCS+5.


    Kept playing with the Lab X-1 and MPLAB IPE, played with OSC, added PORT, used bits like I did in one of my programs; now the proper LED comes on, but no blinking on the Lab X-1.

    Code:
    #CONFIG
        __config _HS_OSC & _WDT_OFF & _WRT_OFF & _BODEN_ON & _LVP_OFF  & _CPD_OFF & _PWRTE_OFF & _DEBUG_OFF
    #ENDCONFIG
    
    DEFINE  OSC     20
    
    ADCON1 = 7              ' A/D off, all digital
    
    PORTD = %00000000
    TRISD = %00000000
    
    START:  PORTD = %00000001
            PAUSE   500      
            PORTD = %00000000
            GOTO    START
    
    Finish: end
    Tried using another PIC just in case, no difference.

    But get this, I copied an old example of writing to the LCD and that worked, a bit wonky, but I can't get a solitary LED to blink.

  27. #27
    Join Date
    May 2013
    Location
    australia
    Posts
    2,389


    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

  28. #28
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,598


    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.

  29. #29
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    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

  30. #30
    Join Date
    Aug 2011
    Posts
    412


    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.

  31. #31
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,598


    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.

  32. #32
    Join Date
    Aug 2011
    Posts
    412


    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

  33. #33
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,598


    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!

  34. #34
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,598


    Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X

    This worked in IPE, then I played with the options, and now it gives the same error in IPE.

    So I thought I might have bricked my 16F877 with either the E - Erase flash device or M - Entire region programmed (I'm new to these command line parameters, never had to touch that before).

    I tried without -E and -M on another 16F877; same error. So something else is going on.

    I put my first 16F877 on the Lab X-1 and it's still blinking; so it's not bricked.
    Last edited by Demon; - 7th April 2023 at 03:30.

  35. #35
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,598


    Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X

    This is my post over on MeLabs support forum:

    Grabbing at straws, I had removed spaces in my folder names, didn't do anything; unplugged/plugged PK4, didn't do anything. I kept getting the same error from MCS+5 and from direct command line window.

    Desperate, so I did what any rinky-dink customer support would say and rebooted my PC ... and it worked.

    Code:
    DFP Version Used : PIC16Fxxx_DFP,1.3.42,Microchip
    Selected Programming Tool Sno:
    BUR223673449
    *****************************************************
    Connecting to MPLAB PICkit 4
    Currently loaded versions:
    Application version...........00.08.54
    Boot version..................01.00.00
    Script version................00.05.35
    Script build number...........86fedc5c2e
    Tool pack version ............1.13.1519
    PICkit 4 is supplying power to the target (5.00 volts).
    Target device PIC16F877 found.
    Device Revision Id *= 0x6
    Device Id = 0x9a0
    *****************************************************
    Erasing...
    Erase successful
    *****************************************************
    Calculating memory ranges for operation...
    Erasing...
    The following memory area(s) will be programmed:
    program memory: start address = 0x0, end address = 0x3d
    configuration memory
    Programming/Verify complete
    *Program Report
    06-Apr-2023, 23:01:53
    Device Type:PIC16F877
    Program Succeeded.
    PK4 Verify Report
    06-Apr-2023, 23:01:53
    Device Type:PIC16F877
    *****************************************************
    The following memory area(s) will be verified:
    program memory: start address = 0x0, end address = 0x1fff
    configuration memory
    EEData memory
    User Id Memory
    Verification successful.
    Verify Succeeded.
    *****************************************************​
    I don't know why.


    This is my final command line:

    Code:
    -TSBUR223673449 -P$target-device$ -F$hex-filename$ -E -M -OB -OL -OV -W -Y

    Generic PK4 tool works just as well.

    Code:
    -TPPK4 -P$target-device$ -F$hex-filename$ -E -M -OB -OL -OV -W -Y


    Big thanks to Richard and Tumbleweed for their ideas, and to Ioannis for cheering me on.
    Last edited by Demon; - 7th April 2023 at 04:11.

  36. #36
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    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

    Very glad you did it!

    Remember to use MPLABX 5.35 assembler for PBP.

    Ioannis

  37. #37
    Join Date
    Aug 2011
    Posts
    412


    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

    All of the "Transmission on endpoint 2 failed (err = -109)" messages typically indicate that the PK4 wasn't fully updated.

    There are three parts to the firmware inside the PK4, and whenever you change MPLABX versions it's important that all three sections get updated to match the version of MPLABX you're using. This applies to a PK4 right out of the box since there's a good chance it was built with a different set of firmware than the version you're trying to use (you'd think a brand new one would work, but no).

    This is supposed to happen automatically, but on all the PC's I've ever used it doesn't... each time you open MPLABX IPE it'll update one part and then hang. You have to let it timeout, close MPLABX, reopen it and it'll proceed to the next part. It takes about three or four whacks at this until it finally loads all the firmware and magically everything works. During this process I've seen MPLABX produce almost every conceivable bogus error message you can imagine.

    That's why you'll see a lot of posts about rebooting, unplugging the tool, closing/reopening etc. It doesn't always happen quite the same way, but for me it's been this way since day one with MPLABX and ANY of the programming tools. It's even worse if you have one of the older tools (PK2, PK3) and you switch back and forth between the old MPLAB 8.92 and MPLABX.

    It's a good idea to make sure the tool isn't connected to your target hardware while it does this dance, just the USB cable.

  38. #38
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,598


    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

    I updated my summary in post #1. Spaces in the folder/filename will most definitely cause problems.

    I wasn't sure cause I was trying more than one thing at a time. But I am now; it just back and bit me. The command window just flashes and it's gone.

Similar Threads

  1. My serial to parallel attempt
    By johndoug in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 4th January 2013, 04:15
  2. 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
  3. MPLAB Quickbuild stuck on
    By RichardBowser in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 9th July 2006, 02:52
  4. switches & LEDs ... my first attempt
    By yankee in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 28th January 2006, 12:51
  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 : 1

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