Build digitally controlled FM transmitter (PLL) - Page 1
Forum section: electronics / rf-microwave

author: Zipdox
author_rank: Regular Contributor
timestamp: January 13, 2023, 01:22:44 am
content: I want to build a digitally controlled FM transmitter (for stability reasons). I want to feed it a pre-muxed signal (containing stereo FM and RDS). Output power is not a concern. I'd prefer to use a separate power amplifier, so the power shouldn't be too high to feed into an amplifier.I foundthis guidefor an FM PLL controlled VCO, but it has some problems. It uses a separate PLL and discrete VCO circuit. I think nowadays there are ICs with a PLL and VCO in one package, which would reduce complexity. The PLL IC (LMX2322) also uses the Microwire serial protocol, which AFAIK isn't natively supported by any popular MCUs (ATMEGA328P, STM32, etc). Modern PLLs use I2C, which would be more convenient.Does anyone have any suggestions?

author: paul@yahrprobert.com
author_rank: Regular Contributor
timestamp: January 13, 2023, 04:37:13 pm
content: according to wikipedia microwire is a "strict subset" of SPI, so maybe it can be made to work on a modern spi bus.

author: Zipdox
author_rank: Regular Contributor
timestamp: January 14, 2023, 12:30:48 am
content: Quote from: paul@yahrprobert.com on January 13, 2023, 04:37:13 pmYeah I found out about that. But still, I'd rather have a one-chip solution for the VCO and PLL.

author: NiHaoMike
author_rank: Super Contributor
timestamp: January 14, 2023, 03:46:54 pm
content: With the addition of a prescaler (frequency divider), you can use the timers built into the microcontroller as a frequency detector, then use PWM or DAC to apply a correction signal.

author: BrianHG
author_rank: Super Contributor
timestamp: January 14, 2023, 10:00:42 pm
content: Quote from: Zipdox on January 13, 2023, 01:22:44 amYou do know that all-in-one ICs which synthesize the FM radio standard and have a built in PLL driven oscillator / transmitter actually now exist. I don't believe I have seen RDS support.

author: jimmc
author_rank: Frequent Contributor
timestamp: January 14, 2023, 10:37:39 pm
content: Quote from: BrianHG on January 14, 2023, 10:00:42 pmSi4713 does the lot, stereo FM plus RDS. There's cheap modules available to try it.I've been using one driven by a Raspberry Pi zero (and PCM5102 DAC) to transmit an internet radio station to FM receivers around the house.Jim

author: Zipdox
author_rank: Regular Contributor
timestamp: January 14, 2023, 11:56:10 pm
content: Quote from: jimmc on January 14, 2023, 10:37:39 pmLike I said, I want to feed a pre-muxed signal. I'm writing an audio plugin to do the muxing, which is why I want to build a transmitter that takes a muxed signal.

author: Zipdox
author_rank: Regular Contributor
timestamp: January 15, 2023, 01:23:34 am
content: I'm considering theLMX2541,LMX2571andADF4360(hyperlinks to datasheets). These all have charge pumps that don't connect directly to the VCO internally so that it's possible to modulate them with an external signal. The LMX chips use Microwire while the ADF4360 explicitly mentions SPI compatibility. The LMX257 has an FSK input, which I do not need, and may actually be undesirable. The ADF4360 is slightly cheaper (at least on Mouser).

author: Zipdox
author_rank: Regular Contributor
timestamp: January 15, 2023, 02:00:02 am
content: Hmm I found a rather negative thread from 2011.https://www.edaboard.com/threads/lmx2541-pll-vco-combo-how-to-modulate.197948/

author: BigBoss
author_rank: Regular Contributor
timestamp: January 15, 2023, 02:30:21 am
content: Standard FM Broadcasting requires +-75kHz deviation around the carrier. In order to get this deviation, you cannot use PLL directly.Because PLL would pull it back the carrier to center, therefore you should widen Dead-Zone in PLL. This is not easy.Instead, you can use PLL to modulate VCO in sequential form like in DECT transmitters. First lock the carrier then release the PLL and modulation starts then a while lock the PLL again so on.If the timing is well organized, this may work.Dead-Zone is the region where the PLL is insensitive to frequency deviation of VCO.

