MM5450 LED Driver Coding
Jiyati
Posts: 2
Hi Josh,
I'm driving 32 LEDs using Jameco's MM5450 chip. Here's the link to that chip's spec sheet.
I want to turn on the LEDs one after the other, serially, completing a loop within a minute. I don't know much about how to code in Spin, but this is what I came up with:
I know I'm supposed to turn on the pins one after the other using outa[noparse][[/noparse]datapin], but I don't know where to do this... or am I already doing that with this code?
What do you think? Will this do the trick?
I'm driving 32 LEDs using Jameco's MM5450 chip. Here's the link to that chip's spec sheet.
I want to turn on the LEDs one after the other, serially, completing a loop within a minute. I don't know much about how to code in Spin, but this is what I came up with:
CON _clkmode = xtal1+pll16x _xinfreq = 5_000_000 clk=1 data=2 'will add data neable later OBJ VAR long LightNum PUB Main dira[noparse][[/noparse]clk]:=%10 LightNum:=TurnLightOn waitcnt(clkfreq+cnt) PUB TurnLightOn repeat 32 outa[noparse][[/noparse]clk]~~ outa[noparse][[/noparse]clk]~ LightBits:=(LightBits<<1)+ina[noparse][[/noparse]data]
I know I'm supposed to turn on the pins one after the other using outa[noparse][[/noparse]datapin], but I don't know where to do this... or am I already doing that with this code?
What do you think? Will this do the trick?
Comments
1 - Make sure the /data enable pin on the 5450 is low (could be tied always low)
2 - Set the serial data pin high
3 - Set the clock pin high, then back to low ( this lights led 34/35)
4 - wait for 1.875 seconds
5 - Set the serial data pin low
6 - Set the clock pin high, then back to low
7 - wait for 1.875 seconds
8 - Repeat 6 and 7 30 more times
but i tested this out and still, nothing is working. also i connected the data enable pin to ground and i hooked up the the brightness control pin to the power supply. are there any other corrections i could make?
I see no dira[noparse][[/noparse]data] := 1 anywhere, so the data pin is input all the time!?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pullmoll's Propeller Projects