Using a VEX Controller
By Daniel Ramirez
Numeric LED
Display Experiment
Continuing with experiments that can be carried out using a VEX microcontroller,
this article describes how you can build a DIY numeric LED display that can provide
a bright, easy to read display for VEX-based projects. Now that you know how to
use the VEX microcontroller from the first installment in the Mar ‘ 10 issue, we’ll
pick up the pace a bit to show more advanced numeric LEDs and how to drive large
numbers of discrete LEDs while at the same time conserving battery power and
precious VEX I/O pins, reducing the overall cost of external components.
Numeric Display LEDs have been around for many ears and provide a bright display that can be seen in both bright daylight and at night time. They were first used for electronic equipment and
consumer appliances in the ‘70s, including pocket
calculators such as the HP- 65 and TI- 59. Although low
power LCD displays and OLEDs have replaced them in new
calculators and commercial appliances, they still continue to
show up in special test equipment and DIY hardware.
When used in VEX applications, they can provide sensor
data such as motor RPM readings, VEX ultrasonic ranger
readings, and encoder readings that are visible from a
distance under various lighting conditions (including total
darkness).
A numeric LED digit is composed of seven LED
segments that come in two basic configurations: cathode
and anode. For our experiment here, I used the common
cathode version since it requires less parts. I also selected a
MAXIM ( www.maxim.com) MAX7219 numeric LED
display driver to drive up to five cathode digits as shown in
the schematic in Figure 1. Although the cost of this IC is a
bit high (around $8), in my opinion it is well worth it —
considering how it simplifies the hardware and firmware for
VEX-based projects. This is because the MAX7219 IC
provides all the necessary timing and refreshing to display
numbers using bright LEDs. The + 5 volt power supply
necessary to drive all the numeric digits is supplied directly
68 SERVO 05.2010
from one of the microcontroller’s + 5 volt pins (middle)
located on the Analog/Digital I/O block. The MAX7219 IC
can be cascaded to drive even more numeric LEDs as
needed, although the control and selection logic will get
more complicated, and will use more I/O pins on the VEX
controller. The interface requires six signals to correctly
download the commands and data to the MAX7219
controller IC. Numeric LEDs are soldered to the breadboard
to complete the display assembly. The completed circuit
board with the display showing the value 31415 is shown in
Figure 2. The MAX7219 can also display decimal points for
floating point numbers.
MAX7219 numeric LED commands that can be sent to
the controller include: changing the brightness of each
digit; changing the numeric value of each digit; changing
the refresh rate; turning the decimal point on or off; and
running the test mode that turns on all the segments from
each digit by displaying the number 8 (see Table 1).
These commands are then sent to the MAX7219 using
a serial protocol. This is described in great detail in the
datasheet located at ( http://datasheets.maxim-
ic.com/en/ds/MAX7219-MAX7221.pdf). The MAX7219
LED display board shown in Figure 2 can also drive directly
up to 64 LEDs individually when connected in a similar
manner to each numeric LED segment. This feature allows
VEX users to add lighting to their robots.
For one of my own numeric LED applications (the DIY