What's wrong with my circuit?

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
synic
 
Posts: 5
Joined: Mon Feb 17, 2014 12:54 am

What's wrong with my circuit?

Post by synic »

I posted this on reddit, and while I did get some answers, I haven't resolved it yet. I figured I'd post here and see what you folks think.

I bought a large NeoPixel ring (the 60 pixel one), and made a custom Arduino based board to control it, creating what I call the "NeoClock".
Here's a picture of my controller: https://lh5.googleusercontent.com/-mZ1g ... 073354.jpg

The code is here: http://github.com/synic/neoclock

... and a video of the clock in action here: https://www.youtube.com/watch?v=Ojqfi29G42o. (I apologize for the audio, wife was watching some batman cartoon).

The schematic is here: http://synicworld.com/media/neoclock.pdf

Everything works fine, most of the time. However, the clock will sometimes get itself into a state of randomness, where it will do seemingly random things, such as:

* It will start picking random colors and highlighting random pixels.
* Pixels will not be cleared as they should be.
* Time will not advance correctly - the second hand will jump around, however, the DS1307 does seem to have the correct time, because if I reset the clock, it usually goes back to normal, and has the correct time.
* After time, if I leave it in this state, it will either stop working all together, or eventually, all pixels will become white and will be at their brightest. Even though I have a 1A polyfuse and a 2A wall wart, I'm worried that this kind of situation could start a fire. When the LEDs are at their brightest, they get quite hot.

HOWEVER, resetting the controller doesn't always fix the issue, and furthermore, I feel like I can induce this state of randomness by touching certain areas on the controller (especially the 10k resistor to the right of the 22pF crystal cap).

The whole circuit draws no more than 150mA when it's operating normally, but jumps much higher when it gets into the random state.

I don't think this is a code issue, though I won't rule that out. More likely, I'm not filtering the power correctly, or not using the correct components, etc.
Any ideas? Any other information that will be helpful?

User avatar
Renate
 
Posts: 291
Joined: Tue Nov 13, 2012 3:21 pm

Re: What's wrong with my circuit?

Post by Renate »

I looked a bit at your code.
I didn't see any immediate problem.

The whole RoundClock.cpp is unnecessary.
You're keeping a doubly-linked list of the integers from 0 to 59?
You don't need that to calculate backwards and forwards.
You can calculate modulo 60 easier than that.

Code: Select all

i+=d+60;
if (i>=60) i-=60;

synic
 
Posts: 5
Joined: Mon Feb 17, 2014 12:54 am

Re: What's wrong with my circuit?

Post by synic »

Wow, now I feel really dumb. I don't know why I've gotta complicate things for myself.

User avatar
Renate
 
Posts: 291
Joined: Tue Nov 13, 2012 3:21 pm

Re: What's wrong with my circuit?

Post by Renate »

I was thinking, that stuff could actually be your problem.
You have to keep a sharp eye on how much RAM you are using.
You have to leave a bunch for the stack.
The compiler (at least mine) won't really warn you.
I use a little utility to display percentage flash and RAM I'm using:

Code: Select all

        elfview test.elf /f32768 /r2560
Code:    8874
Data:       0
Zero:    2075

Flash:   8874 /  32768 = 27.1%
RAM:     2075 /   2560 = 81.1%

synic
 
Posts: 5
Joined: Mon Feb 17, 2014 12:54 am

Re: What's wrong with my circuit?

Post by synic »

I've changed the code, I just need to get to a place to try it out.

However, that RoundClock only used the heap at the start of the program, it never added anything else once setup() was done, so I figured if there was going to be a memory problem, it would be at the beginning of the program.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”