author: Zipdox
author_rank: Regular Contributor
timestamp: January 16, 2023, 12:31:04 am
content: Quote from: BigBoss on January 15, 2023, 02:30:21 amHow would one do this? And can't you just low pass filter the charge pump so that it doesn't fight the audio frequency modulation of the VCO? Or will that cause the PLL to oscillate and not tune the VCO at all?

author: BigBoss
author_rank: Regular Contributor
timestamp: January 16, 2023, 02:21:26 am
content: Quote from: Zipdox on January 16, 2023, 12:31:04 amDemodulation FM is easy with PLL but it's not valid for Modulation. When you apply AF signal to change the VCO frequency, PLL would track and pull back the carrier to desired value.You need a "slow" PLL meaning the PLL must be insensitive to rapid frequency variations. FM is possible with this technique but when no modulation is applied, the carrier shifts to left or right and the tuning disappears.This is very important especially digital modulated transmissions.If you widen the Loop Bandwidth of the PLL, the PLL in this case fast and will not allow to frequency deviation by modulation signal.You can find a compromise between these two, it's possible but it will not be very healthy but worth to try.Therefore DECT Cordless Phones use an interesting technique.When transmission starts PLL locks the carrier rapidly then a signal coming from baseband processor release the PLL onto do-not-track- mode. ( simply charge pump OFF ) the VCO starts to get into free running mode and simultaneously FM modulation signal applied for a certain time slot after that PLL catches and locks again so on.Professional FM Modulators use Delta-Sigma Loop Technique and it's complicated.This guy tried something, glance at..https://pira.cz/entx4.htm

author: Zipdox
author_rank: Regular Contributor
timestamp: January 16, 2023, 03:02:46 am
content: Quote from: BigBoss on January 16, 2023, 02:21:26 amWhat do you mean the carrier shifts to left or right and the tuning disappears? You mean the charge pump drives the VCO to the wrong frequency when there is no input signal? Why would this happen?

author: BigBoss
author_rank: Regular Contributor
timestamp: January 16, 2023, 03:18:09 am
content: Quote from: Zipdox on January 16, 2023, 03:02:46 amNo, if the VCO is left standalone (CP=OFF State) , the carrier frequency drifts by temperature.

author: BrianHG
author_rank: Super Contributor
timestamp: January 16, 2023, 03:25:07 pm
content: Ok, just choose a MCU with a built in dac and RTC counter input pin.Build a 1 transistor oscillator with a tuning diode, using the the MCU dac output fed through a LPF to the tuning diode combined with your source audio.Write a frequency counter program to drive the DAC tuning output to the frequency you like.Problem manually solved with a transistor, coil, tuning diode and MCU with it's crystal.You may need a pre-scaler divider counter for the source oscillator to divide it down to a frequency the MCU RTC input can count at. Any logic 74ACxxx counter which can count at 110MHz will do. If you are lazy, you can also use a 74AC04 and inductor with tuning diode as your oscillator.

author: edavid
author_rank: Super Contributor
timestamp: January 16, 2023, 04:38:49 pm
content: Quote from: BigBoss on January 16, 2023, 03:18:09 amThat's silly. Just bandlimit the audio to 50Hz and the PLL to < 10Hz. Carrier drift will be much slower with any kind of well designed VCO.

author: Zipdox
author_rank: Regular Contributor
timestamp: January 16, 2023, 05:43:56 pm
content: Quote from: BrianHG on January 16, 2023, 03:25:07 pmI actually thought about doing something like this. Obviously a frequency divider is necessary at FM broadcast frequencies for the MCU to keep up.Quote from: edavid on January 16, 2023, 04:38:49 pmThat's what I was thinking. Although I think audio should be 30Hz, not 50. Band limiting the PLL to not fight with the audio modulation is basically how PLL FM transmitters work no?

