Go Down

Topic: Arduino Uno Inconsistent and Flickering with TLC5940 (Read 5006 times) previous topic - next topic

abocanegra

**** UPDATE *****
So reworking the arduino code to utilize C++ chars rather than strings seems to have solved the problem with it acting inconsistently. The flicker that remained ended up a simple fix. I shortened the length of the wires connecting the buffers as much as physically possible (approximately an inch). I am still unsure why it only was a problem with the Uno and not the Duemilanove. Regardless, it works perfectly on both now. I am attaching a photo of the 1st panel running on the Raspberry Pi with an Uno (Left) and a Duemilanove (Right). All addresses work perfectly and no flicker.



Thanks for all of your help. After this project is over, I'll scour the forum to see if there is anything I can help out with.

GoForSmoke


**** UPDATE *****
So reworking the arduino code to utilize C++ chars rather than strings


Could you please be more clear for all of us what you mean by

A) C++ chars

B) strings

I'm a bit confused and 2 members have quoted this post to apparently mean opposite things.

My big clue is that you used the term "reworked" as you did.
Nick Gammon on multitasking Arduinos:
1) http://gammon.com.au/blink
2) http://gammon.com.au/serial
3) http://gammon.com.au/interrupts

abocanegra

I am referring to the above advice that the strings in Arduino cause memory issues. Which is what i used in my initial code posting. The reworked code removes all use of Arduino strings in favor of the more reliable (and faster) C++ chars to build the calls from the Serial.read() and trigger the Tlc commands. I posted the reworked code as well.

Hope this helps

GoForSmoke


I am referring to the above advice that the strings in Arduino cause memory issues. Which is what i used in my initial code posting. The reworked code removes all use of Arduino strings in favor of the more reliable (and faster) C++ chars to build the calls from the Serial.read() and trigger the Tlc commands. I posted the reworked code as well.

Hope this helps


That's nice except your terms are mixed up which is okay for you since what you do works but is confusing for others.

There is no Arduino strings except as C strings or C++ String objects. Arduino uses C/C++ and that maybe causes confusion among new people.

C strings are kept in char arrays as ASCII text code and always end with a NULL (zero) char.

C++ Strings are declared as capital S String and keep their ASCII text inside.

If/when you get into C++ and learn Classes, String is one of those.
Nick Gammon on multitasking Arduinos:
1) http://gammon.com.au/blink
2) http://gammon.com.au/serial
3) http://gammon.com.au/interrupts

Nick Gammon

He is clearly referring to the Arduino IDE-supplied String class:

http://arduino.cc/en/Reference/StringObject

The original post uses String, which I advised against.

Unfortunately the word "string" has quite a few meanings (apart from the stuff you tie up your roast with, and the ones related to theoretical physics).

Character arrays are often referred to as strings, even though the word "string" does not appear. Then there is the Arduino String class, and no doubt lots of other people have their own String classes. Then there is the STL string class (note the lower-case s).
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

GoForSmoke

Arduino String Class is an implementation of the standard C++ String Class.
Nick Gammon on multitasking Arduinos:
1) http://gammon.com.au/blink
2) http://gammon.com.au/serial
3) http://gammon.com.au/interrupts

Nick Gammon

Do you mean the STL (standard template library) string class? Or another one? Can you provide a link to it please?
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

GoForSmoke

I learned C++ years before I ever got internet. The Arduino C++ String Class is pretty much the same as the Borland C++ String Class presented to me as standard.

Here is what I find at cplusplus.com:
http://www.cplusplus.com/reference/string/string/



Nick Gammon on multitasking Arduinos:
1) http://gammon.com.au/blink
2) http://gammon.com.au/serial
3) http://gammon.com.au/interrupts

Nick Gammon

That's the STL string class (note lower-case S). That's absolutely nothing like the String class supplied with the Arduino IDE which does not use the STL.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

GoForSmoke

Memory fails me on the exact details but what I had with Borland C++ 3.x in the 90's looks pretty twin to what we have with Arduino in use/functions. But even then I stayed with C string arrays that I knew from the 80's.

Anyhow the thing is I just wanted to be sure that the OP has actually dumped the use of Strings for C style char arrays rather than me assuming so or someone else assuming not. We can't both be right but maybe just maybe there's a third option and we're both wrong -- at least that's what my troubleshoot/debug instincts tell me.

Nick Gammon on multitasking Arduinos:
1) http://gammon.com.au/blink
2) http://gammon.com.au/serial
3) http://gammon.com.au/interrupts

Docedison

I'm really surprised that the "CC Power Supply" works at all... there is none shown on the PDF anywhere. I hope that Q1 to Q16 are just reversed, emitter and collector. A PNP transistor emitter must be more positive than it's collector and is made to conduct by pulling current from the base to ground.
I would also add some proper bypassing to the board, a couple of 100 nF caps are not really enough.

Doc
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Go Up