boji

Re: Bi-color leds and shift registers
« Reply #20 on: November 30, 2020, 02:43:25 PM »
Vbe(on) minimum 580mV?  Am I reading that right?

Obviously it's taking much less to switch on.



ruffrecords

Re: Bi-color leds and shift registers
« Reply #21 on: November 30, 2020, 04:04:10 PM »
Transistors are turned on (saturated) by base current. The actual Vbe depends on the saturated collector current - see the VBe sat entry.

Cheers

Ian
www.customtubeconsoles.com
https://mark3vtm.blogspot.co.uk/
www.eztubemixer.blogspot.co.uk


'The only people not making mistakes are the people doing nothing'

boji

Re: Bi-color leds and shift registers
« Reply #22 on: November 30, 2020, 04:15:00 PM »
Duh. What would I do without you guys eyes-n-brains...Thank you!

I ASSume because they leave the minimum blank, any microcurrent value that will get the leg to show proper voltage will do the do.



« Last Edit: November 30, 2020, 04:24:19 PM by boji »

squarewave

Re: Bi-color leds and shift registers
« Reply #23 on: November 30, 2020, 04:21:30 PM »
At 5ma you don't need the transistors. And I don't see how you're going to do 55 leds with one micro. You need an LED driver or maybe just an I/O expander if it has enough power (although long runs of clock and data could be an issue). Then just do resistors from supply to each expander output pin with the LED across the output pins. The rest is software. Drive one output high and the other low to get one color and then swap high / low for the other.

For lots of LEDs a mutliplexing IC is really the only sane way to go but it's not clear how that would work with bi-color LEDs.

boji

Re: Bi-color leds and shift registers
« Reply #24 on: November 30, 2020, 04:46:36 PM »
Hi SW! Missed your input!

Quote
At 5ma you don't need the transistors. And I don't see how you're going to do 55 leds with one micro.
Well, I've not settled on a led yet. Still believing some may require standard 20mA.  But wow yeah, these particular ones are efficient.  Mega has about 60 available pins, so two of them would suffice.
 Edit:more like ~190 pins without plexn'...

Quote
maybe just an I/O expander
it's not clear how that would work with bi-color LEDs.
Now that shift registers have arrived going to try to incorporate some hex inverters to see if I can minimize pincount as you suggest, I'm just not that strong at writing code for IC's. Perhaps the inverters will provide the buffering for leds as well, so to omit the transistors.
« Last Edit: December 08, 2020, 06:52:48 PM by boji »

ruffrecords

Re: Bi-color leds and shift registers
« Reply #25 on: November 30, 2020, 05:39:05 PM »
Duh. What would I do without you guys eyes-n-brains...Thank you!

I ASSume because they leave the minimum blank, any microcurrent value that will get the leg to show proper voltage will do the do.

What you normally do, when operating a transistor as a switch,  is to ensure the circuit provides sufficient base current to saturate it. For worst case design you assume that when saturated, beta drops to no more than 20. You know the rail voltage, you know Vbe (sat) and the base current required; the rest is just ohms law.

Cheers

Ian
www.customtubeconsoles.com
https://mark3vtm.blogspot.co.uk/
www.eztubemixer.blogspot.co.uk


'The only people not making mistakes are the people doing nothing'

boji

Re: Bi-color leds and shift registers
« Reply #26 on: December 01, 2020, 07:04:51 PM »
Maybe these will fit the bill since they can drive led's:
https://www.ti.com/lit/ds/symlink/pcf8574.pdf?ts=1606793008066

Would need quite a few chained together tho.
Much to learn.

« Last Edit: December 01, 2020, 07:22:00 PM by boji »

squarewave

Re: Bi-color leds and shift registers
« Reply #27 on: December 02, 2020, 12:40:06 AM »
Yeah that looks like it could work. I2c is nice in this case too because you can just connect up to 8 ICs to a 7 conductor bus and then just select the IC you want to listen to your clock and data by playing the right chord on the 3 address pins. So you would only need 5 microcontroller pins for 8 ICs for a total of 32 bi-color LEDs or 64 regular LEDs. Shielded CAT6 could probably make it a meter or so with the right clock speed and termination resistors.

boji

Re: Bi-color leds and shift registers
« Reply #28 on: December 05, 2020, 04:52:40 AM »
Square or anyone else care to recommend a trusted I2C expander?  PCA9548A  looks like a candidate.

Reason is I found the MCP23017.


Thanks SW for the repeated I2C advocacy.  Hope switching between groups won't be very difficult. I imagine it will be about cycling I2C bus addresses on and off during state changes, much like clock latches.

Quote
Shielded CAT6 could probably make it a meter or so with the right clock speed and termination resistors.
yessr. thanks
« Last Edit: December 06, 2020, 04:20:11 PM by boji »

boji

Re: Bi-color leds and shift registers
« Reply #29 on: December 08, 2020, 06:35:35 PM »
FWIW:  I/O expanders bit shift to select, as will likely I2C multiplexer.  For PCA switching, this function simplifies:
Code: [Select]
void chipselect(uint8_t i) {
  if (i > 7) return;
 
  Wire.beginTransmission(PCA_ADDR_1);  //1 of 8 I2C bus addresses
  Wire.write(1 << i);                  //1 of 8 Pin expander chips on given I2C bus
  Wire.endTransmission(); 
}


So after setup, naming chips, setting pinstates and starting I2C, switch in expanders as needed:
Code: [Select]
chipselect(1); // prep to test leds I/O expander 1
   
  for(int i = 0; i <=15; i++) {
    mcp1.digitalWrite(i, HIGH);
    delay(200);                     
    mcp1.digitalWrite(i, LOW);     
    delay(200);             
}

chipselect(2);//switch and prep

  for(int i = 0; i <=15; i++) {
    mcp2.digitalWrite(i, HIGH);
    delay(200);                     
    mcp2.digitalWrite(i, LOW);     
    delay(200);             
}

And so on, ultimately providing up to 512 available sink/source pins over three wires. Neat!
« Last Edit: December 13, 2020, 04:50:30 AM by boji »


squarewave

Re: Bi-color leds and shift registers
« Reply #30 on: December 08, 2020, 07:08:13 PM »
I realize you're just fiddling but I cannot stop myself from telling people never use delay(). Even for fiddling don't do it. Delay makes it impossible to do more than one thing at a time. Your code will not be reusable.

Instead, loop continuously and compare the current time to the expiration time of whatever event. When the expiration time is exceeded you process the event and go back to looping.

boji

Re: Bi-color leds and shift registers
« Reply #31 on: December 14, 2020, 07:48:38 PM »
Indeed, thanks SQ!
« Last Edit: December 14, 2020, 08:13:18 PM by boji »

boji

Re: Bi-color leds and shift registers
« Reply #32 on: December 27, 2020, 05:33:02 PM »
Happy Holidays everyone.  I've seen address assignment of I2C chips done both ways as shown below. Do you have a preference and if so, why? 
Note for B, resistors are left out or included so to define assignment, whereas for A, resistors are included no matter the HEX value.



B in layout:



boji

Re: Bi-color leds and shift registers
« Reply #33 on: December 27, 2020, 10:07:38 PM »
Unless otherwise directed, going to go with B as it seems pretty straightforward.

abbey road d enfer

Re: Bi-color leds and shift registers
« Reply #34 on: December 28, 2020, 12:46:18 AM »
Happy Holidays everyone.  I've seen address assignment of I2C chips done both ways as shown below. Do you have a preference and if so, why? 
I vote for B, since I don't like having Vcc (or Vdd) distributed to too many places without protection.

