I was pointed towards the C18 library, but I'm using a PIC16.

Can I use the C18 library for a PIC16 using the MPLAB X IDE? If not, is there an alternative to this library for the PIC16?

  • \$\begingroup\$ No, you can't use the C18 library for the PIC16. You can use the XC8 compiler. \$\endgroup\$ Nov 1 '12 at 11:46
  • \$\begingroup\$ Thanks. Does the XC8 compiler come with a UART library? \$\endgroup\$
    – Randomblue
    Nov 1 '12 at 11:49

No. Read a PIC 16 and PIC 18 datasheet and you will set the instruction sets are different. For one thing, PIC 16 instructions are 14 bits wide and PIC 18 instructions 16 bits wide. Obviously binary code for one machine won't run on the other.

  • 2
    \$\begingroup\$ There are lots of un-compiled libraries (.h & .c) that should work for both PIC16 & PIC18; he'll just have to change some registers specific to the PIC \$\endgroup\$
    – m.Alin
    Nov 1 '12 at 11:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.