===== About ===== A DIN module is used to connect buttons and encoders to the Midibox. The Name comes from “Digital Input” and means that the module can detect two states: ON or OFF. It then sends this information to be processed by the [[:home:mbhp:module:core|mbhp core module.]]It comes with multiple serial registers 74HC165; every register provides 8 digital inputs, which are sampled with the latch enable signal LD and shifted out with the clock signal CLK. The advantage of using such shift registers is, that they can be cascaded to a long chain without the need of more than 5 cables to the core module. The DIN board has been designed on a way which allows to cascade not only the ICs on the board, but also several DIN modules. But note that it depends on the firmware how much inputs are processed by the core module. For instance, the MIDIbox64 allows to connect up to 64 buttons = 8 ICs = 2 * DINX4, the MIDIO128 supports 128 inputs = 16 ICs = 4 DINX4 modules. ===== Getting Started ===== * [[:home:skills:tools| Tools]] * [[:home:skills:soldering]] * [[:home:mbhp:parts | Wher to buy Parts]] * [[:home:skills:etching_pcbs]] * [[:home:skills:terminating_cables]] == Special Instructions == * [[:home:skills:smd_soldering]] * etc ===== Details ===== === Pins === [[din_dout_pin_list | DIN & DOUT pin table]] ===Available Ports=== Following interfaces are provided by the dinx4 module: | Name ^No. of pins ^Description | ^J1 |5 |Interface to CORE J9 (if buttons are used) and CORE J6 (if encoders are used, MIDIbox16E only). DINX4 J1 provides two power pins for 5V, 0V, the serial clock, the latch enable and the serial output of the register chain. This port can also be connected with J2 of another DINX module.| ^J2 |5 |Interface to another DINX4 module. DINX4:J2 provides nearly the same pins like J1, just only the serial output of the first IC is replaced by the serial input of the last IC. This port can be connected with J1 of another DINX module.| ^J3 to J9 |5 |These are the digital input lines, every connector comes with 4 of them and an additional pin for ground. See mbhp_dinx4_32buttons.pdf as an example how to connect buttons to these pins, and mbhp_dinx4_16enc.pdf how to connect rotary | === PCB files === * [[http://www.ucapps.de/mbhp/mbhp_dinx4_v2.brd|DINX4 V2]] [[http://www.ucapps.de/mbhp/mbhp_dinx4.gif|Preview]] * [[http://www.ucapps.de/mbhp/mbhp_dinx3_v1.brd|DINX3 V1]] [[http://www.ucapps.de/mbhp/mbhp_dinx3_v1.gif|Preview]] * [[http://www.ucapps.de/mbhp/mbhp_dinx2_v1.brd|DINX2 V1]] [[http://www.ucapps.de/mbhp/mbhp_dinx2_v1.gif|Preview]] * [[http://www.ucapps.de/mbhp/mbhp_dinx1.jpg|Preview of DINx1]] -No pcd as this part is normally built on veroboard. === Schematic === * [[http://www.ucapps.de/mbhp/mbhp_dinx4.pdf|MBHP DINX4 V2]] * [[http://www.ucapps.de/mbhp/mbhp_dinx1.pdf|MBHP DINX1]] === List of parts === Here are suggested part numbers for various distributors for parts for the DIN board. If you find another site or dealer with a different parts list feel free add it into the list. Also if you’ve successfully used a different part from what was listed here please add the number and/or link to the list. | Part Name ^ Description ^ Polar ^ soldering temp ^ QTY ^ [[http://www.reichelt.de|Reichelt.de]] part# (([[reichelt_shopping_cart|Reichelt Shopping Cart Links]])) ^ [[http://www.mouser.com | Mouser.com]] part# ^ ^ IC1-IC4 | 74HC165 | Yes | Don't! | 4 | 74HC 165 | [[ http://www.mouser.com/search/productdetail.aspx?R=M74HC165B1Rvirtualkey51120000virtualkey511-M74HC165 | 511-M74HC165 ]] | ^ R1-R36 | Resistor 10 kOhm | No | ??? | 36 | 1/4W 10k | [[ http://www.mouser.com/search/productdetail.aspx?R=291-10K-RCvirtualkey21980000virtualkey291-10K-RC | 264-10K-RC ]] | ^ C1-C4 | Ceramic Cap 100 nF | No | ??? | 4 | Z5U-2,5 100n | [[ http://www.mouser.com/search/productdetail.aspx?R=C412C104K5R5TAvirtualkey64600000virtualkey80-C412C104K5R | 80-C412C104K5R ]] | ^ - | IC-Sockets for serial registers | Yes | ??? | 4 | GS 16 | [[ http://www.mouser.com/search/productdetail.aspx?R=390261-4virtualkey57100000virtualkey571-3902614 | 571-3902614 ]] | ^ J* | 1-row SIL Headers (50 pins) | No | ??? | 2 | STIFTL. 40G | [[ http://www.mouser.com/search/productdetail.aspx?R=2340-6111TGvirtualkey51750000virtualkey517-6111TG | 517-6111TG ]] | ^ - | 1-row sil female con | No | ??? | 2 | - | [[ http://www.mouser.com/search/productdetail.aspx?R=929850-01-36-10virtualkey51750000virtualkey517-850-01-36 | 517-850-01-36 ]] | ^ - | Ribbon cable 3 meters | No | ??? | 3 | AWG 28-16G | - | ===== Building it ===== ==== Building instructions ==== blah blah blah ==== Connection to Core Module ==== Check the version of your Boards; if you're using SmashTV's Core that's equipped with double rows, you can build a split-cable to connect J8/J9 to a DIN and a DOUT: {{http://www.audiocommander.de/picBrowser/galleries/070707_ACSensorizer/CORE_DIN_DOUT_J8J9_Cable.png}} \\ ==== Connecting Input Devices ==== [[http://www.ucapps.de/mbhp/mbhp_dinx4_32buttons.pdf|Connecting 32 buttons to a DINX4]] [[http://www.ucapps.de/mbhp/mbhp_dinx4_16enc.pdf|Connecting 16 Rotary Ecnoders to the MIDIbox16E and other MIOS based controllers]] [[http://www.ucapps.de/mbhp/mbhp_dinx4_16enc_alps_stec16b03.pdf|Connecting 16 Alps STEC16B03 Encoders to MIDIbox16E and other MIOS based controllers]] [[http://www.ucapps.de/mbhp/mbhp_din_touchsensors.pdf|Connection Diagram for touch Sensors]] ==== Testing ==== ===== Testing all pins ===== Regardless which MIDIbox you are planning to build, you can use the MIDIO128 application to test the digital inputs of the DIN module(s) Once MIOS and the MIDIO128 application have been uploaded, each digital input will send a Note On event (pin 1-64) or Controller Event (pin 65-128) when a button is pressed (=0V at the digital input pin), and a Note Off event (pin 1-64) or Controller Event (pin 65-128) when the button is released (=5V at the digital input pin). Rotary encoders will send two Events (because they are connected to two pins) depending on the quadrature state. Each pin will trigger an individual note/CC number. This is the second byte of a event. The first pin will send "90 30 7F" when pressed, and "90 30 00" when released. The last 128th pin will send "B0 4F 7F" when pressed, and "90 4F 00" when released. The MIDI events can be displayed with MIOS Studio or a MIDI monitor (e.g. MIDI-Ox) The MIDIO_OUT_ENTRY definitions in midio128_presets.inc help to map the pins to the events, the [[:home:mbhp:module:din_dout_pin_list|DIN DOUT pin list]] helps to map the pin numbers to shift register pins. ===== Testing Shift Register Connections ===== If the first input pin of the first shift register (74HC165) triggers all 128 Notes at once, there is propably a problem with the Shift or Register Clock line (SC/RC signal). Both signals are driven by the core module, and they are connected to all shift registers in order to scan the chain. If these signals are not connected, or if there is a short, the core will always "see" the first digital pin, and never the remaining pins of the chain. If some of the last shift registers cannot be scanned, it is very likely that the SC/RC line is broken, that there is a bad soldering, or similar. Such types of errors can be located with the srio_interconnection_test application, which can be found at the [[http://www.ucapps.de/mios_download.html|MIOS download page]]. Step by Step instructions for the testing procedure are described in the main.asm file Check: * the SC/RC output at the core module (J8/J9) * the SC/RC input of each DINX4 module (J1/J2) * the LD/CLK input of each 74HC165 (Pin #1 and Pin #2, see [[http://www.ucapps.de/mbhp/mbhp_dinx4.pdf|DINX4 schematic]]) If you notice a short circuit (signals always 0V or 5V, or between these voltage levels), check the cables between the modules and especially your soldering at the bottom of the PCB. Consider also, that a PCB track could be broken or connected with another track (etching imperfection). Connect each signle DINX4 module directly to the core in order to find the bad candidate(s). If visual checks don't help to detect the short circuit, you could begin with a very drastic, but effective method: cut the failing track in the middle, and check if the short has disappeared. Cutting has to be repeated until you've found the cause for the failure. Warning: Don't do this too early, this should be the last measure which normaly leads to success, but also to a bad looking PCB. After this procedure, you have to repair the track with some solder ==== Troubleshooting ==== [[:home:troubleshooting]] ===Reference===