Quote
Note for B, resistors are left out or included so to define assignment, whereas for A, resistors are included no matter the HEX value.
Not necessarily.
Who's right or wrong is irrelevant. What matters is what's right or wrong.
Star ground is for electricians.

boji

Re: Bi-color leds and shift registers
« Reply #35 on: December 28, 2020, 04:24:43 AM »
Thank you Abby. B it is.

Quote
Not necessarily.
Think I understand, because Vcc could be 3.3 or perhaps lower in some scenarios.

boji

Re: Bi-color leds and shift registers
« Reply #36 on: January 13, 2021, 04:17:56 AM »
First time digital project, about to send out for PCB's.  If anyone has a free moment, wouldn't mind glancing over the attached skiz in case I missed something obvious? Thank you much!


boji

Re: Bi-color leds and shift registers
« Reply #37 on: January 13, 2021, 04:18:47 AM »
Layout attached. 
I2C resistors / pads used depending on mux bus & 1/4 PCBs.
« Last Edit: January 13, 2021, 04:34:08 AM by boji »

squarewave

Re: Bi-color leds and shift registers
« Reply #38 on: January 13, 2021, 10:36:18 AM »
I don't see anything obviously wrong but I do have two possibly minor concerns.

One is that it seems to me that part of the benefit of using an I/O expander is that you can put it where the devices you're driving are. But in this case you're going to have potentially long control cables? Just brainstorming here but my first thought would be to make a little daughter board with one I/O expander on it and that can be plugged into a board that has relays or LEDs or whatever. Then just run a little bit of two conductor for the low current I2C control signal.

Or, if you do it the way you have it layed out, what is the ground plane situation? What voltage are the relays? If you have large currents going through those transistors, it might be desirable to have a decent ground plane below (or above) those lines to the transistors with a really good ground wire to DGND running right next to (or loosely twisted around) the relay supply wire. Remember ground follows signal. That is super important here since you're delivering currents out in a distributed fashion.

boji

Re: Bi-color leds and shift registers
« Reply #39 on: January 13, 2021, 01:36:54 PM »
Thanks for feedback SW.

Quote
you're going to have potentially long control cables?
Yeah I struggled with this decision but perhaps concerns are unfounded. Figured a bundle of shielded i/o wires are better than having a 'digital' pcb in each bucket (right under unbalanced fader lines) chunking away 24/7.  I agree it would be much simpler to put extenders near the i/o endpoints. Looking for a slimline case to shield pcb's, but finishing is becoming more important than anything at this point. :/

Went so far as to order some I2C balanced extenders to test, but they haven't arrived yet.

Quote
Or, if you do it the way you have it layed out, what is the ground plane situation?
5v and Gnd planes included, quite objectively to drain those transistors and pull up button sensing i/o :)
Cut them out for sake of picture clarity-- oops

Quote
might be desirable to have a decent ground plane below (or above) those lines to the transistors with a really good ground wire to DGND running right next to (or loosely twisted around) the relay supply wire.
Yessr.  Pulldown/debouncing circuits for relays are onboard each channel card that supplies 12v, and sinks most of it.  I believe as long as m/c pcb's are tied to console dcom, max draw is 0.6mA @ ~3v per relay cv pin.

I should have put a dotted line around that relay buffer circuit on the previous page, they are already installed in each channel/group cards. The logic pcb only sinks cv, not the whole relay loop.

There are better ways to have implemented this whole thing, that's for sure. Live and learn.
« Last Edit: January 13, 2021, 02:34:03 PM by boji »


 

Related Topics

  Subject / Started by Replies Last post
1 Replies
2144 Views
Last post August 04, 2004, 07:52:49 PM
by volki
15 Replies
4050 Views
Last post August 23, 2004, 02:54:18 PM
by
8 Replies
11851 Views
Last post October 04, 2006, 06:16:19 PM
by Brad McGowan
1 Replies
1397 Views
Last post October 26, 2007, 03:28:34 PM
by CJ