Shop OBEX P1 Docs P2 Docs Learn Events
PIC chips..... where to start — Parallax Forums

PIC chips..... where to start

Steve2381Steve2381 Posts: 94
edited 2012-01-28 10:46 in General Discussion
Hi all

Pretty much exhausted the Basic stamps now..... currently playing with Propeller chips.

However, for several smaller projects I have going, I am pretty sure PIC chips would be better suited - as the functions I need are pretty simple.

There are SO MANY Pics! Where the heck do I start.
I have been trying to work out what the differences between all these chips is (some are obvious)

Anyone recommend a good starter kit - USB connected?

Thanks
Steve

Comments

  • Heater.Heater. Posts: 21,230
    edited 2012-01-26 04:17
    There are SO MANY Pics! Where the heck do I start.

    Exactly. And when you have stocked up with a few PICs you will find that your next project idea can't be done with them because you don't have just the one with the right combination of features that day.

    So, stock up on Propellers, they may be overkill for some jobs but they are a blank slate that can be used very flexibly.
  • LeonLeon Posts: 7,620
    edited 2012-01-26 04:19
    This kit looks quite good:

    http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en539716&redirects=picdemlab

    There are much cheaper options, such as buying a PICkit and a few chips and wiring up your own board. In that case, here are some nice tutorials:

    http://www.gooligum.com.au/tut_baseline.html

    The PIC18 family is much easier to use than the other 8-bit devices, and it might be better to start with those.
  • BeanBean Posts: 8,129
    edited 2012-01-26 04:40
    Steve,
    I've been using some pics recently because I need a very small processor.
    The PIC10F322 has just come out and it is available in a SOT-23 size.
    I would suggest staying away from the 12 bit core devices. They are a pain to use.
    I use the 14-bit core devices.
    As for a programmer, I'd get the PICKit3.
    And you'll need the adapter for whatever device you want to program. Or you can do what I do, and just connect wires from the programmer to the device pins.

    Bean
  • Steve2381Steve2381 Posts: 94
    edited 2012-01-26 05:14
    Mmm... but propeller and stamp chips are just so bloody expensive.
    I love using stamp chips, but most projects just don't warrant the cost of the stamp.

    Read good/bad about the pickit3 programmer (as in - pickit2 was far better), but I expect it doesn't make a lot of difference.
    Who uses what software for programming (I see some kits come with discs)

    Looks like a learning curve ahead again!
  • BeanBean Posts: 8,129
    edited 2012-01-26 05:20
    Steve,
    The IDE for PICs is called MPLAB. You can download it from Microchip.
    I got the PicKit3 because the PicKit2 doesn't support the 10F322 in MPLAB.

    I don't know if you can still buy it, but the PicKit1 is good for beginners. It has LEDs, button, pot, etc on the board.
    For a good all-around generic Pic I like the PIC16F688.

    Bean
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2012-01-26 05:23
    I too recommend going with the 18 +, as you can code C. This would also be a good starter - http://www.microchipdirect.com/ProductSearch.aspx?Keywords=DV164131

    If you want to do assembler, the pic16f688 is a classic that would be a good starting point. If you can stand spending the money, get the icd3, its a lot faster, although I can't get mine to work with mplabX.
  • bill190bill190 Posts: 769
    edited 2012-01-26 07:31
    So far as getting started with PIC's, just start reading!

    Everything is 400 pages!
    Microcontroller Data Sheet, MPLAB IDE documentation, C language, Assembly, etc.

    And they don't tell you obvious things. All throughout a microcontroller data sheet it will reference "FOSC". But nowhere does it say what "FOSC" is!

    FYI - It is the entire oscillator block diagram and your chosen output speed of that. Or "Flexible Oscillator Structure".

    Fully understand "FOSC" and the "Configuration Bits", then you will be off to a good start.

    Then look at specific pins in the data sheet. For one pin it might say...

    RB5/AN13/CPS5/P2B(1)/CCP3(1)/P3A(1)/T1G(1)/COM1

    ...those are all different things that pin can be used for! And to use the pin for one thing, there may be "configuration bit" settings which need to be on/off. Or other settings relating to other things which may need to be turned off. So you are best to read through the data sheet about all of those things the pin can be used for and be sure the settings for the things you are not using are off.

    And poke around the Microchip web site to see all the documentation available. There are all sorts of papers written on specific topics like Capacitive Touch, Interrupt on Change, Energy Saving, USB, etc.

    Then nobody understands PWM by just reading the data sheet! For that there is a cheat calculator here...

    (Note it says: "This calculator will save you from insomnia and headaches!")
    http://www.micro-examples.com/public/microex-navig/doc/097-pwm-calculator.html
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-01-26 08:24
    Even though many Parallax forum users use (or have used) PICs, this is a forum primarily for Parallax products. You may find the following to be a richer and more complete source of info for Microchip products:

    -Phil
  • Heater.Heater. Posts: 21,230
    edited 2012-01-26 08:35
    Yes, Props are more expensive.

    Even so one might find it cheaper and easier to have some Props on hand than a draw full of PICs that don't quite fit anything you want to do and don't get used.. And it saves waiting around for the right ones you have ordered to arrive. I still have a pile of PICs and AVRs sitting unused. And as pointed out it saves all that endless waiting through 400 page manuals.

    So unless you have a production run it's worth thinking about.
  • rod1963rod1963 Posts: 752
    edited 2012-01-26 10:01
    Try the PicAxe series of micros. They run on Basic and are dirt cheap($2.95 on up) and come in a variety of sizes from 8 pins to 40 pins.

    Nice chip for those one-off non-demanding apps that don't need a 32bit processor.

    Sparkfun among others sells them.
  • davejamesdavejames Posts: 4,047
    edited 2012-01-26 12:06
    Steve2381 wrote: »
    Pretty much exhausted the Basic stamps now.....

    Being recently reminded that I'm still a noob, could you explain (for my education) what you mean by the above?

    Admittedly I've just scratched the surface of the Stamp's capabilities in using it as just a simple controller, but I've seen what others have done in exercising its math and bit handling features.

    Why and how, in your usage, has the Stamp been "exhausted"?

    I'm just curious, I'm attempting to learn, I'm not insinuating anything - just asking.

    Thanks much.
  • ercoerco Posts: 20,259
    edited 2012-01-26 13:46
    rod1963 wrote: »
    Try the PicAxe series of micros. They run on Basic and are dirt cheap($2.95 on up) and come in a variety of sizes from 8 pins to 40 pins.

    Nice chip for those one-off non-demanding apps that don't need a 32bit processor.

    Sparkfun among others sells them.

    +1
  • Martin_HMartin_H Posts: 4,051
    edited 2012-01-26 15:39
    While I like objects and methods offered by Spin on the Propeller or C++ on the Arduino. I find PBASIC on the stamp nice too. The built in commands and tons of sample code available means you can knock out stuff quickly. I wouldn't try kinematics on it without a coprocessor and servo controller, but for line following or roaming with sensors it is more than adequate.
  • FranklinFranklin Posts: 4,747
    edited 2012-01-26 20:50
    There are SO MANY Pics! Where the heck do I start.
    In most cases you start with a project and a need, then you find the hardware and chip that will most closely fit your needs.
  • Steve2381Steve2381 Posts: 94
    edited 2012-01-27 01:03
    OK. Thanks guys. I have plenty to read and think about.
    I will research all the links you have thrown up, and see what fits my needs best.

    My comment about exhausting Basic stamps really means that I can program them with my eyes shut. The reason I moved on to Propeller chips is because, every time I start a Basic chip project, I end up running out of development room.
    The have their limits. It all comes down to what you are building and picking the right components.

    The reason for the PICs... its something else I have at my disposal. For those silly little 2" square mini projects that don't need a huge amount of programming.
    Plus... it niggles me when I see a PIC chip and I have no idea how to use it (within reason).

    For an exmaple of pushing a Stamp to its limits.... the classic alarm clock I made a good few years back...

    http://www.youtube.com/watch?v=vCgMDY-Sg1Q

    Thanks all
    Steve
  • bsnutbsnut Posts: 521
    edited 2012-01-27 02:23
    I would suggest after you read all this. Is a Velleman PIC kit which comes with its own PIC chip and you can get it from Radio Shack stores or from their site.
  • Steve2381Steve2381 Posts: 94
    edited 2012-01-27 04:39
    The Picaxe stuff looks pretty good I have to say (for what I need). Is this just a variation of a standard PIC then? Is the programming the same or more basic?

    http://www.techsupplies.co.uk/epages/Store.sf/en_GB/?ObjectPath=/Shops/Store.TechSupplies/Products/AXE091U

    This kit seems to cover a lot of bases.
    Steve
  • rod1963rod1963 Posts: 752
    edited 2012-01-27 09:19
    In the words of the PicAxe people - "A PICAXE chip is a standard Microchip PIC microcontroller that has been pre-programmed with the PICAXE bootstrap firmware code. The bootstrap code enables the PICAXE microcontroller to be re-programmed 'in position' directly via a simple 'three wire' download cable connection.." The newest versions(X2 series)) uses the PIC18F25K22(28 pin) and PIC18F45K22(40 pin).
  • davejamesdavejames Posts: 4,047
    edited 2012-01-27 09:36
    Steve2381 wrote: »
    For an exmaple of pushing a Stamp to its limits.... the classic alarm clock I made a good few years back...

    Again, attempting to understand...sorry for being thick.

    Is the limit mentioned above and the comment about "running out of development room" related to the number of I/Os?


    Thanks much.
  • bill190bill190 Posts: 769
    edited 2012-01-27 11:13
    As for learning about PIC microcontrollers, I would advise you to not take the "easy" way out (preprogrammed and Basic).

    Rather read the data sheets and learn how the internals work. Learn about interrupts. Write a C program with a bit of "inline assembly code" as an interrupt handler. Write an assembly program.

    And learn how to load your programs into a PIC microcontroller with a PICKit 3. (Gets the job done for a reasonable price and you can use it for on chip "live" debugging.)

    Note: I have 3 computers in my office. On "my" computer, I have a PICKit 3 connected and that connected to a PIC chip.

    And on my old "visitor" computer, I have a Basic Stamp connected to "blinky LED's". If I want to show a friend/visitor the basics of programming, that is my microcontroller of choice. I also use it to test some outputs of PIC chips and the Propeller. For some things a multimeter or scope does not cut it!

    Learning all about PIC chips will help you see the limitations of these chips and to appreciate the speed and multitasking ability of the Propeller.

    PIC's can only do one thing at a time. So while it is doing one thing, it may not "see" a button press.

    And with assembly, it can go so fast, that new unique problems crop up. For example an input line which was "high" and is transitioning to "low" may not make that transition fast enough by the time the next instruction is called. The next instruction still sees that input line as being "high"!

    All sorts of challenging problems which will drive you nuts! (I call that FUN!)

    Note the following development board is cheap, but gets the job done (other number pin boards available)...
    http://www.sparkfun.com/products/18

    Then once you select a certain number of pins board, the next step is finding and ordering a chip which will fit into that socket (another challenge).

    Which Pin Count?
    18, 20, 28, 40, 44, 64, 80, 100 Pins.

    Which package?
    28/QFN
    28/SOIC
    300mil
    28/SPDIP
    28/SSOP
    208mil
    28/UQFN

    Order PIC chips here...
    http://www.microchipdirect.com

    And info/technical documents/downloads on those chips here...
    http://www.microchip.com

    MPLAB IDE here...
    http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en019469&part=SW007002

    Read about MPLAB "X" as opposed to MPLAB IDE v8.83 here...
    http://www.microchip.com/forums/default.aspx
  • Heater.Heater. Posts: 21,230
    edited 2012-01-27 11:24
    Lack of development room could also be not enough memory or not enough speed. Perhaps it's the complexity of trying to perform more than one task at a time.
  • Steve2381Steve2381 Posts: 94
    edited 2012-01-27 11:39
    davejames wrote: »
    Again, attempting to understand...sorry for being thick.

    Is the limit mentioned above and the comment about "running out of development room" related to the number of I/Os?


    Thanks much.

    Both. Running out pins (that can usually be got over) and running out of programming room too.

    I will still use Stamps, but want to try other options.
    Anyway, my biggest gripe is they are far too expensive for most projects

    As for PicAxe vs PIC... I am not that fussed. Yes, its great to learn these things the hard way, but I only want them for quick little projects.
    I am buried in the Propeller stuff at the moment, so the PicAxe angle is attractive for the simple stuff.

    As for speed etc. They are going to be used for seriously dull tasks, so I don't think its a problem.

    Why are the Stamp chips still so expensive compared to the Prop chips? Surely component costs have come down by now.
  • John A. ZoidbergJohn A. Zoidberg Posts: 514
    edited 2012-01-28 07:27
    I started PIC microcontrollers 4 years back - and started with the PIC16F (bought the PICKit 2 and the mini board by Microchip) first. With pure assembly. Not really a good experience (bank switching is pretty nasty in ASM), but it's pretty fun and rewarding for the first time I got the LEDs to blink at a different rate and stuff.

    Books to recommend:

    PIC16F - Owen Bishop's "Robot Builder's Cookbook" (in ASM)
    PIC18F - Mazidi's "PIC Microcontroller and Embedded Systems: Using Assembly and C for PIC18"
    PIC24 - Lucio di Jasio's "Programming 16-Bit PIC Microcontrollers in C: Learning to Fly the PIC24"
    PIC32 - Lucio di Jasio's "Programming 32-bit Microcontrollers in C: Exploring the PIC32"

    Programmers:

    PICKit 2
    PICKit 3

    Compilers:

    Use the ones which have the lite version if you are trying the compiler or as a hobby use (all of them are C compilers).
    PIC16F - CCS Compiler, HitechC (lite version available), MikroC (4kb program size limit)
    PIC18F - CCS Compiler, HitechC (lite version available), MikroC (4kb program size limit), MPLAB C18 (student version available)
    PIC24/dsPIC - CCS Compiler, HitechC (lite version available), MikroC (6kb program size limit), MPLAB C30 (student version available)
    PIC32 - MPLAB C32 (student version available)

    Microcontrollers to start with:

    PIC16F - PIC16F628 (avoid the PIC16F84 as it's obsolete and expensive!), PIC16F690, PIC16F684, PIC16F887
    PIC18F - PIC18F1320, PIC18F4550, PIC18F45K20, PIC18F14K50, PIC18F2550

    * As for now I do not remember what should I recommend for the higher end PIC chips here, so I list down the basic ones first.
  • LeonLeon Posts: 7,620
    edited 2012-01-28 07:40
    Avoid the 16F628 and use the much better 16F88.
  • Mike2545Mike2545 Posts: 433
    edited 2012-01-28 08:07
    I started with Basic Stamp, and I too would run out of headroom in a hurry. Switching to PIC's for those monster programs is a real lifesaver. I started with the 18F series on a recomendation. I got the Pic Basic Pro, which uses the stamp syntax.

    For a quick and easy program I will still use a stamp to hash out the details :)
  • MikeKMikeK Posts: 118
    edited 2012-01-28 10:46
    I second the recommendation of the 16F88. If you want an 8-pin, try the 12F683. I've programmed them in assembler and Basic.
Sign In or Register to comment.