Show Posts
Pages: 1 [2] 3 4 ... 9
16  Forum 2005-2010 (read only) / Troubleshooting / Re: LED display Issues on: October 23, 2009, 01:41:05 pm
RE direct register access:

WRT the cascading, imagine a loop to be a  mechanical typewriter.  Every time your loop ends and goes back to the beginning its like hitting the carriage return.  It takes the typewriter a lot more time to go back to the beginning than it does to type a single letter.  

Therefore if you want to type 42 letters (i.e the state of each LED) it is faster to type all 42 letters in one line than to type one letter per line.  This is a time optimization called "loop unrolling" (google it).

Add to that the direct register access idea.  Using it, ONE key press (one instruction) can type 8 letters (by directly writing the port) instead of it taking more like 10-20 key presses to type just ONE letter (digitalWrite function call).

Finally, when you cascade the 595s you have to manipulate the clock line for each letter.  To continue the analogy, this would be like typing a ^ (up)  before and a v (down) after each letter.  So you instead of typing:
you are need to do ^1v^0v^1v, etc.

But if you give each of 8 chips its own data line but use the same clock line its like typing:

^10101010v^10101010v, etc

A LOT fewer ^v are needed.  Note that there is a limit to how many chips the Arduino can drive from a single line... it has to do with how much current the Arduino can source per line and how much the 595 draws.  I'm not sure what those number are, just be aware that weird behavior may be a hardware not software issue.

With all of these optimizations you'll probably get it to go hundreds if not 1000 times faster.  I have driven 6 M5451 chips (they are like a 35 output shift register LED driver) using code like this and am able to blink the LEDs at 16kHz (I didn't try more).  200 hz or so looks "on" solid to a human eye...

My code (for the M5451 chip) is available at <url></url>.  But you know you'll probably have more fun and learn a lot more if you DIY! :-)

17  Forum 2005-2010 (read only) / Troubleshooting / Re: LED display Issues on: October 22, 2009, 11:36:18 pm
What's your outer vs inner loop?  Are you sweeping so each LED will be on 1/64 of the time, or are you going the other way so they will be on 1/16th of the time?

Are you using digitalWrite() to bit bang the 595s?  That function is pretty slow.  Instead use direct register access.

Finally, are the 595s cascaded?  Doing it that way causes you to make a long inner loop.  Instead connect one arduino output to all the 595 clock inputs, and a different arduino output to each 595 data in.  If you choose the right arduino inputs then you can write the data to 8 595s at the same time by just setting one register (PORTB or PORTD are the digital IO register names)...

18  Forum 2005-2010 (read only) / Troubleshooting / Re: LED Driver?! on: October 22, 2009, 11:17:35 pm
If you don't want to multiplex (aka blink) so people's eyes don't wig out when glancing across your display then use the M5451 chip.  It does 35 outputs (so you'd need 2 of them)  And can take 13 volts across it, so that should be enough for 4 LEDs...  But it only does a max of 20mA per line.  However, remember that its not multiplexed, so 20mA on constantly is brighter than 30mA multiplexed by 7 (i.e. 30mA/7 is your average current).

Search for Arduino M5451 if you are interested.  I have code and even some boards with 2 chips on them and an AVR 328 if you don't want to do it all yourself.

The only drawback is you have to run more wires since each group of 4 LEDs will need its own wire.  My board takes 40 pin IDE cables which makes this a bit easier.

19  Forum 2005-2010 (read only) / Development / Re: New twist on Arduino clones. on: April 14, 2010, 10:21:23 am

I don't think that there is any advantage to *us*!  The advantage is that C# programmers can do some embedded and most importantly use any Arduino shields... but of course not the shield's drivers -- so it is nice but not REALLY nice.  I don't really think that a $80 board is quite the impulse buy a $25 Arduino clone is so don't worry we all won't be moving to C# anytime soon :-).

@Joe Mcd:  That's funny I thought Arduino WAS C++?!  I mean I've always just coded C++ in it...very confused.  I'm talking the language not the libraries...

20  Forum 2005-2010 (read only) / Development / Arduino vs. PSOC on: August 13, 2010, 08:31:06 pm
I've recently did a little Cypress/PSOC board and so I posted my thoughts on the process and how it compares to Arduino/AVR her:

21  Forum 2005-2010 (read only) / Development / Re: Button Press Debounce Problem, when used Serial on: April 29, 2010, 10:28:48 am

"The button is conneted the correct way. Reason why I am 100% sure is that when I so a very simple button push program it works perfectly"

I'd recommend that you learn how to present data not your opinion.  That you are 100% sure is not relevant.  You are asking for help.  If you can't be bothered to take the time to state what you think the correct way is, why should we be spending all this time thinking abt your proglem.  In this case, if the pin is "floating" proximity to a driven  pin could affect the float level.  Inclusion of the serial drives pins and could influence proximal pins.  This is why I asked the question.

Regardless, there's no point chasing this unlikely case when in fact this bug is pretty obviously what Eberhard 1st suggested.  I just got fooled by your obstinacy.  Loop() is never being run.

Good luck...
22  Forum 2005-2010 (read only) / Development / Re: Button Press Debounce Problem, when used Serial on: April 28, 2010, 07:34:24 pm
Yeah, Eberhard is smart to take a divide and conquer approach.

We cannot guarantee that the code is getting past the while loop that is waiting to recv data.  His comments will prove or disprove that and therefore point us to a problem in the OLED code or a problem with the button.

