help! :)

Coding and general discussion relating to the compiler

Moderators: David Barker, Jerry Messina

Post Reply
richardb
Posts: 306
Joined: Tue Oct 03, 2006 8:54 pm

help! :)

Post by richardb » Tue Dec 08, 2009 12:44 pm

i dont know if this is possible but it would be really usefull for me to generate a batch of hex files based on the same general code but with a few parameters changing.

is it possible to do a batch file and pass #options to the compiler?
Hmmm..

User avatar
RadioT
Registered User
Registered User
Posts: 157
Joined: Tue Nov 27, 2007 12:50 pm
Location: Winnipeg, Canada

Post by RadioT » Tue Dec 08, 2009 7:15 pm

Sounds like a job for Perl or a shell script. Perl has a "system" command that can launch applications with parameters:

system("start c:\dir\program.exe -parameter");

Is that the sort of thing you wish to do?

-Tom

gramo
Registered User
Registered User
Posts: 200
Joined: Tue Mar 20, 2007 6:55 am
Location: Australia
Contact:

Post by gramo » Tue Dec 08, 2009 7:36 pm

You could make a pretty simple program in Excel - drag and drop a hex file into excel and the contents will be shown down column 1

With a macro, parse row by row into the desired file name and makes changes where desired.

Might be an easier way - I'm just thinking out loud
digital-diy.com - Hobby microcontroller projects and tutorials. Assembly, PICBasic and C examples.

Australian distributor for the Swordfish Compiler

Jon Chandler
Registered User
Registered User
Posts: 185
Joined: Mon Mar 10, 2008 8:20 am
Location: Seattle, WA USA
Contact:

Post by Jon Chandler » Tue Dec 08, 2009 7:48 pm

I've had the experience Excel "helping" me with hex numbers and really screwing things up when it "formats" them.

I wonder if a mail-merge-type functions could be used. Edit the original hex file to put in variable terms where needed, and use the merge function in Word to replace the terms.


Jon

User avatar
ohararp
Posts: 194
Joined: Tue Oct 03, 2006 11:29 pm
Location: Dayton, OH USA
Contact:

Post by ohararp » Tue Dec 08, 2009 9:43 pm

richard, matlab could do this pretty easily.
Thanks Ryan
$25 SMT Stencils!!!
www.ohararp.com/Stencils.html

Francis
Registered User
Registered User
Posts: 314
Joined: Sun Mar 25, 2007 9:40 am
Location: Devon

Post by Francis » Wed Dec 09, 2009 9:21 am

I obv don't know precisely what you want but if you want to have incremented numbers on each code download (e.g. a unique serial number for each PIC programmed) you can use the MELabs programmer.

About halfway down this page:
C:\Program Files\melabs Programmer\meProg.htm

richardb
Posts: 306
Joined: Tue Oct 03, 2006 8:54 pm

Post by richardb » Wed Dec 09, 2009 9:31 am

i think i'll steer clear of editing the hex file as i think the constant may move in the file if i add new functionality to the code.

as for pearl.. i assum that would require the command line compiler to accept compile time options? does the compiler support that ?
Hmmm..

User avatar
JWinters
Posts: 106
Joined: Mon Feb 04, 2008 4:56 pm
Location: North Carolina, USA
Contact:

Post by JWinters » Sat Dec 12, 2009 2:13 am

I do this with some of my code. To make it easier, I put the dynamic parameters in the bootloader instead of the main app. I have a little custom VB6 utility (old school, I know) that replaces the parameters and makes a new HEX. I can't say it was easy... I'm just saying it's possible.

Post Reply