SCREENSHOT 1. I've turned off the reference
power supplies and selected the 3. 3 volt fixed
supply to power the PIC18F46J13
microcontroller and PICkit3 debugger.
What may just be the perfect solderless
breadboard is smiling for the Canon in Photo 1.
The solderless breadboard area is augmented by
special-purpose solderless breadboard bricks. The
bricks expose four voltmeters, digital I/O, external
trigger inputs, a four-channel oscilloscope, an arbitrary wave
form generator, a pair of reference voltages, and
positive/negative supply voltages.
Static Digital I/O
Four of the solderless breadboard bricks contain 32
digital pins that are shared with the Digilent Electronics
Explorer’s Logic Analyzer and Digital Signal Generator
modules. The 32 digital pins are virtually linked to a USB-attached PC computer as pushbuttons, LEDs, switches,
sliders, seven-segment displays, and progress bars.
The Electronics Explorer is heavily oriented towards
analog exploration. However, the Electronics Explorer is
perfect for those that want to work with microcontroller
circuitry. Utilizing the Electronics Explorer’s Static Digital I/O
module eliminates the need for physical LEDs and pushbutton
In Photo 2, I attached a PIC18F46J13-based
microcontroller board to the Electronics Explorer’s Digital 1
solderless breadboard brick. The Digital 1 brick exposes the
least significant bits of the Explorer’s 32-bit Static Digital I/O
module. The low-order solderless breadboard brick also
contains Vcc and ground points based on the Explorer’s 5.0
volt and 3. 3 volt power supplies. As you can see in
Screenshot 1, the Explorer is powering the PIC18F46J13
board with 3. 3 volts. Its Fixed Supply has enough current
available to also power a PICkit3 debugger/programmer.
The PIC18F46J13’s I/O port D is physically attached to
the Digital 1 solderless breadboard brick. Let’s use the CCS C
Compiler and a PICkit3 to force the PIC18F46J13 to
manipulate the Digital 1 brick as if it were a bank of LEDs. To
accomplish this on the Explorer side of the river, we must
configure its least significant eight static I/O bits for bit I/O.
Right-clicking on each of the least significant eight bits in
Screenshot 2 allows us to choose to view the bits as LEDs.
Obviously, the virtual LEDs in Screenshot 2 are changing
state. In reality, the virtual LEDs are displaying the state of the
PIC18F46J13’s PORT D which is programmed as a binary up
counter. Excerpts from the MPLAB X electronics-explorer.c
source file back up my claim:
//connected to Digital 1 of the
//drives a real LED on bit 0
lastsec = servo_time.tm_sec;
counter = 0;
if (servo_time.tm_sec != lastsec)
The preceding code snippet is obviously incomplete.
However, you can see that a real LED is toggled every second
according to the time kept by the PIC18F46J13’s internal
RTCC. Following the action on the real LED, the eight-bit
counter variable is incremented and presented on PORT D of
the PIC18F46J13. The state of the PORT D I/O pins is
represented in Screenshot 2.
Let’s use that same LED binary counter code to drive
another Explorer indicator. This time, we’ll configure the
Digital 1 brick as a progress bar. As the count on the
PIC18F46J13’s PORT D increases, the progress bar in
Screenshot 3 is updated accordingly.
Unless you have access to a preassembled array of seven-segment displays on a PCB, you’ll have to wire up that array
pin by pin. What a pain! Wiring up virtual seven-segment
displays is much easier. In fact, we’ve already done that.
Screenshot 4 is the result of configuring the Digital 1 brick
as a seven-segment display. We can use the binary counter
code to illuminate each segment associated with the binary
count. That wouldn’t be of any use, however, I’ve seen
professional instruments that randomly illuminated segments
of a seven-segment display to indicate activity. Since we have
some binary counter code written, let’s translate the binary
on PORT D to a human-readable 7-segment character using
caveman coding. A caveman would begin this coding by
defining all of the valid hexadecimal and numeric bit patterns
that count from 0x00 to 0x0F:
unsigned int8 counter;
#define dp 0b10000000
#define d0 0b00111111
#define d1 0b00000110
SERVO 01.2012 53