Pages: 1 ... 16 17 [18] 19 20   Go Down
Author Topic: ShiftPWM support topic. Latest update: Schematics, high power LED's, LED strips  (Read 80626 times)
0 Members and 1 Guest are viewing this topic.
Eindhoven
Offline Offline
Jr. Member
**
Karma: 1
Posts: 87
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi guys,

Sorry I have not been responding too much in this topic lately. I have been a bit busy.

I completely rewrote the ShiftPWM documentation. Now there is a function reference, a load estimator and schematics for regular LED's, high power LED's and LED strips. Please let me know if you are missing something or if I made any errors.

I also added a schematic for a push-pull line driver for when you have issues driving long signal wires.

I also update the ShiftPWM code base:
- Moved some initialization into the library: cleaner sketches, easier to switch between SPI and no SPI.
- Added optional load balancing: shift the PWM phase by 8 PWM bits for every register. This will distribute the current peeks more evenly.
- Added Leonardo compatibility

And finally I opened a web shop where you can buy boards to drive 350mA high power LED's and LED strips.

Now that I got this done, I finally have time to work on the matrix version to get it up to par with the normal version, so I can officially release it. To answer ematson's question: I will rewrite the matrix version to inlcude a no-spi option as well.

So check it out at www.elcojacobs.com/shiftpwm
« Last Edit: August 09, 2012, 01:51:35 pm by elcojacobs » Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 204
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am attempting to port this to Energia (Arduino IDE for the TI launchpad) I will post updates as I go
Logged

Kuala Lumpur, Malaysia
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Absorbing knowledge! Will give it back :)
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
Are there any software that you know which can provide a graphical user interface for us to easily change the sequence of the lights?
Something like Vixen Lights? (http://www.vixenlights.com/downloads.html, there's a plug-in called "Simple 595 with pulse width")
How do I get started?

Thanks a lot! smiley-grin
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 204
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This has been discussed previously. Go back a page or so
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

After 3 days of trying to get an Arduino Uno with a TLC5916IN with shiftPWM I still cannot get it to function properly.  I am unsure as to where the problem even stems from,  Although the code says to put ShiftPWM_invertOutputs = true for the tlc5916 when i do so my LED lights up when ShiftPWM.SetAll(0);  when set at 255 my led is still dimly lighting and blinks on and off at a steady rate.  Any intermediate value leads to the led blinking on and off in a non random pattern.  I have constructed the circuit as per the instructions on the website including decoupling capacitors.  Does the problem lie with the fact that I am using a single LED for testing rather than a common anode RGB led?  After writing the above i think it makes sense that the LED is blinking the way it does as the load would normally be split by 3 and so the visible blinking from one would correspond to a dimming effect on an RGB LED.  However I still do not understand why it the LED is on when it should be off (granted my understanding of how a common anode led functions is extremely limited)  If its simply a matter of plugging in a RGB LED case I'm going to feel very dumb about wasting so much time trying to find a problem in my circuitry.
Logged

Eugene, Oregon
Offline Offline
Sr. Member
****
Karma: 9
Posts: 388
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I cant seem to get this to install or work.
I am using ubuntu, I tried to follow the very simple directions, but had to vary  a bit.


"
    Go to the GitHub repository the download the latest version of ShiftPWM.
   Extract ShiftPWM directory from the archive to your Arduino libraries directory (for example: \???\arduino-1.0\libraries).
    Extract it with the ShiftPWM directory intact, so the result will be \???\arduino-1.0\libraries\ShiftPWM).
    Restart Arduino
    Open one of the examples from the Arduino menu (File –> Examples –> ShiftPWM –> pick one) "

I cant extract to the /usr/share/arduino directory as the user, that has to be done as root. I extracted the files as user, then su'd to root, and copied the files to /usr/source/arduino/libraries, then chown -R, chgrp -R, and chmod -R to have all the files ownership, and everything set like the other files.
When I try to load up an example, they are not listed, but I can load the libarary by clicking sketch/import library (ShiftPWM shows up in that list).
I copied the examples directory over to the examples directory under /usr/share/arduino, but no shiftPWM examples show up in the program.


I tried downloading the zip file, and then su ing, and unzipped the file in the /usr/share/arduino/libraries as root. It still doesnt show up any examples.

I opened the ShiftPWM_RGB_Example.ino in a text editor, copied it to a blank sketch, and tried to upload it to my uno, but it failed, stating:


Code:
/usr/share/arduino/libraries/ShiftPWM/CShiftPWM.cpp: In member function ‘bool CShiftPWM::IsValidPin(int)’:
/usr/share/arduino/libraries/ShiftPWM/CShiftPWM.cpp:51:61: error: ‘F’ was not declared in this scope
/usr/share/arduino/libraries/ShiftPWM/CShiftPWM.cpp: In member function ‘void CShiftPWM::SetAmountOfRegisters(unsigned char)’:
/usr/share/arduino/libraries/ShiftPWM/CShiftPWM.cpp:229:94: error: ‘F’ was not declared in this scope
/usr/share/arduino/libraries/ShiftPWM/CShiftPWM.cpp: In member function ‘bool CShiftPWM::LoadNotTooHigh()’:
/usr/share/arduino/libraries/ShiftPWM/CShiftPWM.cpp:253:44: error: ‘F’ was not declared in this scope
/usr/share/arduino/libraries/ShiftPWM/CShiftPWM.cpp: In member function ‘void CShiftPWM::Start(int, unsigned char)’:
/usr/share/arduino/libraries/ShiftPWM/CShiftPWM.cpp:297:11: error: ‘SS’ was not declared in this scope
/usr/share/arduino/libraries/ShiftPWM/CShiftPWM.cpp:316:71: error: ‘F’ was not declared in this scope
/usr/share/arduino/libraries/ShiftPWM/CShiftPWM.cpp: In member function ‘void CShiftPWM::PrintInterruptLoad()’:
/usr/share/arduino/libraries/ShiftPWM/CShiftPWM.cpp:416:45: error: ‘F’ was not declared in this scope
/usr/share/arduino/libraries/ShiftPWM/CShiftPWM.cpp:426:45: error: ‘F’ was not declared in this scope
/usr/share/arduino/libraries/ShiftPWM/CShiftPWM.cpp:467:38: error: ‘F’ was not declared in this scope

I have another computer I could try it on, but I will have to free up some space on that computer to install it.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

When you unzip there is a folder inside the unzipped folder.  you want only the ShiftPWM folder not the one that says something like Aug_15_ShiftPWM.
Logged

Eindhoven
Offline Offline
Jr. Member
**
Karma: 1
Posts: 87
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

After 3 days of trying to get an Arduino Uno with a TLC5916IN with shiftPWM I still cannot get it to function properly.  I am unsure as to where the problem even stems from,  Although the code says to put ShiftPWM_invertOutputs = true for the tlc5916 when i do so my LED lights up when ShiftPWM.SetAll(0);  when set at 255 my led is still dimly lighting and blinks on and off at a steady rate.  Any intermediate value leads to the led blinking on and off in a non random pattern.  I have constructed the circuit as per the instructions on the website including decoupling capacitors.  Does the problem lie with the fact that I am using a single LED for testing rather than a common anode RGB led?  After writing the above i think it makes sense that the LED is blinking the way it does as the load would normally be split by 3 and so the visible blinking from one would correspond to a dimming effect on an RGB LED.  However I still do not understand why it the LED is on when it should be off (granted my understanding of how a common anode led functions is extremely limited)  If its simply a matter of plugging in a RGB LED case I'm going to feel very dumb about wasting so much time trying to find a problem in my circuitry.

ShiftPWM_invertOutputs should be set to false for the TLC5916. That was an error on my website, which has been corrected now. How many 5916's do you have connected and how long are your wires? It sounds like your clock signal is missed sometimes. You can try using the push-pull line driver to improve the clock signal.
Logged

Eindhoven
Offline Offline
Jr. Member
**
Karma: 1
Posts: 87
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I cant seem to get this to install or work.
I am using ubuntu, I tried to follow the very simple directions, but had to vary  a bit.


"
    Go to the GitHub repository the download the latest version of ShiftPWM.
   Extract ShiftPWM directory from the archive to your Arduino libraries directory (for example: \???\arduino-1.0\libraries).
    Extract it with the ShiftPWM directory intact, so the result will be \???\arduino-1.0\libraries\ShiftPWM).
    Restart Arduino
    Open one of the examples from the Arduino menu (File –> Examples –> ShiftPWM –> pick one) "

I cant extract to the /usr/share/arduino directory as the user, that has to be done as root. I extracted the files as user, then su'd to root, and copied the files to /usr/source/arduino/libraries, then chown -R, chgrp -R, and chmod -R to have all the files ownership, and everything set like the other files.
When I try to load up an example, they are not listed, but I can load the libarary by clicking sketch/import library (ShiftPWM shows up in that list).
I copied the examples directory over to the examples directory under /usr/share/arduino, but no shiftPWM examples show up in the program.


I tried downloading the zip file, and then su ing, and unzipped the file in the /usr/share/arduino/libraries as root. It still doesnt show up any examples.

I opened the ShiftPWM_RGB_Example.ino in a text editor, copied it to a blank sketch, and tried to upload it to my uno, but it failed, stating:


Code:
/usr/share/arduino/libraries/ShiftPWM/CShiftPWM.cpp: In member function ‘bool CShiftPWM::IsValidPin(int)’:
/usr/share/arduino/libraries/ShiftPWM/CShiftPWM.cpp:51:61: error: ‘F’ was not declared in this scope
/usr/share/arduino/libraries/ShiftPWM/CShiftPWM.cpp: In member function ‘void CShiftPWM::SetAmountOfRegisters(unsigned char)’:
/usr/share/arduino/libraries/ShiftPWM/CShiftPWM.cpp:229:94: error: ‘F’ was not declared in this scope
/usr/share/arduino/libraries/ShiftPWM/CShiftPWM.cpp: In member function ‘bool CShiftPWM::LoadNotTooHigh()’:
/usr/share/arduino/libraries/ShiftPWM/CShiftPWM.cpp:253:44: error: ‘F’ was not declared in this scope
/usr/share/arduino/libraries/ShiftPWM/CShiftPWM.cpp: In member function ‘void CShiftPWM::Start(int, unsigned char)’:
/usr/share/arduino/libraries/ShiftPWM/CShiftPWM.cpp:297:11: error: ‘SS’ was not declared in this scope
/usr/share/arduino/libraries/ShiftPWM/CShiftPWM.cpp:316:71: error: ‘F’ was not declared in this scope
/usr/share/arduino/libraries/ShiftPWM/CShiftPWM.cpp: In member function ‘void CShiftPWM::PrintInterruptLoad()’:
/usr/share/arduino/libraries/ShiftPWM/CShiftPWM.cpp:416:45: error: ‘F’ was not declared in this scope
/usr/share/arduino/libraries/ShiftPWM/CShiftPWM.cpp:426:45: error: ‘F’ was not declared in this scope
/usr/share/arduino/libraries/ShiftPWM/CShiftPWM.cpp:467:38: error: ‘F’ was not declared in this scope

I have another computer I could try it on, but I will have to free up some space on that computer to install it.


I have not tried ShiftPWM on Linux, but I can tell you that in your library directory, you should have a directory called ShiftPWM. In this directory you will have the file CShiftPWM.h and his friends.

I don't know if that is the cause of the compiler not recognizing the F() function. That is an Arduino version of PSTR(). Is your Arduino install up to date?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


ShiftPWM_invertOutputs should be set to false for the TLC5916. That was an error on my website, which has been corrected now. How many 5916's do you have connected and how long are your wires? It sounds like your clock signal is missed sometimes. You can try using the push-pull line driver to improve the clock signal.

I have only a single 5916 wired in at the moment, everything is just bread boarded right now and so the wires from the arduino to the 5916 are only about 4 cm.  I'll try to add in the push-pull line driver and see what happens.
Logged

Eugene, Oregon
Offline Offline
Sr. Member
****
Karma: 9
Posts: 388
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have tried many things, none of which have worked. I think I first tried to unzip as user, and it wouldnt let me unzip it to /user/source/arduinio/libraries, so I unzipped it to a folder on my desktop. Then I logged in as root, and copied that folder (ShiftPWM) to /usr/source/arduino/libraries, changed ownership to root recursively, changed group to root recursivly, and changed the file permissions to reflect what other file permissions were in the same directories. When that didnt work, I looked around and found an examples directory, and  put the 2 directories that were in the examples folder, into the /user/share/arduino/examples directory

