This is an old revision of the document!


Microchip XC16 compiler

This is a C compiler for the dsPIC and PIC24 24-bit address word PICMicros.

Installation is comprised of two steps. The first step installs the commercial compiler and the support files. The second step is used to replace the compiler with the free edition. The support files are needed in step 2 from step 1.

Commercial edition

The commercial edition has optimisation limitations unless a license is bought.

Initialise
mkdir -p /opt/microchip
cd /opt/microchip
Fetch
wget http://ww1.microchip.com/downloads/en/DeviceDoc/xc16-v1.25-full-install-linux-installer.run
Install
chmod +x xc16-v1.25-full-install-linux-installer.run
./xc16-v1.25-full-install-linux-installer.run
Include files

Version 1.25 is missing some important include files so we need to download them separately.

Method 1

wget xc16-v1.24-full-install-linux-installer.run
chmod +x xc16-v1.24-full-install-linux-installer.run
./xc16-v1.24-full-install-linux-installer.run
cp -Rpa /opt/microchip/xc16/v1.24/support/peripheral_* /opt/microchip/xc16/v1.25/support/

Method 2 (TODO)

wget http://www.microchip.com/mymicrochip/filehandler.aspx?ddocname=en574961

Free edition

The free edition utilises header files and libraries from the commercial edition so perform the installation steps given above. The free edition has no limitations and does not require a license for optimisations.

Initialise
cd /var/tmp
apt-get install build-essential flex bison unzip mercurial zlib1g-dev
hg clone http://hg.kewl.org/pub/pic30
cd pic30
Fetch
wget "http://ww1.microchip.com/downloads/en/DeviceDoc/MPLAB XC16 v1.26.src.zip"
Install
./install

Raspberry Pi

This also depends on the commercial edition which must be installed as given above.

Install emulator
Initialise
mkdir -p /embedded/raspbian/opt/microchip/xc16/v1.25/
cd /embedded/raspbian/opt/microchip/xc16/v1.25/
cp -Rp /opt/microchip/xc16/v1.25/* .
mkdir -p /embedded/raspbian/var/tmp/
cd /embedded/raspbian/var/tmp
hg clone http://hg.kewl.org/pub/pic30
cd pic30
Fetch
wget http://ww1.microchip.com/downloads/en/DeviceDoc/v1.25.src.zip
Enter emulator
Install in emulator
apt-get install build-essential flex bison unzip zlib1g-dev
cd /var/tmp/pic30
./install
exit
Mount emulator directory in RPi

NFS

Install on RPi
cd /opt
cp -Rpa /embedded/raspbian/opt/pic30-tools .

Resources

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies