Question About Circuit Simulation Programs
NWCCTV
Posts: 3,629
Does anyone know of a free circuit simulation program that has RGB LED's within them? I am using these RGB LED's and I want to be able to simulate them to see if I can figure out why my continuous loop does not work. I have found the 4 Pin RGB LED's in Fritzing but I am not sure if Fritzing is suppose to simulate anything. If it is then I must be doing something wrong as I can not get the LED's to light up.
Comments
Perhaps you can get some clues about creating the software to drive such LEDs from this nice video by Shahriar Shahramian on the SignalPath blog: https://www.youtube.com/watch?v=EXr2_zSfnFw&list=UUKxRARSpahF1Mt-2vbPug-g Where he goes through the creation of a driver for a ring of NeoPixels. And explains all the timing, and what you can get away with, as he goes.
Perhaps rather than a simulator a scope or logic analyser on the pins would help debug your problems. Of course on can use other pins on a Prop as an analyser for free:)
Which object are you using?
These are some of AdaFruit's NeoPixel rings using code posted in this thread (the code uses JonnyMac's object).
I made my own ring using the "B" version. My ring had the LEDs a bit closer together than the Adafruit ring.
I attached the gerber files for my version of the ring to post #49 of the above mentioned thread.
The code used to control the rings should also control the individual Adafruit LEDs.
I think JonnyMac included a demo with his driver. His demo would probably be easier to understand than the "Hypno Rings" code.
If you post your code, I'll take a look at it.
How set are you on using C?
I think it's pretty clear you're having a software issue since the code someone else wrote apparently works.
If you're set on using C, I'll still try to help but I'm more comfortable using Spin.
The RAM needs power to stay alive, the prom does not. A brownout will erase RAM and the program will no longer run.
This is a very common problem for me, and I usually include a reboot warning at the top of my code that executes in a very obvious way. A dedicated pin with a piezo speaker is usually the best way.
I was thinking the same thing.
Andy, I'm working on a simple demo for your six LEDs. Hopefully I'll post it soon.
What are you using as a power supply?
I would find a high current 5v DC source, tie the ground with your board and use it only for the LEDs.
Also these LEDs retain their last setting when they lose signal, and that can complicate debugging. Sometimes I "reboot" the strip by killing power to it and I get different results. I read a lot of stuff online where people think their code is "locking up" when it seems to me it's just a lost signal.
Anyway, keep playing with it and get used to all that stuff and be able to identify it. It helps a lot.
I agree but a few LEDs usually will run off of USB power.
The attached code drew about 200mA on with the Activity Board using six LEDs.
The main loop sends one of the colors listed in "colorTable" to the a LED.
@Andy, Let me know if this is close to what you want the LEDs to do.
The only time the LEDs are off is at the very beginning of the program.
I'm uploading a video showing the code in action on an Activity Board.
[video=youtube_share;T7QYz8MkuR8]
YouTube says it will take another 21 minutes before it's available.
The video is now available.
My camera has a hard time with these LEDs. I used a sheet of white paper to diffuse the light a bit when I made the videos embedded in post #3. The white paper makes the colors easier to see but the camera still fails to capture how cool these things look.
Do you get that effect?
Edit: Never mind, it was my signal wire going to the strip. Seems a few inches too long causes some interesting effects lol.
So I take it you haven't changed your mind about the following?
If you have a ring of these, I hope you've given my "MirroredWheels" program a try.
You'd just need to change:
To 12 and:
To 1 (assuming you're only using one ring).
The program is attached to post #2 of my "Fun with NeoPixels" thread.
Sometimes I don't take my own advice out of sheer laziness. I spent some time soldering leads and a connector to the strip and it was hard to bring myself to redo it. It seemed to me like it should be fine.
This is also very interesting and reveals some key components of prior headaches when the same strip was on my robot. I have measured the max length of the signal wire between the Propeller's pin and the first LEDs DI pin to be around 5" before there is a problem. I think this is why I thought level shifters were required, I had never really used these without a signal wire.
Does this seem right? Can you test using a longer signal wire to the strip please?
I linked several servo extension wires together to make a wire just under three feet long and the LEDs didn't have a problem.
I've noticed big changes in how well these LEDs work when using different power supplies. I think they're very susceptible to noisy power.
In the Fun Board thread, there was talk about powering the LEDs with 3.3V. I haven't tried this myself but I plan to.
This is usually an indicator your Propeller is resetting. (Which is why I asked about the power supply in post #9.)
You can add as many colors as you like to the colorTable arrray.
You need to change the constant "COLORS_IN_TABLE" so the program knows how many colors are in the table.
I'm working on a demo of my "MergeColors" method. The MirroredWheels program uses this method to filling the colors of the rainbow. I'll post the demo once it's finished.