Mplab Install on MAC
Mplab on MAC
One of the reasons that I chose to use the MPLab X IDE is that it is
available as a free download allowing student to use it on their own
computers. This supports an important
pillar of my teaching philosophy; to enable students to work
independently to explore and solve interesting problems. Unfortunately,
many engineering programs are PC only, leaving MAC users with awkward
solutions to work off campus. Fortunately with a little work, MAC users
can install and use the MPLAB X IDE. What follows are some guidelines
to help you through the process - as a PC user I have not tested these!
Hence, if you find these instructions lacking in any way, please send me
an email at coulston@mines.edu with concrete suggestions on how to improve
them. Support your fellow and future MAC users. That said, thanks to
Nick for providing these.
Preliminaries
These preliminaries are needed before installing MPLAB or XC8
compiler.
If you don’t have Xcode and its dependent Command Line Tools, you can
download Xcode for free from the 'App Store' on your mac. Or, you can
install Command Line Tools (CLT) without Xcode (its big) by opening
'Terminal' located in Applications/Utilities/. In a new Terminal
window enter:
xcode-select --install
Followed by the return key. You'll be asked if you want to install CLT,
say yes. See
http://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/
for more help.
You will also need Java (JRE6). To see if you already have it installed,
enter the following into a Terminal window:
java -version
If Java is already installed, you will get an output indicating which
version. An example output (as of Sept 2017) looks like:
Java version "1.6.0_65"
If you do not have Java installed you will need to download and install it
from
https://support.apple.com/kb/DL1572?locale=en_US
You may want to visit
http://microchipdeveloper.com/install:mplabx-macos10-7-plus
for more help.
Now you should be able to install MPLab X and XC8 compiler from the
links on the class website.
Using Terminal instead of PUTTY
For a significant portion of the semester, you will be using a terminal
interface to your development board. A terminal interface traditionally
consists of a text display device and a keyboard. In our class we will
use a PC (or MAC) as the terminal and connect it to our development board
through the USB port on the development board. The FT232 chip on the
development board will create a virtual communication port (VCOM) with
the PC. This VCOM port acts as a serial port, meaning that data is
transmitted one bit at-a-time across the interface. While I can use
the terms "VCOM" and "serial port" interchangeably, I prefer the term
"VCOM" when I want to emphasize the USB-ness of the connection and
"serial port" when I want to emphasize the bits being pushed to and
from the PIC. To create a terminal interface to the development board, you
will need to run a terminal application on your MAC and then point the
terminal application at the VCOM port.
After plugging in the development board to your MAC, you need to determine
the name given by your MAC to the serial port associated with the VCOM port.
You can list all serial devices available by entering the following into
a Terminal window:
ls /dev/tty.*
One development board that was plugged into a MAC provided the following
output:
/dev/tty.Bluetooth-Incoming-Port /dev/tty.usbserial-A505PQE1
You will get a slightly different address. Consider copying the portion
/dev/tty.usbserial-<myAddress> to a text
document or my code for quick reference. To connect to your development
board, enter:
screen /dev/tty.usbserial-<myAddress> 9600 -L
and work away with the terminal interface.
Important
You have to release your serial port to end the session! To do this:
control a
control \
Y <to confirm>
Finally, if you'd like to log your Terminal session to a file, you can enter
script -a -t0 myLog.txt
followed by your normal screen /dev/tty... command
To stop logging, Press control d
The file, myLog.txt will be saved to your home folder.