Learning PIC - where to start?

I'm thinking about learning PIC programming, and would appreciate any advice. E.g.

  1. Which programmer? Preferably something that can program most DIP flash PICs, primarily 10-18 series.

  1. Which prototyping method(s)? Is plugblock feasible? Veroboard?

  2. Are the PICDEM kits worth it?

  1. How useful/important is an ICD?

  2. Any recommended web sites and/or books?
Reply to
Nobody
Loading thread data ...

On a sunny day (Sun, 22 Feb 2009 21:08:38 +0000) it happened Nobody wrote in :

First question: What do you know about programming, what languages.

I would start with something simple like a 16F84 (something I started with, those were in the pay TV smartcards for example).

Soldering is the only reliable method. Imagine my switch mode PIC power supply with an intermittent connection, BANG. And the high current would melt any flimsy contacts.

No idea, I use the noppp programmer, 'no part programmer' and have added software and hardware to it over the years for many different PICs.

I do not even use a simulator, do not use MPlab, just the GNU gpasm assembler, and an oscilloscope one pin as output is all I need to know what is happening. RS232 link is also very nice.

The rest is for people who have no clue what they are doing (duck flying pies).

Read the datasheet. I assume you know about hardware and logic. A microprocessor just executes instructions it finds, and changes registers or bits, nothing special or mystical. Books do not tell you anything about the special functions in a specific type of controller, books kill trees, books are heavy, books are a fire hazard, books, to be clear, suck, are from the dark or middle ages. Google will show you, if you type some code, many many examples, there are good PIC related websites, and a lot of crap too. Just start programming one, when tears come to the yes because nothing works, you are really getting close to results. Just do not give up. If PIC does not execute your code, then you forgot a 'banksel' statement.

Reply to
Jan Panteltje

You should just get a PICkit 2 starter board from wherever you buy your other components it's only around $40.00.

formatting link

This will come with MPLAB and a C compiler,as well as other documentation. They are coming out with a a PICkit 3 soon from what I heard.

A good place for some starter tutorials is here.

formatting link

Get some header pins so you can program other PIC's using a breadboard,read the data sheet for the PICkit 2 for the correct size.

Reply to
Hammy

formatting link

EPEmag did a reader offer of a pickit2 for about £10 I think, but it expired end of last month (they do plenty of PIC projects) its not the first time they've done a pickit2 reader offer and probably not the last.

Its best to avoid any programmer that uses RS232 or LPT ports as newer PCs don't have them.

Reply to
ian field

formatting link

Reply to
Charles

Jan Panteltje wrote:

How much *more* will he pay to get that (obsolete?) number rather than a modern stocking number?

Isn't there a modern variant that is ~1:1 compatible with the large 16F84 codebase out there?

formatting link
8-)

Reply to
JeffM

On a sunny day (Sun, 22 Feb 2009 15:11:06 -0800 (PST)) it happened JeffM wrote in :

Dunno, If I was me, and I am, I would get some PIC with analog inputs, so much more fun.

Yea, well .... book burning has happened at several times in history, probably next will be the destruction of the Internet, or google books... Somebody will attack it for political reasons of gain, already politics is squeezing Internet and related hardware like PCs for so called 'copyright' etc... more a question of political control.

Reply to
Jan Panteltje

On a sunny day (Sun, 22 Feb 2009 22:46:54 -0000) it happened "ian field" wrote in :

I'd say: get an USB to RS232 adapter, as many PICs have RS232 and you will want to use it.

Reply to
Jan Panteltje

"Nobody" schreef in bericht news: snipped-for-privacy@nowhere.com...

I consider

formatting link
a good intro. A lot of info for starters.

As for programmers you have zillion possibilities. I've used Votis Wisp, Oshons serial programmer

formatting link
and the serial programmer described in WINPIC
formatting link

I also used professional programmers but do not own one. I did not need them as one or more of the ones mentioned above always met my needs.

I've used wirewrap, soldering and solderless breadboards. The last method is not reliable in critical applications.

Never used a PICDEM kit. AFAIK buying a PICKIT 2 for some 50 Euros will cost some money and save some time.

Ever used an ICD. That one caused more problems then help. Though a good one may be usefull.

Once you find the PICLIST

formatting link
you can navigate to everything you ever want to know about PICs. If not, you can always ask. I never found a real usefull book about PICs. As for reading you need to read the datasheet of the PIC at hand carefully, including the erata.

petrus bitbyter

Reply to
petrus bitbyter

I'm going to assume you have some programming experience. The best place to start would be to get a PICKIT 2 kit from Microchip, you'll have a 16F690, a board for it with some switches and LEDs, a USB programmer, a CD full of software & documentation.

If you don't have any programming experience at all, I would suggest a copy of "What's a microcontroller" and a basic stamp development kit for openers.

Reply to
att

At various times, I've used assembler (6502, Z80, 68000, 80x86, ARM), C, C++, Python, Lisp, Java, Haskell, PostScript, Basic for writing significant amounts of code. Plus having toyed with a dozen or so others but never using them for anything significant.

Am I correct in thinking that the various 10-16 chips are essentially the same CPU with different amounts of RAM, flash and I/O? And that 18 is quite similar but with enhancements to support programming in C?

