Shop OBEX P1 Docs P2 Docs Learn Events
MAX6953 and Prop communication — Parallax Forums

MAX6953 and Prop communication

Peppe316Peppe316 Posts: 3
edited 2009-01-09 08:33 in Propeller 1
Cliffnotes:
1. Can the max 6953 be used with a "DIY" matrix?
2. Are there any better options to control a "DIY" matrix?
3. Am I on the right track with the code below (any obvious problems with it)?

I've got a MAx6953 [noparse][url=http://datasheets.maxim-ic.com/en/ds/MAX6953.pdf]Datasheet[/url hooked up to the prop. My goal is to create a scoreboard out of leds (aprox. 8000 leds involved). I've ported some arduino/I2C code over for my application to get this thing to work (Code below). However, no matter what I do I can't get it to work. The max chip is a 5x7 led controller...now does this mean I have to buy a LED matrix like this [noparse]/noparse][url=http://www.futurlec.com/LEDMatrix.shtml]LINK[/url to make it work? Up to now I've never seen anyone using a "DIY" matrix. I've made my own matrix following the schematic on the max datasheet.

3291.gif

Here's the code I've ported over from this post [noparse]/noparse][url=http://www.electro-tech-online.com/micro-controllers/85018-max6953-input.html]LINK[/url
CON
  _clkmode = xtal1 + pll16x
  _xinfreq = 5_000_000
VAR
  long config_byte
  long device_address
  long tempd
OBJ
  i : "i2c"  
  s : "FullDuplexSerialPlus"

 
PUB Main 
  config_byte:=$00
  if(i.init(15,14,false)) ' turn on a led when I2C is initialized
    dira[noparse][[/noparse]17]:=1
    outa[noparse][[/noparse]17]:=1
  
  SetDeviceAddr($00)
  Shutdown(false,true)'disable shutdown mode
  SetIntensity(15) 'set intensity to the highest
  DisplayTest(true) ' Turn on all leds
 
  repeat ' debug led just to make sure it's working/running
    dira[noparse][[/noparse]16]:=1
    outa[noparse][[/noparse]16]:=1
 
PUB SetDeviceAddr(addr)
  addr += $50 'MAX6953 addresses take the form 101xxxx
  device_address := addr 'where xxxx is the user-selected address 0-15
 
PUB DisplayTest(state)
  'Put the display in test mode. Will illuminate all LEDs if state=TRUE
  'Does not affect plane data - original display is restored when set FALSE
  i.i2cStart
  i.i2cWrite(GetAddr,8) 
  i.i2cWrite($07,8)
  if(state)
    i.i2cWrite($01,8)
  else
    i.i2cWrite($00,8)
  i.Stop
 
PUB Shutdown(state, wrt)
'Put the display into/out low power 'shutdown' mode
  if(state)
    config_byte:=config_byte &= $FE
  else
    config_byte:= config_byte |= $01
  if(wrt)
    WriteConfigRegister(config_byte)
 
PUB WriteConfigRegister(reg)
  i.Start
  i.i2cWrite(GetAddr,8)
  i.i2cWrite($04,8)
  i.i2cWrite(config_byte,8)
  i.Stop
 
PUB GetAddr : myaddr
  'device_address:= (device_address <<1) & $FE
  'return device_address
  return (device_address <<1) & $FE
 
PUB SetIntensity(inten)
  ' Set the display intensity from 0-15
  tempd := inten<<4 ' set the most significant nybble
  inten|=tempd
  i.Start
  i.i2cWrite(GetAddr,8)
  i.i2cWrite($01,8) ' first intensity register
  i.i2cWrite(inten,8) 
  i.i2cWrite(inten,8) ' register addr autoincrements, so write second reg
  i.Stop



I've been racking my brains on this for the last couple of weeks reading/learning everything I possibly can. Posting here is my last resort. I realize what I'm asking is a fairly big task but I hope someone might be able to lend some more options.

Comments

  • StefanL38StefanL38 Posts: 2,292
    edited 2009-01-07 20:39
    Hello Peppe,

    in fact it is a big task.

    by googling I found this c-code

    max6953.c

    and did you take a look into the sourcecode of a
    demoprogram downloadable here ?

    Did you experimentate with the device-adress hardocded testing through 0-15 with and without & FE
  • Peppe316Peppe316 Posts: 3
    edited 2009-01-08 22:13
    Thanks for the code and links Stefan.· I've seen all but one. However, I spent a bit more time inspecting the maxim program as well as trying to see what each of the code snippets had in common. Late last night I was able to at the very least get the LEDs to blink..once!·Very exciting when you've been trying to get it going for a couple of weeks [noparse]:)[/noparse]. The bad part is they blink for .5 sec and then it's done. Almost like it's not holding the values.· I think I might be able to figure that one out on my own. Seems a little easier now that I know that I am communicating with the·max chip

    i2c.spin
    

    PUB MaxWrite(i2cData) : ackbit
      return i2cWrite(i2cData,8)
    

    MaxCom.spin
    

     i.init(15,14,false)
      i.Start             
      i.MaxWrite($A0) ' write address
      i.MaxWrite($04) ' config address
      i.MaxWrite($01) ' disable shutdown
      i.Stop   
      i.Start
      i.MaxWrite($A0) ' write address
      i.MaxWrite($07) ' display test
      i.MaxWrite($01) ' enable display test (all leds on)
      i.Stop
    


    But now I have a second, kind of similar question. The max chip will only drive LEDs with a· forward voltage of 1.3. For the LEDs I'm using to test this will work fine. But the LEDs I will be using have a forward voltage of 3.2-3.4. Any ideas on what I can do to increase the voltage to the LEDs and not kill the max chip? The max input voltage on the chip is 5V to drive the LEDs with a 1.3V.· At least that's the way I've interpreted this:

    [b]Choosing Supply Voltage to Minimize Power Dissipation (Page 19)[/b]
    The MAX6953 drives a peak current of 40mA into LEDs
    with a 2.4V forward-voltage drop when operated from a
    supply voltage of at least 3.0V. The minimum voltage
    drop across the internal LED drivers is therefore (3.0V -
    2.4V) = 0.6V. If a higher supply voltage is used, the driver
    absorbs a higher voltage, and the driver&#8217;s power
    dissipation increases accordingly. However, if the LEDs
    used have a higher forward voltage drop than 2.4V, the
    supply voltage must be raised accordingly to ensure
    that the driver always has at least 0.6V headroom.
    The voltage drop across the drivers with a nominal 5V
    supply (5.0V - 2.4V) = 2.6V is nearly 3 times the drop
    across the drivers with a nominal 3.3V supply (3.3V -
    2.4V) = 0.9V. In most systems, consumption is an
    important design criterion, and the MAX6953 should be
    operated from the system&#8217;s 3.3V nominal supply. In
    other designs, the lowest supply voltage may be 5V.
    The issue now is to ensure that the dissipation limit for
    the MAX6953 is not exceeded. This can be achieved
    by inserting a series resistor in the supply to the
    MAX6953, ensuring that the supply decoupling capacitors
    are still on the MAX6953 side of the resistor. For
    example, consider the requirement that the minimum
    supply voltage to a MAX6953 must be 3.0V, and the
    input supply range is 5V ±5%. Maximum supply current
    is:
    15mA + (40mA x 10) = 415mA
    Minimum input supply voltage is 4.75V. Maximum
    series resistor value is:
    (4.75V - 3.0V) / 0.415A = 4.22&#937;
    We choose 3.3&#937; ±5%. Worst-case resistor dissipation
    is at maximum toleranced resistance, i.e., (0.415A)2 &#10005;
    (3.3&#937; x 1.05) = 0.577W. We choose a 1W resistor rating.
    The maximum MAX6953 supply voltage is at maximum
    input supply voltage and minimum toleranced
    resistance, i.e., 5.25V - (0.415A x 3.3&#937; x 0.95) = 3.95V.
    



    As I'm sure you've noticed I'm a electronics noob and I'm taking quite a big jump for a first project. All I really·need is a point in the right direction and I can usually find what I need via google.

    Post Edited (Peppe316) : 1/9/2009 3:31:26 AM GMT
  • Peppe316Peppe316 Posts: 3
    edited 2009-01-09 05:53
    Ok, as usual after I post about how something won't work it usually works and it did...kinda [noparse]:)[/noparse]

    I'm getting some awfully bad blinking happening even if I explicitly turn of 'blink' mode. Along with that the top row stays fully lit through the whole sequence.· Throughout both runs the max chip is recieving 4.9V. Any ideas on what might be going on here?

    http://www.youtube.com/watch?v=zT78AOTIewY·(Full run from A-Z)
    http://www.youtube.com/watch?v=1mpUUDpczdw·(with display test on in the beginning)


    Code used for the tests:

      i.init(14,15,false)
      
    i.Start             
      i.MaxWrite($A0) ' write address
      i.MaxWrite($04) ' config address
      i.MaxWrite(%00110001) ' disable shutdown clear globally and turn off bliking
      i.Stop
      i.Start
      i.MaxWrite($A0)
      i.MaxWrite($01)
      i.MaxWrite($00) ' set intensity 16 to very low
      i.Stop
      i.Start
      i.MaxWrite($A0)
      i.MaxWrite($02)
      i.MaxWrite($00) ' set intensity 32 to very low
      i.Stop
    {
      i.Start
      i.MaxWrite($A0) ' write address
      i.MaxWrite($07) ' display test
      i.MaxWrite($01) ' enable display test (all leds on)
      i.Stop
      WaitCnt(ClkFreq*2 + cnt)
      i.Start
      i.MaxWrite($A0) ' write address
      i.MaxWrite($07) ' display test
      i.MaxWrite($00) ' enable display test (all leds on)
      i.Stop
    ]
    
      tempd:=$41 ' A
      repeat tempd from $41 to $5A ' Loop from A to Z
        i.Start
        i.MaxWrite($A0)
        i.MaxWrite($20) ' Plane 0 digit 0
        i.MaxWrite(tempd) ' character to write
        i.Stop
        WaitCnt(ClkFreq +100+ cnt) 
        if(tempd==$5A) ' if z start over
          tempd:=$40
    
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-01-09 08:33
    Hello Peppe,

    to increase the output-voltage you can use transistors. As you have really a lot outputlines transistorarrays woud be suitable.
    It depends on the current which type of transistorarray would be suitable.

    From just a quick look at the schematics I'm unsure about the exact design. As a quick guess (that might be wrong)

    There are 5 columms to which the ANODEs of the LEDs are connected.
    It might be enough to use transistors on the columms and keep the Kathodes on the rows connected directly to the MAX-chip.
    The rows seemed to be on ground if the LED is switched on.

    Measure the voltage between ground and a columm-output when the related LED is switched ON
    If you are able to switch on some of the LEDs stable. (ON steady for some minutes)

    If this voltages is very near to ground (some Millivolts) this should work

    best regards

    Stefan
Sign In or Register to comment.