PIC 16F vs 18F

General discussion on mikroC PRO for PIC.
Post Reply
Author
Message
zhiyongwoo
Posts: 16
Joined: 29 May 2008 16:32

PIC 16F vs 18F

#1 Post by zhiyongwoo » 05 Jul 2010 16:48

Hi

I have read the Help file from MikroC Pro 2009 compiler and it did encourage user to use 18F instead of 16F.

Does anyone can explain to me in details why the compiler is only bring the benefit to 18F but not 16F?
Is it because the compiler can not handle the page crossing when the code generate or something else serious?

I need to know this because I am planning to write a programme that it needs to drive the LCD. Previously I use 18F but recently I found 16F has more features like support more segments and with XLP built-in but most importantly it is twice cheaper than previous Chip I used.

So, please kindly write down anything that the C compiler does or doesn't do on the 16F and 18F.

Thank you in advance.

Regards
Yong

Sobrietytest
Posts: 619
Joined: 05 Jul 2008 06:05
Location: Thailand

Re: PIC 16F vs 18F

#2 Post by Sobrietytest » 05 Jul 2010 22:48

There is no preference. My understanding is that the compiler is equally capable of exploiting the features of both device series. When you specify a PIC you should look at the features of the chip with respect to your application, select the PIC with the right combination of flash size, speed, peripherals and I/O pins. The MikroE compilers will give you access to all the features of the PIC's contained in the support list.

zhiyongwoo
Posts: 16
Joined: 29 May 2008 16:32

Re: PIC 16F vs 18F

#3 Post by zhiyongwoo » 05 Jul 2010 22:56

Hi,

If you go to the help file and look at the menu "PIC Specific".

In the topic, under 16F Specifics, it stated something like..... the limitation of using 16F.......

Mince-n-Tatties
Posts: 2780
Joined: 25 Dec 2008 15:22
Location: Scotland

Re: PIC 16F vs 18F

#4 Post by Mince-n-Tatties » 05 Jul 2010 23:03

the main issue with this compiler and 16F is that of IRP bit setting. The compiler does NOT handle this in pic 16F. This has a massive impact on the available RAM space which can be used. Its a massive massive deficiency of the compiler.

this issue alone is enough to consider the current versions of mikroC as only fully functional for 18F
Best Regards

Mince

Mince-n-Tatties
Posts: 2780
Joined: 25 Dec 2008 15:22
Location: Scotland

Re: PIC 16F vs 18F

#5 Post by Mince-n-Tatties » 05 Jul 2010 23:09

PIC 18F are getting cheaper and cheaper by the day.

what 16F do you want to use?

i found an 18F2321 as a replacement for 16F886, and the 18F has up to 32MHz internal clock and it was cheap.

the most significant hardware reason for using an 18F is that of LATch, the 18F has hardware latch for output pin drive. This is fantastic and reason enough to opt for 18F over 16F from a hardware view point.
Best Regards

Mince

User avatar
tihomir.losic
mikroElektronika team
Posts: 2138
Joined: 02 Dec 2009 14:16
Location: Serbia
Contact:

Re: PIC 16F vs 18F

#6 Post by tihomir.losic » 08 Jul 2010 16:13

zhiyongwoo wrote:Hi,

If you go to the help file and look at the menu "PIC Specific".

In the topic, under 16F Specifics, it stated something like..... the limitation of using 16F.......
Hello,

if you look at PIC Specifics:
http://www.mikroe.com/esupport/index.ph ... ticleid=42
briefly you can see the main features of 16F family, and limitations of the same in our compilers.
- PIC16, no single routine should exceed one page (2,000 instructions). If routine does not fit within one page, linker will report an error.
- 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.
zhiyongwoo wrote:So, please kindly write down anything that the C compiler does or doesn't do on the 16F and 18F.
Thank you for your suggestion,
I will pass this to our help and manual developers, in order to put that kind of preferences in help file.

Best regards,

Losic Tihomir
mikroElektronika [Support team]

Post Reply

Return to “mikroC PRO for PIC General”