Author Topic: Can anyone help with a PIC16F636 program??  (Read 2605 times)

Govmnt_Lacky

Can anyone help with a PIC16F636 program??
« on: September 25, 2020, 08:55:40 AM »
I have a BIN file for a PIC16F636 that I need to modify. Problem is... I have no earthly idea how to modify it, where to start, etc. I know what I want done to change the functions of the PIC. I have a PicKIT2 system.

Can anyone walk me through it or assist me in making the changes?

Any help is appreciated. Thanks!  8)
A Veteran is someone who, at one point in his or her life, wrote a blank check made payable to The United States of America
for an amount of up to and including my life.

ElectricDruid

Re: Can anyone help with a PIC16F636 program??
« Reply #1 on: September 25, 2020, 04:27:56 PM »
I've not come across .bin files being used for PIC stuff. The Microchip tools produce .hex files for burning to the chip. Still, it's probably the same thing.

Assuming it is...

You've got a wonderful world awaiting you! You have to disassemble the file to get back to mnemonics. Since the code will have lost any identifiers (like comments, address labels, or constant names, or other useful stuff the compiler lets you do) you're stuck with a load of hex numbers. You'll have to work out from the code itself what the variable names should be, what the sections are, what the look-up tables mean, etc etc etc. It's not *impossible* to reconstruct source code like this, but it's tedious and time-consuming.

What does the code do? What does it need to do once modified? Honestly, you might find it quicker and easier to start from scratch if it's not something super-sophisticated.

Ice-9

Re: Can anyone help with a PIC16F636 program??
« Reply #2 on: September 26, 2020, 01:55:17 PM »
Yeah the .bin file is like the .hex file which is a compiled version of the program and pretty useless unless you can decompile the file into a meaningful program. Do you also have a .asm file as this is what will make editing much easier as it is the machine code for the PIC chip.  If you only have the .bin or .hex it is still possible to get to some sort of useful code with a pic decompiler.
www.stanleyfx.co.uk

Sanity: doing the same thing over and over again and expecting the same result. Mick Taylor

Please at least have 1 forum post before sending me a PM demanding something.

Govmnt_Lacky

Re: Can anyone help with a PIC16F636 program??
« Reply #3 on: September 26, 2020, 03:47:42 PM »
Currently I am using the PIC as a 5V controller and distributor. My problem with the program right now is that a few of the 5V outputs are ON constantly and I only want them on for 1-2 seconds upon command.

I know I have the BIN file. I may have the HEX file but I need to look for it (its been a while since I got it) other than that... Im certain I dont have any other formats.
A Veteran is someone who, at one point in his or her life, wrote a blank check made payable to The United States of America
for an amount of up to and including my life.

potul

Re: Can anyone help with a PIC16F636 program??
« Reply #4 on: September 27, 2020, 01:12:57 PM »
I found this somewhere in Internet...

Quote
A simple approach to disassembly would be to simply load your HEX file into MPLAB and select View->Disassembly Listing, then right-click the windows and select "Output to File". This output may need some massaging for it to be suitable for input to an assembler.

looks like you can disassemble directly in MPLAB.

Govmnt_Lacky

Re: Can anyone help with a PIC16F636 program??
« Reply #5 on: September 28, 2020, 08:57:21 AM »
I appreciate the replies and help guys! I think I may have to shelf this for now. Just do not have the time to learn how to do all this from scratch. When it comes to programming PICs, I have ZERO knowledge on the subject.  :(
A Veteran is someone who, at one point in his or her life, wrote a blank check made payable to The United States of America
for an amount of up to and including my life.

Govmnt_Lacky

Re: Can anyone help with a PIC16F636 program??
« Reply #6 on: September 30, 2020, 07:24:08 AM »
If anyone can walk me through it or, wants to take a crack at it... let me know  ;)
A Veteran is someone who, at one point in his or her life, wrote a blank check made payable to The United States of America
for an amount of up to and including my life.

potul

Re: Can anyone help with a PIC16F636 program??
« Reply #7 on: September 30, 2020, 07:59:50 AM »
I have never disassembled a PIC bin, but I have experience in PIC ASM. If you want to give it a try just let me know and I can try to guide or help.

First thing should be to find a way to convert the bin file to hex. And find a disassembler for it.

I have an old MPLAB installed in a virtual machine, but I don't know if it has the "disassemble" function of MPLABX. I can try to investigate

potul

Re: Can anyone help with a PIC16F636 program??
« Reply #8 on: September 30, 2020, 09:27:03 AM »
What can happen is that after getting working ASM, maybe it's so complex that we don't know how to modify it....

Govmnt_Lacky

Re: Can anyone help with a PIC16F636 program??
« Reply #9 on: September 30, 2020, 10:29:52 AM »
I have never disassembled a PIC bin, but I have experience in PIC ASM. If you want to give it a try just let me know and I can try to guide or help.

First thing should be to find a way to convert the bin file to hex. And find a disassembler for it.

I have an old MPLAB installed in a virtual machine, but I don't know if it has the "disassemble" function of MPLABX. I can try to investigate

I was able to find the HEX file for the PIC. I guess I used the PickIT2 GUI to convert from HEX to BIN and saved it and have been using that ever since.
A Veteran is someone who, at one point in his or her life, wrote a blank check made payable to The United States of America
for an amount of up to and including my life.

potul

Re: Can anyone help with a PIC16F636 program??
« Reply #10 on: October 01, 2020, 03:24:22 AM »
good, if you can send me the HEX file I can try to disassemble and we start from there.

I have a freeware disassembler for PICs and MPLAB installed. I will try both methods and see what is the result.

« Last Edit: October 01, 2020, 03:42:26 AM by potul »

Govmnt_Lacky

Re: Can anyone help with a PIC16F636 program??
« Reply #11 on: October 01, 2020, 07:32:51 AM »
good, if you can send me the HEX file I can try to disassemble and we start from there.

I have a freeware disassembler for PICs and MPLAB installed. I will try both methods and see what is the result.

PM'd
A Veteran is someone who, at one point in his or her life, wrote a blank check made payable to The United States of America
for an amount of up to and including my life.

Henderson95

Re: Can anyone help with a PIC16F636 program??
« Reply #12 on: March 02, 2021, 05:38:22 AM »
The gadget and update information is put away in the Device ID situated at 2006h in program memory.

potul

Re: Can anyone help with a PIC16F636 program??
« Reply #13 on: March 02, 2021, 08:34:51 AM »
spambot?

garcho

Re: Can anyone help with a PIC16F636 program??
« Reply #14 on: March 09, 2021, 09:56:47 AM »
So many lately
  • SUPPORTER
"...and weird on top!"