PICBasic Pro and gEdit

First, install gEdit’s external tools using “sudo apt-get install gedit-plugins”,

Then add the pbp.lang file to /usr/shared/gtksourceview-2.0/language-specs/

You need to close out of all gEdit windows at this time and restart it to get the new language to show up.

Dont forget to go to edit/plugins, and enable the External Tools plugin.

Finally, go to gEdit and went to Tools/Manage External Tools, and create an entry called Compile PBP code, and add this into the codebox at the right:

#!/bin/sh
pic=”16f628a”
wine c:/pbp/pbpw -e -s -ac:/Program Files/Microchip/MPASM Suite/MPASMWIN -p$pic $GEDIT_CURRENT_DOCUMENT_NAME
var=$GEDIT_CURRENT_DOCUMENT_NAME
var2=${var%???}
outasm=$var2″ASM”
wine c:/Program\ Files/Microchip/MPASM\ Suite/mpasmwin /q /e /l $outasm

Just name that command something like “Compile PBP Code” and save it.

You may need to modify the include files hidden in the pbp, just look for the pic chip that you are using with the .inc extension and open it in a text editor. look for the _config line towards the bottom and add a ; to the beginning of the line to comment the line out.

Then add pickit2 by installing the official pk2cmd from microchip’s site, and did this mod to the system:
http://gatemaze.blogspot.com/2009/06…er-ubuntu.html
This allows you to run pickit2 as a normal user, which is what we want.
Then add this code to the external tools dialog in qEdit:

#!/bin/sh
pic=”16f628a”
wine c:/pbp/pbpw -e -s -ac:/Program Files/Microchip/MPASM Suite/MPASMWIN -p$pic $GEDIT_CURRENT_DOCUMENT_NAME
var=$GEDIT_CURRENT_DOCUMENT_NAME
var2=${var%???}
outasm=$var2″ASM”
wine c:/Program\ Files/Microchip/MPASM\ Suite/mpasmwin /q /e /l $outasm
outhex=${var2}”HEX”
pk2cmd -B/usr/share/pk2/ -PPIC$pic -F$outhex -M -R

Just name it something like “Compile and Burn PBP Code using PICKit2” and click close.

Here’s the commands for using a JDM type program with the picprog software.

#!/bin/sh
comport=”/dev/ttyS0″
pic=”16f628a”
wine c:/pbp/pbpw -e -s -ac:/Program Files/Microchip/MPASM Suite/MPASMWIN -p$pic $GEDIT_CURRENT_DOCUMENT_NAME
var=$GEDIT_CURRENT_DOCUMENT_NAME
var2=${var%???}
outasm=$var2″ASM”
wine c:/Program\ Files/Microchip/MPASM\ Suite/mpasmwin /q /e /l $outasm
outhex=${var2}”HEX”
picprog –erase –burn –input $outhex –device pic$pic –p $comport

Just name it “Compile and Burn PBP code with JDM programmer”

To change the PIC type, just change the 16f628a in the “PIC=”16f628a” to whatever chip you use in each script, and in the JDM programmer script, just set the /dev/ttyS0 to whatever your serial port the jdm programmer is attached to.

Here is the pbp.lang file, just extract it and place it where it’s supposed to go.

pbp.lang.zip

After everything is set up and programmed in, just open a .bas file or .pbp file and go to tools/external tools, then click either the compile pbp code or use jdm programmer, or the pickit2.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: