Go Down

Topic: PWM cable lenght (Read 9577 times) previous topic - next topic

raschemmel

#45
Dec 27, 2015, 08:14 pm Last Edit: Dec 27, 2015, 08:15 pm by raschemmel
Well now that's a huge improvement.
Code: [Select]
//lookup table for 256 CIE lab brightness corrected values with 12 bit resolution
const uint16_t CIEL_8_12[] PROGMEM = {
  0, 2, 4, 5, 7, 9, 11, 12, 14, 16, 18, 20, 21, 23, 25, 27, 28, 30, 32, 34, 36, 37, 39, 41, 43, 45, 47, 49, 52, 54, 56, 59, 61, 64, 66, 69, 72, 75, 77, 80, 83, 87, 90, 93, 97, 100, 103, 107, 111, 115, 118, 122, 126,  131, 135, 139, 144, 148, 153, 157, 162, 167, 172, 177, 182, 187, 193, 198, 204, 209, 215, 221, 227, 233, 239, 246, 252, 259, 265, 272, 279, 286, 293, 300, 308, 315, 323, 330, 338, 346, 354, 362, 371, 379, 388, 396, 405, 414, 423, 432, 442, 451, 461, 471, 480, 490, 501, 511, 521, 532, 543, 554, 565, 576, 587, 599, 610, 622, 634, 646, 658, 670, 683, 696, 708, 721, 734, 748, 761, 775, 789, 802, 817,  831, 845, 860, 875, 890, 905, 920, 935, 951, 967, 983, 999, 1015, 1032, 1048, 1065, 1082, 1099, 1117, 1134, 1152, 1170, 1188, 1206, 1225, 1243, 1262, 1281, 1301, 1320, 1340, 1359, 1379, 1400, 1420,1441, 1461, 1482, 1504, 1525, 1547, 1568, 1590, 1613, 1635, 1658, 1681, 1704, 1727, 1750, 1774, 1798, 1822, 1846, 1871, 1896, 1921, 1946, 1971, 1997, 2023, 2049, 2075, 2101, 2128, 2155, 2182, 2210  2237, 2265, 2293, 2322, 2350, 2379, 2408, 2437, 2467, 2497, 2527, 2557, 2587, 2618, 2649, 2680, 2712, 2743, 2775, 2807, 2840, 2872, 2905, 2938, 2972, 3006, 3039, 3074, 3108, 3143, 3178, 3213, 3248,3284, 3320, 3356, 3393, 3430, 3467, 3504, 3542, 3579, 3617, 3656, 3694, 3733, 3773, 3812, 3852, 3892, 3932, 3973, 4013, 4055, 4095 };


Wawa

#46
Dec 27, 2015, 08:22 pm Last Edit: Dec 27, 2015, 08:44 pm by Wawa
RS Components Germany has the PCA9685.
Not too hard to mount with very small amounts of solder paste and a hotplate.
A soldering iron is a bit tricky, unless you're experienced.

Adafruit has the chip mounted on a board with all the supporting parts and address solder bridges.
Maybe not ok as sinking LED driver, because of tiny 220ohm resistors in series with each output.

Not many libraries for the PCA9552.
Leo..

MrGlasspoole

I always forget RS. There shipping costs are barely ok.
Digi-Key for example is to expensive.

Does the PT4115 connected to the PCA9685 need a pull-down?
I guess not and you switch in the code from PWM out to sink?

Wawa

RS has free shipping (here in NZ).

No extra parts between PCA and the PTs.
No changes in the library/code I use for the PTs (Brunnels@github).

I guess you have to invert the outputs for the individual LEDs.
I will look through the library to see if there is a command for that.
Leo..


MrGlasspoole

Adafruit is using 10K pull-up on SDA/SCL?
And whats the reason they use 10K on the address selection?

Is there a reason you did not choose to use GND (VSS) on every bus line like i see in the I2C-bus specification:
Quote
If the bus lines are twisted-pairs, each bus line must be twisted with a VDD return.
Alternatively, the SCL line can be twisted with a VSS return, and the SDA line twisted with
a VDD return. In the latter case, capacitors must be used to decouple the VDD line to the
VSS line at both ends of the twisted pairs.

If the bus lines are shielded (shield connected to VSS), interference is minimized.
However, the shielded cable must have low capacitive coupling between the SDA and
SCL lines to minimize crosstalk.
I also ordered some WIZnet W5500 cause I'm curious if i can get power usage down to more then the half.
Some calculation: W5500 power saving (WoL) - Ethernet power consumption (W5100, W5200, W5500)

Wawa

10k on each I2C line is ok for short wires, e.g. inside an enclosure.
More bus capacitance (cables), and higher speeds (if needed), require lower value pullup resistors.
Not sure if there is a calculator for that.
I have seen upto 3mA pullup current used for 400pF (@100khz).
I would start with 3k3 (total resistance) for 5meters of Cat-6, and lower to 2k2 if needed.
That could be 10k on each PCA module, and the remaining 10k (or less) resistance near the Arduino.

10k pullup (or pulldown) on the address lines is not needed if you connect the line directly to ground or VCC.
Don't leave the pin 'floating".
I use 100k and a solder bridge on my boards.

Do NOT use clock and data on the same twisted pair (crosstalk).
Ok to combine one with ground and one with VCC, if you decouple VCC at both ends of the cable.
Exactly as in your post.
You should ofcourse always decouple VCC near any chip.
If you have enough pairs, you could combine each I2C wire with a ground wire.
Leo..




 

MrGlasspoole

How do i calculate R701 do have the 0-2.4 volt range on DIM through the potentiometer.
R706/R707 are the internal resistors of two PT4115 connected parallel.

Wawa

You basically only need a 100k pot (as variable resistor) to ground for two PTs.
The PT already has a 5volt source inside.

Another way is to provide an external control voltage.
That could be a 10k resistor from 5volt to one pin of a 10k pot, and the other pin of the pot connected to ground.
The wiper will have 0-2.5volt.
Maybe best to use a log pot for lineair brightness.
Leo..

MrGlasspoole

Isn't that what i have in the attachment?

The 5 volt source is the arduino.
But since the two PT parallel are 100k i was not sure if the 10k to ground pull low enough
to turn the PT off in that circuit?

Or didn't you see the attachment?

And a big thank you Wawa for all your help!

Wawa

No, your attachment shows a 10kpot and a 10k resistor in parallel.
They should go in series, so 2.5volt is across the pot.

Connecting the pot directly to 5volt will work, but then only half the rotation of the pot will change brightness.
Leo..

MrGlasspoole

So it was already right how i had it in my big circuit?

Wawa

Yes.
R708 has no function here.
It just loads the 5volt rail.
Leo..

MrGlasspoole

I don't need a pull down here to completely turn it off?

Wawa

#58
Dec 31, 2015, 10:26 pm Last Edit: Dec 31, 2015, 10:27 pm by Wawa
The wiper of the pot can travel between the 10k resistor (2.5volt full brightness) and ground (LEDs off).
Try to remove R708, and flip the drawing upside down.
Leo..

MrGlasspoole

Happy new year!

Upside down?

Go Up