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.

[SOLVED] Can't compile this program MPLAB IDE

Status
Not open for further replies.

Mimuwhen

Junior Member level 3
Junior Member level 3
Joined
Oct 7, 2014
Messages
29
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
284
Hi everyone,

I'm pretty new at all of this still so bare with me.

Someone sent me this program a while back for me to play with. I've already successfully built it using the hex code but I'd love to experiment with the code itself. The problem is that as the author indicated, he made it using an old version of MPLAB that used Hi-Tech C and now apparently MPLAB has changed to MPLABX and uses something else.

I'd been learning using mikroC but for the purpose of playing with this experiment I installed both MPLAB X and MPLAB V8.92. The code works with neither of them as it doesn't recognize htc.h, math.h, TRISA, TRISB, PORTA, PORTB, etc as well as several other things in the code.

I tried installing Hi tech C from this website. https://www.cs.ucr.edu/~eblock/pages/pictools/install.html

Even though it installs successfully, it makes no difference. When I open my code using MPLAB 8.92 it tells me it uses a language and toolsuite not installed in my system. When I try to open it in MPLAB X the problem remains unchanged.

Can someone please explain to me what I should do for this to work? I've experienced a lot of issues with compatibility between codes and programs and I haven't been able to get much done since I began learning how to program. What I learn using one program wont work on another etc.

Attached is the project files.

Thank you and I hope you can help me.View attachment 16F877a DFT.zip
 

Try installing XC8 from Microchip's web site then removing all the #include statements that have a file name between the ' < ' and ' > ' and insert a single line:
#include <xc.h>
instead.

The problem is there are variables, constants and register names in the HiTech include files which are specific to those compilers and will not work (unless seriously edited) with other compilers. The 'xc.h' file is part of the XC8 compiler program and it contains most if not all the definitions present in the HiTech ones.

You might have to open the MPLAB project file and add "lcd-4bit-custom.c" to the source file list.

Brian.
 

The code compiled fine on the first try.

See Code Compilation result.

See images to set Toolsuite.

111877d1417453431-htc1.png


111878d1417453439-htc2.png


111879d1417453463-htc3.png
 

Attachments

  • htc1.png
    htc1.png
    93.7 KB · Views: 275
  • htc2.png
    htc2.png
    88.2 KB · Views: 264
  • htc3.png
    htc3.png
    84.8 KB · Views: 321

Hi,

I tried that but it still doesn't work. Mine looks a little different though. Check the attached images. There's no Hi Tech Universal Tool Suite, it's just called Hi Tech PCC Toolsuite option. I guess I using a different version or something along those lines? If so where can I get the same one as you?

Betwixt, I tried that as well but I suppose there's other things in the program I have to adapt? I've never ported a program before, I'll see if i can make it work using Hi-Tech since that's what the code is written for and if it doesn't work out I'll try XC8.
 

Attachments

  • PICC.png
    PICC.png
    50.5 KB · Views: 216
  • failed.png
    failed.png
    62.7 KB · Views: 186

Check the link in the Hi-Tech C Compilers section here. **broken link removed**

According to the screenshots you posted you have set the Toolsuite properly and the Compiler is Compiling the code and it is showing some errors in the code. Maybe your Compiler doesn't have htc.h file but uses picc.h file. Did you compile the same project which you attached in post #1 ?
 

OKay, I installed Universal Toolsuite from here, ftp://ftp.microchip.com/Universal Toolsuites/

I selected it from the list but nothing appears in the little box below it and when I try to compile it tells me there's no valid Hitech C drivers installed. When I try to manually choose the location from the menu all I can find is a file named setup in the add ons folder, this doesn't change anything either.

Also for some strange reason, when I try to open the project, MPLAB only opens it up normally a few times and after this MPLAB opens it but only displays the windows briefly before everything vanishes as shown in the attached image. If I install Universal Toolsuite the program opens up the project normally again, but of course with out the toolsuite I can't do anything.poof.png

- - - Updated - - -

Okay I uninstalled Universal Toolsuite and installed the one I was using previously and after that re-installed Universal Toolsuite again.

This time Universal Toolsuite is present and working but the program still will not compile. It's at least trying now.

Any idea what the issue is now?
 

Attachments

  • Build Fail.png
    Build Fail.png
    69.7 KB · Views: 217

It seems old version of the compiler is causing the problem. The last version of Hi-Tech PICC was 9.80 and for PICC18 it was 9.83. I don't know why microchip removed the setup files from their ftp site. It was available for download a few days back. It contained all versions of Hi-Tech Compilers that were released.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top