8x8 led matrix help apreciated.
ninogenio
Posts: 7
hi all,
ive been a coder for quite some time now and messed around in many laungauges. so i though id take the jump and start learning about electronics and how the code ive been writting for years does its stuff.
well a few days ago i recived a quickstart board and 8x8 led matrix with the max7221 from gadget ganster and thought how hard can it be.... lol.
the 8x8 matrix has 5 pins to interact with the prop so i tryed the power line on both pin 30 (usb_power_en) and pin 40 (3.3v) and negative to pin 39.
now this leaves din load and clk wires for data so i ran these through a breadboard with a 10k resistor on each because the max can have problems with inteference, to pin 0 5 9 on the prop and used this code i found on this forum.
but nothing the leds stay off. sometimes if i ground the positive of the max then connect it back i get a quick flash. also if i connect the power and neg of the max too a battery instead of the prop the leds go crazy flashing on and off and making weird patterns. but these are not dependent on din load or clk wires.
i am probably making some stupid mistakes i am completely new too all of this but if i can get a starting point where i know everything is working as it should i should be able to get stuck in and really start learning spin and the propeller.
thanks for any help it will be most appreciated.
ive been a coder for quite some time now and messed around in many laungauges. so i though id take the jump and start learning about electronics and how the code ive been writting for years does its stuff.
well a few days ago i recived a quickstart board and 8x8 led matrix with the max7221 from gadget ganster and thought how hard can it be.... lol.
the 8x8 matrix has 5 pins to interact with the prop so i tryed the power line on both pin 30 (usb_power_en) and pin 40 (3.3v) and negative to pin 39.
now this leaves din load and clk wires for data so i ran these through a breadboard with a 10k resistor on each because the max can have problems with inteference, to pin 0 5 9 on the prop and used this code i found on this forum.
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 Scan = $0B Brite = $0A Decode = $09 ShutDn = $0C TestMax = $0F LOAD = 5 'Connected to max pin 12 DataIO = 0 'Connected to max pin 1 Clock = 9 'Connected to max pin 13 #4,LSBFIRST,MSBFIRST 'Used for SHIFTOUT routines OBJ BS2: "BS2_Functions" PUB Main| index,INIT dira[0..9]:=%111111111 BS2.start(31,30) WAITCNT(CLKFREQ/2+CNT) Repeat index from 1 to 2 INIT := lookup(index:ShutDn, 1) BS2.SHIFTOUT(DataIO, Clock, INIT, MSBFIRST, 8) BS2.PULSOUT(LOAD, 5) Repeat index from 1 to 2 INIT := lookup(index:TestMax, 1) BS2.SHIFTOUT(0, 9, index, MSBFIRST, 8) 'push the test command to the max7221 BS2.PULSOUT(5, 5)
but nothing the leds stay off. sometimes if i ground the positive of the max then connect it back i get a quick flash. also if i connect the power and neg of the max too a battery instead of the prop the leds go crazy flashing on and off and making weird patterns. but these are not dependent on din load or clk wires.
i am probably making some stupid mistakes i am completely new too all of this but if i can get a starting point where i know everything is working as it should i should be able to get stuck in and really start learning spin and the propeller.
thanks for any help it will be most appreciated.
Comments
If you have a 5V external supply:
The +5V should go to pin 40 (Vin) and the negative to pin 39 on the quickstart board.
The +5V should go to pin 1 (Vdd) and the negative to pin 5 of J1 on the led matrix.
The quickstart board can be powered from an external 5V (pin 40) or an external 3.3V (pin 38). Only one of these should be connected at any time. Pin 39 is the negative (gnd) connection for both +5 and +3.3V. If neither one is connected then the board gets power from the USB connection.
I think you mean "negative to pin 39 on the quickstart board."
And again here:
Should be "Pin 39 is the negative (gnd) connection".
You do mention pin 38 being 3.3V which is correct.
I know these are just a couple of typos, but didn't want anyone trying to connect ground to pin 38 (ground connects to pin 39).
"usb_power_en" is tied to ground if using a non-data USB cable for power. Usually usb_power_en isn't connected to anything. It's not needed when using battery power or when using a normal USB cable connected to a computer.
I think it's time for a new pair of reading glasses for me.
that clears a lot up. i now have pin 40 of the prop connected up too the 5v line on the max and the ground feed connected too pin 39. no damage has happened i only ever try one pin at a time never bridge.
i have double and triple checked the data lines but i cannot get the max to load in test mode. the main problem being i bought the max pre built on a board from gadget gangster and have no info if i need to add any capacitors resisters etc to power or neg lines to make it work with the prop.
do you guys think the code i posted looks about right to boot the max into testmode?
thanks very much!
Make sure CS is set low First
Then shift data out 16 bits not 8 but you may have this in check with the
btw i read your thread and hope all is well soon also.....
thanks
ninogenio CS = chip select. I think its pin 12 on the ic. Look at the top of page 6 and you will see that CS has to be pulled low to start a conversation to the IC.
http://gadgetgangster.com/find-a-project/56.html?projectnum=282
If it's the MAX7219 this thread might help:
http://forums.parallax.com/showthread.php?136470-MAX7219-Propeller-object.-Is-there-one-in-the-OBEX-or-in-the-Forums&highlight=MAX7219
@Publison hi yes thats the kit i bought but for whatever reason the board has come with the 7221 installed. thanks for the link though im going to go through the thread very carefully to see if there is anything applicable to me.
thanks very much guys.
Bits is right. Pull CS low FIRST, (previously called LOAD).
Nick should change the description on his website to reflect the usage of the MAX7221.
thanks for all the help
Great that you got it working!
Always glad to get a positive update. This helps others looking for the same solution.
Jim