Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC 16f. or 18f series mc ?

Status
Not open for further replies.

gsrattan

Newbie level 5
Newbie level 5
Joined
Jan 27, 2013
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,340
I am starting learning about PIC microcontroller. but i am in confusion about which MC i choose 16 series or 18.
please help me to choose right one. And what is the difference between them.And where can i get about that MC?
 

I am starting learning about PIC microcontroller. but i am in confusion about which MC i choose 16 series or 18.
please help me to choose right one. And what is the difference between them.And where can i get about that MC?


Hi Gsrattan,

My opinion is that you should choose uC based on projects needs, availability and prices of parts, ease of use (soldering SMD uC with many pins),...

DIP case for developing and experimenting, SMD TQFP,... for finished device.

For my thinking, minimum starting point is PIC18 family, next steps are dsPIC-PIC23, PIC32, ARM.

I see a lot of stereotype usage of old PIC16F877 uC and similar uCs in 2013. year. :roll:

Look to buy and use uC with better features, higher amount of RAM, Flash, cheaper, ....




Best regards,
Peter
 

I am just starting studying about PIC, I am not working on any project. I just want to know which mc will be more helpful in future..
 

For lots of projects best buy is PIC18F46K22.

This uC have ideal balance between features-price-resources.

64KB program memory
3896 bytes of RAM
1024 bytes EEPROM
64 MHz
16 MIPS CPU Speed
Price is around 2,5eur.
.
.
.

https://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en547757



Compared with PIC16F877A

14KB program memory
368 bytes RAM
256 bytes
5 MIPS CPU Speed
Price around 5-6eur ! :shock:
.
.
.

https://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en010242





Best regards,
Peter
 

U may start learning about microcontroller with 16F especially 16F877A (40 pin), many courses starts with this pic or even with 16f628a (20 pin).

There's no big differences between 16F and 18F series, except that 18F has more features than 16F...
 

Its big difference to know when you enter into programming and start getting programming skills, you will see that you can easily use other uCs. Usage of each uC requires reading manufacturers datasheet for that particular uC.



U may start learning about microcontroller with 16F especially 16F877A (40 pin), many courses starts with this pic or even with 16f628a (20 pin).

There's no big differences between 16F and 18F series, except that 18F has more features than 16F...


Old PIC16F84A for example have more available examples and tutorials, but price is around 5-6eur (in my country price is catastrophic around 10eur :shock:)

And what we can make in 2013. year in GLCD, LCD, TFT environments with these available resources:
1,75KB Programming memory
68 bytes RAM
5 MIPS
.
.
.

https://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en010229




Best regards,
Peter

:wink:
 

Hi,


Agree with all the above, the 16F range is so well documented with examples, tutorials and forums, but the 18Fs are the better chips and actually a bit easier to use, though that only a point you can appreciate once you have used both.

Something not mentioned so far it the programming language you are looking to use ? thats just as important as the higher level ones do need lots more program memory so the bigger chips like the 18F are much better.

Also a consideration is your budget, do you want to buy an expensive ready made development board or are you more into build your own ? - there are plenty of in between options as well, always something to suit everyone.

Edit - should add that there are a few simulators around, some free, so you do not actually have to have any hardware to build the circuit and prove a program.
You of course have to learn a bit more to use a simulator, but at least its only going to cost you time, not money.
 
Last edited:

i paid only 20 bucks for 20 pic16f877a on ebay.very good deal.


I hope they are genuine. If they are original maybe we can sell them to Microchip company, they will save whole 5USD. :)

https://www.microchipdirect.com/ProductSearch.aspx?Keywords=PIC16F877A

https://www.digikey.com/product-detail/en/PIC16F877A-I/PT/PIC16F877A-I/PT-ND/480769

https://www.digikey.com/product-detail/en/PIC16F877A-I/P/PIC16F877A-I/P-ND/446143

If they are genuine its ok, but still with small capabilities/resources compared to other newer and cheaper uCs.

PIC16F877A have flag "Mature" on Microchip web, and they manufacture these older products just to support existing projects/products with older uCs. Older products have higher prices for production but company still produce them. For new designs and projects better choose something from this time, with respected features for needs of todays projects.

"Mature" flag is fine way to tell you "Not recommended for new designs." :smile:



What car do you want to drive VW Golf 1 or VW Golf 7 ?

On end to say this : "If you know to drive car, you will know to drive both Golf 1 and Golf 7".



Best regards,
Peter

:wink:
 
Last edited:

My advice:
Choose 18F series every time.

As a new user you really do not want to contend with the IRP bit issue as your program starts to grow.
You can avoid this mess totally by selecting 18 series and the prices are not generally higher.
 

I'm sorry guys, i made a mistake.I paid 20 bucks for 10 chips not 20 as i motioned before.
here's a link to ebay


**broken link removed**


Its ok. ;-)

On "ebay" can be found lots of useful and cheap things. But, for some complex designs and projects better look to buy new parts from reputable sellers.


One additional thing to original thread question. Compilers often have some specifics for each PIC family (PIC16 and PIC18 - 8bit uCs) and its good to know that.

MikroC PRO for PIC Specifics
https://www.mikroe.com/download/eng/documents/compilers/mikroc/pro/pic/help/mikroc_pro_specifics.htm

Code:
PIC Specifics
In order to get the most from your mikroC PRO for PIC compiler, you should be familiar with certain aspects of PIC MCU. This knowledge is not essential, but it can provide you a better understanding of PICs’ capabilities and limitations, and their impact on the code writing.

