There are a million ways to skin a cat. Here is one way that will skin it effortlessly and without the need for a big knife...
So you want to program a PIC? You've got your programmer, you've got some software. But where to go from here?
You will need:
The greatest thing about this setup is that it provides for very fast code-to-burn times.
We do all of our coding in CC5x C. Forget assembly. To do any kind of complex PIC interface, C is a must. How else do you plan to take over the world with your army of miniature robot warriors?
Jens's file editor is great because it allows for external program calls and color tags all your code for you.
We just found out IC-Prog has a command line interface - cool! We will have to experiment with that a bit before we can completely implement it under Jens' file editor.
Software package installs -
Install CC5x into a directory where it's easily identifiable - such as directory 'D:\pic-c\' - whatever. Just so you know where it is.
Jens' file editor has not install, simply a file (how nice is that?).
IC-Prog has the standard windows install. Let it go wherever it defaults to.
Jens' File Editor -
Under the view menu, select the 'C/C++ Function List'. This will display all your C functions in a tree off to the left. Very handy when you have 6 linking files and 83 subroutines to navigate through.
Also under the view menu, select 'View Output'. This will allow you to see what the compiler outputs - i.e. errors and stuff.
Now the fun stuff, under Settings select 'Add Tool'. This will open up the following window:
Quick Button configuration window
This is what our CC5x compile button has behind it. When you click on the 'Compile' button, whatever C code you are working on will be saved and passed to the CC5x compiler. Fancy, no? You should be able to point this to any C compiler out there for PICs - we just happen to CC5x.
We also setup as assemble button for the 'MPASM for Windows' program:
Assemble button configuration
You work area should look like this:
JFE ready to go
Right click on the 'Compile' or 'Assemble' buttons to edit what the buttons do.
The steps to get you code onto the PIC:
Code up your program in C
Hit the compile button
Jump to IC-Prog and open up the new HEX file
Hit 'Program All' in IC-Prog
And you should be good to go!
Take a look at setting up IC-Prog into a button. We have not had time to fiddle with it yet, but the IC-Prog documentation claims it is command prompt compatible.
There may be short cuts - tells us! firstname.lastname@example.org We are always updating the info in our tutorials.
Comments 1 comment
Just as a warning, I suggest scanning both the cc5x compiler and jenn's file editor before running. One gave me a nasty little trojan earlier today