PIC chips..... where to start
Steve2381
Posts: 94
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
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
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.
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.
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
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!
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
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.
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
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.
Nice chip for those one-off non-demanding apps that don't need a 32bit processor.
Sparkfun among others sells them.
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.
+1
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
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
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.
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
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.
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.
For a quick and easy program I will still use a stamp to hash out the details