Peppe316
01-07-2009, 01:13 AM
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 [LINK (http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3291) | Datasheet (http://datasheets.maxim-ic.com/en/ds/MAX6953.pdf)] 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 [LINK (http://www.futurlec.com/LEDMatrix.shtml)] 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.
http://media.maxim-ic.com/images/qv/3291.gif
Here's the code I've ported over from this post [LINK (http://www.electro-tech-online.com/micro-controllers/85018-max6953-input.html)]
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[17]:=1
outa[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[16]:=1
outa[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.
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 [LINK (http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3291) | Datasheet (http://datasheets.maxim-ic.com/en/ds/MAX6953.pdf)] 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 [LINK (http://www.futurlec.com/LEDMatrix.shtml)] 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.
http://media.maxim-ic.com/images/qv/3291.gif
Here's the code I've ported over from this post [LINK (http://www.electro-tech-online.com/micro-controllers/85018-max6953-input.html)]
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[17]:=1
outa[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[16]:=1
outa[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.