Hot!Converting hex file into MPLAB project

Page: 12 > Showing page 1 of 2
Author
Alex160
New Member
  • Total Posts : 10
  • Reward points : 0
  • Joined: 2018/02/24 13:36:26
  • Location: 0
  • Status: offline
2018/04/15 12:48:08 (permalink)
0

Converting hex file into MPLAB project

Hello,
I've many PIC programs manually developed (hand-made, byte after byte).
Then I only have hex files for these programs.
How can I convert these hex files into an MPLAB IDE projects ?
For each hex file, is it possible to "rebuild" a source file ?
 
Alex
#1

23 Replies Related Threads

    vloki
    Jo, alla!
    • Total Posts : 6761
    • Reward points : 0
    • Joined: 2007/10/15 00:51:49
    • Location: Germany
    • Status: offline
    Re: Converting hex file into MPLAB project 2018/04/15 12:55:18 (permalink)
    +1 (1)
    Alex160
    Hello,I've many PIC programs manually developed (hand-made, byte after byte)
    Really?

    Uffbasse !
    #2
    qɥb
    Monolothic Member
    • Total Posts : 3329
    • Reward points : 0
    • Joined: 2017/09/09 05:07:30
    • Location: Jupiter
    • Status: offline
    Re: Converting hex file into MPLAB project 2018/04/15 13:17:07 (permalink)
    +1 (1)
    Forgive our doubt, but that's not how beginners work.
    This sounds much more like someone trying to rip off someone else's code.
     

    This forum is mis-configured so it only works correctly if you access it via https protocol.
    The Microchip website links to it using http protocol. Will they ever catch on?
    PicForum "it just works"
    #3
    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 2670
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: offline
    Re: Converting hex file into MPLAB project 2018/04/15 13:43:53 (permalink)
    0
    I'm calling you out on that one.
    Not hand writing in the 21st and you can not get source from that only mnemonics.
     
    I would have done that when writing 6502 code when I didn't have an assembler on a Superboard which I believe was a Nascom II.

    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #4
    katela
    Super Member
    • Total Posts : 956
    • Reward points : 0
    • Joined: 2013/06/11 05:25:18
    • Location: South Africa
    • Status: online
    Re: Converting hex file into MPLAB project 2018/04/15 14:17:44 (permalink)
    0
    Alex160
    I've many PIC programs manually developed (hand-made, byte after byte).

    That's super fantastic "hand-made, byte after byte".
    Maybe you can still modify them byte after byte.. No need to rebuild them.

    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/user/StudentCompanionSA
    #5
    rodims
    Super Member
    • Total Posts : 1354
    • Reward points : 0
    • Joined: 2009/02/10 11:08:59
    • Location: 51.9627, 7.6262
    • Status: online
    Re: Converting hex file into MPLAB project 2018/04/15 15:10:14 (permalink)
    0
    I also hand coded assembly programs by entering HEX codes for SCMP II, 6502 and Z80 (thanks Rodnay Zaks) , when I had no PC (not yet invented) or CPM System to cross assemble any source files (if there was a file system at all). 
    But that was another time, and why should you have done that if the Microchip assembler was already available ?
     
    How did you encode the HEX file ? How did you program the PIC with a hex file ?
    post edited by rodims - 2018/04/15 15:17:47
    #6
    Ivan Cenov
    Super Member
    • Total Posts : 274
    • Reward points : 0
    • Joined: 2003/11/07 12:36:51
    • Location: Bulgaria
    • Status: offline
    Re: Converting hex file into MPLAB project 2018/04/15 22:25:23 (permalink)
    +2 (2)
    Hi,
    You may create new project in MPLAB X, (File.New Project...) and select "Prebuilt (Hex, Loadable image) Project. Then on Next dialog you select the usual things - controller, hardware tools, and Prebuilt file. However, this will not give you source code.
    #7
    Alex160
    New Member
    • Total Posts : 10
    • Reward points : 0
    • Joined: 2018/02/24 13:36:26
    • Location: 0
    • Status: offline
    Re: Converting hex file into MPLAB project 2018/04/16 12:53:49 (permalink)
    0
    Thanks for all your answers.
    At the begining, i had a basic PIC programmer (PIC-01 if i remember well). After entering all bytes manually, an export functionality gave me an hex file. With basic PICs, a simple Excel sheet could be used as compiler.
    And when each nano or micro second counts, sometimes, hand-coding is better than compiling...
    Now, due to new century, i have MPLAB and PM3 board. Then I want to transfer all these programs in this "up-to-date" environment. That's why hex to project conversion interests me so much !
     
    Ivan, i've tried to create a new project and select Prebuild. The code is loaded but I can not perform any changes.... maybe something wrong in compiler configuration.
     
    Alex
    (leposte160.free.fr)
     
    #8
    NKurzman
    A Guy on the Net
    • Total Posts : 16455
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: Converting hex file into MPLAB project 2018/04/16 13:06:14 (permalink)
    0
    You can look at the disassembly window, but it will not save the disassemble as a new editable file.
    You would need to find a PIC Dis-assembler.  If you only need to change a Byte or two, then MPLab8 maybe a better choice.  The PIC ASM was free back then, your past self should have used it.
    #9
    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 2670
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: offline
    Re: Converting hex file into MPLAB project 2018/04/16 13:28:49 (permalink)
    +1 (1)
    Why not just type in the mnemonics and operands?
    Cut and paste the code that you have.
     
    "And when each nano or micro second counts, sometimes, hand-coding is better than compiling"
    Err, no.  It's assembled, not compiled, the code you enter in asm is the code that goes in the chip.
    No optimization going on.  The datasheet has the cycles.
     
    You've created hard work, I did that sort of thing decades ago.
    I ended up writing my own assemblers in assembly / machine code.
     
    On my Superboard I manually typed in the hex codes but that is what you had to do then.

    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #10
    vloki
    Jo, alla!
    • Total Posts : 6761
    • Reward points : 0
    • Joined: 2007/10/15 00:51:49
    • Location: Germany
    • Status: offline
    Re: Converting hex file into MPLAB project 2018/04/17 00:39:30 (permalink)
    +1 (1)
    Alex160
    Ivan, i've tried to create a new project and select Prebuild. The code is loaded but I can not perform any changes.... maybe something wrong in compiler configuration.

    There is nothing wrong. It is not possible to do what you want in a direct way!
    You can start a debug session with the simulator and view the program memory then.
    There you can export disassembly code to a file. With the content you can start to play...
     
    Maybe read this older thread.

    Attachment(s)

    Attachments are not available: Download requirements not met

    Uffbasse !
    #11
    crosland
    Super Member
    • Total Posts : 1257
    • Reward points : 0
    • Joined: 2005/05/10 10:55:05
    • Location: Bucks, UK
    • Status: offline
    Re: Converting hex file into MPLAB project 2018/04/17 00:59:02 (permalink)
    0
    Gort2015
    I would have done that when writing 6502 code when I didn't have an assembler on a Superboard which I believe was a Nascom II.

     
    Superboard != Nascom and Nascoms were Z80.
    #12
    JorgeF
    Super Member
    • Total Posts : 3290
    • Reward points : 0
    • Joined: 2011/07/09 11:56:58
    • Location: PT/EU @ Third rock from the Sun
    • Status: offline
    Re: Converting hex file into MPLAB project 2018/04/17 05:02:04 (permalink)
    +1 (1)
    Hi
     
    This brings to memory my beginings at the University.
     = Second semester =
    Started with this one http://oldcomputers.net/pics/intel-mcs-85.jpg
    Step 1 - Write ASM program, same as today but in paper.
    Step 2 - Assemble the program, to hex in paper. Do it by hand with the help an instruction table, also in paper.
    Step 3 - Fill in RAM with the hex from step 2 (generated more errors than the previous steps).
    Step 4 - Test - If it doesn't work go back to step 1
    = Third semester =
    Someone discovered the kit has a serial port (TTL) compatible with a dumb terminal (prior to VT100).
    Things become  a little easier, we could fill in the RAM with a better keyboard, a full screen line at a time.
     
    We, a work group of 3, added an RS-232 interface (level converter) to the kit to connect it with a TRS-80 model II.
    Next step to wrote a program in PASCAL over CP/M to communicate mimic the human at the dumb terminal. Now we can save our work in 8" floppies and load the kit faster with less errors.
    As the instruction set / assembly code of the Z80 on the TRS-80 is compatible with the i8085, it only took a few macros to be able to write the code on the TRS-80, use the Z80 macro assembler to build it, and then load the programs in the kit.
    And that was "Heaven". grin: grin
     
     
    Best regards
    Jorge
     
     
    #13
    JorgeF
    Super Member
    • Total Posts : 3290
    • Reward points : 0
    • Joined: 2011/07/09 11:56:58
    • Location: PT/EU @ Third rock from the Sun
    • Status: offline
    Re: Converting hex file into MPLAB project 2018/04/17 05:04:05 (permalink)
    0
    Hi
     
    Back to thr OP question.
    What PIC, hoew many programs and program sizes are we talking about?
    At least for the old 16 PICs its quite easy to write a disassembler.
     
     
    Best regards
    Jorge
     
     
    #14
    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 2670
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: offline
    Re: Converting hex file into MPLAB project 2018/04/17 06:40:49 (permalink)
    0
    crosland
    Gort2015
    I would have done that when writing 6502 code when I didn't have an assembler on a Superboard which I believe was a Nascom II.

     
    Superboard != Nascom and Nascoms were Z80.


    It was a long time ago!
    I remember I wanted a Nascom but got a Superboard II for xmas.

    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #15
    vloki
    Jo, alla!
    • Total Posts : 6761
    • Reward points : 0
    • Joined: 2007/10/15 00:51:49
    • Location: Germany
    • Status: offline
    Re: Converting hex file into MPLAB project 2018/04/17 07:54:31 (permalink)

    Uffbasse !
    #16
    Jim Nickerson
    User 452
    • Total Posts : 5294
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: Converting hex file into MPLAB project 2018/04/17 08:04:57 (permalink)
    0
    I started building this one from a kit https://en.wikipedia.org/wiki/IMSAI_8080
    #17
    vloki
    Jo, alla!
    • Total Posts : 6761
    • Reward points : 0
    • Joined: 2007/10/15 00:51:49
    • Location: Germany
    • Status: offline
    Re: Converting hex file into MPLAB project 2018/04/17 08:20:39 (permalink)
    0
    JorgeF
    Started with this one http://oldcomputers.net/pics/intel-mcs-85.jpg

    Wanna have one? 10 minutes ago there was an offer in a German forum ;-)
    (2nd offer)

    Uffbasse !
    #18
    NKurzman
    A Guy on the Net
    • Total Posts : 16455
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: Converting hex file into MPLAB project 2018/04/17 09:06:24 (permalink)
    0
    I wrote an 8085 ASM in Basic on a Commodore 64
    #19
    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 2670
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: offline
    Re: Converting hex file into MPLAB project 2018/04/17 09:27:46 (permalink)
    0
    I wrote a Z80 assembler for the Amstrad 464C.
    Wrote it in Basic first then replaced with assembler.
     
    I also extended the Basic instruction set to include assembler and for good measure increased the resolution of the bitmapped display fonts.
     
    It was super fast.  Long programs assembled in a few seconds.
     
    When I bought C++ for the PC, it came in a massive box with 12 ref. books and 20+ disks.
    That was all the libraries/C++/assembler/utilities/linker.
    Good to have the physical books.

    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #20
    Page: 12 > Showing page 1 of 2
    Jump to:
    © 2018 APG vNext Commercial Version 4.5