I'm going to jump ahead tho and ask you to describe how the button is connected... did you connect pin 2 to one side of the button and the other side to ground?  (That will not work erratically...)

23  Forum 2005-2010 (read only) / Development / Re: Button Press Debounce Problem, when used Serial on: April 27, 2010, 10:54:20 am
Please do what other posters suggested; post your exact sketch copy-and-pasted.  Don't type it in!

By only posting hand-copied material from where you think that the problem is, you are forcing us to essentially look at your conclusions and not at the source material.  It is unlikely that we will find the issue by looking at your conclusions since you cannot find it.

Worse, you are wasting all these people's time which is why people have stopped trying to help you.

But here's a wild guess: press the button and HOLD IT DOWN for many seconds and tell us if that works.  AND COPY_PASTE YOUR SKETCH!!!
24  Forum 2005-2010 (read only) / Development / Re: Open ended topic: Testing "clones" on: April 27, 2010, 10:43:40 am
I have 2 sketches that verifies pins -- it makes sure that no pins are shorted to other pins or unconnected and that they all drive high and low.  It uses 2 Arduinos -- you plug the "tester" into the "tested".  I guess that's kind of your most basic functional test.  You are welcome to have it if you want.

In terms of more interesting things to test, I'd look at your power and ground rails and see how stable they are.  The AVR has those 6 analog inputs and if you don't have proper capacitors or even isolation inductors your analog input readings will suffer from random noise.

Also you could look at your clock crystal and caps and see how steady it is (if your scope is fast enough).

But you might have more fun trying to exceed the specs.  Make the 5v rail handle an accidental connection to a higher voltage source.

25  Forum 2005-2010 (read only) / Development / Re: Long female header pins? on: April 14, 2010, 10:10:32 am
@sircastor: Order them with 2 spacers on the top.  That way you have more space on the top of your PCB and it plugs fully into the one below.  Note, make sure that you don't put thru hole components over the ethernet or it will touch them.

26  Forum 2005-2010 (read only) / Development / Re: Arduino on PCB and crystal on: March 24, 2010, 04:27:44 pm
Thanks Udo that is very informative!  Especially the section on unbalanced loads since that is what is working for this particular board.
27  Forum 2005-2010 (read only) / Development / Re: Arduino on PCB and crystal on: March 19, 2010, 08:23:22 am
You guys seem to know a lot about crystals and caps!  Here's a quick question just for curiosities sake:  I have a board that did not work until I REMOVED one of the 22pF caps (yes I tried replacing it first and it still didn't work)!  So there is just 1 cap connected to the crystal.  Any ideas why this could be happening?

28  Forum 2005-2010 (read only) / Development / Re: Large LED display for temperature. on: October 13, 2009, 10:14:36 am
You could use my LED driver board to drive it.  This link is a description of rev 2 of the board:  I haven't made a formal purchasing site yet, etc.  But the code is here:

It is based on 2 M5451 chips which will do 35 outputs at 12 volts, 20mA.  Since it is not a matrix driver the LEDs are on solid.  This means that they are a lot brighter (an 8x8 matrix only has an individual row on 1/8 of the time).  And you can have multiple lines drive the same LED if you choose to use high brightness LEDs instead of multiple low brightness ones.

Speaking of brightness... are you expecting that the display will be visible in full sun (you said it was a swimming pool)?  If so, you might want to experiment with that to make sure it actually works before jumping into the project.  Note that the sparkfun video has the lights off, AND they are using green (the eye is much more sensitive to green) -- so I'm guessing its not really that bright.   Really its more likely that a mechanical solution (I'm thinking of a rotating styrofoam drum with numbers painted on it, slot machine style) will be visible in full sun.  You could use the arduino to drive continuous rotation servos to move the drums.  Of course, the mechanical solution doesn't look as cool!

29  Forum 2005-2010 (read only) / Development / Re: Setting in resin on: March 19, 2010, 08:28:14 am
Sorry for the repeat post.  But there's one more important thing.  You want to use a resin that's made FOR display.  Resins made as glue or for surfboards, etc will yellow with age (well all resins yellow with age, but some yellow less than others) and may even turn cloudy.

I've had great luck with Kleer-Kote (its the glassy finish on restaurant tabletops):
30  Forum 2005-2010 (read only) / Development / Re: Setting in resin on: March 19, 2010, 08:18:36 am
I've been setting LEDs into resin.  I'd have a hard time believing that a thin pour would generate more heat than soldering on parts.  But I'd be more concerned about heat dissipation of the parts when the board is running if you are planning to pour directly over the circuitboard.  For example, internal trace widths are specced thicker than external for the same current.

I'm very interested to hear how this turns out since I'd like to try it myself.

Other resin tips:

To minimize internal bubbles stir the resin at a slow constant rate for several minutes.  You can see if you are generating bubbles because the resin will cavitate at the back of the stirring stick.  This is very boring! :-)

After pouring, to remove all surface bubbles fire up a blowtorch and just touch the edge of the flame to the surface for an instant.  It will pop all bubbles like magic!  Don't keep the fire on the resin for too long though.

A wax based mold release like Carnuba will leave an opaque finish.  Apply as thinly as possible.  I think if you want a transparent finish your best bet is silicone spray lubricant but maybe I'm misremembering...

Pages: 1 [2] 3 4 ... 9