0
Offline
Newbie
Karma: 0
Posts: 11
|
 |
« on: November 16, 2012, 01:49:20 pm » |
Please forgive the noob question. First, some background. The Due ARM chip runs on 3.3v, but it can provide 5v. There are, however, stern warnings about providing more than 3.3v current to any of the I/O pins, or this could burn out the board. Fair enough. Now, I have a series of addressable RGB LED strips that use either the WS2801 (https://www.sparkfun.com/products/11020?) or WS2811 (http://www.ebay.com/itm/150931961150) chipsets that I've been using very successfully with the Arduino Mega and Uno boards. These require 5v to run. These have either 3 or 4 wires. Two are always 5v and Ground, and the others are either separate Clock and Data lines (WS2801), or a combined Clock/Data line (WS2801). So, to my noob question: Would it burn out the board to connect the Clock/Data lines to Due I/O pins? Ostensibly, they are only supposed to be output, but ... ?? Am I going to kill my board? And if so, is there something I can do to make my lights work? Thanks for your help!
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 269
Posts: 17032
Available for Design & Build services
|
 |
« Reply #1 on: November 16, 2012, 02:03:48 pm » |
The would only be providing clock & data to one chip, that chip buffers the 2 lines and passes it along, yes? So power them from their own 5V source, connect all the grounds together.
At 5V, the WS2801 needs 0.8*Vcc = 4V minimum for Vih. Run the signal lines thru a TXB0102 buffer. Only micro-amps of output current are needed.
Or, run the WS2801 from an external 3.3V. Still just need micro-amps of output current for the control pins.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 11
|
 |
« Reply #2 on: November 16, 2012, 02:35:25 pm » |
The would only be providing clock & data to one chip, that chip buffers the 2 lines and passes it along, yes? So power them from their own 5V source, connect all the grounds together. Do I actually need to do this, if the Arduino is providing 5v power? The fewer components, the better, I would think. At 5V, the WS2801 needs 0.8*Vcc = 4V minimum for Vih. Run the signal lines thru a TXB0102 buffer. Only micro-amps of output current are needed.
Or, run the WS2801 from an external 3.3V. Still just need micro-amps of output current for the control pins. Ah! I see that the WS2801 can run from 3.3V natively. That is useful. Unfortunately (based on the WS2811 datasheet I found), the WS2811 requires 5v input voltage. So, for that one, a TXB0102 would be needed. Thank you!
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 269
Posts: 17032
Available for Design & Build services
|
 |
« Reply #3 on: November 16, 2012, 02:46:09 pm » |
I don't see that the WS2811 can't run from 3.3V - they only provide characterists at 4.5-5V. Give it a try, not gonna hurt anything.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 11
|
 |
« Reply #4 on: November 17, 2012, 12:04:42 pm » |
Ah, good point. Will try it out. 
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 11
|
 |
« Reply #5 on: January 10, 2013, 02:16:09 pm » |
Ok, it looks like the WS2811 does NOT respond to signals at 3.3v. So, I'm investing in some 74LVC245 ICs ( https://www.adafruit.com/products/735) to convert my 3.3v to 5v. Unfortunately, I'm not quite sure how to hook them up. The datasheet ( http://www.adafruit.com/datasheets/sn74lvc245a.pdf) implies that there is a way to do it, but it seems to conflict with the description on the adafruit product page in a vaguely orthogonal way. Adafruit gives a description for going in the opposite direction (5v->3v3), and says hook up VCC to your target voltage (say, 3v3), OE to ground and DIR to VCC. In my case, the target voltage should be 5v, but the datasheet says it only takes VCC up to 3.6v. However, the datasheet says some very vague and confusing things about how to achieve the 5v input, and possibly involves switching the directions from B->A. This is all very confusing. So to what voltages do I connect the various bits. I want to go from Due (3.3v) -> Lights (5v) VCC -> ??v Gnd -> Gnd (obviously) DIR -> ??v OE -> ??v and is A my input from the DUE, or is B my input? Any help at all would be immensely appreciated.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 11
|
 |
« Reply #6 on: January 10, 2013, 02:25:31 pm » |
Also, I want to add that it is entirely possible that it doesn't even go in that direction. At which point, sigh. :/
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 269
Posts: 17032
Available for Design & Build services
|
 |
« Reply #7 on: January 10, 2013, 03:49:24 pm » |
Use TXB0102, TXB0104, level translation in both directions, altho you only need 3.3V to 5V. www.ti.comTXB0101, 0102, 0104, 0106, 0108 depending on how many pins you need.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #8 on: February 06, 2013, 07:55:24 pm » |
Looks like you've figured out the '245s won't work in that direction... what's interesting is that I've had good results so far driving WS2811 strips directly from a 3.3V I/O pin (bit-banged SPI) on the Arduino Due, while I had decidedly weird results when using a TXB0108-based level translator. I haven't scoped it yet, but it's definitely far noisier that way for some weird reasaon (I threw a pull-up resistor on the 5V output side and it got remarkably better, but I'm not quite sure why that helped... I'm driving some other things with this chip though, and they were also affected by the LED strip, so perhaps it's the higher frequency data stream here). All that really matters is solid power and getting reliable data through the first LED... the rest take care of themselves (being, effectively, a long repeater chain). Maybe the LEDs themselves vary, or you've got a longer line between your board and the first LED (I'm within 18" of it, if that). tl;dr - I can drive a WS2811 strip with the 3.3V output of an Arduino Due directly (from a short distance away), without pull-ups or anything else, and it works (strip being powered by a robust 5V supply). Beware of noise effects when using translators.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #9 on: February 07, 2013, 03:50:28 am » |
So having banged my head against the proverbial wall trying to get the TXB0108 working with this (works fine with other things but NOT for this, unaided), I decided to throw in a BSS138-based I2C-friendly level shifter (both from Adafruit btw). THAT seems to work normally. As I scoped the signal in and out of the TXB0108, I noticed something: it got very, very noisy as soon as the LED strip was connected to the output. Inputs and outputs both get a high-frequency signal washing them out (on the order of 55.3 MHz, versus the roughly 800 kHz signal I'm sending). I'm not sure where that's coming from, but I think it's the cause (or the effect of) the TXB switching directions rapidly. In short, it's pretty annoying. It could be that I need more signal conditioning and noise isolation on the output side, or it's just the wrong chip for this job. So, in short, you will likely have better luck driving the WS2811 via something like a BSS138 FET circuit, or from 3.3v either directly (not terribly safe IMHO), or via a 74LVC245 or another '244/'245 that's got a Vcc of 3.3V (I've not tried it but a few places actually sell it in a DIP... though it'll only output 3.3V at least it isolates the input from the output and for a short data line that'd probably be fine). Using the TXB0108, however, just isn't cutting it. (If anyone knows of an equivalent FET in a TO92 or TO220 case, I'm all ears... all the better to breadboard with.) Edit: I stumbled upon a lengthy post on the BSS138 and level shifting here: http://electronics.stackexchange.com/questions/18457/is-my-mosfet-based-bidirectional-level-shifter-insaneHowever, as the BSS138 circuit is working fine for me I'm not inclined to argue with it for this particular application. Edit2: From what I can tell the 74LVC8T245 may be the perfect chip for 3.3v-5v level shifting when auto-direction switching is not needed ( http://www.nxp.com/documents/data_sheet/74LVC_LVCH8T245.pdf). However, it's SMT and that means far more effort if you're breadboarding... that, and I can't find anyone who actually sells it... :-/
|
|
|
|
« Last Edit: February 07, 2013, 04:20:14 am by MartyMacGyver »
|
Logged
|
|
|
|
|
0
Offline
Sr. Member
Karma: 20
Posts: 426
Always making something...
|
 |
