tago Posted March 21, 2017 Report Share Posted March 21, 2017 (edited) Hi, i wonder about pro/cons of matrix configurations vs direct connections (DIN/DOUT/DIO). What i've found so far is lower led brightness in matrix configs and different wirings. I'll have 30 encoders, 60 btns and 90 leds mounted all over a fairly large (80x25cm) frontpanel perf board. To me it seems that direct connections to DINX4/DOUTX4 modules would lead to cleaner wiring in my case. Would that many IO modules result in bad performance as in higher core/cpu usage? ps Additionally the controller will have 40 pots, a 4 octave keybed and 8 oleds. Edited March 21, 2017 by tago Quote Link to comment Share on other sites More sharing options...
latigid on Posted March 21, 2017 Report Share Posted March 21, 2017 LEDs in matrices are only on 1/8 of the time, so naturally they're dimmer. Are you using sink transistors, or at least no resistor on the sink side? Matrices are designed to save pins, but it only makes sense when you have close to a grid arrangement. Count your pins for individual wiring: 30 encoders = 60 DINs 60 buttons = 60 DINs 90 LEDs = 90 DOUTs 120 DINs /8 per chip = 15 165 chips = 4 DINX4 modules 90 DOUT /8 per chip = 12 595 chips = 3 DOUTX4 modules MIOS32 allows for a maximum of 32 shift registers (I think this is 32 DIN + 32 DOUT), so you're okay. I hope we get to see it one day. Quote Link to comment Share on other sites More sharing options...
tago Posted March 21, 2017 Author Report Share Posted March 21, 2017 Thanks for your input @latigid on 39 minutes ago, latigid on said: Matrices are designed to save pins, but it only makes sense when you have close to a grid arrangement. I anticipate the distances between LEDs/Btns etc. will be too large. So i'm leaning towards direct connection via DIN/DOUT modules. 35 minutes ago, latigid on said: Are you using sink transistors, or at least no resistor on the sink side? Unfortunately i've no idea what do you mean by this. For the LEDs i'd have 220ohms resistors on the DOUT modules. Is this what you're referring to? Do i need something like that with that many LEDs? My current thinking is that i would need to power the core via a dedicated power supply (20mA * 100 = 2A max for LEDs alone). 42 minutes ago, latigid on said: I hope we get to see it one day. I hope too :) It's a slow process because i'm a beginner. Quote Link to comment Share on other sites More sharing options...
latigid on Posted March 21, 2017 Report Share Posted March 21, 2017 4 minutes ago, tago said: Thanks for your input @latigid on I anticipate the distances between LEDs/Btns etc. will be too large. So i'm leaning towards direct connection via DIN/DOUT modules. It creates more wiring work/mess and potential for mistakes, but can be simpler to address individual elements. With the NG if you have a missing/swapped connection, it should be quite simple to identify and fix. 4 minutes ago, tago said: Unfortunately i've no idea what do you mean by this. For the LEDs i'd have 220ohms resistors on the DOUT modules. Is this what you're referring to? Do i need something like that with that many LEDs? It doesn't matter if you go for single wiring, because you're addressing individual LEDs, with the DOUT pin via a resistor to the anode, and the cathode tied to ground. However, when using a matrix, you want a constant current sink on the cathode side, so you bridge the resistors only on that DOUT section with wire. Otherwise, your total series resistance is ~440 ohm at a duty cycle of 0.125, and this will lead to dim LEDs! The other method is to connect the sink side resistors to the base of NPN transistors (collector to LED cathodes, emitter to ground/0V), or you could consider the ULN2803 octal Darlington driver. (The latest rev DOUT boards from SmashTV can fit sink or source driver chips directly on the PCB.) 4 minutes ago, tago said: My current thinking is that i would need to power the core via a dedicated power supply (20mA * 100 = 2A max for LEDs alone). For red/yellow/yellow-green LEDs with Vf ~2V, your consumption is approximately (5-2)/220 = 13.6mA for each LED. Don't forget the OLEDs can have reasonable consumption too. 4 minutes ago, tago said: I hope too :) It's a slow process because i'm a beginner. Keep at it, you'll get there eventually! Quote Link to comment Share on other sites More sharing options...
Hawkeye Posted March 21, 2017 Report Share Posted March 21, 2017 A small side note: don't wire up the encoders in matrix configuration. The normal encoder pulses will be high-speed and may not be "caught" by the reduced sampling rate of an input matrix leading to erratic encoder behaviour. At least that is my latest tech info, please correct me, if i am wrong :-). No problem on the LED output side, though, 8x8 matrices are great with low-power LEDs. This also drops your estimated current consumption a lot, a single LED will then not consume 20mA, only 1/8th of that, because of the reduced duty cycle. Many greets, Peter Quote Link to comment Share on other sites More sharing options...
latigid on Posted March 21, 2017 Report Share Posted March 21, 2017 That's right Peter, encoders should be directly connected to 2* DIN pins. With button/LED matrices it can work and does save lots of pins and power, but the additional wiring might be suboptimal. For instance, anything other than a clean, square array will mean rows will be split, but the columns still need to be wired together. Of course, a way around this is to create multiple matrices based on smaller sections, even if not all positions are filled. Best, Andy Quote Link to comment Share on other sites More sharing options...
tago Posted March 21, 2017 Author Report Share Posted March 21, 2017 1 hour ago, latigid on said: However, when using a matrix, you want a constant current sink on the cathode side, so you bridge the resistors only on that DOUT section with wire. Like shown in this schematic: http://www.ucapps.de/mbhp/mbhp_dout_8x8leds.pdf ? 1 hour ago, latigid on said: or you could consider the ULN2803 octal Darlington driver. (The latest rev DOUT boards from SmashTV can fit sink or source driver chips directly on the PCB.) I made my own DIN/DOUT boards and forgot to add the ULN2803 option. So i can only mount standard resistors or bridges :( Quote Link to comment Share on other sites More sharing options...
tago Posted March 21, 2017 Author Report Share Posted March 21, 2017 1 hour ago, Hawkeye said: A small side note: don't wire up the encoders in matrix configuration. The normal encoder pulses will be high-speed and may not be "caught" by the reduced sampling rate of an input matrix leading to erratic encoder behaviour. Thanks for the hint Peter, sounds plausible. Quote Link to comment Share on other sites More sharing options...
tago Posted March 21, 2017 Author Report Share Posted March 21, 2017 4 minutes ago, latigid on said: With button/LED matrices it can work and does save lots of pins and power, but the additional wiring might be suboptimal. For instance, anything other than a clean, square array will mean rows will be split, but the columns still need to be wired together. Of course, a way around this is to create multiple matrices based on smaller sections, even if not all positions are filled. How would that smaller sections look like? Two 4x4 (32 LEDs) instead of a single 8x8 (64 LEDs)? Is 4x4 even possible? Quote Link to comment Share on other sites More sharing options...
latigid on Posted March 21, 2017 Report Share Posted March 21, 2017 56 minutes ago, tago said: Like shown in this schematic: http://www.ucapps.de/mbhp/mbhp_dout_8x8leds.pdf ? I made my own DIN/DOUT boards and forgot to add the ULN2803 option. So i can only mount standard resistors or bridges :( Just try with the bridges, it should be okay with single anode columns Just now, tago said: How would that smaller sections look like? Two 4x4 (32 LEDs) instead of a single 8x8 (64 LEDs)? Is 4x4 even possible? 4*4 = 16 :) For this, please read the NGC section: Quote DOUT_MATRIX The DOUT_MATRIX command configures LED matrices which are connected between multiple DOUT shift registers. Usecases: Already with 2 DOUT shift registers it's possible to control 64 LEDs. One DOUT is used to select the column, the second DOUT to set the row pattern. By using the led_emu_id_offset parameter they behave like common EVENT_LED elements and can be controlled individually. This saves some hardware! (only 2 DOUT shift registers instead of 8 to drive 64 LEDs). Other useful hardware configurations: with 1 DOUT assigned to the column, and two assigned to the row, up to 128 LEDs can be controlled from 3 DOUT shift registers. With two DOUTs assigned to the column, and two assigned to the row, up to 256 LEDs can be controlled from 4 DOUT shift registers. Actually each matrix provides three separate "row layers", called r, g, b (red, green, blue). You get the message: this allows you to control multicolour LEDs! LED Rings and Meters - see also the LED_MATRIX_PATTERN configuration below. The led_matrix_pattern can be passed from a control element (e.g. EVENT_ENC) to the LED matrix in order to output a pattern based on the event value. LED Digits (7-segment displays) are controlled from a DOUT_MATRIX as well. Here are some interconnection diagrams with the appr. .NGC configuration examples: Interconnections for 5 7bit displays (cfg/test/leddig1.ngc) Interconnections for MTC and Status LED Digits of a Logic Control Emulation (cfg/test/leddig2.ngc) Available configuration parameters: DOUT_MATRIX Parameter Description n=<1..8> Specifies the matrix number which should be configured; it can range from 1..8 rows=<4|8|16> Sets the number of rows which should be scanned: rows=4: 4 selection pulses are output by the DOUT register specified with sr_dout_sel1. The pulses are available twice: at D7:D4 and D3:D0. This configuration allows to scan up to 4x8 LEDs with two DOUTs, or 4x16 LEDs with three DOUTs. rows=8: 8 selection pulses are output by the DOUT register specified with sr_dout_sel1. The pulses are available at D7:D0 This configuration allows to scan up to 8x8 LED with two DOUTs, or 8x16 LEDs with three DOUTs. rows=16: 16 selection pulses are output by the DOUT registers specified with sr_dout_sel1 and sr_dout_sel2. The pulses are available at D7:D0 of each register. This configuration allows to scan up to 16x8 LEDs with three DOUTs, or 16x16 LEDs with four DOUTs. inverted=<1|0> DOUT selection lines will be inverted with inverted=1. This is required if the LEDs of the matrix have been connected in the opposite order: inverted=0: Cathodes are connected to the DOUT selection lines, see also this schematic. inverted=1: Inverting sink drivers have been added to the DOUT register. inverted_sel=1 and inverted_row=1: Anodes are connected to the DOUT selection lines (swapped polarity) inverted_row=<1|0> DOUT row patterns can be inverted with inverted_row=1 sr_dout_sel1=<0..16> Sets the first DOUT shift register which should output the row selection signals. sr_dout_sel2=<0..16> Sets the second DOUT shift register which should output the row selection signals in a row=16 setup. Set this parameter to 0 if a second DOUT is not required. sr_dout_r1=<0..16> Sets the first DOUT shift register of the LED matrix row. sr_dout_r2=<0..16> Sets the (optional) second DOUT shift register of the LED matrix row. sr_dout_g1=<0..16>sr_dout_g2=<0..16> These parameters allow to drive duo-colour or RGB LEDs by using a second set of DOUTs connected to the green LEDs. sr_dout_b1=<0..16>sr_dout_b2=<0..16> These parameters allow to drive RGB LEDs by using a third set of DOUTs connected to the blue LEDs. mirrored_row=<1|0> The pins of the DOUT rows can be mirrored. This happens only for the shift register value itself. Means: if two DOUT shift registers are assigned to the row, they won't be swapped. If this is desired, just change the sr_dout_r1/sr_dout_r2 assignments. led_emu_id_offset=<1..4095> With a value >0, the LED matrix will listen on EVENT_LED events instead of EVENT_LED_MATRIX, starting with the specified ID. A matrix of 8x8 LED can emulate 64 LEDs with individual event assignments this way. In order to avoid conflicts with LEDs which are directly connected to DOUT pins (and which are accessed with LED:1 .. LED:256), it's recommended specify emulated ids outside this range, e.g. led_emu_id_offset=1001. lc_meter_port=<USB1..USB4|IN1..IN4> Special option for the Logic/Mackie Control emulation. It allows to transfer incoming Poly Preasure events (which are used by the protocol to trigger the meters) to LED bars. An usage example can be found in following template (search for "meter"): logictrl.ngc Quote Link to comment Share on other sites More sharing options...
tago Posted March 21, 2017 Author Report Share Posted March 21, 2017 (edited) 1 hour ago, latigid on said: 4*4 = 16 :) But TWO 4*4 = 32 :) I thought SR1/SR2 (D7-D4) = one matrix and SR1/SR2 (D3-D0) = second. But according to the docs it looks like 4x8 is the smallest. The main problem is how to keep the wiring clean with perf boards. Edited March 21, 2017 by tago Quote Link to comment Share on other sites More sharing options...
tago Posted March 22, 2017 Author Report Share Posted March 22, 2017 Another problem is that i'd like colored LEDs. I assume i have to use different resistors to get an even brightness between them. Quote Link to comment Share on other sites More sharing options...
latigid on Posted March 22, 2017 Report Share Posted March 22, 2017 11 hours ago, tago said: Another problem is that i'd like colored LEDs. I assume i have to use different resistors to get an even brightness between them. The way around this is to arrange LEDs of a single colour for each column. It's also important to do this when the Vf values are different, otherwise the current takes the easiest path through the wrong LED. Quote Link to comment Share on other sites More sharing options...
gerald.wert Posted March 22, 2017 Report Share Posted March 22, 2017 You can use strip board either vertically or horizontally to reduce you wiring if it makes sense for your layout. It should cut your individual wires almost in 1/2. Quote Link to comment Share on other sites More sharing options...
tago Posted March 22, 2017 Author Report Share Posted March 22, 2017 3 hours ago, gerald.wert said: You can use strip board either vertically or horizontally to reduce you wiring if it makes sense for your layout. It should cut your individual wires almost in 1/2. I have 500x200mm perf boards (hard paper) for now, it's not perfect. Do you know a supplier for large sturdy strip boards? At Reichelt they only have max. 500x100mm (hard paper). I would prefer epoxy for more mechanical stability. My frontplate dimension is 800x250mm. Quote Link to comment Share on other sites More sharing options...
tago Posted March 22, 2017 Author Report Share Posted March 22, 2017 (edited) I tested some 20mA LEDs and found they could be dimmer. Low-current LEDs (2mA) would be to dark. Is it ok to halve the current via higher resistance sink resistor? Or will there be too much loss/ bad efficiency? Edited March 22, 2017 by tago Quote Link to comment Share on other sites More sharing options...
latigid on Posted March 22, 2017 Report Share Posted March 22, 2017 Just now, tago said: I tested some 20mA LEDs and found they could be dimmer. Low-current LEDs (2mA) would be to dark. Is it ok to halve the current via higher resistance sink resistor? Or will there be too much loss/ bad efficiency? Matrix or direct drive? Quote Link to comment Share on other sites More sharing options...
tago Posted March 22, 2017 Author Report Share Posted March 22, 2017 Just now, latigid on said: Matrix or direct drive? Direct, i assume in a matrix they would be fine. Quote Link to comment Share on other sites More sharing options...
tago Posted March 22, 2017 Author Report Share Posted March 22, 2017 (edited) How does the dimmed parameter work? Is it via pulsing with variable frequency? Could it be more energy efficient than higher resistance? Edited March 22, 2017 by tago Quote Link to comment Share on other sites More sharing options...
latigid on Posted March 22, 2017 Report Share Posted March 22, 2017 Try dimmed and see how it works for you. Dimming doesn't work properly in a matrix. Quote Link to comment Share on other sites More sharing options...
gerald.wert Posted March 23, 2017 Report Share Posted March 23, 2017 The Veroboard is really good quality. Their most durable is the epoxy board. It is much more durable than the paper or phenolic stuff. You can buy it direct : https://veroboard.com/product-category/the-veroboard-products/view-by-material/epoxy-fiber/ It comes up on Amazon and ebay too. That is where I normally buy it but I do not see a good listing right now. If you have ever worked with fiber glass before be sure to protect yourself when cutting it. I wear disposable gloves mask and safety glasses. Use a rotary tool with a fiber cutoff disk to cut it. It cuts a lot faster if you cut down a row with the holes in it and they make a nice guide. Also try not to cut it to fast so it does not heat up and smoke. Making a shallow first pass and going back over it a few times keeps it from smoking. It does take some time making the cuts to lay out the circuit but I find it is faster than cutting and stripping so many extra wires. It may or may not be faster than etching a board it depends on how many holes you have to drill and how much time you have to spend laying it out in the cad program. Another design tip if you are using encoders you can run you ground bus below the encoders on a strip and jump over to it with a resistor trimming. Quote Link to comment Share on other sites More sharing options...
tago Posted March 24, 2017 Author Report Share Posted March 24, 2017 On 22.3.2017 at 10:56 PM, latigid on said: Try dimmed and see how it works for you. I got a dimmed LED working, but had to use a range map (eg 0 2) to get a fixed dimmed value. Is there a better way? Does this method saves power vs resistor solution? I'd assume yes if it's done via PWM. But i have really no idea. Quote Link to comment Share on other sites More sharing options...
tago Posted March 24, 2017 Author Report Share Posted March 24, 2017 3 hours ago, gerald.wert said: The Veroboard is really good quality. Their most durable is the epoxy board. It is much more durable than the paper or phenolic stuff. You can buy it direct : https://veroboard.com/product-category/the-veroboard-products/view-by-material/epoxy-fiber/ Thank you. 5"x10" Epoxy Fiber Strip Board Copper USD $13.80 -> 7pcs = $96.60 11.5"x19.5" Epoxy Fiber Strip Board Copper USD $63.40 -> 2pcs = $126.80 The question is whether strip boards would really help with many mixed parts (leds, btn, pots). A custom pcb at dirtypcb with 80x25cm cost $250 for 10 pieces. If i could find a manufacturer that offers single pieces, maybe it would make sense to do a custom pcb. Quote Link to comment Share on other sites More sharing options...
latigid on Posted March 24, 2017 Report Share Posted March 24, 2017 7 hours ago, tago said: I got a dimmed LED working, but had to use a range map (eg 0 2) to get a fixed dimmed value. Is there a better way? I haven't tried this with direct DOUT pins. I know for the WS2812-type LEDs "dimmed=1" will allow a CC to control the dimming level as defined in the LED event. 7 hours ago, tago said: Does this method saves power vs resistor solution? I'd assume yes if it's done via PWM. But i have really no idea. With a resistor, you're burning current*voltage as heat, so yes, switching the LED via PWM should be more efficient. Measure it yourself: set the multimeter to mA and connect it in series after the resistor. You'll need a higher value resistor to match the given dimmed value. Something else to keep in mind is you don't want a panel full of flashlights. The more LEDs on your panel, the lower brightness they should be (depending on how they're spread apart). 6 hours ago, tago said: The question is whether strip boards would really help with many mixed parts (leds, btn, pots). Check also if your parts have a standard 0.1"/2.54mm pin spacing. 6 hours ago, tago said: A custom pcb at dirtypcb with 80x25cm cost $250 for 10 pieces. If i could find a manufacturer that offers single pieces, maybe it would make sense to do a custom pcb. If you're inexperienced with PCB design, it will probably take the same amount of time (+mistakes) as going the wiring method. That said, it's a good chance to practice. Consider splitting the panel into subsections, that brings the down cost and shipping is easier. If others find the layouts useful you can sell the extras you don't need. Quote Link to comment Share on other sites More sharing options...
gerald.wert Posted March 24, 2017 Report Share Posted March 24, 2017 You can spend a lot of time routing traces in a cad program. If you etch your own PCB you also need to consider drill time. Limited drilling can be an advantage of strip or pad per hole board in a proto phase or a one off. You have a lot more freedom in part placement when making a board in cad. If you are planning more that one it is definitely worth cad time. +1 to also having more than one board, that will make your life a lot easier when you start to trouble shoot it in addition to the lower cost. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.