PIC Book or Tutorial

I am looking for a good book or tutorial on using the PIC. I have used many micros over the years (starting with the 8080 and progressing through umpteen 4 and 8 bit devices) so I am very familiar with the oddities of micro architectures and assembly level programming but I have never used a PIC. Most of the tutorials on the net seem, not surprisingly, aimed at the absolute beginner. Can someone recommend a book or tutorial aimed at the experienced micro user?

Cheers

Ian

Reply to
Ian Bell
Loading thread data ...

On a sunny day (Sun, 06 Dec 2009 13:56:19 +0000) it happened Ian Bell wrote in :

Any PIC datasheet has the instruction set and full description of the peripherals and registers. there is also some programming reference somewhere, if you want to write your own programmer. The

formatting link
website has plenty of application notes and example code, libraries etc.

Reply to
Jan Panteltje

peripherals and registers.

You know, one of the main things that has put me off using the PIC is the god awful navigation of Microchip's web site. I find it virtually impossible to find anything there.

Cheers

Ian

Reply to
Ian Bell

On a sunny day (Sun, 06 Dec 2009 16:23:05 +0000) it happened Ian Bell wrote in :

peripherals and registers.

code,

mm, look for application notes. Else type it in google, I have had cases where a search on a company website turned up nothing, but typing it in google found it in a second on their website.... So I use google... Example, type this in google, without the quotes: '

formatting link
application note' First link that pops up, select something, PIC16 for example, some subject, press enter Also works for anything else you may want to know.

Reply to
Jan Panteltje

peripherals and registers.

code,

Actually, I take some of that back. I just tried the site again and they seem to have changed the navigation to something more reasonable.

Cheers

ian

Reply to
Ian Bell

The Pic is not so different than other 8 bit micros, or even 16bit stuff. A higher language compiler makes it easy, There is a limited version for the C18 stuff on the microchip website.

Cheers

Reply to
Martin Riddle

Only uC I've used is the pic(since you used to get samples for free and they were pretty cheap). You shouldn't have any problem. Obviously there is a somewhat steep curve just to figure out how to get the damn things to work but it's mainly because of their sorry documation methods.

They have a forum to use that can be helpful at times. Just download mplab, get you a pic kit, and get a few samples. You should be up and running in no time.

You can breadboard the pic for ISCP and use DIY programmers which is a start but if you think you might actually get into using them regularly then the pic kit is the way to go.

When you get mplab also get the free C compilers as they'll make it much more easier to get started.

Reply to
Jon Slaughter

Just get yourself a starter kit (PICkit 2 or PICkit 3) and go from there. All these kits give you a programmer/debugger, a demo board and example apps to get you started. That and the datasheet, what more does an experienced person need? Forget assembler, move to C and most of the "oddities" that go with various assembler architectures will magically disappear.

The main difficulties with any micro is working the registers to set various peripherals up.

For some PIC fun, watch me rant:

formatting link
view/

Dave.

formatting link

Reply to
David L. Jones

...and i think almost the same thing concerning their "datasheets". A datasheet should have DC and AC info, period. Then have programming application note(s). And do not scatter info around among a dozen "datasheets" where it is hell to find something "simple" but needed - like which pins are used for programming; not to mention having _consistent_ designations regarding them.

Reply to
Robert Baer

A kit and the datasheet should be enough if you have had exposure to any low level hardware programming in assembler. The number of instructions typically around thirty is tiny in a PIC and they are fairly orthogonal. Conditional branches are simple, bit tests and loop counters are provided. Almost any of the datasheets will tell you everything you need to know. If you want a concrete example of a design that works out of the box then one of the hobbyist kits done by a magazine with associated tutorials might be your best bet.

Some of the starter kits also provide ICD capability with PC hosted software to control setting breakpoints for full speed execution and single stepping through tricky code. I'd say that was worth having if you intend to do anything remotely serious or realtime. The MPLAB simulator has a few quirks but is pretty good on the whole. It is almost trivial to make a design in circuit programmable for testing or upgrade too.

OK if you are not trying to do timing critical things, but C isn't a great fit to the PIC architecture.

Bank switching can be a source of some amusement too. Although it can be used creatively.

Regards, Martin Brown

Reply to
Martin Brown

The 8051 isn't friendly to c. But many projects using the SiLabs C8051 or the Atmel AT89 use c compiler tools all the same.

Unlike assembly, c doesn't have a way of specifying semantics that may be important. For example, there is no way to specify that the cycle count of two code edges must be the same. In reality, this may be important and in assembly this is often quite easy to implement. No way to even express the desire in c.

But I'm doing highly time-critical stuff on the SiLabs parts without problem, using c and assembly mixed. But then I usually mix the two to get the best of both worlds.

:)

The PIC is like the transparent man. You can almost _see_ the design parts exposed.

Jon

Reply to
Jon Kirwan

20 years ago a kit and a data sheet would have been exactly what I would have done. I had hoped that the internet might provide more in depth information particularly on the quirks and pitfalls that all these micro-controllers have.

Cheers

Ian

Reply to
Ian Bell

Parallax, of course.

Start with the BASIC STAMP.

--
Many thanks,

Don Lancaster                          voice phone: (928)428-4073
Synergetics   3860 West First Street   Box 809 Thatcher, AZ 85552
rss: http://www.tinaja.com/whtnu.xml   email: don@tinaja.com

Please visit my GURU's LAIR web site at http://www.tinaja.com
Reply to
Don Lancaster

In our days, there is no point in starting with PIC. Why learning crippled architecture when there are families which are better then PIC by *all* paramerers including price? BTW, some ARM clones are approaching cost barrier of $1.

Vladimir Vassilevsky DSP and Mixed Signal Design Consultant

formatting link

Reply to
Vladimir Vassilevsky

What would you recommend for an OLD analog guy who would like to learn (and use) such devices? ...Jim Thompson

--
| James E.Thompson, CTO                            |    mens     |
| Analog Innovations, Inc.                         |     et      |
| Analog/Mixed-Signal ASIC\'s and Discrete Systems  |    manus    |
| Phoenix, Arizona  85048    Skype: Contacts Only  |             |
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  |
| E-mail Icon at http://www.analog-innovations.com |    1962     |
             
                     In wine there is wisdom,
                    In beer there is freedom,
                   In water there is bacteria
                                               - Benjamin Franklin
Reply to
Jim Thompson

I agree with DJones and JPanteltje - the datasheets and appnotes are a wealth of information.

Studying some of the code (Mr. Panteltje has done some very interesting things) is most instructive. The in circuit programmers from Microchip are very cost effective and useful. Of course you can homebrew these too.

I've also used the books by Predko and Hellebuyck and found them helpful. Regards, TomC

Reply to
tomcee

Hi Jim, Well, here is what I did...

First subscrbe to Circuit Cellar

formatting link
to get a lot of info on what is out there. In the past, they had design contests where you could get a free development kit just for signing up. That is where I got my initial kits for the PSoC and PIC products, as well as the Freescale ones.

Now, to really use the PIC, you need a programmer/debugger, and an eval board or two. I have been working in the PIC24 line pretty much, so the Explorer 16 board has a lot to offer. Thre is also a book, Programming 16-Bit PIC Microcontrollers in C: Learning to Fly the PIC

24 that has a lot of experiments based on the Explorer 16 that is very useful. For $500 you can get pretty well set up to learn a lot!

Charlie

Reply to
Charlie E.

Bite the bullet and get a PIC24 (eg. Explorer 16) eval board and a debugger/programmer such as the ICD3 or Pickit. You can get an ICD3 with a low end PIC24 eval board (not the Explorer 16) for just over $200 list.

It's a pretty C-friendly architecture and you can use the "Student" edition of the GCC-based compiler for free indefinitely, though it forgets how to do the optimizations after the evaluation period is over (so you have to buy the full version, OR buy a bit more expensive chip if it's a big program, not a bad trade-off). You can also program it in assembler if you like. The debugger in conjunction with the free MPLAB IDE and C compiler will allow you to edit, download and debug (eg. set breakpoints and single-step). Most of the newer PICs (other than those which are very pin constrained or cost-constrained) have built-in debug hardware that consumes a small amount of resources (pins, memory) and essentially replaces the $20,000 emulators of old.

Warning: These newer chips have a steeper learning curve than the old micros with scores of configuration registers and so on. You'll need to do a lot of reading to accomplish some fairly simple things (such as telling the micro where to find its clock signal) the first time through, unless there's sample code that helps you out. You need the 'data sheet' and the appropriate family reference manual at a minimum, and these can run upwards of 1k page of documentation, and it may not always be 100% clear (or 100% correct). Be prepared for this frustration.

If you like classroom learning, Microchip has regional training centers, and the courses are not bad (I happen to get to attend them for free, but I don't think they are expensive and they probably give deep discounts with no shipping cost on the development tools if you attend so cost might end up a wash if they're held in your city ). You'll be up and running hands-on in no time.

A lot depends on what you want to do with the micro-- but even it's as complex as setting up an Ethernet connection or a USB host, the eval kits and demo software will get you up and running pretty fast. Even for something as pedestrian as a custom 'smart' battery charger (for an aerospace application) I've found the PIC24/30/33 family to be appropriate.

Alternatively, you could start off with one of the clunkier lower-end

8-bit PIC architectures (12 or 14 bit or 16 bit instructions) but I wouldn't suggest that unless you want to do really low end tasks (in assembler or maybe in Hitech C) *and* part cost is quite important. Something like the 8-pin PIC12F625 should be fun to play with.

Avoid things like the Stamp-- you won't be programming a PIC, but writing a program in a terrible language stored on a slow serial EEPROM that is fished out in bytecodes and interpreted by a proprietary firmware program *on* a PIC. The difference between the lightning and the lightning bug. If you have had exposure to micros the constraints will drive you up the wall. You can do it yourself in macros with 10x the performance.

Reply to
Spehro Pefhany

Let the old guy lay his own board and start working on a real project. The only way to learn is to do something practical. Microcontrollers are very simple, there is really nothing to it. If elephant drovers and rice farmers could do this job, why can't you?

Atmel AVR is particularly easy to learn, very suitable for C programming and you only need 5 wires to PC LPT port to flash it. Hobbyists like it.

ARM family is big thing as it is available from different vendors, and ARMs come in all sizes from $1.5 tiny part competing with low end

8-bitters, to huge ARM10.

Freescale or TI are good for professional use. Excellent part longevity, reliability; but not so easy to start working with. Their documentation is dry and they mention one thing only in one place; so you have to read it all through.

MSP430 is a king if you need years of operation from coin cell.

In my 20+ years of practice, I never had a need for evaluation boars, nor for fancy JTAG debuggers. The only development aids that I use are test printouts, flashing LEDs and sometimes DAC to output a waveform. I've done quite complicated projects with multicore DSPs, FPGAs and megabytes of source code. As for the books, IMO the original datasheets and appnotes from vendor are much more useful and short spoken then those retellings and interpretations.

Many folks enjoy wrestling with linuxes and so-called free opensourse software. Well, why not, if they are having fun out of it, especially on company time. I prefer software that simply works and does the job.

Vladimir Vassilevsky DSP and Mixed Signal Design Consultant

formatting link

Reply to
Vladimir Vassilevsky

If you like to learn PIC by starting to making the circuit while learning the inner working of PIC at the same time, this site is worth to take a look at

formatting link

It doesn't assume you are a absolute beginner and know all the high level language like C or BASIC. It is just simply play while you learn. I have experience in 6 bit micros like 6502, Z80, 68HC11 etc but I found this site very easy to follow. This is where I learnt my PIC HW and SW.

Allen

Reply to
Allen Bong

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.