Connect with us

PIC Book or Tutorial

Discussion in 'Electronic Design' started by Ian Bell, Dec 6, 2009.

Scroll to continue with content
  1. Ian Bell

    Ian Bell Guest

    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
     
  2. Ian Bell

    Ian Bell Guest

    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
     
  3. Ian Bell

    Ian Bell Guest

    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
     
  4. 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
     
  5. 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.
     
  6. Jon Kirwan

    Jon Kirwan Guest

    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
     
  7. Ian Bell

    Ian Bell Guest

    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
     

  8. 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:

    Please visit my GURU's LAIR web site at http://www.tinaja.com
     
  9. Charlie E.

    Charlie E. Guest

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

    First subscrbe to Circuit Cellar http://www.circuitcellar.com/ 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
     
  10. 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.
     
  11. Ian Bell

    Ian Bell Guest


    Thanks Allen, that's a good link with other good links within it.

    Cheers

    Ian
     

  12. Get a development kit. The kits have a programmer/debugger and a device
    on a protoboard.
    Then find the book
    The.ANSI.C.Programming.Language.Ritchie&Kernighan.2n.ed.pdf and learn a
    little C. Microchips compiliers are pretty well debugged and well
    behaved. So writing real C will generate good code, not buggy code.
    Microchip has demos for their 18F and dsp parts, Optimaizations are
    turned off after 30 days, but you are not limited in any other way.
    Then pick a project and go for it.

    You can go the ARM or AVR route, but some of the free compilers
    generate buggy code. Not the best for someone that is trying to learn.

    Cheers
     
  13. Nobody

    Nobody Guest

    Where can I get an ARM clone in a DIP package?
     
  14. Jon Kirwan

    Jon Kirwan Guest

    I still use DIP and wire-wrap, at times. But I'm a hobbyist. Besides,
    I wouldn't put it past someone to do an ARM7 in DIP (not that I've
    noticed one.)

    There is a discerning division on pin-count, though. I can get 8-bit
    micros with 5, 6, and 8 pins. Pins translate readily to manufacturing
    cost (and thus, at some point, purchase price) due to the 'huge' die
    space required for anything going 'off chip' and the cost of
    wire-bonding and testing. Power consumption is likely to remain a bit
    of a dividing line -- ARMs are "low" power, compared to an x86. But
    they are not "low" power compared to an MSP430 and I don't imagine
    they ever will be.

    Regardless, I'd very much like to know of a 6 or 8 pin ARM. Or if
    there are any even announced in some publicly available product plan.

    Jon
     
  15. Nobody

    Nobody Guest

    [snip]

    Unfortunately, the cost is between 10x and 100x what I typically spend on
    an 8-bit PIC, although I daresay they're somewhat more powerful.
     
  16. Rich Webb

    Rich Webb Guest

    <sigh> Incomplete specifications again... ;-)

    Seriously, though, the chips themselves aren't that expensive even in
    quantity-one pricing, nor are the dev boards out of line with similar
    boards for other processor families. The only reason for DIPs, nowadays,
    is to stick on one of those plastic breadboards. Easier to just get a
    working dev board and start playing.
     
  17. Rich Webb

    Rich Webb Guest

    Very true. My BugBox has a few trays of assorted AVRs (and even a few
    PICs) that get plugged into breadboards for the occasional one-off or to
    try out an idea. They usually stay there until I need more breadboard
    space and can't remember what the heck that particular rat's nest of
    wires was originally built for...

    But I also have a few ESD bags where the MSP430 and ARM dev boards live.
    They easily interoperate with the breadboards using a few jumpers or,
    for a couple that are on DIP carriers, just plug 'm in. Be a shame to
    miss out on the 32-bitters just because they don't fit on stripboard or
    breadboards.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-