Shop OBEX P1 Docs P2 Docs Learn Events
max7219 help — Parallax Forums

max7219 help

TimmyTimmy Posts: 10
edited 2006-01-19 05:11 in BASIC Stamp
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!

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-01-18 12:01
    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
  • TimmyTimmy Posts: 10
    edited 2006-01-18 12:31
    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,

    timmy!
  • KenMKenM Posts: 657
    edited 2006-01-18 20:42
    Tim,

    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
  • TimmyTimmy Posts: 10
    edited 2006-01-19 05:11
    Thanks Ken for the info. really helpful.

    timmy!
Sign In or Register to comment.