Propeller as heterodyne for DC transceiver (was Generating 30 MHz quadrature)
Andrey Demenev
Posts: 377
I need to generate 2 square waves with 90° phase shift. The obvious way is to setup 2 counters in NCO mode with $4000_0000 difference in initial PHSx value. But this would only work for frequencies up to FCLK/4. I need 30 MHz output, and that would require 120 MHz clock. Way too much.
Another way would be using 60 MHz system clock, setting up a counter in video mode with 120 MHz pixel clock, an using WAITVID. But this wastes a cog.
Am I missing a way to generate 30 MHz quadrature using counters only, without software support?
Another way would be using 60 MHz system clock, setting up a counter in video mode with 120 MHz pixel clock, an using WAITVID. But this wastes a cog.
Am I missing a way to generate 30 MHz quadrature using counters only, without software support?
Comments
You can do what you want by using a PLL counter mode. Here's an example:
-Phil
I would suggest trying it anyway and, if you can, measure the phase difference between the two outputs. This is the method I used to generate LO inputs to the I and Q mixers in my direct-conversion shortwave receiver experiment, and it seemed to work okay.
If the potential for error still bothers you, just output the 120MHz signal and use external logic to form the quadrature signals. Whatever method you use, though, your biggest problem will be phase jitter, if you want clean signals, not average differential phase error.
-Phil
I don't understand this statement.
In my understanding, in most general, PLL structure looks like this:
PLL is locked, when output voltage from phase comparator is such that VCO's output freq equals F0. Since phase comparator's output is proportional to pahse difference between VCO and F0, phase shift between VCO and F0 depends on F0. But since VCOs are not identical, each one may need different voltage (read: phase shift) to produce F0 at VCO's output
-Phil
If you want quadrature, you will mean without jitter, and exactly 90.00' phase ?
Note that 90' at 30MHz is 8.33333'ns - so unless you can think of a way to generate exact 8.333ns delays, you will need a clock of 120MHz.
If you can tolerate "almost 90' ", then some tricks with opposite clock edges may be possible.
CTRA and CTRB are set up to output same frequency, each using its own PLL. Frequency was set to minimum (80 MHz VCO, 128 PLLDIV) cause my scope has low bandwidth.
To observe phase difference, I made a simple resistor network. Tho-channel scope would work better, but I do not have one. Each time I press Reset button, I see a different waveform - obviously phase of PLL depends on nothing but phase of the moon and bananas cost at Barneo.
In fact, I am exproling usage of propeller as a heterodyne for direct conversion receiver, with clock frequency produced by external VCO
If you have an external VCO, why not simply create the Quad signals as well - it's only 2 FipFlops.
I am renaming this topic, to not open a new one.
Recently, some interest has been shown in using the Prop in radios using direct conversion techniques, mostly thanks to Phil's experiments with DSP. I already mentioned that this was the reason I started to learn Propeller. With Phil's FIR filters, my dreams are getting closer. But I would like to go further, and use as much of Prop as possible.
A common approach in direct conversion transceivers' mixers is to generate a frequency 4x higher that working freq, and use counters and/or shift registers to generate quadrature sequence for the mixer. And common problem here is that ICs used (74AC series) are working at frequencies close to their limit (almost 120 MHz for 10 meters ham band). This makes the phase shift differ from 90 degrees, degrading transceiver's performance. There are methods to reduce this problem, like applying DC bias to counters' inputs, but this is frequency-dependent and not reliable.
My idea was to use a microcontroller to generate a relatively low frequency (20-50 kHz) as a reference for external PLL using DDS technique, feed the PLL's output to Propeller's clock, and use the prop to output quadrature signals for the mixer. Since Propeller's outputs can change their state synchronously, there are big chances to achieve very precise 90 degrees phase shift for the mixer, regardless of frequency.
My concern here is that I would need to use PLLs for both Propeller clock and counters, and how this would affect the spectrum. We know that when generating frequencies that are not CLKFREQ divided by a power of 2 introduces lots of phase jitter. This should not be a problem in my approach though, since DDS output with a proper filter can be of any frequency. What concerns me more is how clean is Propeller's PLLs' signal, even when using NCO set up with a power of 2?
The approach I plan to use is to build a superhet instead of a DC receiver. The IF would be 10 MHz (or 1/8 of the system clock frequency, whatever that happens to be). The mixer would be an SA612 whose sinewave oscillator would be controlled in a FLL/PLL feedback loop by the Prop using DUTY mode output and a varactor. This accomplishes three things:
2. Additional pre-detector gain and selectivity can be had with a simple IF amplifier, along with a lattice filter which uses the same crystals that set the Propeller's system clock frequency.
3. The I/Q clocks in the detector stay at one stable, jitter-free frequency.
-Phil
Anywho, good luck with all this. It's a lot of fun reading about what smart people can get the Prop to do.
Lawson
This register de skews the variance and noise of the counters. Yes, there will still be a variation in the propagation delay in the register. However, this delay is, mostly, not frequency dependent and can be tweaked out using a simple RC delay.
I have done this and the 90 deg characteristic was maintained over the full frequency range.
Duane
Please explain the beauty of DC as opposed to a super-het. I am just curious at this point. Not a debate, just idle curiosity. I think I understand what a poor IF choice is. 950Khz, for example on AM is a bad call, as it's right on top of one frequency allocation in the US. A station broadcasting there may see reduced quality, in the form of receiver artifacts at that frequency, for example. Are there others?
The NXP 74AUP series claim 550MHz speeds on their flip flops, so they could be a good compact choice, with low skews. 2 x 1G74's would give balanced quadrature signals
The spectrum looks pretty clean, especially taking it account that I clearly see on the scope that the product signal degrades when I connect the sound card. That said, the spectrum of the Propeller's PLL is not as bad as one could expect. Obviously, such a heterodyne would never be as good as a good VFO or "real" synthesizer, but I think it would be sufficient for a mid-class transceiver.
I envision the following possible structure of a receiver:
The frequency is synthesized with a PLL, where instead of a divider, a DDS generator is used. Phase comparator works at frequency of 32 kHz. That is high enough for fast PLL lock, and low enough to obtain pure waveform with DDS. Quadrature signals for the mixer are generated by Propeller's counters or video generator. The VCO should cover the range of 28..32 MHz for 160, 80, 40, 20 and 10 meters bands. WARC bands would require additional VCOs though.
Phase comparator can be built using Propeller itself.
Another Propeller chip would be used to demodulate the quadrature signals.
That's my plan Not sure how it will go, or if I ever finish (or even start ) implementing it. Anyway, I am open for discussion and suggestions.
Surely that's only the case if the mixer is a precision multiplying mixer - which is not normally done at RF is it?