Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Using MCC18 in a custom program (http://www.chiefdelphi.com/forums/showthread.php?t=45814)

EHaskins 24-03-2006 23:56

Using MCC18 in a custom program
 
I am would like to create a hybrid between EasyC and MPLab. I would like to make it be able to import and export to MPLab. Is it possible to write a program in VB.net or C#.net that can use Microchips C18 complier? i know there are a number of .Exes in the mcc18/bin/ folder. I think i would somehow need to run the compiler, linker, and mabe other programs, but i don't know how to run or get a response from the .EXEs.

Any help would be appreciated

JBotAlan 25-03-2006 00:25

Re: Using MCC18 in a custom program
 
I had considered this before as I was getting some very erratic behavior out of MPLAB. My guess would be to either consult the MCC18 manual for what EXE needs what parameters (the long way), or watch what gets passed to which EXE in the compiler output in MPLAB and hard-code it (the short way). During off-season, us programmers need to unite and create FIRST-IDE, still using the MCC18 compiler, but blowing away MPLAB's little ability to keep code good-looking, along with nicer features. Since I have to contend with that hideous IDE for another 2 years, it would definitely be worth coding something up to replace it.

Notice: This is not meant in any way to cut on Microchip. Thank you for all that you do, and all the time and money you have put into FIRST. Things would be very hard without the compiler and IDE you donated. Thanks again.

Yeah, eventually I think I'll start a sourceforge for this once I get some off time to start. I'll create a new thread once I get something working.

JBotAlan

PS - keep me posted on what you come up with. I have been very interested in replacing this IDE, and what you want to do sounds cool.

JJG13 25-03-2006 08:16

Re: Using MCC18 in a custom program
 
Quote:

Originally Posted by EHaskins
I am would like to create a hybrid between EasyC and MPLab. I would like to make it be able to import and export to MPLab. Is it possible to write a program in VB.net or C#.net that can use Microchips C18 complier? i know there are a number of .Exes in the mcc18/bin/ folder. I think i would somehow need to run the compiler, linker, and mabe other programs, but i don't know how to run or get a response from the .EXEs.

Any help would be appreciated

Its fairly easy to use the C18 compiler. First you should check out this thread that gives an example of how to construct and use a makefile. The makefile will allow you to manage the compilation of all the files in your project. You can have your program autogenerate this makefile which would save you time and effort.
When you want to compile and link you just need to run make with your desired parameters such as "clean all -f FILENAME" (where FILENAME is the filename of your makefile).

For more information on makefiles, take a look at this.

Mike 25-03-2006 14:09

Re: Using MCC18 in a custom program
 
Quote:

Originally Posted by JBotAlan
PS - keep me posted on what you come up with. I have been very interested in replacing this IDE, and what you want to do sounds cool.

Why re-invent the wheel? From what I understand*, the MCC18 compiler can be used very easily independent of MPLab. I bet in a couple hours of googling, one can figure out how to integrate it with any IDE that supports multiple compilers (such as Eclipse, Programmers Notepad, etc.)

* I've yet to actually try to integrate MCC18 with any other program, but I know it has been done with Eclipse.

X-Istence 25-03-2006 16:26

Re: Using MCC18 in a custom program
 
MPlab just needs to be tamed, that is all. I have actually so far preferred it to all other IDE's that are available on Windows. None of them shake a stick at Xcode yet, and for a standalone editor, SubEthaEdit is still the best all around, with all the features it offers, especially when it comes to making code look nice, and the ease of use to how people want their "tabing" done.

bear24rw 25-03-2006 17:40

Re: Using MCC18 in a custom program
 
I want an IDE that allows you to collapse regions.. like Microsoft Visual Studio... anyone know of any?

Mike 25-03-2006 18:18

Re: Using MCC18 in a custom program
 
Quote:

Originally Posted by bear24rw
I want an IDE that allows you to collapse regions.. like Microsoft Visual Studio... anyone know of any?

For AVR development I use the WinAVR project, which uses Programmers Notepad as the IDE. I think it is really good. Collapsible regions, decent syntax highlighting, good project management, tabbed browsing and overall good simplicity.

http://www.pnotepad.org/

EHaskins 26-03-2006 19:44

Re: Using MCC18 in a custom program
 
I still haven't been able to find how to get the errors from the EXEs. If anyone can point me in the right direction i wound appreciate it.

JJG13 26-03-2006 20:10

Re: Using MCC18 in a custom program
 
Quote:

Originally Posted by EHaskins
I still haven't been able to find how to get the errors from the EXEs. If anyone can point me in the right direction i wound appreciate it.

Capturing data from a console application is a real pain. Fortunately others have already traveled that path and you can see what they have done by looking at the code of just about any open source IDE. I'd advise you to download the source for the Dev C++ IDE and find the RunAndGetOutput function in Utils.pas. The source code is in Delphi but it should be easily convertable to C# or Visual Basic.

EHaskins 26-03-2006 21:31

Re: Using MCC18 in a custom program
 
I am not familiar with Delphi and can't find any vb or c# code to handle the text capturing. If anyone knows where i can find a sample in vb or C#?

JonathanLKS 26-03-2006 22:13

Re: Using MCC18 in a custom program
 
1 Attachment(s)
If anyone wants to try and use MCC18 with Code::Blocks Studio, here's the registry keys and project templates to use MCC18 with Code::Blocks.

It should work if MCC18 is installed at C:\mcc18, if not you'll have to edit the registry keys.

Move all but the registry key to wherever you installed codeblocks\share\CodeBlocks\templates

If anyone needs any information on the way to call mcc18 from the command line it's

For all .C Files
mcc18.exe FILENAME.C -fo=FILENAME.O /i "C:\mcc18\h" -p=18F8722 -D_FRC_BOARD

Then Once
mplink.exe /l "C:\mcc18\lib" ALL_.O_FILES "PATH_WHERE_ITS_LOCATED\18f8722.lkr" "PATH_WHERE_ITS_LOCATED\FRC_library_8722.lib" /m "PATH_WHERE_ITS_LOCATED\FrcCode.map" /o "PATH\FrcCode.cof"

P.S. The Error's are not displayed in the Build Messages but they are in the Build Log

EHaskins 26-03-2006 23:06

Re: Using MCC18 in a custom program
 
I have submitted a project to Source Forge and i will put a link here if it is acepted.

CmptrGk 25-04-2006 13:01

Re: Using MCC18 in a custom program
 
Quote:

Originally Posted by JonathanLKS
If anyone wants to try and use MCC18 with Code::Blocks Studio, here's the registry keys and project templates to use MCC18 with Code::Blocks.

i know that this thread is over a month old, but i was interested in using code::blocks. but the zip file that was attached was corrupted. i was wondering if somebody could repost an uncorrupted version, if one exists.

Joe Ross 25-04-2006 13:14

Re: Using MCC18 in a custom program
 
1 Attachment(s)
Quote:

Originally Posted by CmptrGk
i know that this thread is over a month old, but i was interested in using code::blocks. but the zip file that was attached was corrupted. i was wondering if somebody could repost an uncorrupted version, if one exists.

I was able to open the file with 7-zip, and then rezipped it with winzip.

CmptrGk 25-04-2006 14:20

Re: Using MCC18 in a custom program
 
Quote:

Originally Posted by Joe Ross
I was able to open the file with 7-zip, and then rezipped it with winzip.

thanks, i only tired with winrar initally.


All times are GMT -5. The time now is 03:38.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi