40 programmable LEDs

chopperwalker

New Member
Hello Everyone,

I just discovered PICAXE and I have no previous experience with microprocessors. I stumbled upon PICAXE when searching for a solution to an LED project I need to create. I have built a pretty sweet Beer Pong Table for a friend and I think it needs some flashing lights. I was going to do some hard wired sequencing pattern, but I am better at programing then circuit design and hence the microprocessor aproach.

My goal is to control 40 3.2 volt LEDs over 30 channels (20 LEDs on 10 channels, the rest have their own). I assumed at first that I would need the 40X1, but probably not since there only 8 outputs on most of these chips. I thought about using transistors and NAND gates with multiple chips, but I realized my idea might inadvertently set another LED to high. Seeing how this will be the first circuit design I ever take part in I though I could use some suggestions. If I can get this part down, I might expand it to take input to change patterns, have a distraction button and have other modes. I don't think I will have any of the lights stay on longer then a flash so I am going for battery power, too.

Like I said, I am new to this so if any could suggest better approaches, reading materials, and or the like I would greatly appreciate it. If anyone is a beer pong fan and would like to team up on this that would be awesome.

Thanks for your input,

Chopper
 

Tom2000

Senior Member
Howdy, Chopper,

Google up the data sheet for the MAX7219 LED controller chip. It will handle all your LEDs neatly. If it looks like it might do what you want, search this forum for MAX7219. There's been a lot of discussion of it, and code has been published to show you how to handle it with a Picaxe.

Good luck with your project!

Tom

PS - It'll never replace darts! :)
 
Last edited:

kranenborg

Senior Member
You may also consider a more modern alternative which can be controlled directly via I2C; MAX6955, available via sampling at maxim/dallas. I have used this device successfully and can help with a code example if needed. You may for example use an 18X to control it.

PS: Just saw that you are new to microcontrollers; you should seriously consider to start simple with just a picaxe (18x, for example as a basis for the final 40-led application, but you should in addition consider the very versatile 08m), a led and a switch. Connecting a simple i2c device (eeprom) may be the next step. Take the time to experiment, learn and understand fully (you will not regret the effort) before you start this quite complicated project. For simple examples you may also take a look at my own picaxe page at www.kranenborg.org/ee/picaxe

Welcome

/Jurjen
 
Last edited:

chopperwalker

New Member
Thanks Jurjen, very helpful. I definitely want to learn it right. I have ordered an 18X Solderless Dev Package and the Proto board setups from PHAnderson to get started. I have also ordered samples of the MAX6955 and the MAX7219. Can't wait!
 

Tom2000

Senior Member
I have ordered ... the Proto board setups from PHAnderson...
Chopper,

With the addition of a few simple parts, that 18X protoboard becomes an incredibly useful tool.

I've added a few things to mine that makes it useful for not only lots of Picaxe experiments (18X, 08M, and 28X1), but all sorts of non-Picaxe projects, too. Adding a few extra components to a board already equipped with power and the Picaxe download circuit makes it incredibly useful.

In addition to all the Picaxe experiments I've tried on my board, I've prototyped, among other things, the IF and mixer stage of a transmitter, boost converters, signal generators and conditioning circuitry for quick measurements, and various analog circuitry. Currently, I have a non-Picaxe DSP experiment wired on it.

If you decide to modify yours, don't use mine as a cookie cutter example. Instead, use it as a source of ideas to customize the board to your requirements and desires, using parts you have on hand or can scrounge.

Have fun!

Tom
 

chopperwalker

New Member
Alright! I received the 18X Dev Package and Protoboard. I have been experimenting on the breadboard and I am amazed at how simple it is to get started. Very exciting.

I have added some momentary push buttons and run interrupts on them. I wrote a program that lets me toggle through different flashing patterns with a branch function. I want to do interrupts for both momentary switches (indepenedent). I am aware of using a diode and a resistor and watch one input, and then by program determine which input was used, but I don't know what diode or resistence to use.

I also received my MAX6955 samples; the MAX7219s are in the mail. I wrote a circuit diagram for the 7219, but its not here. I have the 6955, but am not sure how to initiate the chip yet. This byte addressing is completely new to me. Any suggestions on where to read up? Or maybe a starter script to get tinkering?
 
Last edited:

kranenborg

Senior Member
I could not locate the code for a MAX6955 project that I have used in the past, but I found on this forum the following code (by Tarzan) that works for a very similar device (but with less ports), namely the MAX6956:

Code:
i2cslave %10000000, i2cfast, i2cbyte
writei2c $04,(%00000001)’wakeup from shut down
writei2c $02,(%00000111)'half power
writei2c $09,($00,$00,$00,$00,$00,$00,$00)’set as LED segment drivers

main: 
writei2c $4C,($FF)’block of 12~19 ports turn on
writei2c $54,($FF) ’block of 20~27 ports turn on
writei2c $5C,($0F) ’block of 28~31 ports turn on
pause 100
writei2c $4C,($00) ’block of 12~19 ports turn off
writei2c $54,($00) ’block of 20~27 ports turn off
writei2c $5C,($00) ’block of 28~31 ports turn off
pause 500
goto main
The clue to programming these devices is that they need to be configured in order to show activity (trhe very first commands). You should adapt the code above to apply for the MAX6955 (whih has address %11000000, so the first line becomes i2cslave %11000000, i2cfast, i2cbyte)

Regards,
Jurjen
 
Last edited:

chopperwalker

New Member
PICAXE rocks! I have been using the MAX7219 with much success using the solderless dev kit from PH Anderson. I used the other MAX7219 I have and built it into the protoboard from PH Anderson.

Unfortunately, I might have burnt my 18X. I can no longer get it to download in either setup or run. I checked and double checked the wiring (plus I never changed anything). I tried all the resets, letting capicitors disapate, and even connected my multimeter to Serial In with positve voltage showing. I don't have another chip to test, either (in the mail now, though)

After much reading I noticed most people burnt them with to much voltage. I checked my power supply and noticed a difference. It is an old 12V 1.2Amp power supply from a Netgear router. When I connect it to my multimeter I am getting a reading of 15-16 volts. I had checked it initially and it wasn't that high. I am wondering if it went bad and fried it. One note is that the 12 volt LED on the bread board is still functioning. Would the 7805 regulator handle the 16 volts and maintain a 5 volt output? Any ideas on how to confirm its gone?
 

inglewoodpete

Senior Member
The 780x series can handle a maximum steady input voltage of 35V. If the power supply is a switchmode supply, there could be transients that peak well over 35V. Old power supplies can cause problems.

Diagnosis of the problem needs to be addressed logically:
-Is the power supply outputting a steady 5v now?
-Try a battery pack of 3 good alkaline cells.
-Is +5v getting to leg 14?
-Is the reset pin pulled high?
-Is there any activity around the 18X? (a cheap logic probe will help here)
 

chopperwalker

New Member
-Yes, the regulator is outputing 5v
-tried with a 9v instead of the plugin
-Yes, +5v to leg 14
-10k Ohms, with no volts coming through
-Not sure, don't have a logic probe

Not good, huh?
 
Thats funny... I'm using a 12V power adapter from an old netgear router too... :) . Try putting a new 18X in, if that works then your old one burnt out. If not, theres something wrong with the circuitry.
 
Top