« Reply #10 on: February 07, 2013, 05:28:04 am » |
I've been working with driving WS2811s from Teensy 3.0, which has 3.3 volt I/O similar to Arduino Due. There can be ringing and signal quality problems from the wiring between the board and WS2811, which are more serious at 3.3 volts because there is less noise margin. The short answer is to try adding a 100 or 200 ohm resistor, located between the board and the wire running to the WS2811 input. Here's a post with more details and actual measured waveforms: http://forum.pjrc.com/threads/15620-WS2811-on-Teensy-3-0-using-FastSPI_LED-library?p=20787&viewfull=1#post20787Of course, converting the 3.3 volt signal to 5 volts with a 74HCT245 or similar chip is probably best. The WS2811 Vih input spec is technically 3.5 volts. However, I've tested many WS2811 LEDs and they all seem to work fine with 3.3 volt signals, when using a series resistor to lessen the ringing problems. Also, if you're interested in driving a very large number of WS2811 LEDs, you might be interested in a new WS2811 library that I'm developing. It's currently in private beta testing. The first public release is expected in about a week.
|
|
|
|
« Last Edit: February 07, 2013, 05:37:16 am by Paul Stoffregen »
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #11 on: February 07, 2013, 05:37:12 am » |
Interesting... while I was seeing some slight ringing on the main data line in (sans TXB) it wasn't that bad, and the FET level-converter didn't seem to add much noise to it on the output. The TXB outputs were all over the map, and it was clearly something other than what you saw there (the noise was very pronounced and pretty constant).
I'm always eager to try new libraries... where will you announce / publish it?
(On a side-note, I'm finding the Due surprisingly frustrating so far, particularly when it comes to compiling sketches that used to work fine. I realize it's a different architecture but the information and libraries seem mighty thin right now.)
|
|
|
|
|
Logged
|
|
|
|
|
|