Skip to content

Commit

Permalink
Merge pull request #30 from 16n-faderbank/v200
Browse files Browse the repository at this point in the history
Version 2.0.0
  • Loading branch information
infovore authored Apr 6, 2020
2 parents a4c0c75 + f2e30af commit f9122d9
Show file tree
Hide file tree
Showing 9 changed files with 501 additions and 315 deletions.
43 changes: 11 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@ Once upon a time, Sean Hellfritsch and Brian Crabtree [made a faderbank][linespo

**16n** is the revised version of that object: it is open-source and ready for you to make, modify, or hack.

It is currently at version **1.34**.
It is currently at hardware version **1.34**, firmware version **2.0.0**

# Repository contents

- `firmware` is the Teensy source code.
- `electronics` is schematics and gerber files for the PCB.
- `panel` is SVG/DXF files for top and bottom panels.
- `build` is build documentation.
- `browser_test` is a webpage you can use in Google Chrome to test your 16n
using WebMIDI.
- `browser_test` is a **legacy** test webpage to let you test your 16n. As of 16n 2.0.0, the [editor][editor] should be your point of call for debugging your 16n.

Each directory has further `README` files in for you to read.

Your main point of call for documentation, however, should be the [Github Wiki][wiki]

## 16n Details

- 16 60mm faders
Expand All @@ -35,39 +36,15 @@ Toggle switch allows you to swap between 'Arturia/Novation' (tip is current sour

## User guide

### USB MIDI

Connect USB to computer or other USB host. Faders 1-16 transmit MIDI CC data on CCs 32-47, channel 1. This can be altered in firmware configuration.

### TRS MIDI

Connect USB to computer/USB host, or a USB power supply. Set toggle switch to appropriate MIDI standard. Connect TRS midi converter to MIDI port. (If you have a TRS socket on your MIDI device, you can just use a 3.5mm TRS-TRS cable). Faders 1-16 transmit MIDI CC data on CCs 32-47, channel 1. This can be altered in firmware configuration.

### CV

Connect USB to a USB power supply. Faders 1-16 emit 0-~5V out of their relevant jacks. Connect jack sockets to _inputs_ on your synthesizer. Do **not** connect jack sockets to _outputs_ on your Eurorack system; there is power protection on the Teensy, impedence resistors on the sockets, but damage may occur if you do so.

### I2C

I2C is complex and requires a bit more care when connecting up with your 16n. You can do some very powerful things with it, but you need to be very mindful of a few key points:

- I2C is very picky about cable length. Keep your cable runs as short as possible. If your cables are too long, your bus may “hang” and cause connected instruments to become unresponsive until reboot.
- Connect and disconnect devices only when they are powered down. This keeps your instruments from locking up or being damaged. (I2C just wasn’t designed to be as robust and hot-pluggable as MIDI or USB.)
- Be extremely careful not to connect audio or MIDI cables to the I2C jack. This could damage your 16n’s processor.
- 16n’s I2C jack is a 3.5mm stereo jack wired as follows: tip SDA, ring SCL, and sleeve GND (ground). The various devices in the ecosystem that support I2C order these pins differently. Check your devices documentation or PCB to ensure that you are connecting to it properly.
- Depending on the number of devices on the I2C bus and your configuration, you my need to utilize a bus board to add additional “pull up” resistance to the bus in order to have reliable communications. There are a number of options available for this in the community.

By default, the 16n firmware is set up to work with a monome Teletype out of the box. Make sure you are running the latest Teletype firmware (3.0 as of this writing). Simply connect to the I2C bus and go. The 16n commands are listed in the Teletype documentation available here: [https://monome.org/docs/modular/teletype/manual/#n-faderbank](https://monome.org/docs/modular/teletype/manual/#n-faderbank). These commands allow for the Teletype to programmatically read the position of any of the 16n’s faders.

The “MASTER” version of the 16n firmware causes the 16n to emit commands directly to a number of modules. (You need to compile and/or flash it to your 16n over USB - see the README in the `firmware` directory). It sends CV values to up to four monome Ansible, four bpcmusic TXo, and the Orthogonal Devices’ ER-301 all at the same time. Note: In this configuration, you need to have additional pull-up resistors on the I2C line (as mentioned above). Either use one of the available powered I2C busboards for this purpose or, if you don’t plan on connecting your 16n to a Teletype (which supplies its own pull-up), you can populate the pull-up resistors on the 16n PCB.

"_Can I have multiple faderbanks working over I2C?_" - basically, no. [Brendon has a good explanation here of why not](https://github.com/16n-faderbank/16n/issues/16#issuecomment-455739461)
[The user guide can be found on the Wiki](https://github.com/16n-faderbank/16n/wiki/User-Guide)

## BOM

[Available on Octopart][octobom]; a CSV version is in `electronics/bom-csv.csv`
[See more on the wiki](https://github.com/16n-faderbank/16n/wiki/BOM-(Bill-of-Materials))

## Build Guide

Most parts you can get from eg. Mouser. I recommend buying PJ-302 jacks from [Thonk](https://thonk.co.uk) as an alternative to the more expensive CUI parts. If in doubt, 1% 0805 resistors of any manufacturer will do; caps are X7R with appropriate voltage tolerance.
[See more on the wiki](https://github.com/16n-faderbank/16n/wiki/Build-guide)

## Credits

Expand All @@ -89,3 +66,5 @@ Firmware is licensed under the [MIT License][mitlicense].
[octobom]: https://octopart.com/bom-tool/unJxkzvR
[ccbysa]: https://creativecommons.org/licenses/by-sa/4.0/
[mitlicense]: https://opensource.org/licenses/MIT
[editor]: https://16n-faderbank.github.io/editor
[wiki]: https://github.com/16n-faderbank/16n/wiki
113 changes: 3 additions & 110 deletions build/README.md
Original file line number Diff line number Diff line change
@@ -1,112 +1,5 @@
# 16n: v1.31 build guide

This is a basic build guide for putting a 16n together.

This guide does _not_ cover things like "how to solder SMT components". It's designed for builders with a degree of experience.

## BEFORE YOU BEGIN

### BOARD ORIENTATION

All the components go on the top of the board - with all the SMD pads on. The through-hole components are soldered on the other side.

Looking down on the board on your desk, we'll call the side the Teensy is on the LEFT, and the side with sixteen jacks on it the TOP.

![](build/16n_orientation.png)

## BUILDING THE ELECTRONICS

As ever, you want to build up your board in height order. Let's do the ICs first:

* `U1` is the 74HC4067 multiplexer: this is the larg(er) IC. The sloping side should be on the LEFT, same side of the board as the Teensy, with the dot (if visible) top left.
* Next: `U2` to `U9` are the eight MCP6004 op-amp ICs. Sloping side should be on the LEFT, same side as the Teensy is, just like the multiplexer.
![](build/16n_1_ics.png)



* Now solder all the resistors and caps.
* `R1`-`R16` are all 1K resistors.

* `C1`-`C9` are all 100n capacitors.

* 16 5.6k resistors: `R19, R21, R23, R25, R27, R29, R31, R33, R35, R37, R39, R41, R43, R45, R47, R50`

* 16 10k resistors: `R20, R22, R24, R26, R28, R30, R32, R34, R36, R38, R40, R42, R44, R46, R48, R51` Along with the 5.6k resistors, these creator a voltage divider to divider the 5V going into the fader down to ~3.3V for the Teensy.

* `R49` and `R52` are 47 ohm resistors by the switch

![](build/16n_2_rcs.png)

* 4.7k resistors `R17` and `R18` are **probably not required** and are thus marked DNP (do not populate)

* If you don't plan on using I2C, ignore them.
* If you plan on using I2C with a monome Teletype, do not populate these resistors - it may well cause problems.
* If you plan on using I2C with an ER-301, Ansible or TXo, (ie I2C "MASTER" mode) you should populate the 4.7K resistors.
* Next up diodes: `D1` to `D4` are four SOD-123 diodes. line should be on the BOTTOM, as marked by the symbol on the board.
![](build/16n_3_diodes.png)
* Next, through-hole switch. This should snap in and stand just off the board. Make sure it's as flush as it can be and solder it in.
![](build/16n_4_switch.png)
* Now the stereo jack sockets for MIDI and I2C. These won't snap in, so make sure they're flush before you solder them.
![](build/16n_5_stereo.png)
* Now let's do the Teensy.
* Solder the outer through-hole headers onto the Teensy. Every single one needs to be attached. The best way to do this is:
* Take two rows of 14 headers, place one on each side, and solder in just one pin on each side. Now try sliding the Teensy into position on the board. You may need to adjust the angle of the fourteen-pin headers. When they're good, solder them in.
* Mount the Teensy into the 16n PCB, flip the board over, and solder it in. (The board is designed for the Teensy to be permanently attached.) The header plastic should be flush with the PCB on the top. An easy way to confirm this is to solder one leg, and check the Teensy is flush. If not: heat the pin whilst carefully pushing the Teensy flush - don't push the leg you're heating! Remove the heat, and it'll stay flush with the board. Then complete all the other legs. Trim all the overhanging legs, one at a time, to get them super-short.

![](build/16n_6_teensy.png)
* Now the 16 mono jacks. These should push in and stay flush, too - the hole is the size of the mounting pin. I recommend getting them in and soldering one pad of all of them. Then, check if they're flush; if not, heat the pad whilst pushing the jack down until it's flush against the board. When that's done, solder the other pads. Lots of solder to make a good connection.
![](build/16n_7_mono_jacks.png)
* Finally, the faders. These should snap in to the board and rest against it vertically. They're hard to remove, so make sure you get them straight. Four pins at the top, two at the bottom.
![](build/16n_8_faders.png)

That's all the electronics done. Before you assemble the hardware, you should **test the board.** To test it, we'll need to flash the firmware.

## FLASHING THE FIRMWARE

Connect Teensy to a computer. Open the `_16n_firmware.ino` file in the Arduino IDE. Make sure you have Teensyduino installed already.

To compile and flash the firmware, open the Tools menu and be sure to set the Board to Teensy 3.2, USB type to MIDI, CPU speed to 120mhz overclock. Flash the board. If there are config changes you wish to make (CC numbers, MIDI channels, enabling the power LED, configuring I2C mode, these can all be found inside `config.h`). However, don't change any CC numbers or MIDI channels *yet* if you plan to test the board with our webpage tester - the test page is only configured for the default configuration.

Your 16n should be visible to MIDI software over USB as "16n".

By default, I2C is not set up for 'master' mode (ie: it will work with monome Teletype and similar, but **not** ER-301/Ansible. To make it work for ER-301, you need to enable 'master' mode in `config.h`, and _ensure_ your pull-up resistors are in place).

## TESTING THE 16N

Once we've flashed the firmware, we can test the board.

There's all sorts of functionality here, but there's some stuff that's easiest tested through the USB-MIDI connection. To that end, move all the faders to the bottom, connect the USB port of the Teensy to your computer, and open the test page up in Google Chrome (or another browser that supports WebMidi, such as Mozilla Firefox).

Note that the test page expects the default MIDI configuration: Channel 1, CCs 32-47.

Move each fader up and down for its full travel on its own. You should see a bar smoothly rise above the number of that channel for the full 'height' of the box (you'll see). Hopefully, this will all work correctly. If it doesn't, here are some possible catches:

* nothing moves: check the fader pins; check carefully that the opamps are all the right way around and every pin is connected to its pad (and only its pad). Check carefully that the mux is the right way around and every pin on the mux are connected.
* a bar doesn't move nearly far enough; this means the voltage is being divided too much. Check the resistors at the op-amp for that channel (each op-amp handles two channels, left-to-right); one might not be connected or soldered correctly.
* beyond a certain point of travel, *all* the bars move up; this means that too much voltage is flooding into the mux. Again, check the resistors on the op-amp related to that channel - for instance, if channel 14 is causing this problem, check the resistors on the right of the seventh op-amp (U8)

When the USB-MIDI is good, you might want to check the CV. Using a voltmeter or an oscilloscope, measure the voltage at each jack socket as you throw a fader up and down. It should go smoothly from 0V to nearly 5V. If it moves 'suddenly' rather than smoothly, check the op-amp pins are soldered correctly.

By default, TRS-MIDI emits the same data as USB-MIDI. A good way to test it is to power 16n from a mobile phone power adaptor, rather than USB, and watch the traffic. Note that some mini-TRS MIDI dongles can be a little temperamental and require jiggling; this is the universal problem of dongles.

## ASSEMBLING THE ENCLOSURE

The enclosure files can be found in `panel` - there are mechanical drawings and DXF files for the top and bottom. You can cut them on a laser cutter or mill.

Once your board is working, assembling the rest of the hardware is pretty straightforward:

* the short M-F hex standoffs go through the UNDERSIDE of the board, with the thread going through the hole.

* the longer M-M spacers are on the TOP of the board.
![](build/DSC01729.JPG)

(_yes, this is an older version, pre-multiplexer, but the standoffs all go in the same places_)

* Line up the top and bottom panels, and, screw them in place with M2.5 screws.

* Attach fader knobs or rubber covers to taste - standard fader knobs with a 4mm slot will fit. Be careful about pushing these on _too_ hard - they can become difficult to remove should you need to. (I've broken a fader by exerting force on it to lever the top off, for instance).

* Attached rubber feet to base to taste.
![](build/16n_2.jpg)
# 16n: v1.3x build guide

[The build guide now lives on the wiki](https://github.com/16n-faderbank/16n/wiki/Build-guide)

This directory stores the images for the build guide; do not remove.
6 changes: 3 additions & 3 deletions electronics/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# 16n electronics

Electronics CAD and design for the 16n faderbank.
Electronics CAD and design for the 16n faderbank. These currently use Autodesk EAGLE.

## VERSION

1.31
1.34

## Directory contents

* `16n.sch` and `16n.brd` are EAGLE 9.1.3 format schematic and board layout for the project.
* `16n.sch` and `16n.brd` are EAGLE 9.5.x format schematic and board layout for the project.
* `16n_schematic.pdf` is the schematic in PDF format.
* `16n_v126.brd/sch` are **old, legacy layouts that are not recommended for use**. They are kept for historical reasons.
* `bom.csv` is a CSV rendition of a BOM for the project. The parts are all highly generic - any brand of 0805 resistors will do, for instance. For more specific recommendations, the [live BOM at Octopart][octobom] has links to specific components, designed around things easily purchased from Mouser, though note that stock of one manufacturer's parts may not be guaranteed, and you might need to edit your basket to find parts in stock.
Expand Down
58 changes: 35 additions & 23 deletions firmware/_16n_faderbank_firmware/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# 16n Firmware

Written for Teensy 3.2.
16n Firmware is designed to run on a Teensy 3.2. It is not supported on any other platform.

This README serves as a guide for **developing** and **compiling** your own versions of the firwmare. As of Firmware v2.0.0, the recommended method for putting firmware onto a 16n is to use Teensy Loader directly. [Find out more on the wiki][load-firmware]

If you are interested in compiling your own firmware, or hacking on it, read on!

## Requirements

Expand All @@ -16,19 +20,17 @@ Written for Teensy 3.2.

## Customisation and configuration

Most configuration you'll want to do is handled in `config.h`, through a set of `define` statements.
As of 16n firmware 2.0.0, you no longer should do ANY configuration through the Arduino IDE. All configuration is conducted from a web browser, using the [16n editor][editor]

```C
#define REV 1
```
When you upgrade to 2.0.0 you will LOSE ANY CONFIGURATION YOU HAVE. This is a one-time thing; apologies.

will reverse the order of the faders in MIDI and I2C, right-to-left
The 16n will be initialised to a set of default settings (All outputs for TRS and USB set to MIDI channel 1, CCs 32-47, I2C set to follower). Once this is done, connect over USB, and go to the [editor][editor] in Google Chrome; you will be able to see the current configuration, edit the configuration, and transmit the new config to your device. You will likely need to customise the maximum fader value calibrations.

```C
#define FLIP 1
```
Note that if you do change any config related to I2C, you should power-cycle the 16n before it will be picked up.

Some options _do_ remain in `config.h`; they are for developers to specify options that are likely to need setting once, or adjusting during the development process:

will invert the direction of the faders, top-to-bottom, for MIDI and I2C. Combined with `REV`, this will allow you to use the faderbank upside down - useful if your sole connection is I2C.
In `config.h`

```C
#define DEBUG 1
Expand All @@ -42,24 +44,34 @@ will log debug messages to the serial port.

will restrict the faderbank to its first channel. Designed for breadboard development; almost certainly not of interest.

```C
#define MASTER 1
```
will put the 16n into I2C MASTER mode, broadcasting values from the 16n directly.
## Memory Map

MASTER MODE supports up to 4 TXo modules and/or up to 4 Ansible devices and/or 1 ER-301.
Configuration is stored in the first 80 bytes of the on-board EEPROM. It looks like this:

If you want to use 16n with an ER-301, you need to turn MASTER MODE on. If you want to use it with a Monome Teletype, leave you want MASTER MODE off - leave it commented out.
Addresses 0-15 are reserved for configuration flags/data.

### Customising continuous controller numbers and MIDI channels
FADERMAX and FADERMIN are 14-bit numbers; as such, they are stored in two bytes as MSB and LSB; the actual number is calculated by `(MSB << 8) + LSB`

`config.h` also contains the MIDI configuration.
Midi Continuous Controller numbers are specified by the `usb_ccs` and `trs_ccs` variables; each array has sixteen items, for the faders, left to right. You can alter these should you want specific CCs to come out of the faderbank (if, for instance, you have a tool with fixed mapping, or want to directly control a piece of hardware). It is possible to set the USB MIDI port and the TRS MIDI port to output on different CCs if you wish.
Channels are set per-fader in `usb_channels` and `trs_channels`; again, you can have a different channel per fader if you'd like, and different channels for USB and TRS.
+---------+--------+------------------------------------+
| Address | Format | Description |
+---------+--------+------------------------------------+
| 0 | 0/1 | LED on when powered |
| 1 | 0/1 | LED blink on MIDI data |
| 2 | 0/1 | Rotate controller outputs via 180º |
| 3 | 0/1 | I2C Master/Follower |
| 4,5 | 0-127 | FADERMIN lsb/msb |
| 6,7 | 0-127 | FADERMAX lsb/msb |
| 8-15 | | Currently vacant |
+---------+--------+------------------------------------+
| 16-31 | 0-15 | Channel for each control (USB) |
| 32-47 | 0-15 | Channel for each control (TRS) |
| 48-63 | 0-127 | CC for each control (USB) |
| 64-79 | 0-127 | CC for each control (TRS) |
+---------+--------+------------------------------------+

## LICENSING

see `LICENSE`

[load-firmware]: https://github.com/16n-faderbank/16n/wiki/Firmware:-installation-instructions
[editor]: https://16n-faderbank.github.io/editor
Loading

0 comments on commit f9122d9

Please sign in to comment.