Shop OBEX P1 Docs P2 Docs Learn Events
max7219 interface with BS1 debuging assist — Parallax Forums

max7219 interface with BS1 debuging assist

nick bernardnick bernard Posts: 329
edited 2004-12-23 00:18 in BASIC Stamp
i have a small pcb with a max7219 and 4 7 seg displays. its works just fine w/ a bs2p via the 3 wire serial interface (shifting)

if i hook it up to a bs1 running a simple routine the max7219 does not respond to any commands
also the shifting routine on the bs1 works fine with a tpic6a596 shift register in another applicaion of mine.
i just modified it to shift 2 bytes and latch.

here's the code and schematic where R9 = 68k

anyhelp?

nickB

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
League Bowling.... it's not a sport, it's a way of life
992 x 770 - 84K

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-12-22 18:40
    The MAX7219 is expecting bits MSBFIRST, so the following [noparse][[/noparse]partial] example should get you going:
    SYMBOL  shftDat = B0         ' byte for MAX7219
    SYMBOL  shftMSB = BIT7       ' MSB of shftDat
     
     
    ' put byte for MAX7219 into "shftDat"
     
     
    SHIFT_OUT_MSB:
      FOR idx = 0 TO 7           ' shift eight bits
        Dpin = shftMSB           ' put bit on data pin
        PULSOUT Cpin, 1          ' clock the bit
        shftDat = shftDat * 2    ' shift bits left
      NEXT
      RETURN
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • nick bernardnick bernard Posts: 329
    edited 2004-12-22 21:29
    HAIL JON

    thx for the help

    i got it now... also i had to throw in a dirs line in there too

    ROX ON
    nickB

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    League Bowling.... it's not a sport, it's a way of life
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-12-23 00:18
    Yep, you have to do that -- sorry I forgot to mention it -- as

    Dpin = shftMSB

    is like saying

    OUTx = some_bit_value

    If the pin has not been made an output then there will be no change of state on it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
Sign In or Register to comment.