author: fourfathom
author_rank: Super Contributor
timestamp: January 16, 2023, 06:43:54 pm
content: Quote from: Zipdox on January 16, 2023, 05:43:56 pmYes, as long as the PLL VCO is stable and linear. V-to-F nonlinearity will cause distortion of the transmitted signal. And it's not just carrier drift that can be a problem, but also power-supply noise and other sources (including internal thermal noise) that can modulate the VCO frequency. The lower the PLL loop bandwidth goes, the more these factors become an issue. Fortunately, a VCO with adequate performance isn't hard to come up with.

author: Zipdox
author_rank: Regular Contributor
timestamp: January 16, 2023, 09:04:02 pm
content: Quote from: fourfathom on January 16, 2023, 06:43:54 pmI don't know exactly how to interpret this.This is before the VCO frequency divider.

author: ace1903
author_rank: Regular Contributor
timestamp: January 16, 2023, 09:28:37 pm
content: For standard radio 88-108Mhz and 144Mhz, many years ago I built circuit around SAA1057.Without RDS but I think this chip is optimized for this band and loop filter easily can be modified to accept RDS also.On net many proven circuit can be found.

author: fourfathom
author_rank: Super Contributor
timestamp: January 16, 2023, 10:33:33 pm
content: Quote from: Zipdox on January 16, 2023, 09:04:02 pmNor do I, really, other than at a hand-waving level. They claim that a linear interpolation of the MHz/Volt number is appropriate, but I doubt that it's exactly linear. The good news is that if your desired frequency deviation is relatively small compared to the VCO range (as I believe it is) then the nonlinearity should be negligible. The bad news is that a wide-range VCO is likely to be more intrinsically noisy and susceptible to external noise sources. The specs don't give us much to go on there. And me saying "more" or "less" doesn't mean much unless you can match those parameters to your requirements. Is this a broadcast FM transmitter? If so, the noise and stability requirements aren't too tough.

author: rteodor
author_rank: Frequent Contributor
timestamp: January 17, 2023, 09:39:12 am
content: Just a crazy thought on the side: modulate the reference directly then only multiply the frequency with the PLL.I would try this on a Pi pico. A PIO unit should be fast enough to generate modulated reference signal at some tens of MHz.

author: BrianHG
author_rank: Super Contributor
timestamp: January 17, 2023, 12:28:08 pm
content: Quote from: Zipdox on January 16, 2023, 05:43:56 pmDoing it without a DAC, use 2x74HC4040 to divide your oscillator by 16.7million feeding the feedback of a CD4046 phase comparator #2 output to drive your tuning diode while using your MCU's PWM output to generate a square wave to feed a reference PC input of your desired output frequency divided by 16.7million.This way, you get the 3-state charge pump style phase comparator output of the CD4046 and you can power the CD4046 at 15v to get a large tuning voltage for your tuning diode.Note that you will not be using the oscillator in the 4046.Note that making an IF modulator using the 10.7MHz FM IF ceramic filters with a transistor, inductor and tuning diode would be best as they limit your modulation into the FM radio limits. But then you need a mixer oscillator with PLL to synthesize your transmission frequency. This is the more high quality way of doing things as any broadcast frequency you choose, the resulting amplitude and bandwidth and linearity will always match your 10.7Mhz modulator. Not to mention that there exist DSP and FPGA cores which directly all digital synthesize a perfect 10.7MHz FM IF through a high frequency DAC giving you pristine 'Broadcast Grade' modulation results. (IE: all pre-emphasis, limiting, filtering, spectrum balancing and RF margin gain manipulation done in software.)

author: Zipdox
author_rank: Regular Contributor
timestamp: January 17, 2023, 02:45:19 pm
content: Quote from: rteodor on January 17, 2023, 09:39:12 amWould you even be able to obtain a nyquist frequency of 59KHz that way? And if so, what is the resolution?Honestly I'm leaning more towards just creating a simple PLL with bandwidth limited to 10Hz.

author: rteodor
author_rank: Frequent Contributor
timestamp: January 17, 2023, 08:26:13 pm
content: Yeap, with the pico the resolution would be quite bad for FM.But what about slapping a varicap on the crystal capacitors ?