Types Efficiency
First of all, you should know that PIC’s ALU, which performs arithmetic operations, is optimized for working with bytes. Although mikroC PRO for PIC is capable of handling very complex data types, PIC may choke on them, especially if you are working on some of the older models. This can dramatically increase the time needed for performing even simple operations. Universal advice is to use the smallest possible type in every situation. It applies to all programming in general, and doubly so with microcontrollers.

Get to know your tool. When it comes down to calculus, not all PIC MCUs are of equal performance. For example, PIC16 family lacks hardware resources to multiply two bytes, so it is compensated by a software algorithm. On the other hand, PIC18 family has HW multiplier, and as a result, multiplication works considerably faster.

Nested Calls Limitations
Nested call represents a function call within function body, either to itself (recursive calls) or to another function. Recursive function calls are supported by mikroC PRO for PIC but with limitations. Recursive function calls can't contain any function parameters and local variables due to the PIC’s stack and memory limitations. 

mikroC PRO for PIC limits the number of non-recursive nested calls to:

8 calls for PIC12 family, 
8 calls for PIC16 family, 
16 calls for PIC16 Enhanced family.

31 calls for PIC18 family.

Note that some of the built-in routines do not count against this limit, due to their “inline” implementation.

Number of the allowed nested calls decreases by one if you use any of the following operators in the code: * / %. It further decreases if you use interrupts in the program. Number of decreases is specified by number of functions called from interrupt. Check functions reentrancy.

If the allowed number of nested calls is exceeded, the compiler will report a stack overflow error.

PIC18FxxJxx Specifics
Shared Address SFRs
mikroC PRO for PIC does not provide auto setting of bit for acessing alternate register. This is new feature added to PIC18fxxJxx family and will be supported in future. In several locations in the SFR bank, a single address is used to access two different hardware registers. In these cases, a “legacy” register of the standard PIC18 SFR set (such as OSCCON, T1CON, etc.) shares its address with an alternate register. These alternate registers are associated with enhanced configuration options for peripherals, or with new device features not included in the standard PIC18 SFR map. A complete list of shared register addresses and the registers associated with them is provided in datasheet.

PIC16 Specifics
Breaking Through Pages
In applications targeted at PIC16, no single routine should exceed one page (2,000 instructions). If routine does not fit within one page, linker will report an error. When confront with this problem, maybe you should rethink the design of your application – try breaking the particular routine into several chunks, etc.

Limits of Indirect Approach Through FSR
Pointers with PIC16 are “near”: they carry only the lower 8 bits of the address. Compiler will automatically clear the 9th bit upon startup, so that pointers will refer to banks 0 and 1. To access the objects in banks 2 or 3 via pointer, user should manually set the IRP, and restore it to zero after the operation. The stated rules apply to any indirect approach: arrays, structures and unions assignments, etc.

Note : 
It is very important to take care of the IRP properly, if you plan to follow this approach. If you find this method to be inappropriate with too many variables, you might consider upgrading to PIC18. 
If you have many variables in the code, try rearranging them with the linker directive absolute. Variables that are approached only directly should be moved to banks 3 and 4 for increased efficiency. 

PIC16 Enhanced Family Specifics
PIC16 Enhanced family has 16-bit FSRs, FSRxL and FSRxH, capable of accessing entire RAM and Flash memory. 
This makes pointers to constants and pointers to variables compatible.

Linear Data Memory
The Linear Data Memory is a memory space consisted of GPRs (each 80 bytes in size) located in every bank. Together, they form a linear, continuous, memory area and allow large stacks, arrays, buffers, etc. 
This means that there are no gaps between the end of GPR in one bank and the beginning of the next GPR in the following bank.

To use this memory space, ldm memory specifier must be used.


Best regards,
Peter
 

according to me i have to start PIC16 series beacause this is starting point and basic version of PIC controller then 18f, and higher series.
 

In any case its good to start from somewhere. Appetite for projects will grow and always migration to some other uC can be done.

For some simpler jobs even tiny 6-pins or 8-pins PIC12F can be good.


Best regards,
Peter
 

Nice illustration (max speed today is over 140-168MHz) :

8-16-32-bit.gif

http://blogs.synopsys.com/configurablethoughts/category/8-bit-microcontroller/
 

The path I took when learning PICs was to buy the PICKit 3 Starter Kit (part number DV164131). For $70 USD, you get the programmer (which you will need sooner or later) and an evaluation board with a PIC18F45k20 microcontroller and MPLAB on CD. The board has some LEDs, a pot, and a small breadboard area.
 

That board hardly can be called development board, but will do the job for something.

This like small development boards are cheap solution for cheap results.

I personally love more development systems boards with full equipment.



Best regards,
Peter

;-)
 

As a learning tool, small development boards are a good (cheap) start. There's no need for all the additional peripherals when you are just leaning how to setup a PIC, read an A/D channel, control a digital port, handle interrupts, etc. That's what I used to learn the basics of how PIC micro-controllers work as I had never used them before (much like the original poster). I now design my own boards with the components required to do the job. These boards cost WAY more then the $25 for a small development board to learn with.
 

PIC18F26J50 and PIC32MX250F128B are the way to go! They both have 28-pin casing and they are easy to program. Type "PC USB Projects" into Google and you will find a number of projects in vb.net and of course HEX and DLL files.... The microconrollers are also cheap to buy (only a few euros or dollars...)...
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top