In my prior blog ( Multi-Voice Synthesizer - Initial Design ) I detailed my initial design of the three modules of my Multi-Voice Synthesizer project. Well the boards and parts arrived and I jumped into testing the Voice Module which did not go too well. In fact in went terribly bad. And to make matters worst, I have been attempting to recover from an injury.
Almost a month ago, I went on a pre-school field trip with my Grandson, to downtown San Antonio. The class is mostly boys (9 boys and 3 girls) and has a tendency to be very physical. Their favorite past time is to play tag, and they really take it serious. Several of the parents were doing a pretty good job of keeping them in sight, but time to time a couple of the kids would start running up the stairs and then go out of sight. On one of these occasions, I headed up the stairs after them, but I did not possess their grace and skill level of running up the stairs. I ended up catching a toe on one the stairs and quickly fell down. I bounced right up, wounding mostly my pride and I brought the kids back down to the 'safe' area. Well, a couple of days later my left shoulder really starts hurting. With the pain getting worst each day, I made an appointment to see my doctor. His diagnosis was Bursitis of the shoulder caused by breaking my fall with my arms. I am two weeks out from that diagnosis and the pain remains, somewhat less, but still painful. A bout 6 years ago I messed my right shoulder (shredded Bicep and torn rotator cuff), so I have deep concerns of a potential for a surgery on the left side to match the right side. The jury is still out, the doctor ordered X-rays of the shoulder, so depending on the readings, and how the pain continues, there may be more testing.
Well back to the project. To bring up the Voice Module, I first constructed a single slot motherboard to supply the voltages (+5V and +2.5V) to the board.
This allowed me to plug in a assembled Voice Module and start debugging. I tried measuring the output waveform at the attenuator output, but no luck. I moved to the output of the input of the attenuator, which looked terrible. Digging deeper, I found that the 2.5V bias signal looked terrible. This sent me back to the prototype motherboard and the 2.5V regulator. Based on the instability of the bias signal, I decided to swap in a voltage divider and op-amp voltage follower circuit to provide a cleaner output (shown above as I did not take a picture of the regulator version).
Even with the new bias circuit, the attenuator circuit was still not working. So I decided again to pivot and try a new approach for a attenuation/amplifier circuit. Based on some of the issues and in a attempt to minimize the timing overhead on the microprocessor, I decided to use a PWM output to driver a more classical Voltage Controller Amplifier (VCA) circuit. The PWM provides a very efficient approach to a programmable voltage to control the amplifier. I decided on using one of the 8-bit PWM timers in the ATtiny1614 microprocessor, running at 10MHz (39.062kHz). The compare register that determines the output duty cycle is reloaded each time the timer reaches its terminal count and interrupts the processor. The interrupt process reads a global variable and writes it into the compare register. The idle loop process with compute the new duty cycle value based on the ADSR function.
So I hacked up my voice module to add a buffered control voltage, based on the PWM duty cycle. I also designed a buffered circuit to re-bias the waveform output from the microprocessor which would drive the new VCA circuit. The DAC output is referenced to an on chip 4.3V signal, generating a waveform centered around 2.15V. The buffer/bias circuit converts it to a 4.3V peak-peak waveform, centered around 2.5V. I then bread boarded the new VCA circuit to test everything out. Here is a schematic of the VCA implementation.
The 'red' block of the schematic is the ATtiny1614 driving the PWM to control voltage and the re-biased DAC output (changes were made on the Voice Module PCB). The 'blue' block is a programmable current source that is driven by the control voltage. The 'purple' block is a differential amplifier and uses the programmable current source to amplified the input waveform.
The new VCA design is working well, with a slight clipping on the waveform at the positive maximum (either a op-amp rail-to-rail issue or a possible voltage drop in the 5V supply) in the biasing/buffer circuit.
This is minimum gain output signal (Blue input waveform, Green output waveform and Red Control voltage).
This is maximum gain output signal (Blue input waveform, Green output waveform and Red Control voltage). The specification of the op-amp is 50 to 150mV drop from supply at 0.5mA current level, the circuit should be doing much better, but is dropping out at 4.5V (with a 0.1mA current level), so the op-amp is damaged or, the +5 supply at the op-amp is low. Hopefully this is a rework issue and will be corrected on the new PCBs.
The good news is that minus the clipping the design works well, providing a programmable output from ~10mV up to ~3.0V peak-to-peak.
The issue with the programmable filter circuit, which was a total failure was due to a schematic error. I reversed the '+' and "-" inputs of the three op-amps in the State-variable active filter. I again modified the Voice Module to route the Programmable pots and the inputs of the filter selector MUX to an external connector, allowing me to breadboard the filter in order to test it. I did try to hack up a new Voice Module to correct the filter's op-amp input swap, but that did not go well at all. My soldering skills are barely suitable for building PCBs using these components, let alone trying to cross flying leads, to fix the swapped pins.
Here is a look at the hybrid combination of the 'hacked' Voice Module and the breadboarded VCA and State-variable active filter circuits.
The overall circuit now appears to be operating as expected. I made quite a few changes to the overall circuit as shown in this marked up copy of the original schematic.
These changes are broken out as follows:
1) Purple box (upper left corner) - Modified processor pinout to allow for PWM control of the VCA. Also added a footprint for a 20MHz crystal oscillator to correct for temperature drift of the R/C base 20MHz oscillator (to be loaded optionally).
2) Blue box (upper right corner) - Replaced programmable attenuator with a true VCA circuit.
3) Green box (middle left side) - Modified motherboard connector, changing the 6 pin connector with a 4 pin connector, eliminating the bused 2.5V bias circuit in favor a onboard bias circuit (op-amp buffered, voltage divider).
4) Three Blue boxes - corrected the "+/-" inputs of the op-amps in the State-variable active filter circuit.
Here are the modified schematic and layout drawings:
Next Steps
The Voice Module PCBs will need to be ordered (I am waiting testing and fixes to the other two boards before proceeding).
I am currently working on write code for the Voice Modules.
I add an external oscillator and still considering the use an external EEPROM/FLASH for wave-table storage.
I am sure that I will be tuning and tweaking the Echo Module (slightly different implementation with this part as my prior design was delay only and this time I am mixing the delayed signal to develop an echo).
I will need to design code for the ATtiny3226 on the main board (MIDI decoder, Voice Module control, Mixer/Volume control and Echo Module control).
I will need to design code for the Voice Module to act as a noise source.
I want to look at adding tremolo and vibrato effects into the Voice Module (varying amplitude and varying pitch via software control of the attenuator and the oscillator).
As I get more of the code complete, I will start writing software descriptions. As I get the hardware more defined, I will generate and post updated documents and BOMs.
Design some 3D printed frames to hold all the modules and a speaker into a rigid form.
And finally, I will need to record a video to prove that it all works.
Thanks as always for reading along and keep an eye out for updates to the project!