MAX7219 CWG 8-digit LED Display

In anticipation of the 2015 Leap-secondBP_LED_23_59_60_9049, I’m in the process of constructing a monitor for my Trimble Thunderbolt GPS clock and DO so I can watch it “live”. For the clock display, I’m evaluating an inexpensive  8-digit LED display with an SPI (mostly) interface from a MAX7219 (bought on-line for $2.35).

For a quick and easy test, a Bus Pirate is just the trick.The LED interface module has five pins which I connected to the Bus Pirate as follows:

BPLED
+5V – VCC
GND – GND
MOSI – DIN (data in)
CS – CS
CLK – CLK

HiZ>m
1. HiZ
2. 1-WIRE
3. UART
4. I2C
5. SPI
6. 2WIRE
7. 3WIRE
8. LCD
x. exit(without change)

(1)>5
Set speed:
 1. 30KHz
 2. 125KHz
 3. 250KHz
 4. 1MHz

(1)>4
Clock polarity:
 1. Idle low *default
 2. Idle high

(1)>
Output clock edge:
 1. Idle to active
 2. Active to idle *default

(2)>
Input sample phase:
 1. Middle *default
 2. End

(1)>
CS:
 1. CS
 2. /CS *default

(2)>
Select output type:
 1. Open drain (H=Hi-Z, L=GND)
 2. Normal (H=3.3V, L=GND)

(1)>2
Ready
SPI>

Once in SPI mode, it is straightforward to…

turn power on:

SPI>W

The information typed after the “SPI>” prompt is sent to the device. The [ and ] characters lower and raise CS’.

enable self test mode:

SPI>[0x0f,0x01]

BP_LED_self-test-mode_9052

exit self-test mode:

SPI>[0x0f,0x00]

BP-LED_blank_9048

At this point, the display is back in shutdown mode, so nothing is displayed. This makes it easy configure without any visual changes.

enable BCD mode:

SPI>[0x09,0xff]

set scan limit – display all 8 digits:

SPI>[0x0b,0x07]

clear digits of startup junk:

SPI>[1,0x0f][2,0x0f][3,0x0f][4,0x0f][5,0x0f][6,0x0f][7,0x0f][8,0x0f]

Now that it has been configured, disabling shutdown will still show a blank display.

enable normal operation (disable shutdown):

SPI>[0x0c,0x01]

set the display intensity to level 2:

SPI>[0x0a,0x02]

display 8 7 6 5 4 3 2 1:

SPI>[1,1][2,2][3,3][4,4][5,5][6,6][7,7][8,8]

BP-LED_987654321_9047

display 1 5 – 0 6 – 3 0:

SPI>[8,1][7,5][6,10][5,0][4,6][3,10][2,3][1,0]

BP_LED_15-06-30_9053

display  2 3   5 9   6 0 (leap second):

SPI>[8,2][7,3][6,0x0f][5,5][4,9][3,0x0f][2,6][1,0]

BP_LED_23_59_60_9049

And there you have it.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>