PDA

View Full Version : Melabs U2 Programmer Command Line Options



Robert Wells
- 2nd July 2009, 22:32
Hello Ladies and gents,

I have a Melabs U2 programmer that I am trying to get working with the MPLAB IDE v8.33 or the HI-TECH HI-TIDE 3 IDE. I am doing so to try out the HI-Tech C18 compiler. My OS is XP sp3. I have the latest U2 programmer beta software and firmware installed but MPLAB IDE does not have the Melabs U2 USB programmer in the programmer selection list. I guess that means I have to use the Post Build option? I tried various commands including the following:

"C:\Program Files\melabs Programmer Beta\meProg.exe" -P$(ProjectDir)bobby.hex but it kept reporting the device file was not found

So from the dos command prompt I tried:

"C:\Program Files\melabs Programmer Beta\meProg.exe" -PC:\PICC_Projects\bobby\bobby.hex

A dialog box from MeProg (I presume) came up and read:

Unable to open device file C:\Program Files\melabs Programmer Beta \C:\PICC_Projects\bobby\bobby.hex.epc.


I guess my question is how do I get this working and why is "epc" always being appended on the filename? Any help would be greatly appreciated.

Thank You,
Bob

Bruce
- 3rd July 2009, 00:54
I use command line options with the U2 every day, and they work fine, but you may need
the non beta version of the software for command line options to work properly.

If you have a pre-compiled blink.hex, compiled for a 16F627a, in C:\PBP, then create a batch
file with this in it to test.

meProg -n -dPIC16F627a -e -p -v c:\pbp\blink.hex

Say its name is prog.bat, and it's in the U2 software directory. When you click on prog.bat
it will launch the U2 software, select the 16F627a, erase, program, then verify blink.hex in
the target.

Edit: .epc files tell the U2 software programming info, config options, and a few more things
about each PIC target. If you don't have a .epc file for a PIC the U2 supports, it won't
show in the drop-down menu.

I copied meProg.exe, the target .epc file, and meprog.ini into C:\PBP, then setup MPLAB
post build option like this; meProg -n -dPIC16F627a -e -p -v c:\pbp\blink.hex

It compiles, launches & programs from within MPLAB when you click the compile button.

MPLAB seems to consider it part of the language toolsuite, so it works if all required files
are in the PBP directory.

HTH

Darrel Taylor
- 3rd July 2009, 01:40
The command lines still work with the beta version, even though the melabs page says they don't.

I think Bob's line would work if there was a space after the -P.

I'm getting tired of the splash screen in the beta version though.
Do you sell the upgrade to meProg Bruce?

The beta solved several problems I had with the version that came with the U2, so I can't go back to the old one.
If I could just get rid of the nag screen.
<br>

Bruce
- 3rd July 2009, 01:53
Hi Darrel,

Yep. We have it.

I've never tried setting up the U2 for 1-click compile/program in MPLAB
until just now. Couldn't get it work at all without dropping a few files in
my PBP directory.

If there's an easier way, I would love to know about it. Pretty handy.

Darrel Taylor
- 3rd July 2009, 02:02
This command line works with MicroCode Studio for 1-click. Well ... 2-clicks including the nag screen.

/DPIC"$target-device$" -P $long-hex-filename$

I have no idea what it would take for MPLAB.

Great, glad you have the upgrade.
I'll email you.

Bruce
- 3rd July 2009, 02:11
I think that's specific to the MCS IDE?

For command line options in batch files I just use the ones
shown in the meLabs help file.

DT - I already sent you an email.