Let's Make Robots!

Microchip (PIC) RISC Assembler

For anyone who wants to try assembler instead of that girly BASIC stuff some folk are always raving about, this is the place.

RISC assembler programmed into PICs by In-Circuit Serial Programming using home-built programmers for under $20 is my thing.

Ask me questions.

Now, this maybe belongs under the 4 elements. Does it go under programming or electronics? Naw. I'd say it's another "system". Is anyone able or inclined to move it to that container?

What do you need?

Well, for programming you just need a programmer such as http://www.jdm.homepage.dk/newpics.htm which plugs into your PC serial port. (Assuming you have one of those anchient (circa 3 years ago) PCs that still has serial ports - USB/RS232 convertors don't seem to work terribly well for this type of application.)

Then you need a piece of software to drive it. I used http://www.ic-prog.com/ for years (it has a cool builtin disassembler). Then I switched to http://freenet-homepage.de/dl4yhf/winpicpr.html recently, becuase it inherently supports ALL Pics.

ICSP is dead easy. You attach /MCLR, Vdd, Vss, PC and PD on your programmer to /MCLR, Vdd, Vss, PC and PD on your PIC and press "go".

Walkthrough

Yes. Good idea. The problem with making a walkthrough is that I don't see what's difficult. I'll try to remember what I found as the major hurdles and work from there.

1) Get an account at www.microchip.com. They will happily send you three engineering samples of any four components for free - and they even pay the postage.

2) download their EXCELLENT and FREE RISC assember IDE. It has online help, offline debugging, in-circuit serial debugging and is possibly the best development environment for any programming language EVER. I really mean it.

(http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1...)

3) Get a 16Fxx or 16Fxxx series PIC, and attach and LED to one of te DIO lines, through a resistor to ground.

Actually... Watch this space. I will shortly recommend a PIC with an internal oscillator, give you the assembler code, recommend a programmer and a promming package and tell you how to prom it with ICSP. (If real life allows.)

Notes:

There are only a few DIY programmers whcih work directly with the Microchip IDE. They have to make money SOMEHOW: they give you everything else for free! Consequently, we need to choose an external prommer and some software to drive it. I will work only with freeware and freely available prommer designs.

Update 2008-05-29

The first revision of the HowTo is here.

http://letsmakerobots.com/node/715

Update 2008-07-07
I'm not going to do any further work on this as all the information is presented in an idiot-resistant form at Gooligum Electronics.

If you find it useful, contact the guy and say "thanks". He has put a LOT of effort in.

 

Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

It seems like Microchip has stopped providing free samples to Europe! What a shame, I could really have used one :'(

---

Dennis L

I haven't followed the process right through to actually pressing "order", but I have the impression that they'll still do the samples, but you have to pay your own postage now.

Some sources are saying you need a business account. I don't think you NEED one, but if you don't have one you don't get free postage.

I have a good supply at the moment, but I will follow this process through one day soon.

They only offered one sample of any two devices and I had to pay postage and handling. I went ahead as it was still cheaper than buying the chips from a reseller.
Aye, but you're way further South than me.

I want to learn the Risc Assembly. I've programmed a Z80 in assembly before. More and more I'm running into picaxe limitations, especially how slow it is and faulty firmware is a pain in the proverbial. I have a book and now a USB "pic kit 2" clone as well as an 18F4550 trainer board but lately I've been wimping out and making picaxe bots because they don't hurt my head so much.

Book1.jpg

I've downloaded MPLAB IDE, just got to spend the time. In the near future I hope to join you as one of the few RISC programmers on this site :)

At 430 pages the datasheet for the 18F4550 is surely a hefty read. I'd recommend you start with a simpler chip. Say at least the 16f690. It is a nicely featured chip and the gooligum tutorial is very easy to follow.

With your ability you should find it easy to knock up a board to program the 16F690 with your pickit2 clone. I started with the basic stamp myself because I saw it in a jaycar store may years ago and bought it. For some reason they don't keep them anymore. But I realised it was just a pic chip anyway and because of limitations with them I decided to get some pics and learn the assembler for them.

Good luck with that book. I have it and never really got much out of it I'm sorry to say.

I could maybe work with the 16F690. I tried it once and had limited success. There was something unusual about the way the BRG worked for asynch comms that I never got my head around.

Plenty of room to move. If I do find it too hard at first then I can go back to an easier processor as the programmer gives me plenty of flexability.

I bought the 18F4550 developement board because as I get better I want to be able to use the USB port and because it's instruction set is optimised for "C" it gives me incentive to re-learn "C" (started to learn Borland C++ 16 years ago).

I have still got the Borland Turbo C installer disks. FOUR HI-DENSITY 1.5in floppies! ...and that included the IDE!!

The Elmer160 guide is also worth a look. It helped me a lot!

---

Dennis L