author: Zipdox
author_rank: Regular Contributor
timestamp: January 18, 2023, 01:06:04 am
content: Quote from: rteodor on January 17, 2023, 08:26:13 pmWhat? The entire point of a crystal is to have a stable constant frequency.

author: fourfathom
author_rank: Super Contributor
timestamp: January 18, 2023, 01:27:29 am
content: Quote from: Zipdox on January 18, 2023, 01:06:04 amIf you are using a wide-bandwidth PLL to multiply a FM-modulated reference, then the VCXO is a perfectly good way to generate the reference. People have been pulling XTALs with varicaps for essentially forever and the stability is *much* better than an LC oscillator can deliver. You can always add temperature compensation to the VCXO circuit. Of course you can always buy a pre-made VCXO and the spec sheet will tell you what you need to know (usually).

author: BrianHG
author_rank: Super Contributor
timestamp: January 18, 2023, 04:59:49 pm
content: Seriously, if the OP doesn't wan to over complicate things, just buy one of these IC's:https://www.ti.com/product/CDCE913Tie a 10.7Mhz FM radio IF filter to the crystal inputs (may need to add a tuneable inductor) and feed his modulation to the Vctr input pin. TV audio 4.5mhz filters will also allow a narrower band. Also try SAW filters in the 10 to 30 mhz range.You cannot use a crystal as they cannot be pulled far enough for FM radio's 200khz width.Use the TI clock software to program it as it is I2C control.TX from 10mhz up to 230mHz.You will need to bandpass filter the output into a sine wave unless you don't care.I still say make a proper 10.7mhz modulator and use a freq synth with mixer to transmit properly.

author: fourfathom
author_rank: Super Contributor
timestamp: January 18, 2023, 08:24:04 pm
content: Quote from: BrianHG on January 18, 2023, 04:59:49 pmTrue, but that's why I mentioned the PLL multiplication. You can reasonably pull a 5 MHz xtal +/- 5 KHz, which gives you +/- 100 KHz deviation at 100 MHz. But yes, there are easier ways to do all this.

author: Zipdox
author_rank: Regular Contributor
timestamp: January 19, 2023, 01:21:11 am
content: I think I'll just wing it and design a circuit around the LMX2541. Modulating the the VCO input using the AC coupled audio signal and tuning it using the filtered charge pump output. If I'm not mistaken, band limiting the PLL by filtering the charge pump output is howthis circuitdoes it. I'll have to add a circuit to manipulate the modulation depth, aka the audio amplitude.

author: fourfathom
author_rank: Super Contributor
timestamp: January 19, 2023, 01:52:00 am
content: Quote from: Zipdox on January 19, 2023, 01:21:11 amFM transmitter, right? Then it'sdeviation. Modulation depth is an AM thing.

author: BrianHG
author_rank: Super Contributor
timestamp: January 19, 2023, 09:01:53 am
content: Quote from: fourfathom on January 18, 2023, 08:24:04 pmIn other words, tie a 5Mhz crystal to the TI PLL IC I listed. Set the PLL to multiply by 20 to get 100MHz out. I'm still not sure you can push and pull a 5MHz crystal quick enough to get that full band broadcast. You would probably need some serious pre-emphasis.I think in this topic, we are just going all over the place as the OP hasn't described the quality and adjust ability he needs. PLL pulling a 5MHz crystal will need gain an pre-emphasis re-adjustmend if he goes from 88Mhz, then selects 107MHz. It's the same with tuning a fundamental oscillator directly. That is why I say make a 10.7Mhz modulator, then use an off the shelf PLL osc/mixer running at + or - 10.7 Mhz the output freq you want to make a quality tunable transmitter.

author: Zipdox
author_rank: Regular Contributor
timestamp: January 20, 2023, 12:29:40 pm
content: Quote from: BrianHG on January 19, 2023, 09:01:53 amI need only about 60 kHz bandwidth to include RDS. Maybe round that up to 80.