View Full Version : max7219 help

01-18-2006, 06:34 PM
Hi folks,

just after any suggestions as to why i am unable to get my max7219 to display any data on my 7-seg display. I suspect it is a coding error (not my strong area). My circuit is identical to the one described in Nuts n volts #10 however I am using a BS2 instead of a BS1. I have thoroughly checked my circuit and checked to see if my stamp has dead pins.

my code is as follows, very simple initially to get started.

' {$STAMP BS2}
'display char's on a 7-seg display with a max7219

DPin CON 8 ' data to MAX7219
Load CON 9 ' latch
Clock CON 10 ' shift clock to MAX7219

text VAR Byte

LOW dpin: LOW load: LOW clock '

'----main prog

text = 3

SHIFTOUT Dpin,Clock,MSBFIRST, [ text]
PULSOUT load, 6

any suggestions most appreciated,


Jon Williams
01-18-2006, 07:01 PM
There's more to initializing the MAX7219 than you're doing. This (old) StampWorks project will help: http://www.parallax.com/dl/docs/books/sw/exp/sw29.pdf

Jon Williams
Applications Engineer, Parallax

01-18-2006, 07:31 PM
thanks for the article jon. I've got the display operating now, which is a relief, I just now need to slowly trawl through the program to understand how the initialisation loop routine works.

thanks for the speedy reply,


01-19-2006, 03:42 AM

This may help to decipher the initialization....

;------[MAX7219 Operation]----------------------------------------------------
;The 7219 must first be initialized. Initialization is done by sending serial
;data to the IC. Four 16 bit values sent will complete the initialization.

;To send a 16 bit value load is brought LOW, then each of 16 bits (msb 1st) is
;clocked into the IC, and load is then brought HIGH to complete the shifting
;of 16 bits into the device

;For each word sent to the IC, the most significant byte is the address and the
;lower byte sets the option for each particular function.

;For the descriptions that follow values will be shown as $Xx. The upper case x
;represents the upper nibble and the value is "don't care"

;DECODE MODE - Address $X9
;Optionsˇ$X0 = No decoding
;ˇˇ$X1 = Decode digit 0 (BCD)
;ˇˇ$XF = Decode digits 0-3
;ˇˇ$FF = Decode digits 0-7
;Sending $090F sets decode mode to enable digits 0-3 and instructs that the least
;sig nibble is BCD

;Optionsˇ$X0 = Shutdown
;ˇˇ$X1 = Normal Operation
;Sending $0C01 sets the IC for normal operation

;SCANLIMIT - Address $XB
;Optionsˇ$Xx where the least significant nibble sets the number of digits
;ˇˇto enable. digit 0, x = 0. digits 0 & 1 x = 1. digits 0, 1, & 2 x = 2
;Sending $0B02 enbables digts 0, 1 & 2
;Sending $0B07 enables all 8 digits

;INTENSITY - Address $XA
;Optionsˇ$00 = minimum intensity
;ˇˇ$FF = maximum intensity
;ˇˇSee MAX7219 data sheet for resistor selection and current


01-19-2006, 12:11 PM
Thanks Ken for the info. really helpful.