Download free music MP3s on genuine quality, the world’s largest online music catalogue, powered by your scrobbles. Free listening, videos, photos, The world’s largest online music catalogue, powered by your scrobbles. Free listening, videos, photos, stats, charts, biographies and concerts. stats, charts, biographies and concerts.
Having now tried both an Arduino and Raspberry Pi Pico as programmable clocks for the SP0256A-AL2, this post starts to look at some alternative solutions, starting with a HC4046 phase-locked loop, voltage-controlled oscillator clock. https://makertu…
Having now tried both an Arduino and Raspberry Pi Pico as programmable clocks for the SP0256A-AL2, this post starts to look at some alternative solutions, starting with a HC4046 phase-locked loop, voltage-controlled oscillator clock.
Warning! I strongly recommend using old or second hand equipment for your experiments. I am not responsible for any damage to expensive instruments!
If you are new to microcontrollers, see the Getting Started pages.
Some Ideas
Whilst trawling around the Internet (and remembering a comment from my earlier posts), I found two existing projects where changing the frequency was used as a way to add pitch to the SP0256A-AL2:
Both use a VCO approach. The latter using a LTC6903 programmable oscillator; and the former using a CD4046 PLL device.
The LTC6903 looks like it would be a lot more complicated for me to use (especially being SMT), but I have some DIP 4046 devices already in the parts drawer so that is definitely an option for me.
One last thought - use a 555. No really! There are some versions that can go up o 3, 4 or even 5MHz apparently, see: https://en.wikipedia.org/wiki/555_timer_IC#Derivatives Of course having that in any way programmable might be a challenge, but it isn't out of the question.
4046 VCO/PLL
A voltage-controlled oscillator is just what it sounds like. An oscillator whose frequency is related to the level of a control voltage on its input.
Here is a pinout and functional view of the 4046 from the TI 74HC4046/74HCT4046 datasheet. This provides several phase comparators and a voltage-controlled oscillator to create a phased-locked loop controller.
A key statement is the following:
"The VCO requires one external capacitor C1 (between C1A and C1B) and one external resistor R1 (between R1 and GND) or two external resistors R1 and R2 (between R1 and GND, and R2 and GND). Resistor R1 and capacitor C1 determine the frequency range of the VCO. Resistor R2 enables the VCO to have a frequency offset if required."
The "application information" section describes the "with offset" operation:
There are a lot of graphs of characteristics in the datasheet for the various combinations of R1, R2 and C1 - these are the "figure 27-32" mentioned above. Actually, to cover all options, there are figures 10 through to 43, but most of those cover other situations.
For the MIDI Narrator, the values being used are as follows:
R1 = 1.5K to 2.5K (adjustable)
R2 = 12K
C1 = 1nF
Which I believe puts it in the following areas of the performance curves:
So without detailed calculations and measurements, I think this puts the (centre) offset frequency at a low-number of MHz (extrapolating for 12K at 5V) and the Max/Min ratio (R2/R1) at something around 4 to 8.
I believe, from looking at the other charts, that a higher R1 or C value gives a lower frequency. There are graphs for the following with the stated approx frequency ranges at 4.5V:
1M5, 100nF: 0 < Freq <100Hz
150K, 100nF: 0 < Freq < 1kHz
5K6, 100nF: 0 < Freq < 20kHz
150K, 50pF: 0 < Freq < 1.5MHz
One last thing to note from figure 32 - it states that a Vin of 0.95 VCC will generate the maximum frequency and 0V for the minimum.
It turns out I have some CD4046 in my parts box, not a HC or HCT 4046. On initial inspection, there doesn't seem to be a lot of difference that would significantly affects my messing around. Some of the pins (that I'm not using) have different functions:
But as I'm not using those pins, that probably won't matter. But then on closer inspection, I can see a key difference that definitely will affect my messing about - the operating frequency ranges:
HC/HCT4096: Up to 18MHz at VCC=5V.
4096: Up to 1.4MHz at VDD=10V.
And digging into the detailed spec for the CD4046, when running at 5V the maximum is down to just 0.8MHz typical.
So I could use them to test out some general principles but need a HC/HCT version to really achieve what I'd like to do.
At this point my understanding was starting to struggle, and those graphs weren't helping much. So I just went ahead and built the version of the circuit from the Rarewaves MIDI Narrator. I really wasn't having much luck with it as is however, so started fiddling about with different components and an oscilloscope to see if I could make any sense from it.
I was finding that the output wasn't a particularly clean square wave, and at higher frequencies was pretty much triangular. But more significantly, the peak to peak voltage was greatly reduced to around 1.5Vpp with a significant BC bias. That wasn't much use as a clock signal for me - from Part 3 I know the SP0256A-AL2 requires <0.6V for a LOW and >2.5V for a HIGH.
I'd included a 10K resistor between the 4046 and SPA256A-AL2 as per the circuit for the MIDI narrator. But it turns out that without that resistor, the clock is much cleaner and has much more useful levels, so I removed it.
I also found that the suggested 1nF capacitor wasn't giving me a particularly useful range. In the end, 4.7nF seemed to work well for me. Eventually after testing a range of different resistor values, I went back to 12K and 1.5K + 1K pot from the original circuit. This gives me:
The frequency range set by a combination of 4.7nF and 12K.
A frequency offset of between 1K and 2.5K is configurable.
I believe this will pull the frequency offset down slightly from the previous values to something between 100kHz and 600kHz, according to the charts, but it gives me a very useful range between around 1MHz and 5MHz once tuned slightly with the trimpot.
My final circuit used is as follows:
The CLK output was plugged directly into the SP0256A-AL2 OSC 1 input, with OSC 2 connected to GND.
The control voltage pot goes through a LM358 which might not be strictly necessary in this case, but helps to at least stabilise the input voltage to the VCO. It might also be useful when I switch to programmatically driving the control voltage from a microcontroller.
The usable clock frequency range is adjusted using the trimpot. Eventually, as mentioned, I settled on a range of around 1MHz to 5MHz. It will go lower, but that isn't so useful for driving the SP0256A-AL2.
Closing Thoughts
This seems to work really well. The control using a pot isn't particularly reliable, but that will be quite different if generating a control voltage from a microcontroller.
I'll need to do some calibrations to work out what voltages create which frequencies and then what pitch of voice reproduction that seems to produce, but that can come later. For now it is enough to know it appears to work.
As an aside, whilst trawling around the Internet for this one I stumbled across the CTS256A-AL2 device. This is a microcontroller (I think it is 8051 based, based on a PIC7041) that performs text to allophone conversion for pairing with a SP0256A-AL2 for a complete text to speech system.