Electronic – Why pic18fxxx microcontrollers is better for C language

cmicrochipmicrocontrollerpic

Pic18fxxx family has a lot advantages and improvements from the pic16fxxx family of microcontrollers. What is the particular feature that make them better for C programming than the pic16fxxx devices?

Best Answer

I don't know about "ideal for". That's a marketing term that has no place in a learned discussion.

However, one big advantage of the PIC 18 architecture versus the original PIC 16 architecture, especially related to compilers, is that it is possible to implement a software data stack on a PIC 18 with single instructions for PUSH and POP. The PIC 18 also has a deeper call stack, 32 versus 8, which can help when a compiler implicitly calls subroutines. The PLUSW indirect addressing mode is probably something a compiler would make more frequent use of than a human programmer.

The PIC 18 also has other advantages that are useful both for compilers and human programmers, like 3 hardware pointers instead of one, auto inc/dec indirect addressing modes, a 8x8 into 16 hardware multiplier, add with carry, and subtract with borrow, and a few other niceties.