Electrical – PIC – How to program them in assembly

assemblermplabxpic16f

For years I programmed PIC controllers in assembler, but let it drop. Now I want to get back to where I was, and – so help me – I can't find out where to start.

Downloaded MPLAB-X-IDE and it says I must buy a C compiler, although I have no interest in C. Found a page that says I can use assembler (MPASM) if I just click the link. No link. (Do I need a C compiler to not use it?)

I called Microchip and a robovoice said to fill out an online question form. Did so. No response 5 days later.

All I want to know is just how to bring up the first screen – y'know, where I type in the source code and assemble it to a hex file. That's it. And I am getting nowhere fast.

Yeah, I feel like an idiot, but I am at wits end.

Best Answer

  • Start MPLAB X IDE
  • Go to File > New Project
  • From the Microchip Embedded, select a "Standalone Project", click Next
  • Pick your processor family/device, click Next
  • Pick your tool (or just click Next)
  • Select your compiler toolchain, mpasm should be available, it defaults to c:\Program Files (x86)\Microchip\MPLABX\v5.xx\mpasmx Click Next
  • Give your project a name/location, click Finish

You'll now have a project with no source files. Right click the source files folder and add a new source file, there should be two options under the "New>" context menu for assembler files.

The C compilers are free from this page, just click on the "Compiler Downloads" tab and you can download/use them. They have licenses for more commercial uses if you want, but you don't need it to use them. You shouldn't have to install the XC compilers if you don't want to use them, MPASM comes installed with MPLAB X.