Pages: 1 [2]   Go Down
Author Topic: Arduino Uno Inconsistent and Flickering with TLC5940  (Read 4587 times)
0 Members and 1 Guest are viewing this topic.
Los Angeles
Offline Offline
Newbie
*
Karma: 0
Posts: 22
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

**** 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.


* 20130619_015337.jpg (2577.75 KB, 3264x2448 - viewed 49 times.)
Logged

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 98
Posts: 4819
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

**** 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.
Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Los Angeles
Offline Offline
Newbie
*
Karma: 0
Posts: 22
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 98
Posts: 4819
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Global Moderator
Online Online
Brattain Member
*****
Karma: 506
Posts: 19120
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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).
Logged


Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 98
Posts: 4819
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Arduino String Class is an implementation of the standard C++ String Class.
Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Global Moderator
Online Online
Brattain Member
*****
Karma: 506
Posts: 19120
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you mean the STL (standard template library) string class? Or another one? Can you provide a link to it please?
Logged


Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 98
Posts: 4819
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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/



Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Global Moderator
Online Online
Brattain Member
*****
Karma: 506
Posts: 19120
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 98
Posts: 4819
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 47
Posts: 2928
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

--> 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

Pages: 1 [2]   Go Up
Jump to: