0
\$\begingroup\$

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.

\$\endgroup\$
3
  • \$\begingroup\$ Did you try to download and install one of the free C compilers (although you don’t need it, it might be a standard way of getting things running). BTW I think that nowadays you need a C compiler as an assembler executable. \$\endgroup\$ Jun 23, 2020 at 18:34
  • \$\begingroup\$ The XC C compilers are free, but they're deliberately made to create bloated code (no optimization) so you might need to buy a bigger or faster chip than otherwise- so you pay by the chip or pay for the compiler if you have a volume application. But you don't need them for assembly code, as Ron says. \$\endgroup\$ Jun 23, 2020 at 19:01
  • \$\begingroup\$ I use gputils to program PICs in assembly. \$\endgroup\$
    – Bart
    Jun 24, 2020 at 13:09

2 Answers 2

5
\$\begingroup\$
  • 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.

\$\endgroup\$
4
  • \$\begingroup\$ OK up to compiler toolchain. No mpasm. I get a choice of XC8\v2.20\bin or XC8\v2.20\pic-as\bin. Is pic-as what I'm looking for? In either event, cannot find a source files folder - only source (along top) and files (left side); neither seems applicable. \$\endgroup\$ Jun 23, 2020 at 20:05
  • \$\begingroup\$ Can you verify that MPASM is installed in the folder that I pointed out in the answer? Which version of MPLAB did you install? \$\endgroup\$
    – Ron Beyer
    Jun 23, 2020 at 20:05
  • \$\begingroup\$ MPLAB X IDE v5.40 FYI Not sure how I got here, but I started getting the "source files" heading and now have a title block (just to theleft of "history") that says "Asm source" Looks promising. \$\endgroup\$ Jun 23, 2020 at 20:50
  • \$\begingroup\$ @EdGellender I haven't written PIC programs, lately, either. I currently have MPLAB-X v3.61 and the last project I worked on was in assembly. Just checked. It works fine. Old projects are still there and assemble just fine. (I almost never use C on anything at the PIC18 level or below.) I haven't downloaded the newer v5.40, though. \$\endgroup\$
    – jonk
    Jun 23, 2020 at 23:09
2
\$\begingroup\$

MPASM is included in the MPLABX toolchain only when the version is below 5.4. If you want to work with the newest version (MPLAX 5.4) you had to install the xc8 compiler and to work with the assembler supplied with the compiler. But please remember, there are several differences between the two assembler.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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