Using Swordfish with MPLAB

This guide enables you to install the command line edition of Swordfish into the MPLAB IDE, which is available from Microchip™. The installation procedure has been tested using MPLAB version 7.6 running on Windows™ XP.


The first thing to do is make sure the command line version of Swordfish is present in you main installation folder. For example,

Swordfish VersionExample Location
Special Edition (SE)C:\Program Files\Mecanique\SwordfishSE\SESwordfish.exe
FullC:\Program Files\Mecanique\Swordfish\Swordfish.exe

Next, you need to locate and copy SFBasic.mtc and TLSFBasic.ini. These will be located under the MPLAB subfolder. For example,

Special Edition (SE)C:\Program Files\Mecanique\SwordfishSE\MPLAB
FullC:\Program Files\Mecanique\Swordfish\MPLAB

If not, you can download from here. Next, copy the files so that they reside in the MPLAB third party support folder (MTC Suites). For example,

C:\Program Files\Microchip\MPLAB IDE\Core\MTC Suites\SFBasic.mtc
C:\Program Files\Microchip\MPLAB IDE\Core\MTC Suites\TLSFBasic.ini

After the above files have been installed in the MTC Suites folder, you need to run Swordfish.reg (or Swordfish 64 OS.reg for 64 bit operating systems). This ensures that the correct registry entries are created so that MPLAB recognises Swordfish as a compiler toolsuite.

In summary:

  • Ensure either SESwordfish.exe or Swordfish.exe are present in your main Swordfish installation folder
  • Copy SFBasic.mtc and TLSFBasic.ini into the MPLAB MTC Suites folder
  • Run Swordfish.reg (or Swordfish 64 OS.reg for 64 bit operating systems)

Additional Notes

  • When selecting 'Swordfish BASIC Compiler' as your MPLAB toolsuite, don't forget to set the language tool location. That is, point it at either SESwordfish.exe or Swordfish.exe. As stated above, these files must be located in you main Swordfish installation folder.
  • The device name selected in MPLAB is passed to the Swordfish command line application during compilation. If you specify a target device from within your main program, the value passed by MPLAB will be ignored by the compiler.