1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

exporting hex file w/ pickit2

Discussion in 'Microcontrollers' started by MrDEB, Aug 21, 2017.

  1. MrDEB

    MrDEB Active Member

    Joined:
    Apr 16, 2007
    Messages:
    4,364
    Likes:
    22
    attempted to locate a hex file to program 8 pics but could not locate.
    Luckily I have an extra chip that was programmed w/ hex file needed BUT!!
    I import the hex file from the pic and a yellow error message says that the file is too large. Went ahead and programmed the pic anyway and it says a successful write to the pic. Powered the pic w/ test board and all seems to work.
    Wonder why it had an error about being too large of a file?? or perhaps has something to do with the hex file import??
     
  2. JonSea

    JonSea Well-Known Member

    Joined:
    Oct 1, 2012
    Messages:
    1,119
    Likes:
    90
    Location:
    Seattle, WA
    There are so many things wrong with the above, it makes my head hurt.

    "attempted to locate a hex file to program 8 pics but could not locate." - I presume this is YOUR hex file. It should be in the same directory as your source code. If you deleted it or something, why not recompile from your source code? Or didn't you save the working version?

    "I import the hex file from the pic and a yellow error message says that the file is too large." - If you get an error message, Do Not Pass Go. Do Not Collect $200. Something is wrong and unless you can explain it, it absolutely will come back to bite you in the ass...or more likely the guy you conned into this project.

    When you say import, do you mean you read the code from the programmed PIC? There is no option to import from a PIC.

    What you could do is read the file from the original chip, and then click Verify on the PICkit 2 GUI. This verifies the file against what's in the chip. If it verifies, it's ok.

    MDIAI-PICKIT2 Shot.jpg MDIAI-PICKIT2 Shot.jpg
     
  3. MrDEB

    MrDEB Active Member

    Joined:
    Apr 16, 2007
    Messages:
    4,364
    Likes:
    22
    I looked in the folders with my original code but having several different versions and nothing looked right.
    The error message was in yellow so yellow is caution. I programmed the pics and each one says successful programmed.
    I ran each pic on a board and no issues arose, everything worked as planned.
    Hopefully it all works as planned installed. Wonder if importing the hex file from one pic has some extra code or ??
    Time will tell after it is all installed. Thinking of experimenting with a different pic combo on a tap28 board and maybe it is something to do with using a clone pickit2??
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. JonSea

    JonSea Well-Known Member

    Joined:
    Oct 1, 2012
    Messages:
    1,119
    Likes:
    90
    Location:
    Seattle, WA

    I know you think I type this stuff because I can't sleep or I'm tired of I Love Lucy reruns, but no, the words have specific meanings.

    I explained exactly how to tell that tbe code read by the PICkit matches what's in the chip. I would strongly suggest you do this rather then just shrugging and sending the guy crap that may fail under some condition you haven't tested.

    But this isn't my clown show......
     
  6. granddad

    granddad Active Member

    Joined:
    Jan 18, 2015
    Messages:
    750
    Likes:
    75
    Location:
    Worcestershire UK
    Mr D , would not the date on the .HEX file show the last build you did, or perhaps the "source" .asm file , just build it again.
     
  7. MrDEB

    MrDEB Active Member

    Joined:
    Apr 16, 2007
    Messages:
    4,364
    Likes:
    22
    I looked at all the source files and none of them have the entire code I am wanting. not sur if I can do a search with using the last date it was opened in Swordfish??
    Going to do a better search but wondering if the pic needed to be erased before loading a different hex file??
     
  8. JonSea

    JonSea Well-Known Member

    Joined:
    Oct 1, 2012
    Messages:
    1,119
    Likes:
    90
    Location:
    Seattle, WA
    Sigh. You really have a great immunity to extrapolating knowledge MrDEB. Truly magnificent.
     
  9. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,808
    Likes:
    135
    Location:
    morristown,tn
    If it's to big there something wrong. You can get the hex
    Code (text):

    pk2cmd -PPIC16Fxx -GF/home/my_user/my_program.hex
     
    PPIC16Fxx change for your chip
     
  10. MrDEB

    MrDEB Active Member

    Joined:
    Apr 16, 2007
    Messages:
    4,364
    Likes:
    22
    the chip is a 18f4321. connected up with 15 leds running on 5v and ran for 10-15 minutes. NO issues arose and the program selection rotary switch worked as did the ACD speed selection pot.
    I am still perplexed but it runs with no problems. The hex file shows 91KB
     
  11. JonSea

    JonSea Well-Known Member

    Joined:
    Oct 1, 2012
    Messages:
    1,119
    Likes:
    90
    Location:
    Seattle, WA
    In posts 2 and 4, i outlined how you could verify that the code received by the PICkit matchs what's in the PIC. This minute-long process would let you be certain the code matches exactly.
     
    Last edited: Aug 23, 2017
  12. MrDEB

    MrDEB Active Member

    Joined:
    Apr 16, 2007
    Messages:
    4,364
    Likes:
    22
    it matches
     
  13. JonSea

    JonSea Well-Known Member

    Joined:
    Oct 1, 2012
    Messages:
    1,119
    Likes:
    90
    Location:
    Seattle, WA
    Good. A simple test done the right way.
     

Share This Page