The Digital Discovery comes with a
2x6 flywire cable assembly that fits the
inputs/outputs male headers. There is also
a 2x16 flywire cable assembly that
interfaces to the Digital Discovery’s high
speed inputs male header. You can
optionally purchase a high speed adapter
kit, which replaces the stock 2x16 high
speed inputs flywire cable. The high speed
adapter kit consists of 16 twisted pair logic
probes and a header block. Using the high
speed adapter allows you to obtain up to
800 MS/s. A single logic probe
representation of this adapter can be seen
in Photo 2. Referencing Photo 1, note the
Discovery’s pair of eight I/O ports plus 24
high speed inputs. With the help of
Waveforms 2015, we are going to set up
our Digital Discovery to act as a simple
logic probe. We’ll use the Microchip
Explorer 8 you see in Photo 3 as the unit under test.
The Microchip XC8 C compiler under the control of
MPLABX will be used to
generate code for the
PIC16F18345, which is
mounted on the Explorer 8
development board. To make
things really easy, we’ll allow
the Microchip MPLAB Code
Configurator to “write” our
application code for us. The
Code Configurator runs under
MPLABX as a plugin.
I attached the
PIC16F18345’s RB4-RB7 I/O
pins plus a ground connection
to the Discovery’s 24-27 I/O
terminals, respectively, using
the Discovery’s 2x16 flywire
cable. Thus, RB4’s logic state
will appear on the Discovery’s
24 I/O input subsystem which
is configured as a virtual LED.
In fact, the 24-27 digital inputs
are all configured as virtual LEDs. The Explorer 8 and
PIC16F18345 are powered by a nine volt wall wart. The
actual voltage applied to the PIC16F18345 is 3. 3 VDC. I
could have also powered the Explorer 8 and PIC16F18345
from the laptop’s USB portal. The PIC16F18345 will be
programmed using a PICkit 3.
In Screenshot 1, I used MPLAB to configure the
PIC16F18345’s PORTB I/O pins as outputs. I also took
this opportunity to add human-readable and logical names
to the PIC16F18345’s PORTB I/O pins that will come
under our control.
Once the PIC16F18345’s I/O pins were selected and
renamed, I hit the Code Configurator GENERATE button
and MPLAB created a number of C files, which included a
main C file and an include file that contains all of the
PIC16F18345 I/O control macros. I added a couple of
those I/O macro statements in the main.c file you see in
Screenshot 2.
Meanwhile, the Digital Discovery and Waveforms
2015 are monitoring the PIC16F18345’s PORTB pins. As
soon as the compilation was completed and the hex file
downloaded to the PIC16F18345, the Waveform’s virtual
LEDs produced the expected results.
You can see that I renamed the virtual LEDs to match
ADVANCED TECHNIQUES FOR DESIGN ENGINEERS
June 2017 47
■ PHOTO 3. This is one of my favorite Microchip
development platforms. With the advent of advanced 16F
parts, the Explorer 8 comes in handy when I have to call
upon the resources of the new eight-bit Super PICs.
■ SCREENSHOT 1. This is the way to code for a PIC. Once the definitions are entered in
the graphical interface, the Microchip MPLAB Code Configurator can be commanded to
generate the associated C language source code.