max7219 help
Timmy
Posts: 10
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
'----initialize
LOW dpin: LOW load: LOW clock '
PAUSE 100
'----main prog
text = 3
start:
SHIFTOUT Dpin,Clock,MSBFIRST, [noparse][[/noparse] text]
PULSOUT load, 6
any suggestions most appreciated,
timmy!
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
'----initialize
LOW dpin: LOW load: LOW clock '
PAUSE 100
'----main prog
text = 3
start:
SHIFTOUT Dpin,Clock,MSBFIRST, [noparse][[/noparse] text]
PULSOUT load, 6
any suggestions most appreciated,
timmy!
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
thanks for the speedy reply,
timmy!
This may help to decipher the initialization....
;
[noparse][[/noparse]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
;SHUTDOWN MODE - Address $XC
;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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ken
timmy!