Page 1 of 1

PIC 16F vs 18F

Posted: 05 Jul 2010 16:48
by zhiyongwoo
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

Re: PIC 16F vs 18F

Posted: 05 Jul 2010 22:48
by Sobrietytest
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.

Re: PIC 16F vs 18F

Posted: 05 Jul 2010 22:56
by zhiyongwoo
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.......

Re: PIC 16F vs 18F

Posted: 05 Jul 2010 23:03
by Mince-n-Tatties
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

Re: PIC 16F vs 18F

Posted: 05 Jul 2010 23:09
by Mince-n-Tatties
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.

Re: PIC 16F vs 18F

Posted: 08 Jul 2010 16:13
by tihomir.losic
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