Saturday, September 16, 2017

Korg Nanokontrol Schematic + New Firmware

Ages ago I drew a schematic for Korg's original Nanokontrol. I finally decided to dust it off and do something with it.

From the outside the Nanokontrol is just a USB control surface, but inside it hides an AVR microcontroller. It even has the ISP (programming) header broken out, though the pinout differs. With this it seems pretty natural to write a new firmware for it.

I wanted a simple project that demonstrates interfacing the potentiometers, LEDs and buttons. The idea of a CV step sequencer sprang to mind. In order to get nice clean voltage output I decided to add a DAC. The problem with adding to this setup is the general lack of IO pins. The serial pins TX and RX are conspicuously unused, but I chose to leave them free for possible MIDI communication. I don't plan on using USB MIDI, so I freed up IO by removing the USB chip.

PDIUSBD12 USB chip
The USB chip actually serves as the clock source for the AVR, so a replacement clock must be supplied. Step one is to flash the AVR fuses such that it can accept a crystal clock source. This has to be done while we still have an external clock. After that the USB chip can be removed and a crystal can be attached to the XTAL pins of the AVR. Conveniently the USB chip has an external crystal footprint that we can repurpose.

Now most of IO PORTD is free to use. I used one external interrupt pin for the trigger input. This makes it fast and easy to step the sequencer in response to an external clock/trigger. This leave plenty of pins for the DAC (MAX528). It gets its own clock and chip select lines, but it shares the data line with the LED shift register since it's clocked separately.

This is what the schematic looks like after the modifications:

Modified Nanokontrol
This setup works, but the CV output only spans about 0-4V. To broaden this, the DAC can operate on +12V while still responding to TTL level control. It just needs the supply rail and reference voltages changed to 12V. For convenience sake, I also added a 5V regulator. This makes it easy to run the entire setup off of 12V.

MAX528 12V configuration
Now all of the hardware modifications are done. It's time to write some code. The only trickiness comes from interfacing the multiplexed IO. Here is an overview of how to read/write them:

Read Buttons:
  1. Pull PC0-3 low one at a time to enable one column
  2. Pull PC4 low to enable buffer
  3. Read PINB for button statuses (low = pressed)
  4. Repeat steps 1-3 pulling each column low

Read Pots:
  1. Set PA0-2 to select pot from Mux
  2. Read Mux on PA4 and PA6
  3. Read single pots on PA5 and PA7
  4. Repeat steps 1-3 selecting each set of pots

Write LEDs:
  1. Set PC7 high to disable LED output
  2. Write first bit to PD7 (low to turn on)
  3. Set PA3 high, then low to clock in bit
  4. Repeat steps 1&2 for all 8 bits
  5. Set PC5-7 to select column and enable LED output
  6. Delay to allow LEDs to shine
  7. Repeat steps 1-6 selecting each column

The code and schematics can be found on my github here. The code is pretty barebones and simple. It just serves to demonstrate interfacing the Nanokontrol hardware. There are some obvious upgrade and features that can be added, so this is just a starting point.

Wednesday, September 13, 2017

Novation Bass Station Schematic

It seems that no one has a schematic of the original Bass Station, so I drew one up. This is from the keyboard version with board markings "Novation Bass Station SM, Issue 4, 1995".

DCO

At the beginning of the signal chain is the DCO. There are two identical DCOs, so we'll just look at one I've dubbed "OSCA".

DCO

At the top is an exponential current source that charges capacitor C10/2. It's built around a transistor pair marked "FMA1". Based on that marking I believe this is the correct datasheet.

At the bottom left is the sync pulse generator. When a pulse or square wave is fed into the "OSCA_SYNC" net a short pulse is output at pin 4 on U20B. The width of this pulse is determined by the RC network formed by R29 and C9. Together they cause a small delay between pins 5 and 6 changing logical state. While these inputs are unequal the output will be high.

This sync pulse enables transistor Q2 to sink the charge stored in C10/2 thereby "resetting" it to VSS. The capacitor is then able to charge back up via the exponential current source. This cycle results in a sawtooth wave that is present on pin 5 of U18B.

U18B serves as a buffer for the sawtooth, but can also be switched to generate a squarewave. Nets OSCA_WF_SW and OSCA can be connected or disconnected via multiplexer U12. If connected the opamp is configured as a noninverting amplifier outputting the sawtooth. If unconnected the opamp is configured as a comparator, comparing the pulse width CV, OSCA_PWM_CV, on pin 6 and the sawtooth on pin 5. This results in a PWM squarewave as pictured below.


Multiplexer
PWM CV

Mixer

Next in the chain is the mixer. The mixer is made of two simple VCAs, one for each oscillator. Each VCA works off of a single linear CV. The mixers serves only to change the relative volume of the oscillators, not to apply the volume envelope.
Oscillator Mixer

VCF

After the mixer is the filter. It's closely related to the OSCar filter that is, in turn, based off of the Wasp filter. It should be noted that the inverting stage present in the OSCar has been removed from the Bass Station. This stage allowed the filter to be switched into a high-pass mode. Without it, the Bass Station is stuck in lowpass mode.

Bass Station VCF
OSCar VCF
I find it interesting that the resonance is under CV control, but cannot be modulated. It does respond to MIDI though.

VCA

Last in the chain is the main VCA. It's another simple, one-OTA VCA. Unlike the mixer VCAs it includes an exponential current source and responds to modulation from one of the envelopes. It also has a trimmer to adjust the offset voltage.
VCA

CV Header

The final thing of note is an unlabeled header. It breaks out most of the internal CV and audio outputs. Almost all of them tap directly after a buffer and, with the addition of a 1K resistor, are safe to connect to other devices.

Unfortunately none of them are really suited to take a signal as input. Nearly every signal would have to be disconnected from its destination and fed through a summing-amp instead. With this summing-amp an external CV signal could then be mixed in with the existing CV.
CV Header

Full Schematic

Here is the majority of the analog section of the Bass Station. I've omitted the dull CV multiplexer and buffers.



Bass Station Schematic