I'm not looking at doing power stuff, at least not for now. I'm mostly concerned with the effect of parasitics on high-frequency signals.

Hmm; it's creator appears to have "disowned" it, recommending a PICkit 2.

Reply to
Nobody

I see you've had a lot of good feedback already... I'll add my $0.02 worth...

I got a book called "Programming and Customizing PICmicro Microcontrollers", Myke Predko. It came with a PCB for a simple programmer and several describes several projects. It has a good section discussing the basics, etc. While most of the projects use the 16F84, most should be able to be moved to other PIC variants. Most of the code is in assembler, though.

Dave

Reply to
starfire

Holy >!@&#!

That's some board! Oh, now I see "Touch Screen, Pencil, DS1820, LCD and GLCD are not included in the price!" But they aren't expensive to add. Nice. For the PIC10F200's, might need a SOT23-6 ZIF to ZIP, for programming some of those.

Jon

Reply to
Jon Kirwan

The PICkit 2 wins hands down. only $35. For DIP parts buy or make DIP ZIF adapter (ebay has them) Don't muck around with no-name brand or DIY programmers, it's not worth the hassle.

formatting link

Traditional breadboard is easiest.

Demo kits in general are pretty handy, but not much different to building yourself on breadboard.

Very important. It's a real PAIN to plug and unplug DIP parts every time you program it. MUCH easier if every design you make (even on breadboard) has an ICD connector. You can use in-circuit debugging too, it's not just for programming.

Also, forget using assembler, use and learn C. Then your programming skills will be more useful across any brand microcontroller, and you'll be able to do more complicated things with greater ease.

Dave.

Reply to
David L. Jones

I have the PICStart+ and the ProMate II plus some adapters. I don't have the PICKIT2 yet. I will be buying one, soon, though. (If anyone knows of a place cheaper than $49.99 US, let me know.) You can also get a variety of 3rd party boards for this, as well. (I like the fact that Microchip supports their old tools [like the ProMate II] literally "forever," though.) My original PicStart didn't support flash programming of new code into it, but I adapted it with their newer chip (opened it up and installed it a few years ago) and it now downloads code from MPLAB just fine, when new chip support is required.

There are a lot of options for you to consider and none of us can really tell you what is better for you. If I were doing this new, I'd probably just look around for schematics -- think a little about their approaches -- and build it myself using some ZIF sockets I'd buy to go along with it.

(I just noticed that Newark has a "promo" on the PIC10F200 for less than 30 cents each in 1's, by the way.)

Whatever works for you, I think. I haven't had problems yet with a variety of methods. I sometimes use wire-wrap, even; or those $10 white proto boards and end-stripped jumper wires.

Don't know, but they look like one of several cheaper options.

There are times when that helps. But in the two or three cases where I really needed something, I needed my ICE2000 system to find the chip bugs. The trace buffer was a huge help there. (I haven't used ICD in years, to be honest. I usually can track down my own problem code fairly easily without it.)

You have some, already. Microchip also has a forum and if I were you I'd set up an account and use it.

Jon

Reply to
Jon Kirwan

Then stick with C. Don't struggle learning yet another useless assembler dialect, it won't get you very far.

Basically yes.

You can happily use C on even the smallest PICs, not just the 18's and above. The 18's and above handle C a bit better but it's not a big deal. Code-compactness varies of course, some compilers are MUCH better than others. Unles you are targeting some high volume price-senstive application, choose a PIC with the most memory. If you are hitting memory constraints then you have chosen the wrong PIC.

That's not much of a concern with most basic micro apps, as even the fastest PICs can't process I/O at more than few MHz. Breadboard will be fine, vero-board for more permanent stuff. And custom PCB's are pretty cheap once you want a decent looking product.

Very very smart idea, you'd be wise to heed that advice. The PICkit 3 is due out any week now, but probbaly not worth waiting for. PICkit 2 will be everything you want, including powering your circuit (fully software variable voltage), in-circuit debugging, has push-button field programming, and also works as a logic analyser.

Dave.

Reply to
David L. Jones

Plenty of places for $35: Microchip Direct:

formatting link

Digikey:

formatting link

Mouser:

formatting link

The PICkit 3 is just out:

formatting link
and
formatting link
But the PICkit2 is well proven, the 3 isn't yet.

Dave.

Reply to
David L. Jones

Actually, I was thinking about the kit that includes the extra board (DV164120 and DV164121.) Also, I may need AC162061 and AC164110.

Jon

Reply to
Jon Kirwan

The PICkit 2 Debug Express seems to give the most bang for the buck. Do not be alarmed at the poor documentation, incomplete documentation, incomplete software, etc. As long as you have high speed internet, the gaps can be mostly filled in less than a few hours (wild guess; it took me a number of hours for download and a number of daze to find what was needed). The demo board works right out of the "box"; the so-called tutor programs might work if you can figure out how to install them.

Keep the bypass cap (i used 0.1uF) close to the supply pins and you should be OK with almost any prototype scheme.

Reply to
Robert Baer

PICs.

of controller,

clear, suck, are from the dark or middle ages.

good PIC related websites, and a lot of crap

you are really getting close to results.

*CATCH* those pies; well worth the effort if any are fresh!
Reply to
Robert Baer

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.