Advertisement

Quantizer

Not rated 18,627

#PIC16F84 #quantizer #voltage control #semitone steps #octave steps #programmable #dual channel #microcontroller #signal processing #music electronics
Quantizer
Quantizer

Description: This document outlines a dual-channel quantizer design inspired by Chris List's ARP Style CV Quantizer. The implementation utilizes a Microchip PIC16F84 microcontroller, which enables programmable quantization of voltages in 1/12 volt (semitone) or 1 volt (octave) steps within a range of -10V to +10V. The quantization process takes approximately 2 milliseconds per channel. The design features octave switches that allow users to choose between semitone and octave quantization. Each channel employs a digital-to-analog converter (DAC), a comparator, and a sample-and-hold circuit to continuously quantize an analog signal. The quantization process is driven by a suitably programmed PIC. A second comparator and sample-and-hold circuit can be added for a second channel, and additional channels can be incorporated depending on the available PIC pins and conversion intervals. The DAC is multiplexed across all channels. The design adheres to the MOTM format, utilizing the MOTM-000-A1 DIY breadboard with a power cable and mounting bracket from Synthesis Technology, along with a MOTM-1UB blank 1U panel for the front. Components were sourced from personal stock, Mouser, and Digikey.

The circuit's core consists of a Microchip PIC16F84 microcontroller (U1) operating at 10 MHz, paired with an MP7542 12-bit DAC (U2). Operational amplifier U3B converts the DAC's current output into a voltage output, while U3A is used for zero voltage trimming and control voltage scaling. The components surrounding U3A are selected to ensure a standard 1V/octave control voltage scaling. The sample-and-hold circuit for channel 1 is constructed using U4A, capacitor C18, and U5A, while channel 2's sample-and-hold circuit is built around U4B, capacitor C19, and U5B. Resistor R5 is included to provide slew limiting and reduce noise. The comparators for channel 1 and channel 2 are designated as U8 and U9, respectively. The 100kΩ and 180kΩ resistors surrounding the comparators introduce approximately 8mV of hysteresis to mitigate comparator chatter caused by noise. The PIC and DAC operate on a 5V supply provided by U6, while a clean 12V reference for the DAC and scaling circuits is supplied by U7. Diode D1 limits the maximum voltage at the PIC input RA4 to 5V, and the internal protection diode restricts the maximum voltage at the PIC input RB3 to 5V. Resistors R9 and R13 limit the current through the internal and external limiting diodes, while resistors R8 and R12 serve as pull-up resistors for the open collector outputs of the comparators.

The design operates with both channels' control voltages being quantized sequentially. A complete dual-channel quantization cycle initiates with the PIC executing an 8-bit binary search to determine the digital value of control voltage CV1 at the channel 1 comparator, effectively performing a digital-to-analog conversion. During this search cycle, the channel 1 sample-and-hold is maintained in hold mode. Once the search is complete, the sample-and-hold for channel 1 samples the DAC output briefly to allow the hold capacitor to charge. Subsequently, the PIC executes a quantization cycle for channel 2, mirroring the process used for channel 1. A 12-bit DAC was selected to achieve the requisite accuracy for VCO control voltages while utilizing only the 8 most significant bits, thereby achieving 12-bit accuracy within an 8-bit application. The MP7542 was chosen due to availability, though any comparable 12-bit (or better) DAC could be utilized with appropriate software modifications. Additionally, an octave switch facilitates octave (MOD12) quantization for control voltages, allowing users to select octave quantization by closing the switch for a given channel; otherwise, semitone quantization is employed. This functionality is implemented through a straightforward mathematical operation in software, suggesting that alternative quantization scales could also be integrated with the necessary software adjustments. This flexibility is exemplified by the Doepfer A-156 Dual Quantizer. The PIC is operated at its maximum rated clock speed of 10 MHz.This describes my original design dual channel quantizer inspired by Chris List`s ARP Style CV Quantizer design. My new implementation is an intelligent design that exploits the programmability of a Microchip PIC16F84.

It will quantize voltages in 1/12 volt (semitone) or 1 volt (octave) steps from 10V to 10V. Quantization time is about 2ms per channel. Octave switches allow the user to select between semitone or octave quantization. On a per channel basis, this design uses a digital-to-analog converter (DAC), a comparator, and a sample/hold to continuously quantize an analog signal. A suitably programmed PIC drives the quantization process. The addition of a second comparator and sample/hold is all that is needed to get a second channel. Even more channels can be added at the expense of PIC pins and conversion interval per channel. The DAC is multiplexed among all channels. The design was built to the MOTM format using the MOTM-000-A1 DIY breadboard with power cable and mounting bracket from Synthesis Technology.

I also purchased the MOTM-1UB blank 1U panel for the front panel. Other parts were obtained from my own personal stock, Mouser, and Digikey. See the schematic and source code to follow the design discussion. The circuit engine is a Microchip PIC16F84 microcontroller (U1) clocked at 10MHz and an MP7542 12 bit DAC (U2). Op amp U3B converts the current output of the DAC to a voltage output. Op amp U3A allows the trimming of the zero voltage point and control voltage scale. The components used around U3A were selected to achieve standard 1V/octave CV scaling. Channel 1 sample/hold is built around U4A, C18, and U5A. Channel 2 sample/hold is built around U4B, C19, and U5B. Resistor R5 provides some slew limiting to keep down noise. Channel 1 comparator is U8. Channel 2 comparator is U9. The 100W and 180KW resistors around the comparators provide about 8mv of hystersis to reduce comparator chatter due to noise.

The PIC and DAC are powered by 5V. This voltage is supplied by U6. The DAC and zero/scaling circuits require a clean 12V reference. This voltage is supplied by U7. Diode D1 limits the maximum voltage at the PIC input RA4 to 5V. The internal protection diode limits the maximum voltage at the PIC input RB3 to 5V. Resistors R9 and R13 limit the current through internal and external limiting diodes. Resistors R8 and R12 provide pull-up voltage to the open collector outputs of the comparators. The design is a two channel design in which both channels CVs are quantized repeatedly and in order. A complete dual channel quantization cycle begins with the PIC executing an 8 bit binary search cycle to find the digital value of the control voltage, CV1, at the channel 1 comparator. This is essentially a digital to analog conversion process. The channel 1 sample/hold is set to hold during the search cycle. When the search cycle is complete, the channel 1 sample/hold is set to sample the DAC output for a brief time to allow the hold capacitor to charge.

After the sample time, the PIC executes a quantization cycle on channel 2 similar to that of channel 1. A 12 bit DAC was chosen to achieve the accuracy needed for VCO control voltages. Only the 8 most significant bits are used. Doing this, 12 bit accuracy is achieved in an 8 bit application. The MP7542 was selected because I have many on hand. Any comparable 12 bit (or better) DAC can be used with the appropriate software changes. The design also uses an octave switch to use octave (MOD12) quantization for control voltages. Closing the octave switch for a given channel selects octave quantization otherwise semitone quantization is used.

This is a simple math function performed in software. This would suggest that any quantization scales could be implemented with the appropriate software changes. This is exactly what the Doepfer A-156 Dual Quantizer does. The PIC is clocked at the maximum rate of 10MHz for the part I use

Related Circuits