/usr/share/arduino/examples$ ls
1.Basics   4.Communication  7.Display   ShiftPWM_Non_Blocking
2.Digital  5.Control        8.Strings   ShiftPWM_RGB_Example
3.Analog   6.Sensors        ArduinoISP

It still didnt work.

 /usr/share/arduino$ ls
Arduino.mk  examples  hardware  lib  libraries  reference  tools
 
/usr/share/arduino/libraries$ ls
ArduinoTestSuite  examples       Matrix  ShiftPWM        Sprite
EEPROM            Firmata        SD      SoftwareSerial  Stepper
Ethernet          LiquidCrystal  Servo   SPI             Wire
  /usr/share/arduino/libraries$ cd ShiftPWM/
  /usr/share/arduino/libraries/ShiftPWM$ ls
CShiftPWM.cpp  examples      pins_arduino_compile_time.h
CShiftPWM.h    keywords.txt  ShiftPWM.h

I just tried copying the ShiftPWM directory to the examples directory and no luck there too.


So, I have a copy of the ShiftPWM directory in /usr/share/arduino/libraries, and a copy in /user/share/arduino/examples, and I have a copy of the exampes directorys also in there.

I have an old mac that I was able to install it on, and i was able to get it working on a couple test fixtures I setup, but I still wont work on my main computer.

This version of arduino software is 0022ubuntu0.1 It says alpha. Its THE version available for ubuntu.

If I click sketch/import library, it shows the ShiftPWM library, so the program does see stuff I added, but fails when I try it, and doesnt show up in my examples menu.
Logged


Eugene, Oregon
Offline Offline
Sr. Member
****
Karma: 9
Posts: 388
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

https://www.youtube.com/watch?v=ZN0qXgcU-w0&list=UUz9z1xiGg70J6bT0tksUb-A
Using that old mac, I was able to get shiftpwm running on my uno. I have 2 test setups both use 8 RGB LEDs an 3 Shift registers. Each setup has different pin grouping that I havnt figured out yet. One setup uses 1 chip for each color (red, green, blue), the other one is setup with  the LEDs interlacd RBGRGB....
The one that is RGBRGB seems to work as expected, but the other one seems work wrong, even if i set its pingrouping to 8.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Looking for some advice here...how well does this library work when you start trying to multiplex the LED's?  Is there any built in support for that?  I'm looking to drive 100RGB led's multiplexed 10 times for a 10x10x10 RGB LED cube, would this be the fastest possible solution? What kind of processing power would I need to achieve persistence of vision across all 10 layers?
Logged

Australia
Offline Offline
Jr. Member
**
Karma: 2
Posts: 65
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@mnpumar: There is a separate library that Elco wrote that does handle 2D led matrix. I believe this could be easily modified to run as a 3D cube. (http://arduino.cc/forum/index.php/topic,66988.msg536032.html#msg536032)

There are limits on how many LED's you can address and if you are using a standard Arduino (328) the limitation is the array size (memory limitation). But if you were to use a MEGA with more memory I believe you could go beyond that. Currently with a 328 Arduino the limit is 1024 Leds. I currently have this many Leds running in a 16x64 single colour matrix. There are a number of other variables that influence how many LED's you can address (Frequency and Brightness levels) vs the speed of the arduino.

I am not sure if 10x10x10 RGB would be feasible....that would be 300 LED's per plane of the cube, with 10 planes that would be 3000 LED's that would need to be addressed total. I just don't know if you could do this at a fast enough frequency to not have flicker......

But that is not to say don't try. Would be very awesome to see!!!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@milamber Thank you for the link!  Is shiftMatrixPWM being actively developed alongside ShiftPWM?  If so, where can I get the latest version?

I think it may be possible to do this using the ardunio uno.  Has anybody tried using the uno to control shift registers running at 5V using something like this: http://rocky.digikey.com/WebLib/Texas%20Instruments/Web%20data/SN74LVC4245A.pdf ?  Would this work?
« Last Edit: November 14, 2012, 08:23:28 pm by mnpumar » Logged

Pages: 1 ... 16 17 [18] 19 20   Go Up
Jump to: