to quote Hannibal Smith, "I love it when a plan comes together" <insert cheesy grin>
Pointed in the right direction by our latest member of the Month (Robotonics) in this thread: http://www.element14.com/community/thread/17634
the deal went down and I ended up with one of these PIC18F4550 chips (along with quite a few others!), having only had experience with the OTP 16C54 and 57 chips using Seriously obsolete kit! I spent an evening reading the Data sheet for it and also researching programmers for it.
but as it happened, I was Given a brand new PICKit2 by Element 14 a while back as a "member of the month" gift...
yeah, you can probably see where I`m going with this
So, in a nutshell, I set about making a little PICKit connector to Breadboard (an `L` bend pin array), and managed to get a working circuit with this 4550 using all this cool free stuff (my favorite price).
the Hard part (of which I`ll share so it isn`t hard for anyone else) was getting the lot tied together in a way that I can think of a problem, explain it in a computer languge I know (in this case I chose BASIC), and writing a prog and then *shudder* uploading it!
I`d alread used Great Cow Basic with my pic 16c5x`s so I knew I had a good front end for my toolchain, oddly the "Compile and download with PICKIT2" option didn`t work???
so I just compiled that into an ASM file instead, and then saved it.
at this point I`m (or you would be) half way there!
downloading the free MPLAB s/ware (I use MPLAB v8.84) I was able to then pick up that saved ASM file from GCBasic and open it in MPLAB, by going to FILE then down to OPEN and picking the file.
Then you simply go to the PROJECT tab and then down to "Quickbuild no. asm file" and click that, all being well (and I`v never had a problem yet) it will say Build Successful.
then go accross to the PROGRAMMER tab and pick what your using for your programmer, in my case it`s the PICKit2.
That menu pull down will Change after you select, into the Full Programmer menu.
so go into it again and click "Program".
now this is where it goes a bit strange (In a good way!) when I did that the first time it seemed that Nothing happened apart from some writing in a window.
I did it again but clicked whilst looking at the PICKit, and almost too fast to see, the Red light (Busy) came on then off!
such a Dramatic change from the Arduino! whereby it`ll compile, then think about it, then wait a while, have a cup of tea, upload some stuff that flashes LEDS, wait a little longer, then upload the program (probably whilst dunking biscuits in said tea).
don`t get me wrong, there`s nothing wrong with the marriage of Biscuit and Tea, but it really shouldn`t take that long to send a little bit of code!?
a thing to remember is to either Unplug the MCLR wire or go into the "Programmer" drop down, and select "Release from Reset", if you don`t do either your program won`t start running, so you need to set this pin HIGH again to resume normal activity.
and it REALLY is as simple as that!
I`m a complete Newb at this sort of thing and I managed to figure it out, it really isn`t as complex as it looks, these IDEs can look Very Intimidating with a million tiny windows open on one page and kazillion options to pick from on each etc... it needn`t be that way to get a simple program working on a chip
Now, if you Already know a language like C you can cut out one aspect of my currently prefered toolchain that uses BASIC as the front end, and just get programming, Microchip do a free C compiler too, C18 is what I would have to have used but I don`t do C (yet).
I would strongly reccomend the use of a Genuine PICKit2 or 3 programmer though, A) they`re built well and should last a lifetime in ordinary use. B) DIY stuff at an early stage may introduce problems that are hard to understand when you have nothing to compare against. C) they`re fairly inexpensive and as L`Oreal says "You`re worth it"
now for a bit of eye-candy (I love seeing other peoples circuits), here`s a PIC (pun intended) of my setup, do try to ignore the arduino nano in the top right, all my boards have one mounted on them, but this one is not in use.
it`s a simple 16 bit Binary counter across 2x 8 bit ports, in this case ports B and D.
I`m going to be messing with USB next, how hard can it be... What could Possibly go wrong?
Special Thanks David (Robotonics) and also Element 14 for your help in this.