Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[PIC] PIC18f Configuration settings? Unable to run old running hex file.

Status
Not open for further replies.

dineshjpr14

Newbie level 4
Newbie level 4
Joined
Jun 24, 2014
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
49
I used MPLAB 8.76 for my program. It used to build successfully and run on controller.

I have the source code and working Hex file. I used Hitech Compiler for Pic18f46k80.


After two years, i have formatted my computer. When i again to try build my program

it does build successfully, but hex file is not running and my seven segment display not

working. Hardware is ok, i checked with old Hex file.


What could be reason for this behavior? I changed my configruation bits by reading

loading old hex file. And every setting matches. But when i compile it the new hex

file doesnt run.


One more observation is that size of nex hex file is coming 42 kB and size of old hex file

was 57 KB.

Please help? i am unable to use even i have source code and everything.

I have old compiled source code folder saved in rar file. So if any could suggest

solution to see .lst file or .map file, please do so.
 

One thing i can suggest you is that try to disable optimization and use lite version of hitech c.
Then compile you program and try to run it on your hardware.
And also make sure that the hex file has same size or approximately equal.
I am guessing that you have used freshly installed compiler which is running is pro mode and in this optimazation is enabled by default.
 

If you compile from the same source, using the same libraries and same compiler you should get the same hex file. I think Xpress_embedo is on the right track, the difference in size is because the optimizer is removing redundant code and searching for any duplicate sections it can merge. Normally that wouldn't stop the program running, only the size would be different but if you use software delay routines they may now run faster so the delays would be shorter and maybe that is enough to prevent it functioning.

Brian.
 

I tried in Lite mode.
I uninstalled the Hitech Compiler(pro Mode). Cleaned registeries using cccleaner then restarted computer. Cleaned registry again. Restarted computer again and then installed
hitech pic18 in Lite mode.
No luck Still the file is of same size ( 42 Kb, error hex file).


The configuration settings files are attached for comparison.
https://obrazki.elektroda.pl/2214542300_1403600213.jpg
https://obrazki.elektroda.pl/3925034100_1403600214.jpg

Kindly suggest suitable solution and ***** this mystery.

Also tell how to set optimization level. I suppose it is available in Pro mode and not available in lite mode.
 

The config files are different, the memory protection bits shouldn't make much difference but one uses the internal RC oscillator, the other uses the internal LP oscillator. these are quite different, to use the RC oscillator you need external time constant components to set the frequency, the LP oscillator is frequency trimmed and inside the PIC. This might acount for the program not running but I doubt it fully explains the file size differences.

The optimization levels are nothing to do with the source program or PIC settings, they set the methods used by the compiler to reduce code size or speed. I do not use Hitech compilers but I would guess the 'lite' has no optimization and the 'pro' has full optimization. The appeal of smaller faster code is what they use to make you buy the pro version.

Brian.
 

Any solutions guys? I don't have the hardware, it is at customer end. I can't debug properly. Source code i have and i can send them to customer to test it. Newly created hex file is still not working. And old Hex file working perfectly. What it could be? Can i see anything from .map or .lst file? or project settings saved in any of file during project creation?
 

Obviously the source code must be different. Without the working source code and the one you have to compare, the only conclusion I can think of is they are far from identical. Are you linking in any libraries that might be different even though the main code is the same?

The list file will tell you exactly what's wrong but you need the original and your new one side by side to compare them. If you don't have the original list file you can't do it.

Try this, it *might* give some clues:
1. start MPLAB
2. click View/Program Memory This will open a blank window.
3. click File/Import and select your hex file. It should show something in the Program memeory window.
4. click the "Symbolic" tab beneath the window and it should give you a dissassembly listing of the hex file.

See if you can spot any major differences in the listings between the good and bad files. Note that although this will show the executable instructions, it can't convert back to the original source code.

Brian.
 

I have old compiled source code folder saved in rar file. So if any could suggest

solution to see .lst file or .map file, please do so.

It is difficult to advise you further without examining the source code and a schematic of the design.

Is it possible for you to upload the RAR file? Along with the old and new hex files and a schematic, if possible.

What version of the HiTech PICC18 compiler was the source last compiled successfully?


BigDog
 

Any solutions guys? I don't have the hardware, it is at customer end. I can't debug properly. Source code i have and i can send them to customer to test it. Newly created hex file is still not working. And old Hex file working perfectly. What it could be? Can i see anything from .map or .lst file? or project settings saved in any of file during project creation?
I had a similar problem with the MCC18 compiler in that a new version would not compile one of my legacy programs (which was at several end user sites). I managed to find of copy of the prevision of the compiler and used that.
It is worth checking if you can get the version of the compiler you originally used and try that.
 

Thank you for Valuable reply and guidance.

@betwixt:
I did as suggested by betwixt. I imported the 42KB(Not working and newly build file) file and 57 KB ( working and old build file) and viewed the memory in symbolic mode. There was huge difference.
I have attached the picture. Hope you guys can suggest something more, i am hoping that we are near to the solution. Kindly see the attachment for details. Pictures are self explanatory.




@bigdogguru:
I cannot upload the hex file, but can mail them if you want. Will that be ok with you? And i do not remember which Hitech 18 Compiler version worked.

@all masterminds:
Cannot we check the tool version/compiler version from workspace file, if possible?


Picture:
 

The code is obviously quite different but sometimes this can be due to minor changes in high level source code making the linker place things at different addresses.
However, the code doesn't seem to make much sense so I would guess it is a table of values or text in one and program code in the other.

For example, look at your second listing around line 1926, in ASCII it reads like these terminated strings:

"0%d2%d20"
"dOLOL "
" +L Ed% "
" R "
"CT L"

which looks more like fragment of source code than binary instructions.

Brian.
 

I tried running code on new MPLABX with new Compiler. Miraculously it got build. But still the hex file is of 24 KB size. I know different compiler produce different output, but when i looked at memory view/ symbiolic it showed same pattern as did on 42 KB not working file.

Picture attached.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top