I've been struggling for some time with the newer IDE and the editing of the flashpic .bat file for flashing.
Simple problem is I can't seem to get it to work as a consequence I am still using a 2015 version of the IDE.
Question is how do I get the newer IDE to execute: (or something equivalent)
cd\
cd Program Files (x86)\Microchip\MPLABX\v5.05\mplab_platform\mplab_ipe
ipecmd.exe -TPPK3 -p%2 -e -f%1 -m -W3.300
Last edit: David Stephenson 2018-11-16
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm clicking on "IDE tools" then "GCBTools" then "edit PIC programme batchfile".
In the newer vesions of the IDE this option is not available as some GUI comes up which appears to have this batch edit capability, but I can't seem to get it to work.
Edited to add: I have seen in another thread where synwrite is described as a "context sensitive editor" maybe that is the problem - sometimes the "edit PIC programme batchfile" comes up and often times it doesn't.
Last edit: David Stephenson 2018-11-16
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm still having this problem. I installed the latest version of GBBasic (today) on my new laptop and once again I cannot (whatever I try) get it to communicate with the programmer (pickit3).
I get the rather useless message programmer returns error(1).
So what I did is delete synwrite and G+stools and replace them with an older version (from my other computer) and it now works fine first time.
I tried editing flashthis.bat, flashpic.bat and I tried using the GUI to set the flash program and none of these would work (though I don't know in which order the compiler tries each of these).
Am I the only one who is having these problems?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Can you video the issue?
No other issues reported like this.
An issue like this would have nothing to do with syn,exe. But, reproduce the error, with VERBOSE set in the new UI and then post the log shown.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You are aware we no longer use flashpic.bat or flashthis.bat? It is now all completed from the new UI. If you have just installed then what are you using to program the PK3?
No I was unaware that flashpic.bat and flashthis.bat were no longer operational. The readme that comes up on loading the most up to date version specifically mentions flashthis.bat.
As I said in my very first post I want to get that BAT in to do the flashing and I can't seem to do this from the UI. I've tried creating a new category and editing and old one still no luck .
So what I am trying to ask is how, using the UI, do I get in something that will do the same as the BAT file in my original post.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am trying gcb 98.04 programmer preferences and there's 4 pk3 options.
which ever I choose and press edit the screen that shows means nothing to me.
It's easier to just make a hex file and get pk3 to auto load/program hex.
same applies using pk3plus
it was "easier" before. sorry.
I got northen software to work though, ie make flash hex button.
uno/nano still works ok to.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The PICKit options you are seeing are probably these:
and as they were added at my request I should probably explain them:
The PICKit2 and PICKit3 can supply power to the target device to program it.
It first detects if the Target is powered, if it isn’t it will attempt to supply power.
If it detects an LF part it will supply power at 3V3, otherwise it will attempt to power the target at 5V0.
The entry PK+ CmdAuto [Power On and Off] is the setting most people will use any other PICKit entries in your “Programmers to Use” box should be removed.
The other two entries allow you to override the default action.
This is useful when working with boards such as the “Low Pin Count demo board “ which was designed to be powered by the PICKit. Two options are provided:
PK+ Cmd3v3 [Maintain Power @ 3v3]
PK+ Cmd5v0 [Maintain Power @ 5v0]
The function is fairly obvious.
Both entries will still detect if the target is powered but this time, if no power is detected, it will then power the board at the specified voltage. In addition to powering the board to program the device, however, the board will remain powered after programming so that you can test the result.
Just to reiterate, only ONE PICKit option should be in the “Programmers to Use” box at any one time, if it detects more than one it will use the first entry. This could lead to unexpected results as it may power the Board at 5 Volts when you expected it to auto detect and power down, or remain powered at 3V3. Such errors can be dangerous if you have 3 Volt peripherals attached to a Device.
I hope that clarifies it.
Cheers
Chris
Last edit: Chris Roper 2018-12-27
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In addition to the above, which covers the PICKit+, there are also entries for the PICKit2 command line interface and the "Intergrated Programmer Editor" from Microchip.
These entries for PICKit2 are:
**Microchip PICKit 2 CLI - Default
Microchip PK2 with PICCheck
Microchip PICKit 2 CLI - with OSCCAL **
And for the PICKit3
These are:
**MPLAB-IPE PK3 CLI: Program all release from reset - Default
MPLAB-IPE PK3 CLI: Program allhold in reset
MPLAB-IPE PK3 CLI: Erase, program all release from reset
MPLAB-IPE PK3 CLI: Preserve EEProm, programrelease from reset **
Again the names are self explanatory and are provided to support the Legacy Microchip IPE and CLI interfaces.
Again only ONE of the 7 Options should be in the “Programmers to Use” box at any one
The 7 entries above are redundant if you have PK+ installed and If you use any PICKit or PICKit Clone I highly recommended that you purchase a licence key for PICKit PLus.
It supports far more devices than the above Microchip Programmer scripts and is far easier to use.
Cheers
Chris
Last edit: Chris Roper 2018-12-27
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Having downloaded the newest version I noticed that GCBasic gets downloaded quite often.
I like GCBasic I have been using it for about 10 years and I am will unlikely use anything else.
I am a bit worried that any new downloader may well be having the same (or similar) problems to mine and could quite quickly give up and try something else (Arduino?).
I know I download a lot of potentially interesting programs that only get tried once (then uninstalled) as I can't get them to function as advertised.
As Stan says it worked better before. Maybe we should have a legacy option to input a BAT to do the flashing part.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
We have simplified by removing batch files - but, for someone that have not used Great Cow BASIC before they will not know of the batch files and the issues that go with editing batch files.
Not going back to batch files - we had many, many threads and posts on this. And, we introduced the new programming method at v0.98.01 see change #460. We are now at changes greater than #585.
460 New Program Updated makehex and makeasm batch to remove version numbers.
Updated GS+Tool.exe to support new program method
New use.ini as sample in the GreatCowBASIC folder
We now have users using Linux, Mac OS etc. They are developing a similar UI for Programmer Control... we need consistent UIs and that is good for our users.
Last edit: Anobium 2018-12-27
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As Chris has shown above. These are already there for you.
MPLAB-IPE PK3 CLI: Program all release from reset - Default
MPLAB-IPE PK3 CLI: Program allhold in reset
MPLAB-IPE PK3 CLI: Erase, program all release from reset
MPLAB-IPE PK3 CLI: Preserve EEProm, programrelease from reset
Edit those entries and to make this easier for you, see the 'Tool Variables' tab and change the Variable 'mplabxipedirectory' to your installation. This way you can easily edit this when you update MPLAB-X
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
A visual guide to help orientate you and get you started editing in the new Programmer's Interface:
Open GCBASIC and look at the Toolbar for the “GCBASIC v” Button.
Select the first option “Edit Programmer Preferences”
Scroll down the list till you find the entry that interests you as a starting point, or click “Add...” (Most likely not necessary). And click on "Edit..."
If you were one of the few that were comfortable editing the old batch file then the options in the Edit window will need no explanation.
Press OK to save your changes or Cancel to abort.
The only thing that remains to be done is to drag your Edited Programer Entry to the TOP of the “Programers to Use” List so that it is your default programer.
Have fun,
Chris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry for being dense. I've fianlly got it to work.
Put C:\Program Files (x86)\Microchip\MPLABX\v5.05\mplab_platform\mplab_ipe\ipecmd.exe
in the box labelled "file"
put -TPPK4 -P%chipmodel% -M -E -F"%filename%" -W3.300
in the box labelled command line parameters (for pickit4)
then important click and drag this to the top.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If like me bat files etc. are too complicated here's a video of the way I do it.
The result is the same as flash hex. https://youtu.be/vvLSgHDPKSQ
I should have said it was "easier" for me before.
Incomprehendable lines that all I had to do was change the com port.
Also, when I started using gcb it was with a uno not a pic.
Last edit: stan cartwright 2018-12-27
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Just to sum up everything.
Download the latest version of MPLABX (v5.10 at the moment). On unpacking (using default directories) the important program IPECMD.exe goes into directory
C:\Program Files (x86)\Microchip\MPLABX\v5.10\mplab_platform\mplab_ipe\ipecmd.exe
this or whatever directory it has ended up in on your computer should be pasted into the box labelled FILE.
The command line in the next box is a bit more tricky
I use -TPPK3 -P%chipmodel% -M -E -F"%filename%" -W3.300
TPPK3 is pickit3, -M programmes everything, -E erases everything, -W3.300 tell the pickit to supply 3.3Volts to the chip. The -P%chipmodel% and -F"%filename%" should not be changed.
All other boxes in the UI can be left blank.
Other command line switches can be found in the document that comes with MPLABX on my computer it goes into the directory:
C:/Program Files (x86)/Microchip/MPLABX/v5.10/docs/Readme for IPECMD.htm.
As for batch processing I still have my MS-DOS handbook.
I've been struggling for some time with the newer IDE and the editing of the flashpic .bat file for flashing.
Simple problem is I can't seem to get it to work as a consequence I am still using a 2015 version of the IDE.
Question is how do I get the newer IDE to execute: (or something equivalent)
Last edit: David Stephenson 2018-11-16
We have adapted SynWrite. A specific version. So, I truly do not know how to sort alternative ID
I'm clicking on "IDE tools" then "GCBTools" then "edit PIC programme batchfile".
In the newer vesions of the IDE this option is not available as some GUI comes up which appears to have this batch edit capability, but I can't seem to get it to work.
Edited to add: I have seen in another thread where synwrite is described as a "context sensitive editor" maybe that is the problem - sometimes the "edit PIC programme batchfile" comes up and often times it doesn't.
Last edit: David Stephenson 2018-11-16
Is this the version of the IDE that is installed with the Great Cow BASIC installer?
If not, we have not tested.
I'm still having this problem. I installed the latest version of GBBasic (today) on my new laptop and once again I cannot (whatever I try) get it to communicate with the programmer (pickit3).
I get the rather useless message programmer returns error(1).
So what I did is delete synwrite and G+stools and replace them with an older version (from my other computer) and it now works fine first time.
I tried editing flashthis.bat, flashpic.bat and I tried using the GUI to set the flash program and none of these would work (though I don't know in which order the compiler tries each of these).
Am I the only one who is having these problems?
Can you video the issue?
No other issues reported like this.
An issue like this would have nothing to do with syn,exe. But, reproduce the error, with VERBOSE set in the new UI and then post the log shown.
You are aware we no longer use flashpic.bat or flashthis.bat? It is now all completed from the new UI. If you have just installed then what are you using to program the PK3?
Also, see http://gcbasic.sourceforge.net/help/_using_great_cow_basic.html
Last edit: Anobium 2018-12-26
No I was unaware that flashpic.bat and flashthis.bat were no longer operational. The readme that comes up on loading the most up to date version specifically mentions flashthis.bat.
As I said in my very first post I want to get that BAT in to do the flashing and I can't seem to do this from the UI. I've tried creating a new category and editing and old one still no luck .
So what I am trying to ask is how, using the UI, do I get in something that will do the same as the BAT file in my original post.
Chris has posted and see my post https://sourceforge.net/p/gcbasic/discussion/579125/thread/ca6749364e/#6ba8/b1a4
I am trying gcb 98.04 programmer preferences and there's 4 pk3 options.
which ever I choose and press edit the screen that shows means nothing to me.
It's easier to just make a hex file and get pk3 to auto load/program hex.
same applies using pk3plus
it was "easier" before. sorry.
I got northen software to work though, ie make flash hex button.
uno/nano still works ok to.
The 4 PK3 options would be the four PK+ entries? Please be explicit - what are the entries you are referring to?
Have you read https://sourceforge.net/p/gcbasic/discussion/579125/thread/7fae77a3/ ? We may need to extend this with new information - if we are missing some key information.
@Stan and others.
The PICKit options you are seeing are probably these:

and as they were added at my request I should probably explain them:
The PICKit2 and PICKit3 can supply power to the target device to program it.
It first detects if the Target is powered, if it isn’t it will attempt to supply power.
If it detects an LF part it will supply power at 3V3, otherwise it will attempt to power the target at 5V0.
The entry PK+ CmdAuto [Power On and Off] is the setting most people will use any other PICKit entries in your “Programmers to Use” box should be removed.
The other two entries allow you to override the default action.
This is useful when working with boards such as the “Low Pin Count demo board “ which was designed to be powered by the PICKit. Two options are provided:
PK+ Cmd3v3 [Maintain Power @ 3v3]
PK+ Cmd5v0 [Maintain Power @ 5v0]
The function is fairly obvious.
Both entries will still detect if the target is powered but this time, if no power is detected, it will then power the board at the specified voltage. In addition to powering the board to program the device, however, the board will remain powered after programming so that you can test the result.
Just to reiterate, only ONE PICKit option should be in the “Programmers to Use” box at any one time, if it detects more than one it will use the first entry. This could lead to unexpected results as it may power the Board at 5 Volts when you expected it to auto detect and power down, or remain powered at 3V3. Such errors can be dangerous if you have 3 Volt peripherals attached to a Device.
I hope that clarifies it.
Cheers
Chris
Last edit: Chris Roper 2018-12-27
In addition to the above, which covers the PICKit+, there are also entries for the PICKit2 command line interface and the "Intergrated Programmer Editor" from Microchip.
These entries for PICKit2 are:
**Microchip PICKit 2 CLI - Default
Microchip PK2 with PICCheck
Microchip PICKit 2 CLI - with OSCCAL **
And for the PICKit3
These are:
**MPLAB-IPE PK3 CLI: Program all release from reset - Default
MPLAB-IPE PK3 CLI: Program allhold in reset
MPLAB-IPE PK3 CLI: Erase, program all release from reset
MPLAB-IPE PK3 CLI: Preserve EEProm, programrelease from reset **
Again the names are self explanatory and are provided to support the Legacy Microchip IPE and CLI interfaces.
Again only ONE of the 7 Options should be in the “Programmers to Use” box at any one
The 7 entries above are redundant if you have PK+ installed and If you use any PICKit or PICKit Clone I highly recommended that you purchase a licence key for PICKit PLus.
It supports far more devices than the above Microchip Programmer scripts and is far easier to use.
Cheers
Chris
Last edit: Chris Roper 2018-12-27
Having downloaded the newest version I noticed that GCBasic gets downloaded quite often.
I like GCBasic I have been using it for about 10 years and I am will unlikely use anything else.
I am a bit worried that any new downloader may well be having the same (or similar) problems to mine and could quite quickly give up and try something else (Arduino?).
I know I download a lot of potentially interesting programs that only get tried once (then uninstalled) as I can't get them to function as advertised.
As Stan says it worked better before. Maybe we should have a legacy option to input a BAT to do the flashing part.
We have simplified by removing batch files - but, for someone that have not used Great Cow BASIC before they will not know of the batch files and the issues that go with editing batch files.
Not going back to batch files - we had many, many threads and posts on this. And, we introduced the new programming method at v0.98.01 see change #460. We are now at changes greater than #585.
We now have users using Linux, Mac OS etc. They are developing a similar UI for Programmer Control... we need consistent UIs and that is good for our users.
Last edit: Anobium 2018-12-27
You still haven't told me how I get the UI to do what the BAT does
cd Program Files (x86)\Microchip\MPLABX\v5.05\mplab_platform\mplab_ipe
ipecmd.exe -TPPK3 -p%2 -e -f%1 -m -W3.300
What issues are those connected with editing BAT files.?It is still much simpler than trying to get LINUX to work for example.
As Chris has shown above. These are already there for you.
MPLAB-IPE PK3 CLI: Program all release from reset - Default
MPLAB-IPE PK3 CLI: Program allhold in reset
MPLAB-IPE PK3 CLI: Erase, program all release from reset
MPLAB-IPE PK3 CLI: Preserve EEProm, programrelease from reset
Edit those entries and to make this easier for you, see the 'Tool Variables' tab and change the Variable 'mplabxipedirectory' to your installation. This way you can easily edit this when you update MPLAB-X
Hi David,
A visual guide to help orientate you and get you started editing in the new Programmer's Interface:
Open GCBASIC and look at the Toolbar for the “GCBASIC v” Button.
Select the first option “Edit Programmer Preferences”
Scroll down the list till you find the entry that interests you as a starting point, or click “Add...” (Most likely not necessary). And click on "Edit..."
If you were one of the few that were comfortable editing the old batch file then the options in the Edit window will need no explanation.
Press OK to save your changes or Cancel to abort.
The only thing that remains to be done is to drag your Edited Programer Entry to the TOP of the “Programers to Use” List so that it is your default programer.
Have fun,
Chris
Nice Chris. If you have time create a new post. I will lift at some point into the Help.
Sorry for being dense. I've fianlly got it to work.
Put C:\Program Files (x86)\Microchip\MPLABX\v5.05\mplab_platform\mplab_ipe\ipecmd.exe
in the box labelled "file"
put -TPPK4 -P%chipmodel% -M -E -F"%filename%" -W3.300
in the box labelled command line parameters (for pickit4)
then important click and drag this to the top.
Should there be quotes "" around the %filename%, but not around the %chipmodel% ??
I suspect that is in case the filename contains spaces, as it is user generated and the compiler has no control over it.
If like me bat files etc. are too complicated here's a video of the way I do it.
The result is the same as flash hex.
https://youtu.be/vvLSgHDPKSQ
I should have said it was "easier" for me before.
Incomprehendable lines that all I had to do was change the com port.
Also, when I started using gcb it was with a uno not a pic.
Last edit: stan cartwright 2018-12-27
Just to sum up everything.
Download the latest version of MPLABX (v5.10 at the moment). On unpacking (using default directories) the important program IPECMD.exe goes into directory
C:\Program Files (x86)\Microchip\MPLABX\v5.10\mplab_platform\mplab_ipe\ipecmd.exe
this or whatever directory it has ended up in on your computer should be pasted into the box labelled FILE.
The command line in the next box is a bit more tricky
I use -TPPK3 -P%chipmodel% -M -E -F"%filename%" -W3.300
TPPK3 is pickit3, -M programmes everything, -E erases everything, -W3.300 tell the pickit to supply 3.3Volts to the chip. The -P%chipmodel% and -F"%filename%" should not be changed.
All other boxes in the UI can be left blank.
Other command line switches can be found in the document that comes with MPLABX on my computer it goes into the directory:
C:/Program Files (x86)/Microchip/MPLABX/v5.10/docs/Readme for IPECMD.htm.
As for batch processing I still have my MS-DOS handbook.
Thank you for documenting.
I throw out old manuals - it makes way for new ones.