Choosing the right PIC
Choosing a PIC according to your needs is sometimes a headache. There are people of course that hate headaches and therefore they use just 2-3 types of PICs and that's all. That is a solution of course, absolutely inefficient though.
The selection needs to have some criteria. Those criteria come along with the type of application you have in mind to make. That is the reason why i cannot set a numbered list of choosing criteria from highest to lowest, but i can only think a list of them. Within this list, all items are equal to each other.
Now, let's see what should be your considerations when choosing the right PIC:
The bit length of the PIC:
You can choose between 8, 16 and 32 bit micro controllers. My advice is to choose the smallest possible. If you do not have to deal with large numbers, larger than 8-bits, then you should stick with the 8-bit family. If you need to measure pulses for example that would exceed the 8-bits, then there are ways to do this with -bit uControllers. Some of them are equipped with one or more 16-bit counter/timers that does the job easy. Also, you may use two or more 8-bit bytes to represent a larger number. What i want to say is that you should always try to use the simplest one for your job. It is cheaper after all.
The memory size:
One word: The more, the better. The only frontier here is the price. Strangely (not really), Microchip has a pricing policy that may surprise you. You may find for example a PIC that has small memory and fewer capabilities from another one, but instead of being cheaper it is more expensive. I suppose that this comes with the selling quantities. More memory does not always mean more money.
Keep in mind that there are actually 3 types of basic memories within one PIC. First the programm memory. It is usually 1 to 32 K Bytes. This part of memory will hold the program itself. If you are thinking of a long assembly sheet, think also of a long program memory.
The second type is the RAM. This is usually 1K Byte but it can get some wild numbers! Especially in 32bit systems that can have up to 32KBytes of RAM. This memory is used for temporarily storing variables and parameter values. This memory, like the RAM of the PC, will blank each time the power of the PIC is turned off.
The third type is EEPROM memory. This is the "Hard Disk Storage" of your PIC. This memory is read and written using a specific program flow and the values stored there are kept even if the PIC is completely out of power. The size is up to 4K and it has a negative effect to the price of the PIC. Use those bytes wisely.
The pin count:
Although i said on the beginning that all the items are equally between them, the pin count of a PIC is usually the first and most important that will determine the selection. there are tiny 4 I/O ports PICs, and some titans with 85 I/O ports! The price is analog to the ports of course. The most common are the 16 I/O (18 pins) pics and the 38 I/O (40 pins). You should keep in mind that there are ways to expand the I/O ports with SIPO and PISO blocks by using just 3 ports of the PIC.
The maximum frequency:
Up to 120MHz is the frequency that those beauties can reach. A standard 20Mhz though, is usually enough for an amateur and an advanced person. You need to have in mind that the fastest the clock, the faster the program flows. There are plenty of situations that a fast clock is completely inappropriate. If for example you make an RPM meter for slow turning motors or PC fans, then you will discover that the clock should be slow to avoid unnecessary divisions and avoid big numbers. It may not make any sense to you right now. If it does not indeed, then just go for a 4 to 20MHz PIC.
Along with the maximum external clock of the PIC, comes also the internal oscillator. This is an internal oscillator that some PICs are equipped with. Using this feature, the PIC can work with no external crystal or other oscillator. This saves space on the PCB, money on the construction and of course it saves power. This is usually a 32KHz clock but can go up to 32MHz in some cases. Although it cannot achieve the fidelity of a quartz, i advise to use it whenever this is possible.
The debugging feature:
I have used several different cheap and not so cheap PIC programmers. Right now, i use an ICD 2.2. This programmer is compartible with the MPLAB debug feature. The PIC16F88 supports this debugger. The debugging is sometimes a life-jacket during a boat sinking. Although it is a S-L-O-W procedure, although sometimes it is technically impossible to debug, i must admit that it has saved me plenty of hours laying face to face with the monitor. For a beginner, i vote YES. If your budget permits that, select one of the possible PIC programmers that are also debuggers and compartible with MPLAB. And if you respect your time, choose a USB one and not a parallel port programmer. Here is a good beginning to your search:
Microchip ICD 2 programmer / Debugger
Communication, analog and digital peripherals:
I've kept the best part for the end. Almost every PIC has at least one of those features embedded. If you are thinking of using them, then this will be the number #1 search criteria. Here is a list of those features, so you know with what you're dealing with:
Hopefully, i have not forgotten any...
Inside every PIC, there is at least one timer/counter. These are modules used to measure pulses from several sources. They could measure pulses from an encoder, from an rtc, from the engine distributor, from the PIC's clock itself... Those timers are 8, 16 or 32 bit length. An 8 bit micro controller does not mean that it will only have 8-bit timer. This is not true. An 8-bit uController may have up to 3 16-bit timers inside, along with some 8-bit timers. But no 8-bit PIC has a 32-bit timer.
Selecting a PIC using this parameter as criteria, require experience. Therefore, if you are an amateur, just leave this feature aside. One 16-bit counter for an 8-bit PIC is far enough for your starting projects.
It's not that bad after all
... as you may have already thought. Yes, there are thousands of PICs. Yes, each one may be used for sophisticated applications. yes you need to gain experience before being a PIC-selector guru. But Microchip has make a big step forward. They recently introduced the MAPS. It means Microchip Advanced Part Selector. What it does, is that you enter your criteria, and it returns the available PICs that fits to your needs, along with the datasheets and a budgetary pricing. You can find the MIPS at the following link:
Microchip Advanced Part Selector (MIPS)
I must say that this tools is WOW!
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise without the prior written permission of the author.
Read the Disclaimer
All trademarks used are properties of their respective owners.
Copyright © 2007-2009 Lazaridis Giorgos.
All rights reserved.