EEVblog Electronics Community Forum

Electronics => Open Source Hardware => Topic started by: SaabFAN on March 10, 2017, 12:08:33 am

Title: Open Source HW RF Signal Generator
Post by: SaabFAN on March 10, 2017, 12:08:33 am
I believe many of you guys have followed my attempt to build a spectrum analyzer that ultimately fizzled out because of Feature-Creep and system-complexity that drove cost and development-time up. In the end I bought a R3131A Spectrum Analyzer on ebay and despite it having some quirks, I'm pretty happy with it so far.

That being said, I now still miss one device here: A Signal-Gen capable of producing predictable results at frequencies higher than 6MHz (Cheap DDS-Generators are only good to that frequency, even though they say on the front they're capable of 24MHz).


The specs of this thing (which are FINAL now!) are the following:

- 10kHz to 3GHz Frequency Span (to match my Spectrum Analyzer)
- -120 to +13dBm digital Amplitude control (This does not need to be flat all the way up to 3GHz, I'd be ok with some amplitude-drop above 2GHz)
- Capability of the main Signal-Chain to send the signal out to an external Module and receive the signal from an external Module (This module could add different forms of modulation to the signal)
- Internal TCXO and ability to take an external reference-clock (from a GPSDO, for example)
- Use of Vero-Board where possible (High frequency signal-path is on custom-made PCB)
- Fit inside a 19inch case

To achieve this, my first idea was to use the ADF4351 Synthesizer-Module I bought for the Spectrum-Analyzer project. It works from 35MHz up to 4.4GHz.
For lower frequencies I'm using a DDS-Module based on the AD9851-Chip. I have already built a simple Network-Analyzer with that module and it worked pretty nice.

Unfortunately, the ADF4351 can only produce a square-wave. So I want to use several LC-Filters to form that square into a sine, which are switched in and out by MASWSS0115TR-3000 switches.
There are several difficulties associated with this approach, so I'm open to different ideas, like frequency mixing, if they can produce a better sine-wave.


The next difficulty is to keep the amplitude constant across the frequency-band. For frequencies up to 60MHz, a JFET-Attenuator or even a variable gain OpAmp is the way to go. For frequencies higher than that, a PIN-Diode Attenuator, controlled by an ALC-Circuit, takes care of precise attenuation of the signal that is then sent through a step-attenuator made out of 10 and 15dB Attenuator-Chips by M/A-COM. This Attenuator provides up to 110dB of attenuation in 10dB-Steps.

I hope, this time I'm not running out of  patience and/or time and actually finish this project :)

EDIT:
For a quicker Overview, now that the "Mark III Prototype" is ready, I have written down the Specs that I'm aiming for at the moment below.

- AC Coupled RF Output: 9kHz - 6.8 Ghz Sine Wave (Filtered Square-Wave from ADF4355/ADF4356 or ADF5355/ADF5356)
- Optional 13.6 GHz AC-Coupled Square-Wave Output (if ADF5355 / ADF5356 is fitted)
- Optional DC Coupled Output: DC - 400 MHz Arbitrary Waveform from AD9957 DDS-Chip + 10M04SCE144 (Intel Max10) FPGA and 16bit Databus SDRAM (Sample-Rate for data-stream from FPGA: At least 125 MS/s - Depends on how fast I can get data out of the SDRAM and how fast the FPGA runs - I'll be using the "C8"-Grade. The I7 or A7-Grade may allow for higher speeds. The AD9957 allows up to 250MS/s at its parallel data-port.)
- Output Power: -90 dBm or lower to +10 dBm (up to 3 GHz) / 0 dBm (up to 6.8 GHz)
- Amplitude Control: 1 dB Steps or better
- Spectral Purity: -20 dBc for first Harmonic or better at 0 dBm Output-Power (Previous prototype based on modules yielded -30 dBc and better for most frequencies)
- Modulation of Output-Signal (IF generated by AD9957+FPGA and up-converted by mixing it with the LO from the HF Signal Source)
- Touch-Display + Keyboard Control Interface (Optional)
- USB Control
- PLL to lock Master Clock to external 10 MHz Reference (Master Oscillator: PL500-17 with 20 MHz Crystal)
- 2x 10 MHz Sine-Wave Reference Outputs (Master Oscillator / 2 with 74xxx74-Chip and buffered by PL133-37)
- STM32F407 CPU
- FT230XS for debugging and in case I can't get the virtual COM-Port to work :)

- Price: 350 € or lower in material per Unit (Partially assembled Boards, components, metal for case, step attenuator-module, etc. - Components bought in single quantity, minimum order for boards).

Link for the GitHub: https://github.com/SaabFAN/ORFSG---OpenSourceRFSignalGenerator (https://github.com/SaabFAN/ORFSG---OpenSourceRFSignalGenerator)
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on March 13, 2017, 02:07:25 am
Quick update:
Based on the Suggestions in the "ADF4351 Sinewave"-Thread, this is the current block-diagram for the LPF-Switching. You can also see the Automatic level control in this picture
Title: Re: Open Source HW RF Signal Generator
Post by: dmills on March 13, 2017, 02:44:48 pm
Just a thought, but something like an AD9912 clocking at 1GHz will get you near DC to maybe 400MHz sine in one hit, and the 9912 has a convenient fast comparator to turn the sine wave output into a square wave, it also programs over SPI, and has built in chirp and limited AWG functionality....

Then the square waves harmonics can be selected out with a filter to get the higher bands, maybe gets you to a GHz or so in 3 or 4 sets of BPFs. Don't forget that a wide tuning range VCO (Possibly YIG) can be phase locked to the output of the DDS, getting you DDS tuning at GHz speeds. 

Relatively low noise 1GHz VCXO are available from Crystek, and PLL chips for locking to the 10MHz reference are an AD/TI sort of thing, low pass filters are a minicircuits thing if you don't want to roll your own.

I would note that a programmable 140dB attenuator at microwave will be more challenging from a screening and leakage perspective then you would ever think possible, this one part is going to take much experimentation, I would personally build (Or buy surplus) a 0-60dB attenuators and then stock a few 30dB in line pads to screw onto the front, less annoying that way.

Personally, I would buy a second hand unit from someone like HP/R&S and have done with it, life is too short, but that is because I have interests that use such sources, but am not really interested in designing them.

Regards, Dan.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on March 13, 2017, 10:53:24 pm
The AD9912 is interesting, but I haven't found a module with it yet (I'm not comfortable with spending 50+€ on a Chip that I'm going to have trouble soldering).
There is a module available with the AD9910 though. Worth a look - Would remove the need of LowPass-Filters at lower frequencies (switching to the ADF4351 at 400MHz would remove at least 2 tuneable Filters and leave only fixed filters. The price-tag of 65€ for all the features it has is ok.

It is definitely is something I'm going to add in the future, but for the moment I'd like to keep expenses down to a minimum.
Which is why I'm going to attempt to build the LowPass-Filters myself (except for the 750MHz one, for which I already have the appropriate MiniCircuits-Part).

Using some old used equipment would be ideal, but unless a unit capable of getting as high as 2GHz drops below 250€, I'll try to make the device myself. :)
Title: Re: Open Source HW RF Signal Generator
Post by: nctnico on March 14, 2017, 02:20:52 am
I wouldn't use seperate filters but integrate them on the PCB. You can design the filters using SVC filter designer ( http://www.tonnesoftware.com/svcfilter.html (http://www.tonnesoftware.com/svcfilter.html) ). For up to -say- 800MHz you can built them using surface mounted 0603 parts. Just make sure each capacitor has 1 or more vias to the ground plane to make the filter work. For >800MHz microstripline filters are the way to go. I have created a program which can convert the component values found by SVC filter designer into an (elliptic) microstripline filter (see http://nctdev.nl/page_pg%3d17.htm (http://nctdev.nl/page_pg%3d17.htm) ). PM me if you want me to pitch in a license for this project. Either way you can download it and play with it a little. IIRC there is also a Sonnet Lite EM simulator example project bundled in the installer. Sonnet Lite ( http://www.sonnetsoftware.com/products/lite/ (http://www.sonnetsoftware.com/products/lite/) ) can be used to simulate microstripline structures in general and may be helpful for this project.
Title: Re: Open Source HW RF Signal Generator
Post by: radar_macgyver on March 14, 2017, 04:13:44 am
There is a module available with the AD9910 though.

The AD9910 has an inherent flaw in that the DAC reference voltage is not brought out to an external pin for bypassing. This means that the thermal noise of the bandgap reference shows up as amplitude modulation. The AD9957 also suffers from this issue.

Consider also the RFFC5071A that integrates a multiband VCO, PFD and a pair of mixers. One could mix the synthesizer output with a filtered DDS output to get both fine tuning steps as well as reduced spurious.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on March 15, 2017, 01:11:33 am
I wouldn't use seperate filters but integrate them on the PCB. You can design the filters using SVC filter designer ( http://www.tonnesoftware.com/svcfilter.html (http://www.tonnesoftware.com/svcfilter.html) ). For up to -say- 800MHz you can built them using surface mounted 0603 parts. Just make sure each capacitor has 1 or more vias to the ground plane to make the filter work. For >800MHz microstripline filters are the way to go. I have created a program which can convert the component values found by SVC filter designer into an (elliptic) microstripline filter (see http://nctdev.nl/page_pg%3d17.htm (http://nctdev.nl/page_pg%3d17.htm) ). PM me if you want me to pitch in a license for this project. Either way you can download it and play with it a little. IIRC there is also a Sonnet Lite EM simulator example project bundled in the installer. Sonnet Lite ( http://www.sonnetsoftware.com/products/lite/ (http://www.sonnetsoftware.com/products/lite/) ) can be used to simulate microstripline structures in general and may be helpful for this project.

I already have the programs from Tonne Software (SVC-Filter, Helicall, Elsie) and Sonnet Lite and played with those programs a little to make Filters for the spectrum-analyzer project, but I didn't know about your program. Thanks! It will surely come in handy here! The stripline-filters I have calculated so far were done by hand, using the script of a lecture I found online :)

There is a module available with the AD9910 though.

The AD9910 has an inherent flaw in that the DAC reference voltage is not brought out to an external pin for bypassing. This means that the thermal noise of the bandgap reference shows up as amplitude modulation. The AD9957 also suffers from this issue.

Consider also the RFFC5071A that integrates a multiband VCO, PFD and a pair of mixers. One could mix the synthesizer output with a filtered DDS output to get both fine tuning steps as well as reduced spurious.

Thanks for pointing that out.
Would you say that a simple differential to single ended converter is able to remove this thermal noise from the signal? I have a few GHz-Capable OpAmps here that could be used for that purpose.
Title: Re: Open Source HW RF Signal Generator
Post by: radar_macgyver on March 15, 2017, 03:18:44 am
Thanks for pointing that out.
Would you say that a simple differential to single ended converter is able to remove this thermal noise from the signal? I have a few GHz-Capable OpAmps here that could be used for that purpose.

Nope, the thermal noise amplitude modulates any tone that the DDS will output, so the only way out would be to have the DDS only generate a single tone, and apply a very narrow band filter around that tone. Having said this, the noise level is quite low, and you'd need a fairly decent spectrum analyzer to even measure it.
Title: Re: Open Source HW RF Signal Generator
Post by: dmills on March 15, 2017, 03:33:11 pm
Martin PA3AKE did the definitive work on this, it is an issue (due to reciprocal mixing) if used in the LO of an extreme performance receiver, but general lab sources are just nout usually that quiet.

Me and Martin did experiment with measuring the current flowing thru the centre tap of the output transformer (Which has nose correlated with the am noise) and feeding it back into the reference pin, but had horrific stability issues with that loop, which is unfortunate as close in it did work. It is possible that some more analysis by someone better at control theory could skin this, I will have to have a look to see if I still have the measured transfer function.

It is possible that something feed forward based with a pin doide could work, but we wanted something that did not require trimming.   

73 Dan.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on March 15, 2017, 07:40:05 pm
The Article PA3AKE wrote about the AD9910 (it is this one, right?: https://martein.home.xs4all.nl/pa3ake/hmode/dds_ad9910_amnoise.html (https://martein.home.xs4all.nl/pa3ake/hmode/dds_ad9910_amnoise.html)) was interesting to read, but I'm not aiming that high in terms of performance, so a little AM-noise is no problem for me at the moment.

At the moment I'm redesigning the RF-Module, where the signals from the different modules are being combined, in Circuit Maker to incorporate the suggestions you guys made.
Would you say that the board needs to have ENIG-Finish if I put the Microstrip-Filters on it, or is HASL enough?
Title: Re: Open Source HW RF Signal Generator
Post by: nctnico on March 15, 2017, 09:25:46 pm
If you keep the filters under a layer of solder mask ENIG or HASL doesn't matter. BTW you can simulate the solder mask as well in Sonnet but I doubt it will have a noticable effect. The errors due to differences in the trace widths due to etching tolerances will be much bigger.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on March 24, 2017, 05:53:45 pm
Small Update (had to do University-Stuff this week):

I'm going to use the AD9910-Module from ebay as the Signal-Source up to 400MHz. Tests will reveal how the second harmonic behaves and if it can be used. Otherwise I'll have to use the AD4351 from 400MHz instead of 800 and need to include one additional filter.

Also I'm ditching the self-made Attenuator, because there's a bunch available on ebay that cover DC to 2.4GHz and 0 to 95dB and are 5V TTL-Compatible. They sell for about 35€ plus 5€ shipping. I doubt my attempt to build one will provide the same performance and it'll probably cost about the same (components and Board-Space).

Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on April 02, 2017, 09:54:37 pm
Apparently, someone had the same idea I had (sort of): http://www.darc-husum.de/Frequenzsynthesizer.html (http://www.darc-husum.de/Frequenzsynthesizer.html)
The website is in german, so short summary: It details a signal-generator that uses the ADF4351 as the frequency-generator and an Arduino Nano as the control-processor.
More or less what my project is about, but with fewer features.

Btw. It seems like the prices for these attenuators on ebay have jumped a bit since I mentioned them here - Coincidence? :D
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on April 05, 2017, 07:56:56 pm
While reading about how to filter the signal from the ADF4351 I came across a circuit that involves a differential pair to smooth a triangle wave.

Does anyone here have some experience with that kind of circuit, or is it completely out of it's comfort zone at GHz-Frequencies? I found some NPN-Arrays with Ft of 10Ghz for 65 cents on Digikey (BFU520YX), which might be able to work in this application from a first glance-standpoint.


In the area of the software, I have started to write the code for the device. I'm targeting the ESP8266 as the processor and the NodeMCU V3 as the breakout-board.
The reasons for that: It offers USB, 3.3V outputs (no need for voltage-dividers or level-shifters on the SPI-Lines), has much more processing-power than an Arduino (useful to use the modulation-capabilities of the AD9910) and on top of that it has a WLAN-Transceiver - Everything is better with WiFi :D

As far as the RF-Board is concerned, I've started to do a preliminary layout to see where everything could go. And I've decided to kick everything off the board except local power-supplies and the RF-Path. All the control-logic will be placed on Veroboard and connected to the RF-Board via ribbon-cable or board-to-board interconnects. This should make it possible to make a really small RF-Board and make 4 Layer-Construction possible without spending too much money :)
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on April 07, 2017, 09:30:28 pm
Today I managed to get the ADF4351 module working.
It needs about 140mA of current, which was too much for the small voltage-regulator on the NodeMCU V3-Board, but once that problem was solved, I captured several screens of my spectrum analyzer.

I also realized that I don't need a 4-Way switch for the LPFs:
Once the frequency exceeds 1.5 GHz it is outside my zone of interest and any signal-component higher than 3 GHz is going to be attenuated by the output-amplifier anyway.
Also the first harmonic of a 400MHz-Signal is already pretty weak, so I might even be able to use the PLP750+ in the 400 to 800 MHz-Band to achieve the desired suppression of harmonics. I will test that tomorrow.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on April 10, 2017, 10:55:07 pm
Today the AD9910-Module arrived. It comes on a nice board with spacers and screws, as well as SMA-Connectors populated.

I haven't played around with the module yet, but a complete read of the datasheet showed me that this chip is POWERFUL! With some tricks, as mentioned here before, it is even capable of doing Arbitrary Waveforms with 1k-Points. Nice!
I've also decided to connect the module at a point in the signal-chain where its signal isn't processed by the PIN-Attenuator and use the internal capabilities for amplitude control.

Now the only thing left is the attenuator, which I managed to get on ebay for a modest price. :)
Once it is here, I'll start building the signal-gen with the control-board. I'm still planning to use the ESP8266, but I'm getting a lot of compiler-errors when I try to use the GFX-Library from Adafruit. With arduino or teensy-boards, there's no problem. I guess this is because the library has been optimized by Adafruit to give better performance.

I also haven't been able to find a library for the AD9910, so I'll have to do the subroutines to program the chip myself. Inconvenient, but using only libaries and very little original code feels a bit like cheating :D

I'm also still investigating the idea of using a slightly overdriven long tailed pair as a sine-shaper. Googling this led me to some patents, the most recent one was from 2004, granted to Philips, who were using that technique in their PM5193 0.1mHz - 50 MHz Synthesizer back in the 80s and 90s.
They used a transistor-array chip with 3 of the 5 transistors employed as a heater/temperature-control circuit and 2 as the active components in a long tailed pair. The temperature-control was used to heat the chip to 80 - 85°C to keep the operating-point of the transistors constant to smoothly clip only the tops of a triangle wave (and judging by the spectrum I saw from the ADF4351, it is putting out a triangle-wave), which was adjusted with a pot to give the best THD.
Title: Re: Open Source HW RF Signal Generator
Post by: Pitrsek on April 11, 2017, 11:56:41 am
Hello,
seems like a nice project!
Would you consider extending LF range? Might be usefull if used as a part of VNA/SA.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on April 11, 2017, 05:10:00 pm
Lower frequencies are possible. I wouldn't go too low though, because the DC-Block caps need to get bigger and bigger to pass the signal, which decreases their performance at high frequencies.
The best way would probably be a relay-switched secondary signal path that covers audio-frequencies up to a few MHz. The AD9910 is certainly capable of generating these signals.


By the way, today the Attenuator arrived, which means that I now have all the big modules available to start building the device.
Unfortunately, I cannot find any datasheet for the Attenuator and from what is shown on the device, it isn't clear how to connect it.
I suspect "G" stands for Ground and VC for Vcc, but what does VE and LE mean in that context? LE might be something like "Latch" or "Load", if this Attenuator is supposed to be connected to a bus.
Is there some kind of standard for these things? Or does anyone have seen these Attenuators before?
Title: Re: Open Source HW RF Signal Generator
Post by: Pitrsek on April 11, 2017, 06:05:14 pm
My guess:
LE - latch enable
VC,VE - bipolar power supply

But I think you should take it apart, you know, just to make sure  :popcorn:
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on April 11, 2017, 08:57:19 pm
Okay, I have disassembled the Attenuator.
It contains a Philips Semiconductor (so it is a bit older^^) 74HCT563 Octal Non-Inverting Latch, and 2 MaCom AT90-1106 50dB Attenuators.
VE isn't connected to anything, only VC. LE is Latch Enable, which is Active HIGH.

So pretty straight forward: +5V to VC, TTL-Level to the other pins, GND to G.

Datasheets:
74HCT563: http://pdf.datasheetcatalog.com/datasheet/SGSThomsonMicroelectronics/mXsqssx.pdf (http://pdf.datasheetcatalog.com/datasheet/SGSThomsonMicroelectronics/mXsqssx.pdf)
MaCom AT90-1106: http://pdf.datasheetcatalog.com/datasheet/macom/AT90-1106-TB.pdf (http://pdf.datasheetcatalog.com/datasheet/macom/AT90-1106-TB.pdf)
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on September 02, 2017, 01:25:23 am
I've finally found some time to work on this project again.

Unfortunately, there's still no library available for the AD9910, so I had to write my own code to control that beast.
I've tried to write it in a way that it is easy to read, so there's probably A LOT of room to improve speed or memory-use (see attached file).

I've exposed every bit of the 3 Config-Registers as global variables (I haven't looked into how to write a proper Library yet) and included a function to calculate the CFR-Registers, as well as the frequency tuning word.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on September 03, 2017, 04:33:42 am
I used the time today to finish (well, almost - First Version :) ) of the analog board.

I have opted for only 3 filters, of which one is always active: The 3GHz LPF. A 1.5GHz and a 750MHz LPF can be selected.

To have all the functions regarding modulation and stuff from the AD9910 available, this module is being connected directly to the output-amplifier via a RF-Switch and can be selected.

Attached are quick screenshots of the board and the schematic. Tomorrow I'll upload better ones :)
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on September 03, 2017, 04:36:45 pm
As promised, here are the better screenshots.

I've redesigned the board to make it a bit more compact and used a 4-Layer board this time. MUCH EASIER than trying to route everything on 2-Layer.
Unfortunately, I had to use 4mil traces in the microstrip-filters, which means I have to use EasyEDA or any other board manufacturer that is capable to go below 6mil and has a 4Layer-Stackup with 0.18mm thick dielectric between Layer 1 and the GND-Plane on Layer 2.

Obviously, I haven't added any ground-vias yet. That will be the last step, as I haven't found a function in Circuit Maker yet that does this automatically. I'm also going to include some soldermask-cutouts to solder shields to the board.

Is this a good layout for signals up to 3GHz?
Btw. I'm pretty confident in the schematic, but before I spend 50€ on some board, could you guys check if I have made some mistake that would render the boards useless? :)
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on September 05, 2017, 07:09:14 pm
Well, damn! EasyEDA does say that they support 3,5mil, but actually using structures smaller than 6mil causes cost to go up. Quite significantly.
So I'm back to using 6mil as the smallest structure.

Also an inquiry at EasyEDA about the dielectric constant didn't yield conclusive details. They told me they use 7628 for 4-Layer boards and 2116 for the 6-Layer ones. Their Core-Material has 4.2, according to the datasheet they provide.
The question now: Is the dielectric constant dependent on the type of Prepreg, or the type of Resin? If the latter is the case, it should be the same for all layers.
Also if the latter is the case, how can I measure Dk with boards I already have here? Or should I just assume the rule-of-thumb value for FR-4, which is about 4.35, according to Wikipedia.
Title: Re: Open Source HW RF Signal Generator
Post by: pigrew on September 05, 2017, 09:34:34 pm
The dielectric constant is a function of not only the resin, prepreg, but also of frequency, solder mask, humidity, everything.... For less than 1 GHz, just guess it is around 4.2.

 You also should think about the loss of the material (also versus frequency).

You'd want to to use a network analyzer to measure a thru line on the board (usually as part of a coupon). Best case would be multiple thru lines of different lengths.
Title: Re: Open Source HW RF Signal Generator
Post by: chrisl on September 06, 2017, 08:34:39 am
A couple of quick comments:

Looks like all the RF switches  have DC block caps at the GND pin (2).  You want to ground this pin directly to the board GND.

Do not expect that the fab house can control and hold the tight tolerance on the DK and 4 mil trace width - especially the low coast PCB houses.
Simulate your filter design to make sure that your design can tolerate +/- 10 to 20% of variation.
It would be much easier and cleaner to use SMT filters at 1.5 and 3 GHz.

Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on September 08, 2017, 04:23:18 pm
A couple of quick comments:

Looks like all the RF switches  have DC block caps at the GND pin (2).  You want to ground this pin directly to the board GND.

Do not expect that the fab house can control and hold the tight tolerance on the DK and 4 mil trace width - especially the low coast PCB houses.
Simulate your filter design to make sure that your design can tolerate +/- 10 to 20% of variation.
It would be much easier and cleaner to use SMT filters at 1.5 and 3 GHz.

Yes, they do have DC Blocks at the GND-Pin. The reason behind this: I've used some attenuators from MaCom in a previous design that required exactly that: DC Blocks at the GND-Pin if driven by only positive voltages.
To avoid having to respin the board if that's the case with these switches too, I've but the DC Blocks in there. If they work without those caps, I'll replace them with 0Ohm Resistors or solder-blobs.

I'm currently using 6mil traces, as that's the smallest ShenZhen2U or EasyEDA can manufacture without massive cost increase.
SMT-Filter available from digikey unfortunately don't really have the features I require. There are filters available that could replace the 3GHz Filter, but a Filter for 1.5GHz isn't really available.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on September 10, 2017, 12:23:14 am
I've just finished the controller-board. I don't have a block-diagram yet, but it is pretty straight forward:
A NodeMCU-Board with an ESP-12E contains the micro, as well as the 3.3V-Converter and the USB-Connection.
Attached to that are 3 PCF8574. One for the Keyboard (Address 0x21), One for the ChipSelect-Signals for the ADF4351 and AD9910, as well as two Interrupt-Inputs - one for the Keyboard, one for the Touch-Controller (Address 0x22), and One PCF8574 for the Attenuator-Control (Address 0x20).
Because the Attenuator requires 5V TTL-Levels, I've added what I had in my parts-drawers to do the level shifting: 74HCT14 and a 74LS00 (Both have a Positive Threshold of about 2V).
To use the TouchScreen, I've installed the STMPE610 Module from Adafruit and the Display is the 3.5inch 480x320 TouchScreen-Display-Module from Adafruit.

The MCU-Board is socketed by the way, because I had problems uploading a new Firmware when I had it soldered in. Really strange - GPIO-Pins 0 and 2 were showing a 0.5Vpp oscillation at about 2V DC-Offset when the Reset came and the bootloader was supposed to start and accept a new Upload.
Did anyone of you guys had similar problems with that board? Or do you have an idea what could have caused this behavior? Installing a socket made with female 2.54mm headers and plugging the MCU-Board into that solved the problem...
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on September 22, 2017, 12:22:41 am
I've measured the Attenuator. Looks like it is rather flat across the frequency-band I'm interested in.

To measure it, I used one of those noise-sources from ebay that get ridiculously hot after a few minutes :)

The B-Trace is just the noise-source connected via a 1m RG316-Cable with SMA-Connectors.
The A-Trace has the Attenuator inserted. It is powered with +5V and no attenuation is selected. The loss at no attenuation is about 10dB.

Input-Power is planned to be about +15dBm, which results in output-power of +5dBm that can be attenuated down to -90dBm.
With the help of the PIN-Attenuator the dynamic range is about +5dBm to -100dBm.
And when I use the AD9910, the amplitude scale factor-setting should allow for even weaker signals, as well as much finer control :)
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on September 22, 2017, 04:16:08 pm
Updated RF-Detectors for the RF_LEVEL_SENSE and RF_OUT_SENSE-Signals.

RF_OUT_SENSE is used during calibration to fill the lookup-table with the right correction-factors. RF_LEVEL_SENSE provides the feedback-signal for the AGC.

I've also decided to use Microstrip-Traces instead of CPW, after reading through a PDF by Rogers that showed Microstrip to be less sensitive to changes in the dielectric constant of the material.
Manufacturing will take place at EasyEDA, as the 0.012mm thickness of the dielectric between first and second layer is too small to build the filters.

I'm not entirely sure, but I think the board is done now. Unless there's something wrong that I missed :)

Edit: Forgot one thing: The Soldermask-Cutouts to solder RF-Shields.

Edit 2: I just realized that I made a mistake, calculating the DC-Voltages. They don't go higher but lower once a signal is present at the input of the detector. So I don't need the bias-circuit on the RF_LEVEL_SENSE-Detector.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on September 23, 2017, 07:51:44 pm
I've changed the Supply-Voltage to 3.3V on the RF-Board, which allows me to work without any level shifters on the i2c-Bus. Doing that also meant I had to add some gain to the Output of the DAC that generates the AGC_BIAS. How much gain I need will be determined during testing.

On the PCB I've added pads to solder some kind of shield-can to. I've also moved the components around a bit to improve the layout and cleaned up the mess of the designators, which were sitting all over the place.

Attached you'll find the current gerbers and the schematics for the board.

This is the memory-map of the i2c-NVRAM-Chip on the RF-Board btw.:
 *  Memory-Map:
 *  0x000 - 0x0F0 = CAL-DATA: 12bit DAC-Calibration Data for PWR_SET-DAC is stored for every 25MHz-Step Starting at 0MHz and going up to 3GHz (120 16bit-Words)
 *  0x0F2 - 0x1E2 = CAL-DATA: 12bit DAC-Calibration Data for AGC_ATTEN_BIAS is stored for every 25MHz-Step Starting at 0MHz and going up to 3GHz (120 16bit Words)
 *  0x400 - 0x5FE = User-Config / User-Data
 *  0x600 - 0x7FE = Sweep-Settings
Title: Re: Open Source HW RF Signal Generator
Post by: ogden on October 02, 2017, 04:52:36 pm
Filter banks, unless very narrowband, will not help against square wave harmonics. I would go "traditional RF synth gen" way: downmixing. For example check Agilent E4400 service guide, E4400-90335.pdf and you will see what I mean. Instead of filter banks you need one 2.4GHz(?) CW source (like CC2500 in CW mode), 4.4GHz - capable mixer and 1GHz(?) low pass filter. Then you either use direct output from ADF4351 in 1GHz-4.4Ghz range or downmixed and filtered signal. Benefit of using 2.4GHz mixed with 2.4-4.4GHz of ADF4351 is: it is range of its VCO w/o divider.

Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on October 08, 2017, 10:47:23 pm
Thanks for the advice, but I've already ordered the boards and am now comitted to this path  :)

For frequencies up to 400MHz, I'll use the DDS-Module anyway, so not that big of a problem there.
I'll have to see how strong the harmonics are after filtering. If they are too strong, I can always put something between the Synthesizer-Board and the Filter-Board.  ;)
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on November 25, 2017, 11:33:57 am
The boards are here and I've installed all the IC except for the quad PIN-Diodes at the input and the OpAmp for the AGC.
Partially because I don't have the PIN-Diodes and I'm too lazy to dive into my parts-bin to search for the OpAmps :D

I've also noticed that I managed to build the footprint for the MiniCircuits 750 MHz LPF backwards, so I have to solder that one in from the backside of the board. Luckily I have enough space inside the case :)

The PIN-Diodes in question are BAP64Q. Unfortunately these Diodes aren't available on ebay for a decent price and Conrad lists them with a delivery-time of 2 weeks.  :--
Anyone here who's living in Hamburg, Germany and happen to have these diodes on hand?  ;D
Title: Re: Open Source HW RF Signal Generator
Post by: ogden on November 25, 2017, 10:24:50 pm
The PIN-Diodes in question are BAP64Q. Unfortunately these Diodes aren't available on ebay for a decent price and Conrad lists them with a delivery-time of 2 weeks.  :--
Anyone here who's living in Hamburg, Germany and happen to have these diodes on hand?  ;D

Farnell does :)
http://de.farnell.com/nxp/bap64q-125/pin-diode-100v-0-1a-sot-753/dp/2775914 (http://de.farnell.com/nxp/bap64q-125/pin-diode-100v-0-1a-sot-753/dp/2775914)
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on November 25, 2017, 11:47:48 pm
Indeed, but two BAR15 also fit the footprint and should work. :)

Next problem I stumbled across: I didn't have the MCP4725 DACs, only MCP4526. Difference: 4725 has A0-Pin on Pin 6, 4726 has a VREF-Input there.
As I only need one DAC (the bias voltage for the PIN-Attenuator can be set once and left there), I've just installed the 4726 to provide PowerSet and Bias-Voltage will for now be 3.3V (should be enough for +5dBm signal) and should shunt all RF-Energy to ground unless the AGC-Circuit sends a higher current through the pass-diodes.

Also the only 3.3V regulator I had available was an 1117-3.3 while the board requires a 78L33. Fortunately, there's enough room on the board to fit the 1117 on a small adapter board.

Next step is to test the board and install everything in the case.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on December 30, 2017, 11:08:45 pm
I didn't have much time the last few weeks, so there wasn't much progress.

I still haven't had the time to test the analog frontend-board, but I've used today to start building the UI.
I've also copied the serial-communication functions from my Game-Controller to the Signal-Generator. They only need minor adjustments to be used with the SignalGen. I'll post the possible commands here as soon as I have them implemented, in case someone wants to build the device too and use a PC-App to control it.

For the look of the UI, I took inspiration from the LW400-Series of LeCroy Signal Generators.
What you see in the attached picture is the Mode_Select_1-Screen, where the different Modes can be selected (Frequency-Set, Amplitude, Set, etc.).
Getting to the Mode to change Frequency, Amplitude or Modulation is also possible by tapping the corresponding area on the Screen instead of the Touch-Button - Once I've implemented the Touch-Functions :)
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on January 03, 2018, 07:43:02 pm
Attached is the current version of the Program - Haven't found the time to upload it to Github yet :)

Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on January 24, 2018, 12:42:34 am
Github-Repository is up: https://github.com/SaabFAN/OpenSource-HW-RF-Signal-Generator-OSHW-RFSG- (https://github.com/SaabFAN/OpenSource-HW-RF-Signal-Generator-OSHW-RFSG-)
I'll add content as soon as I'm able to do so. Bachelor-Thesis is eating up time like crazy :)
Title: Re: Open Source HW RF Signal Generator
Post by: rhb on January 24, 2018, 01:30:52 am
Please excuse my just dropping in, but I very much agree with this remark:

Filter banks, unless very narrowband, will not help against square wave harmonics. I would go "traditional RF synth gen" way: downmixing. For example check Agilent E4400 service guide, E4400-90335.pdf and you will see what I mean. Instead of filter banks you need one 2.4GHz(?) CW source (like CC2500 in CW mode), 4.4GHz - capable mixer and 1GHz(?) low pass filter. Then you either use direct output from ADF4351 in 1GHz-4.4Ghz range or downmixed and filtered signal. Benefit of using 2.4GHz mixed with 2.4-4.4GHz of ADF4351 is: it is range of its VCO w/o divider.


A pair of ADF4351s with a mixer and low pass filters should cover 0-2GHz quite nicely.  The PCB layout will be the hard part. By using two ADF4351s you can map and avoid spurs.  For precision measurements where time is not an issue, you  can dither the frequencies of the ADF4351s so that the  spur average is lower.  Of course, one can use the full range of the ADF4351, but that makes the filtering more difficult. 

If you BP filter the 3rd harmonics from both ADF4351s you can get 0-6 GHz.

If you want the frequency agility of the AD9851 it gets a good bit harder.
Title: Re: Open Source HW RF Signal Generator
Post by: b_force on January 24, 2018, 09:28:50 pm
Lower frequencies are possible. I wouldn't go too low though, because the DC-Block caps need to get bigger and bigger to pass the signal, which decreases their performance at high frequencies.
The best way would probably be a relay-switched secondary signal path that covers audio-frequencies up to a few MHz. The AD9910 is certainly capable of generating these signals.
Can't you better go for a differential output?
With a differential to single ended output you don't need caps anymore.
Another way is to shift the whole down to 0 DC bias, with like a DC servo.
That's also a way to get rid of those nasty caps.
Title: Re: Open Source HW RF Signal Generator
Post by: Navarro on January 31, 2018, 03:51:12 am
A good attenuator that could be used is the PE4312.

I used it on some projects and really liked it.

73 PY1CX
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on February 03, 2018, 05:52:12 pm
A good attenuator that could be used is the PE4312.

I used it on some projects and really liked it.

73 PY1CX

Indeed.
I investigated that chip, but didn't really want to use it, because of the QFN-Package.
Luckily someone sold a bunch of Attenuators in really nice cases on ebay, of which I managed to get one (did a teardown a few posts before).
These PE4312, or similar chips, pop up on ebay quite often in ready made attenuators. Sometimes even with a control-panel and a micro to set the desired attenuation.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on April 05, 2018, 03:00:26 pm
Just a quick announcement, Bachelor-Thesis has been submitted and presentation is also done. Now I finally have the time to get back to work on this project :)

Title: Re: Open Source HW RF Signal Generator
Post by: Navarro on April 25, 2018, 05:52:13 am
There is a old trick to solder QFN easily in prototypes if it's only a GND pack underneath.

Make a bigger hole in the GND pad (3~4mm).
Align and solder the QFN in the soldering iron in two corners.
Flip the board and solder the GND pad with a soldering iron placing solder in the hole.
Flip back again and solder the other pads.

You can also do it easier if you make the pad a little bit longer.

Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on May 01, 2018, 07:02:35 pm
Okay, now that I have all the components together, I've tried to assemble the whole thing.
Turns out, the mess of cables is even messier than anticipated.
And the AD9910-Module unfortunately needs a lot more pins connected than just the SPI and IO-Update...

The mess of cables isn't pretty and I'm not happy with it, so I decided to create a new mainboard. :)

Because the current version is based on a ESP8266, which has way too few pins, and I've used the STM32F103 for my Bachelor-Project, I've decided to base the board on that chip.

I'm also putting a pin-header on the board with which a Orange Pi Zero can be connected (as suggested by user DC1MC). This allows upgrading the processor even further.

On the software-side, I haven't done any work, but user Bastler-XX has managed to get the AD9910 to work. My code wasn't working (missed the part in the datasheet that specifies CW-Mode only works in a specific profile and that particular profile-register has to be written to, if I remember correctly).
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on May 03, 2018, 01:41:11 am
Finished the Mainboard-Design (Rev. A):
- STM32F103 as CPU
- AtTiny861 as Input-Controller (Keyboard and resistive Touch - using internal oscillator)
- PCF8574 with two 74HC14 for Attenuator-Control
- PCF8574 to generate and read slow signals
- Fast signals (ADF4351 and AD9910 control-Lines) directly connected to CPU
- USB-Connector (CPU can talk to PC and be controlled by it + Uploading of Firmware)
- Battery to keep the RTC running and store some settings.
- CAL-Data and NVRAM are on the analog board (connected via i2c)
- OrangePi Zero-Connector (26 pin parallel cable required if used in 19 inch card cage)
- Local Switching Buck Converter for digital 3,3V-Supply
- Power-Filtering for the Attenuator (0805 Ferrite or inductor and 47µF Cap)
- Linear Regulator for ADF4351-Supply (3,3V)
- Dimensions: 10 x 10 cm
- i2c and SPI-Connectors (Chip-Select Signals need to be generated by external GPIO-Expander - Board is too crowded for another connector - Or solder cables to the 4 free pins of the CPU  ;) )
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on June 29, 2018, 11:55:26 pm
Update on the device:

Everything is now inside the case and so far the hardware seems to work.
There were some issues with signal integrity on the SPI-Bus, which I had to solve by connecting the data and CLK-Lines to GND via 22pF caps (the entire thing worked when I measured it with Scope-Probes, but ceased to work once I took the probe away - Active probe from Transverter-Store is ordered, but still on its way).
Also the Attiny is sort of connected wrong: The Libraries for i2c I could find use different pins (the Chip has two pairs for SDA and SCL connected to the USI).  ::)
So I reverted back to the original solution: PCF8574 for the keyboard and STMPE620 for the Touch.

I also designed a board that distributes a 20 MHz Ref-Clock for the Signal Sources and contains a MAX 10 FPGA + SDRAM, as well as i2c-distribution. The FPGA is intended as a advanced controller for the AD9910 and can communicate with the chip via SPI, as well as the parallel interface.
The 20MHz REF-CLK is controlled by a PLL, so locking to an external 10 MHz Reference is possible. In addition to that, 2 Outputs for the 10 MHz-Reference-Input are also fitted on the board.
Of this second board I have so far verified the PLL and that the FPGA is connected to the JTAG-Connector correctly.

Which brings me to the current status of the project:
- Verification of Communication between boards: DONE with the exception of the AD9910-Board
- Signal Generation with ADF4351: DONE
- Signal Generation with AD9910: DRIVER AVAILABLE, NOT IMPLEMENTED YET
- Control of Step Attenuator: DONE
- Amplitude-Control: MANUAL CONTROL OF STEP-ATTENUATOR
- SignalPath-Switching: TESTPROGRAM IMPLEMENTED
- AGC: NOT TESTED, DAC-CONTROL WORKING
- TOUCH: WORKING, NEEDS IMPROVEMENT
- KEYPAD: DONE
- UI: FRAMEWORK READY, IMPLEMENTATION OF FEATURES STARTED

What makes the testing a bit difficult is how the boards are arranged inside the case. Reaching test-points and measuring something is basically impossible. Also I'm still waiting for the SMA-Connector that will be put on the front-panel. It might also be necessary to put a PA somewhere in the signalchain, as it seems that the output power, especially above 2 Ghz, is dropping significantly.
A much better way to arrange the boards would be to put them side by side on a piece of wood, Copper clad Board, or a 3D-Printed Board-Holder.

Btw. At the moment I have 7 boards of each module (CPU-Board, REF-CLK + FPGA-Board, Analog Board with Filters). If someone wants these boards, please PM me. :)
I've also populated the Github-Repository now. So if anyone would like to contribute to the software, please do so :)
Title: Re: Open Source HW RF Signal Generator
Post by: pigrew on June 30, 2018, 12:10:53 am
Maybe I'm missing something, but it looks like Kspi adds 2.2k to each of the SPI lines? I'd expect these values to be closer to 22 ohms.

(I'm looking at the schematic PDF on github)
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on June 30, 2018, 12:38:54 am
Oops :D

Yes, I forgot to change the value.
Currently I'm using 100 Ohms for Rspi.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on July 01, 2018, 08:17:00 pm
Some Measurements of the Filters on the analog Board I took with the noise-source and the ADF4351 as Inputs.

I have also made a Video of a Frequency-Sweep:
https://youtu.be/RAp4lgueNvI (https://youtu.be/RAp4lgueNvI)

AGC is Set to max Output (Control-Voltage: 5,96V)
LPF-Select is set to Auto.

There are some curious effects at some frequencies. Suddenly signals appear that are lower than the set fundamental frequency.

The last picture attached here shows a frequency-sweep from 500 MHz to 2.490 GHz measured directly at the output of the ADF4351.
Title: Re: Open Source HW RF Signal Generator
Post by: RoadRunner on July 18, 2018, 07:40:44 am
i have also made my self a crude Signal source based on AD4351. this seems be really nice candidate but goes only down to 35Mhz. it is an USB based hardware with PC application running in QT 5. i am using raw hid packages to transmit register information from. with HID raw you can send new regsiter configuration at 1ms interval.

At the lower frequency from 35 to 500Mhz i have seen signal is not very clean,  there are lot of harmonics . i am not a rf person may be because of high signal output level.

https://www.circuitvalley.com/2018/07/diy-4ghz-rf-signal-generator-adf4351-usb-qt5-linux-3Ghz.html (https://www.circuitvalley.com/2018/07/diy-4ghz-rf-signal-generator-adf4351-usb-qt5-linux-3Ghz.html)
i also posted a crude qulity youtube video showing sweep and hop
https://www.youtube.com/watch?v=M01K2i2qbhI (https://www.youtube.com/watch?v=M01K2i2qbhI)
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on July 23, 2018, 11:36:49 pm
That's an interesting device. Especially the software controlling it via USB seems handy. I haven't done anything with HID so far, but I really should look into it - Can you point me to some easy to use references?

The spectral purity of the ADF4351 isn't great because it puts out square waves. The VCOs inside the chip start at about 2.2 Ghz and frequencies lower than that are generated by dividing the VCO-Output with digital dividers.
That's why I added filters to the signal chain. Thx again to user nctnico for the software to design the microstrip structures.

I found something interesting though - the subharmonic signals visible around 1.2 GHz in the video are caused by the first LC-element of the 3Ghz LPF on the analog board.
If I put my finger on the trace, the subharmonic signal vanishes - see attached picture.
The Signal from the ADF4351 doesn't have any subharmonic signal content.

I'm now wondering how I can modify the filter accordingly to achieve the same result that placing my finger on it has and what's more at play here: Capacitance or resistance? According to my Fluke 87, placing my finger on the trace increases capacitance of the entire filter-structure by ca. 80nF and brings the resistance to about 1 MOhm. But that's measured at sub kHz frequencies obviously.


On the software-side I'm making slow progress. The ADF4351-Driver works now, as well as the drivers for the analog board and the attenuator. I want to include some more features in the setup-menu to make it compatible with builds that use different hardware, but that's secondary.
Next step is to get the AD9910-Driver working.
By the way: Does anyone know of a UI-Designer for Arduinos using the GFX-Library by Adafruit? Coding the UI by hand is quite tedious :)
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on July 24, 2018, 10:25:25 pm
The problem with the subharmonic signals could be resolved together with forum user bastler-xx. It turns out that the output of the ADF4351-Module that has no resistor can't be used. The signal power is higher at that output, but signals can bounce back and forth. My theory is that the PIN-Attenuator reflects a significant portion of the signal , which then bounces back and forth at 1.2 GHz (the Coax cable is about 7 cm long, so wavelength / 4 @ 1,2 Ghz isn't too far away).

Now that that's solved, I installed a preamp for the ADF4351-Module to have more room to play with the PIN-Attenuator. The frequency response from 500 MHz to 2 GHz is reasonably flat, but lower and higher and signal-strength drops quite drastically and there seems to be a limit that the output-amp can't pass. It's within my original design-goal: "- -120 to +13dBm digital Amplitude control (This does not need to be flat all the way up to 3GHz, I'd be ok with some amplitude-drop above 2GHz)", but it remains a bit of an eyesore :)
I'm guessing this is in part caused by the fact that i used two double PIN-Diodes instead of a BAT64Q quad diode in the PIN-Attenuator (I've got the diodes here now, but it's too warm to fire up the hot air station :) ), as well as losses in the FR4-Board, limited precision in the etching of the filters and maybe also probably a limited frequency response of the detectors that give the OpAmp of the PIN-Attenuator feedback on the signal-strength.

Attached are two measurements with my SA:
- The Output of the PreAmp I bought on ebay, with the ADF4351 directly connected - I'm suprised by the frequency response of the thing. And wondering what type of IC is in there. - This is the Amplifier btw.: https://www.ebay.de/itm/5-6000MHz-Gain-20dB-Broadband-RF-VHF-UHF-Signal-Power-Amplifier-Verst (https://www.ebay.de/itm/5-6000MHz-Gain-20dB-Broadband-RF-VHF-UHF-Signal-Power-Amplifier-Verst)ärker-Modul/362185905078?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2060353.m2749.l2649
- The Output of the whole signal-chain. As you can see, as soon as I start increasing the Bias-Voltage of the PIN-Attenuator, the amplitude below 500 MHz starts to drop, but I can get a reasonably flat (+/- 2dB) frequency response up to about 2 GHz. After that there's a sharp drop.
Title: Re: Open Source HW RF Signal Generator
Post by: edigi on July 30, 2018, 08:32:24 am
I plan to create a similar signal generator using ADF4351 what is discussed here. I've checked the data sheet and it describes the logic compatibility of the chip as 1.8 V. I couldn't find any information if it's 3.3 V tolerant. So far I've used a board that has 1K resistors serial with each controlling pin (CLK, DATA and LE; board is from banggood) and resistor dividers from the controlling board (Arduino nano). However I'd like to switch to ESP32 (that uses 3.3 logic) and avoid the resistor divider to shift logic level (and I have also a card that does not have any resistors between the controlling pin and the headers so the risk is also higher there).

Does anyone have a good source of information if the ADF VCO+PLL family is 3.3V tolerant? Is there any forum where I could ask this and get reliable information?

For this minimalist hobby project I'd like to avoid any extra board, I'd simply just wire the controlling board, the ADFs (2 for mixing) the OLED display and the rotary encoders.

Thank you in advance for any suggestions.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on July 30, 2018, 11:04:48 pm
The chips are 3.3 V chips. They are powered by 3.3 V and can receive data at 3.3V-Levels.
You can use 1.8 V, to send data to the chip, but anything up to VCC + 0.3 V is okay.

I am using about 75 Ohm in series as terminators on the SPI-Bus.
1K will limit the communication-speed, as the edges aren't fast enough an logic levels might not be stable long enough for the chip to recognize the data correctly.
Title: Re: Open Source HW RF Signal Generator
Post by: edigi on August 01, 2018, 10:36:27 am
That sounds reasonable.
Actually I've connected the ESP32 directly with the ADF4351 board yesterday and LD LED was showing lock and frequency meter could measure the output signal of ADF4351.
I've used only 1 MHz CLK so maybe the 1K resistor is till OK there (I guess the board vendor opted for this dumb proof protection), it could be an issue for higher clock though.
Checking with DSO the clock was already not so nice and pretty.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on September 30, 2018, 11:11:30 pm
Some progress has been made and so far several flaws of the analog board have been identified (Fixed in Revision C):
- Reflections from the first Filter cause problems at higher frequencies (3dB Attenuator added)
- Input-Side of PIN-Attenuator has DC-Voltage on it, but no DC-Block (DC-Block between PIN-Attenuator and 3dB-Attenuator added)
- Frequency-Response of the whole signal-chain varies too much. Especially the final Amplifier is a problem here (redesigned signal-chain between filters and output - See below)
- Manufacturing-Process required rather long traces to build inductors (changed manufacturer to JLCPCB to make use of their 4.5mil minimum trace-width on 4-Layer Boards - Changed first filter from 5th order to 7th order Cauer Low Pass-Filter)
- 750 MHz Lowpass-Filter Module from Minicircuits had mirrored Footprint  |O (Mirrored Footprint :) )
- Power-Detectors have terrible frequency response (replaced resistive taps with resistive dividers and replaced diode-detectors with LTC5505)
- Output-Power too low (Added BGA2866 and SBB5089 Amplifiers to the signal-chain after the filters, plus Attenuators to dampen reflections and prevent saturation of amplifiers - Output-Power of signal-chain should be about +13 dBm)
- ADC-Inputs were left floating, which threw off the readings (Added Pin-Headers for the unused ADC-Inputs to ground them or use them to measure voltages)
- Only one Aux-Input, which requires external switching-board to select between a modulated signal or the Signal from the AD9910 (Added a dedicated Input for the AD9910 with amplifier to get Output-Power close to +13dBm - Fine-Adjustment of amplitude will be done in software with the AD9910, no Hardware-ALC for signals from AD9910)
- 5V Regulator reaches over 90°C without heatsink, with heatsink you can barely touch it (Replaced with AZ1117IH-5.0 and changed Layer 3 from +12V to +5V to act as heatsink in order to get temperatures down and account for additional current-draw of the added amplifiers)
- Additional change: Replaced the two Single-Channel DACs with one 4-Channel DAC, to have 2 additional DAC-Channels.

I'll order new boards soon and testing will continue after that.

The next part is the mixer-board, which I did today - It uses a RMS-30+ Mixer (Anyone in Germany who wants one? Minicircuits asks a 20€ shipping fee, so I think I'll order 4 or 5 pieces.) and has a BGA616 Amplifier on board, to come as close as possible to +16dBm output-power as possible. +16dBm is required to get a +13dBm power-level at the output of the analog-board, due to losses in the RF-Switches and the resistive divider.

And in case a DC-Offset is needed: +/-10V of DC-Offset can be added to the signal on the "Final-Board" (current capability: ca. 40mA). Sonnet Lite simulation of the RF-Path on the board looks good.
Added that mostly just for fun :D

Attached are the Top-Views of the boards.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on December 07, 2019, 10:26:32 pm
Many months later and many days of tinkering with the whole system, including installing everyting in a 19 inch case, I can say the the individual modules work as expected (well, mostly - see below) and that basically 2 big problems remain:

- Signal integrity on the SPI-Bus
- Software (Especially UI and calibration routines to compensate for the frequency dependent losses)

While I can't say much about the software-part, as I haven't really started developing a new UI yet, apart from  a rudimentary interface that allows setting the most important parameters via serial commands, I can say quite a lot about the hardware.

The biggest problem so far has been signal integrity on the SPI-Bus, which has been not only frustrating but also actually drove me away from the project for quite some time.
I haven't identified all the issues, but I'm pretty sure that one of the major culprits is the LCD-Controller, which, according to a few forum posts, does not properly tri-state its output and screws up readbacks from other chips (which cost me at least 2 weeks of head scratching and chasing ghosts). Another issue are the cables. Due to the location of the SMA-Connectors the boards are pretty far apart in the case and connected via 10 to 15cm long cables that are bundled together with zip ties and tape. This causes quite extensive overshoot on the Clock and Data-Lines of the SPI-Bus, as well as reflections (the cables are going out in a star-pattern from the CPU-Board).
While the LCD doesn't care and the AD9910 can work with the overshoot most of the time (not always - another ghost I was chasing), the ADF4351 simple crashes when it is confronted with spikes up to 3.7V on the data-lines.
The solution that finally fixed this problem (I tried different resistor-values for the series termination on the CPU-Board with basically negligible results) was a buffer-board that uses a 74AC14 to buffer the signals and catch the spikes. This board also includes over 2000uF of capacitance to filter the power-supply and catch any remaining traces of the spikes.

After installing that, I finally managed to talk to all the chips and tell them what to do - I couldn't really listen to them, due to the stupid LCD-Controller, but I reliably (well, 90% of the time) got the expected results from the entered commands.

So I finished my drivers for the Chips and continued testing, when I noticed rather nasty traces on my Scope: Everytime there's activity on the SPI-Bus, I see a bit of noise on the waveforms. Btw. I built all the modules in a way that the mounting holes are connected to ground and the case is grounded as well, so there's basically a big ground-plane 1cm beneath each board.

But despite all these problems, I was able to verify the basic concept of the system:
- Using several switched filters works (although using a more highly integrated switch would reduce the losses that are created by these switches) and attenuates the higher harmonics to a sufficient degree
- I can (with some difficulty, depending on the frequency) fine-tune the amplitude with the ALC-Circuit
- Switching signal sources in and out works
- The Mixer-board works (I had to make a few adjustments to the circuit however - using just a resistor doesn't yield satisfying results)
- CPU and Keyboard-Interface works
- Communication between the chips works (after overcoming the difficulties described above)
- A basic prototype of the UI works

Which brings me to what I have been doing for the last 3 weeks: The ARSG - Mark III Mainboard.

I've combined all the functionality into one board and also did some changes:
- Replaced the STM32F103 with a STM32F407
- Optimized the SDRAM-Interface for the FPGA to make the traces shorter (which should allow me to increase the SDRAM-Clock to the maximum of 166 MHz)
- FOUR-LAYER-BOARD - No more 2-Layer crap  ;D
- Replaced the ADF4351 with the ADF5355 (13,6 GHz  :o )
- Replaced the AD9910 with the AD9957 (basically the same chip with large portions of the datasheet copy and pasted, but it also has digital I/Q Modulator capability and it can also work as a simple DAC driven by a data-source, whereas the AD9910 could only use the Output Scale Factor for this)
- Improved the Master Clock and used differential clocks wherever possible to reduce noise.
- Changed the power-supply to a +14 / -14V-Scheme with local regulators for the individual circuit-blocks.

I haven't started with the board-layout yet, but I think I might be able to put everything on a 200 by 150mm board.

So, in essence after a rather long hiatus, this project is back on my in progress-list :)
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on December 09, 2019, 12:45:13 am
I've attached a very early preview of the layout - Power Supply-Layout is done and will get its own little shielding-cage with holes in it for the Heatsinks (Unless I run out of space. Then I'll put that on a separate board :) ).

The shield-cages will be 3D-printed cages wrapped in aluminium or copper foil and screwed to the board.
For the RF-Cages I plan to use Filament with metal content to create RF-Absorbers. Has anyone done this before and can share some insights?
Title: Re: Open Source HW RF Signal Generator
Post by: Yansi on December 09, 2019, 12:58:15 am
Ah! Finally! A was just wanting to suggest you the AD9957. I have one piece laying somewhere I bought from china some time ago. That'd be a very good opportunity to make a nice  vector signal generator.

Also, why don't you use a servo-loopped ALC for the output? Stepped attenuators are boring.

For frequency of interest up to 3GHz, a cheap nice BAP64Q PIN quad may be used. Not sure what to use further, as I have never worked beyond 3G. (Thats the limit of my instrument setup).  Any RF log-to-lin detector coupled with it will give you a pretty decent ALC building block. Rest is just any DAC with enough resolution and a couple of opamps.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on December 09, 2019, 01:20:32 am
i already have implemented a ALC ciruit to have fine control over the amplitude. And it uses the BAP64Q, which does a pretty good job :)
But since the ADF5355 can offer up to 6.8 GHz, i am planning to use a special IC by Analog Devices as the Attenuator. Namely this one: https://www.analog.com/en/products/hmc346ams8ge.html (https://www.analog.com/en/products/hmc346ams8ge.html)
Using that chip will also remove the requirement to separately control the Bias-Voltage for the attenuator, which currently requires a rather long calibration process.  ;D

For the control I'm using a quad OpAmp that is regulating the Output amp against the voltage from a 12bit DAC. So the precision should be there to make it possible to remove the step attenuator. :)
I'll have to do some more tests with the current ALC-Circuit to verify this, but its a good idea to just use the ALC-Circuit for this. Thx :)
On my current hardware I'm using LT5505 as RF-Detectors, which work rather well, but only have about 40dB of dynamic range.
The dynamic range of the detector is probably the biggest problem here. Do you know any detector-chip that has a suitable range (about 90dB)?
Title: Re: Open Source HW RF Signal Generator
Post by: Yansi on December 09, 2019, 10:05:49 am
It is very difficult to watch all this thread, as you are way to fast in slapping things together  :)  Sorry if I have missed something.

Have you already verified any RF parts of this huge design?
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on December 09, 2019, 09:21:04 pm
What I've verified so far is:
- Filtering of the ADF4351-Output to attenuate the harmonics - Working after adding some attenuators at the input and output of the filter-chain. Since the 1.5 GHz Filter is only 5th order, it probably is a bit weak, but I don't have any test-equipment to check what is going on beyond 3GHz. Could probably use some improvement - LTCC-Type Filter by Minicircuits could offer better performance here as well as significant space reduction (1.5Ghz Microstrip-Filter is quite large, even with 4mil inductors). To design the Microstrip Filter I've been using this tool: http://www.nctdev.nl/page_pg%3d17.htm (http://www.nctdev.nl/page_pg%3d17.htm) where I entered the values that this tool http://tonnesoftware.com/elsie.html (http://tonnesoftware.com/elsie.html) gave me with pretty good results.

- Automatic Leveling - Working with LT5505 used as the detector, self-made PIN-Attenator based on BAP64Q Application example in the Datasheet, standard quad OpAmp as the controller and 12bit i2c-DAC for the reference voltage. It's a bit tricky to find the correct bias-voltage though as that seems to be changing with frequency. I've replaced the BAP64Q-Attenuator with the HMC346AMS to remove the necessity for actively providing and regulating the bias-voltage for this exact reason.

- Signalpath-switching - Works perfectly with one exception: The input from the AD9910. The Amplifier (BGA616) is generating almost 26 dBm with a 1mH inductor at the input of the RF-Switch that switches between the filtered ADF4351-Signal and the AD9910-Signal. Predictably, this reliably fries the RF-Switch after a short while (I've measured up to 12Vpp on my scope at 20 MHz with the AD9910-Signal source deselected - Absolute Maximum according to Datasheet: 8,5V).
The new design uses OpAmps as the output-amplifiers of the AD9957 that are specified to 1.75 GHz and switches with internal 50 Ohm terminators instead of reflective ones I've been using in the old design.

- AD9910 Signal - Currently the handover from the AD9910 to the ADF4351 happens at 400 MHz, which is a bit high as I can see a pretty strong image frequency at 600 MHz on the spectrum analyzer, as well as some other spurs that get stronger and stronger above 300 MHz.
Using one more filter at 400 MHz to allow switching in the filtered RF-Source at 250 MHz or 300 MHz should solve that problem, since I can use LowPass-Filters with a lower cutoff-frequency for the AD9957-Output. Using an OpAmp at the output also allows much lower frequencies since the BGA616 needs to be AC-Coupled and becomes almost useless below 1 MHz.

- Mixer-Board - Works without a problem once I fixed the supply of the BGA616 Output-Amp. Output amplitude is high enough to fry the reflective RF-Switches though (see above), so again a switch with internal termination is needed (in case the software routes the signal the wrong way).

- Reference Clock-Generator and distribution-amplifier - Works perfectly after I cut a few traces since I goofed up the footprint of the main oscillator :D

- FPGA and SDRAM - FPGA is working, but I haven't checked the communication with the SDRAM-Chip yet. I'm pretty sure it'll work, but since I used a 2-Layer board there I've got interrupted GND-Return paths all over the place and had to use a short coaxial cable to get the clock from the FPGA to the SDRAM-Chip, I'm guessing that the max clock frequency is rather limited.

Most problems in the RF-Parts I've ironed out with the boards I ordered last year and since then the focus was mostly on the software-side and, as I said, the communication-problems between the CPU and the connected chips. Putting everything onto one board and using short, traces and proper termination should hopefully fix all those issues once and for all.

One more note on the FPGA and controlling the AD9957: I'm currently using a MAX 10 FPGA connected to a 8 MByte SDRAM with 16bit wide databus. I do have a few more pins available to connect a larger chip, but I think 4 Mega Samples (the AD9957 takes 18 bits but 2 of those could be calculated or just be static) is enough for this project.
With a SDRAM-Chip, I estimate a sample rate of about 100 Megasamples/s to be possible. Maybe even more with a prefetcher and some clever use of the banks inside the SDRAM to make the most of the burst-mode transfers.
I've also thought about using DDR-Memory, but laying out a board for DDR-Memory has a lot more pitfalls than normal SDRAM.
If anyone can point me to a good source of guidelines or proven rules of thumb, I might reconsider the choice of memory, however :)
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on December 10, 2019, 09:48:03 pm
Here are some of the schematic-blocks of the Mark III Board.

I've tried to stay as close to the application schematics in the datasheets as possible with most of the chips, or used what I verified with my previous boards.

The reason why I'm going for differential clocks is the fact that the clock-lines are rather long and I want to eliminate any additional phase noise sources.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on December 11, 2019, 08:28:01 pm
This is the layout of the FPGA and the AD9957 with all its power supplies.

What I didn't realized when I drew up the schematic was how much power the AD9957 draws on the 1.8V Rail for the digital core: 610mA!!! :o
And on top of that the datasheet is a bit ambiguous - Quote: "DVDD (1.8V) Pin Current Consumption | QDUC mode | 610 mA" - Which could mean that it draws that PER PIN!
I doubt it will draw that much power though, as the next few entries in Table 1 state a power consumption of 1.8 Watts for the entire chip as the maximum in continuous modulation-mode.
As this would mean about 2 watts of waste heat in a linear regulator, I decided to use a switching converter for the digital core while the analog circuits will be supplied by "Ultra Low Noise" RT9193 regulators.

I'll also redesign the Power Supply as it currently takes uses too much space and seeing how large Master Clock Generators and the FPGA+AD9957-Combo is, I fear I'll run out of space pretty soon and I would like to avoid having to put parts on the bottom as much as possible :)

I might put the filter in its own little cage, however.

Btw. I haven't added a Ground-Plane on the top layer yet, as each time I put in a via Circuitmaker takes quite a while to calculate the holes in the planes - even on a Ryzen 5 3600X based gaming machine  :-//
Title: Re: Open Source HW RF Signal Generator
Post by: Mechatrommer on December 12, 2019, 03:57:30 am
kudos (subscribing...)
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on December 25, 2019, 08:52:57 pm
I've got the layout of the board mostly done but I ran into a few problems with designing the filters. Especially the 4 and 6 Ghz-Filters cannot be calculated as the structures have to be too small to achieve the necessary impedance with a 0.1mm 4.05 Ef dieeletric at more than 3 Ghz. And there's also the issue of limited space on the board.

Searching for suitable filters, on Mouser and from Minicircuits, I've come across a new product by Minicircuts: A "Reflectionless Filter".
https://www.minicircuits.com/pdfs/XLF-13H+.pdf (https://www.minicircuits.com/pdfs/XLF-13H+.pdf)

They are quite expensive at 12 Dollar per piece in low quantities, but the reflectionless nature of the filter would be a nice property as the reflections from the filters caused the PLL to lock to the wrong frequency or there were excessive spurs when I didn't have a 10dB attenuator between the Filter-Board and the ADF4351-Module (problem solved with the second revision of the Filter-Board).
Anyone here who used those filters before or know of similar components / how to buld those as microstrip? I'm tempted to use them, but I'm a bit hesitant because of the high price.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on December 26, 2019, 12:09:35 am
Found this book: https://www.amazon.de/Reflectionless-Filters-English-Matthew-Morgan-ebook/dp/B06X9ZLV61 (https://www.amazon.de/Reflectionless-Filters-English-Matthew-Morgan-ebook/dp/B06X9ZLV61)
Anyone know it? Is it any good?
Title: Re: Open Source HW RF Signal Generator
Post by: ogden on December 26, 2019, 12:59:56 am
Using 12$ filter to solve problems caused by pin diode attenuator do not sound right to me. Why don't you use digital step attenuator which do not have impedance matching problems? 1dB step is good enough for most occasions.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on December 26, 2019, 04:58:21 pm
The Attenuator is used to have a defined level before the signal is being fed into a step attenuator. Using the chip from Analog Devices takes care of impedance matching and all the other things.

What I was wondering was if it would make sense to use a reflectionless filter instead of the cauer filters I've been using previously.
I'll stick with the cauer filters for now, as I know they work (with 10dB fixed attenuator between the PLL and the filters).

Current state of the development:
- Power-Supply scheme redesigned (using TPS54302-Chips)
- All function-groups laid out and most connections done
ToDo:
- Add the filters
- Connect the CPU to the function-groups
Title: Re: Open Source HW RF Signal Generator
Post by: ogden on December 27, 2019, 02:50:36 pm
AFAIK pin diode is kinda nonlinear. I would measure distortions of such "attenuator" min/max/mid range before commitment.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on December 27, 2019, 03:37:59 pm
 According to the datasheet, the HMC346AMS8GE is based on GaAs MOSFETs and it specifically states that the application circuit takes care of impedance matching.

The PIN-Diode Attenuator works pretty good too, but requires careful adjustment of the Bias-Voltage depending on the frequency. That's why I want to use the Chip from Analog Devices - Only one input required and no lookup-table that needs to be filled with calibrated values :)
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on January 02, 2020, 11:39:11 pm
Mk. III Board is almost done.

I've laid out the RF-Section with just the filters for 1.5 and 3 GHz still missing.

To make sure that the signal is strong enough at the output and arrives leveled at the Mixer, I've added a second ALC-Stage that sits in front of the RMS-30+ Mixer (Anything above 3.5 GHz tends to get really expensive really fast - Especially amplifiers and I don't have a dealer for Minicircuits-Parts - so I decided to limit the upconverter-stage to 3.5 GHz).

Basically every functional block in the RF-Section has its own linear power-supply that regulates down from a +8V or +/-12V Supply from the Switching Regulators far away on the other side of the board.
In addition to that, I've positioned everything in a way that it can be shielded and the holes to screw the shield in place are 3.4mm diameter so M3 screws can be used.

To make layout a bit easier, I've used Microstrip-Transmission lines instead of Coplanar Waveguides this time. Saves me the time to put a ton of vias next to the RF-Traces and also keeps the bottom side clear of vias so routing of control-signals and power is much easier.
Also based on my experience with the JLCPCB Assembly-Service I've used 0402 components in the RF-Path. To make it less likely to blow the tiny parts off the board when hand soldering the other components, where possible I've kept a rather large distance between the parts. It makes the RF-Path a bit longer, but as I plan to release this as a partially assembled kit in the future, I think ease of assembly in the hobby-room is the more important factor here.
Which is also why I tried to avoid hard to solder packages wherever possible - The ADF5355 and the SP4T RF-Switches are the only QFN-Parts for example.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on February 01, 2020, 12:51:43 pm
Board-Layout is finally done.

I've decided to not implement a 6GHz-Filter, since anything above 6 GHz is already being attenuated quite a bit by the amplifiers that are only specified up to 6 GHz with more than 3 dB drop from their maximum figure already.
Basically anything above 3 GHz is a gimmick and not part of the core-specs (see first post for those :) ).
I'll probably send one board to TheSignalPath though. If he's interested in checking it out and willing to work around the most likely below standard User Interface  ;)

Regarding Keyboard, Display and other things that can be connected to the mainboard, I'll update the github-repository with some specifications about peripherals. Those will contain pinouts and some notes about the communication-protocols.

I've also had to switch IDEs since the Sloeber-IDE (A modified Eclipse Distribution for Arduinos) has been abandoned by the developer and there are now bugs piling up that make it unsuable with the STM32Duino Libraries.
I'm currently undecided whether to stick with Arduino and use Visual Studio as the IDE (with a Plugin), or switch completely to the STM32CubeIDE with which I've programmed a gamecontroller over the last 2 weeks with not too many showstoppers.
Title: Re: Open Source HW RF Signal Generator
Post by: Yansi on February 02, 2020, 06:33:48 pm
Was any part of this tested and verified independently? I am not a close follower of this thread, but I still have a bit of bad taste of it being just a quick slaptogether. Nor do I see a single point to use any duino crap within designs that even uses FPGAs. (simply this is not a piece of a children toy, so why even bother making it child friendly?)

How will you manage to make any RF shielding lids? A custom milled aluminium blocks?

Is there really none ESD protection on the USB?

Also for example, from another quick look at the PCB: Why not flipping the 1.5Ghz LPF vertically? Would allow for much shorter interconnects.

I think the layout is far from what I'd call done. (hence my bad taste of a quick slaptogether). But I stay being corrected.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on February 02, 2020, 07:53:15 pm
This board is a combination of all the individual boards I previously made and which I verified to be working. The only thing I didn't test so far is the FPGA-Board and its control of the AD9910 I have here. Control of the chip via SPI-Bus with the main CPU is working reliably.
The changes I've made compared to the version I have here with the individual boards I've detailed in this post: https://www.eevblog.com/forum/oshw/open-source-hw-rf-signal-generator/msg2819470/#msg2819470 (https://www.eevblog.com/forum/oshw/open-source-hw-rf-signal-generator/msg2819470/#msg2819470)

Regarding your other questions:
I don't have a CNC-Machine, but I've got a 3D-Printer and plan to use conductive filament (and/or copper-foil or conductive paint) to print RF-Shielding enclosures. The holes in the PCB have a diameter of 3.4mm, which allows using M3 screws to mount the shields.

USB ESD-Protection... Oops. :)
I'll add the USBLC6 to the USB-Lines. Used that chip in other projects before and have some in my parts-bin.

The location of the filters could be optimized, yes.
If they were a bit cheaper, I'd be using tiny SMD-Filters by Minicircuits. That would allow more more filters with better attenuation of the harmonics.
Title: Re: Open Source HW RF Signal Generator
Post by: Yansi on February 02, 2020, 08:30:46 pm
I wouldn't trust the 3D printed bullshit (yes, I'm a skepticist, especially with these types of filaments). Get a proper alu case milled (it is not that much expensive, but sure not cheap), or I'd opt to optimize the layout to use off-the shelf tinned steel sheet shielding cases.

Yup, I also go through a lot of USBLC6, both -2SC6 and -4SC6 (2 or 4 way).

There are other manufacturers of monolithic filters. Have you tried looking thoroughly enough?  Johanson technology, Taiyo Yuden, Murata, Epcos/TDK, etc etc etc. Even Mouser stocks heaps of them, for a fraction of MiniCircuits cost.

Performance of these filters suck (stopband attenuation 30-40dB), but can be cascaded with acceptable insertion loss. Very cheap. Also look at aliexpress and other far east sources. Lots of these available.



Title: Re: Open Source HW RF Signal Generator
Post by: thm_w on February 03, 2020, 06:54:16 am
3D printing makes sense regardless of what your end result is, as it lets you test fit the dimensions. CNC setup time is not cheap compared to filament.

Not sure if anyone has tested 30% copper PLA, would be interesting to see. Its not electrically conductive across the material.
The actual surface conductive stuff, afaik, is all carbon based, which is not great for RF absorption compared to say, Cu or Al.

These might be better options over carbon, just a question of if its good enough and won't melt PLA:

https://www.mgchemicals.com/downloads/tds/tds-842wb-l.pdf (https://www.mgchemicals.com/downloads/tds/tds-842wb-l.pdf)
"Surface Resistance @ 50 μm 0.0020 Ω/sq"

https://www.caswellplating.com/copper-conductive-paint-4oz.html (https://www.caswellplating.com/copper-conductive-paint-4oz.html)
"Good surface resistivity of <1 Ohm/sq at 1 mil dry film thickness. Attenuation: more than 75 dB from 30 MHz to 1.5 GHz."

https://www.mgchemicals.com/downloads/tds/tds-841ar-a.pdf (https://www.mgchemicals.com/downloads/tds/tds-841ar-a.pdf)
"Surface Resistance @ 50 μm 0.60Ω/sq"
Title: Re: Open Source HW RF Signal Generator
Post by: OwO on February 03, 2020, 08:54:46 am
Why not use shield cans and clips?
Something like this: https://www.aliexpress.com/item/33003768263.html (https://www.aliexpress.com/item/33003768263.html)
I'm sure you can find other dimensions or fold these from copper foil for custom dimensions. On taobao some sellers can do custom shield cans.

There are clips that solder to the PCB:
[attach=1]
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on February 03, 2020, 06:05:50 pm
Soldering these clips to the PCB should be possible. The surfaces free of soldermask are 5mm wide.

I was inspired to use 3D-Printed pieces by the video of TheSignalPath in which he 3D-Printed some horn antennas and Waveguide-Filters with pretty good results.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on February 19, 2020, 07:10:35 pm
I've done some research and the method to go (even used by at least one company I found that has invested some research in this area) seems to be coating the 3D-Printed objects with conductive paint or metallic foil.

Metallic foil is probably the best choice here price wise. Or cans out of copper sheet metal. :)


Regarding the filters: There's a ton of them available on Digikey and Mouser, but they all seem to be targeting the 2.4 GHz (WLAN)-Area. So they're outside the area of interest and when I have to order parts directly from the manufacturer, Minicircuits seems to be the better supplier.
Title: Re: Open Source HW RF Signal Generator
Post by: eb4fbz on February 20, 2020, 09:41:47 am
Those microstrip lines are pretty thin! What is the dielectric thickness?

You will have big mismatches due to discontinuities created by the components pads. Those lines look very thing even compared with 0402 passives!

I would never ever try again to make distributed elements filters on FR4. Not even for <1GHz. It's not about loss, but also uncontrollable variations between boards and ultimate rejection. I would use SMD low pass filters from Murata or Johanson. They are cheap, and performance will be better and painless compared to those filters on FR4.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on February 20, 2020, 08:10:42 pm
The thickness is 0.1mm (Controlled Impedance 4-Layer Board made by JLCPCB). Dielectric constant is 4.05.
Yes, I noticed the thickness discontinuities of the pads. Unfortunately, that's one of the compromises I had to make to keep cost low.

Regarding the filters: Okay, you guys convinced me to switch to some ready made SMD-Filters :)
It also seems like Mouser has recently added Minicircuits Filters to their inventory. They do not ship to Germany though. Hopefully that'll change in the near future. So I'll redesign the filter-section with the filters by Minicircuits and update the layout of the filter-section. Should save a lot of space as well.
Title: Re: Open Source HW RF Signal Generator
Post by: Yansi on February 20, 2020, 11:39:23 pm
These thin transmission lines are nightmare to work with. Use different stackup or forget 50ohms. On a generic FR4 board, even controlled impedance, it will be from floor to bottom in its value.

What is also commonly done, is to use layer 1 for signal (as you have), then omit layer 2  (no copper under RF parts), layer 3 becomes RF GND, layer 4 other signals (supply, control signals).

That way you can get much thicker traces for 50R, which is welcome, as the etching tolerances won't bother that much. Also will enable you to obtain much higher impedances for distributed filter elements.
Title: Re: Open Source HW RF Signal Generator
Post by: OwO on February 21, 2020, 04:07:33 am
There is also the 0.2mm stackup which JLC offers and is de-facto standard for boards with RF.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on April 15, 2020, 12:14:35 am
Quick update:

I've redone the Filter-Banks (added one Stage btw.) with SMD-Filters by Johanson since Mini Circuits-Components aren't sold to Germany by Mouser for whatever reason. 
Tiny Problem I ran into is the fact that these filters are only available for certain frequencies and I need a filter with a cutoff-frequency around 2.2 to 2.4 GHz. So that Filter needs to be made with a stripline-filter.
The preceding 750 MHz, as well as 1.2 GHz Filter and the succeeding 3GHz-Filters are made out of 3 Filters in series.

I'm also redesigning the RF-Path after the Filtering since the RF-Switches by Analog Devices required negative control voltages and are a bit on the expensive side. As is the ADF5355: 95€ + Taxes! The almost pin-compatible ADF4355 (One pin is an output instead of GND) is only 37€. I've put a 0603 resistor right next to the pin in question, which can be populated by 50 Ohms or 0 Ohms, depending on the chip that's being used.

In addition to that, I've switched to the 0.2mm Stackup, which makes the traces and pads look much more uniform :)

Thx for all the suggestions. Keep 'em coming. I have set the deadline to order boards to the end of may, so there's still time to get them implemented :)
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on April 18, 2020, 12:35:25 am
I managed to find a suitable filter from TDK that is in stock at Mouser and started layout of the new filter-banks.

I also added RC-Filters to each control-input of the RF-Switches to isolate them from digital noise and isolate the CPU from RF-Noise (the RF-Switches are being driven directly by the CPU).
Title: Re: Open Source HW RF Signal Generator
Post by: eb4fbz on April 18, 2020, 11:48:30 am
Have you taken the RF switch isolation into account? That will limit the rejection, so maybe cascading 3 filters does not improve anything. These switches usually have 20-30dB isolation at most for >2GHz. Layout will have some leackage too, and it gets worse when transmission lines are not properly terminated, as happens at frequencies where your filters are rejecting (reflecting) the unwanted components.

I also recommend you to simulate the cascaded filters response including interconnecting transmission lines length (phase), as most filters rejection doesnt simply add up, and even its passband could be distorted due to adjacent filters impedance.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on April 18, 2020, 12:05:15 pm
No, I haven't done that.

The SP4T-Switches have an isolation of 18 dB at 4 to 6 GHz. So if I understand this correctly, the outputs of the RF-Switch that are turned off will have a -18 dBm signal present that will then be added up at the inputs of the last switch and be visible at the output of the filter-bank. So as an example, the 4 GHz and 6 Ghz-Harmonics will appear at the output with an attenuation of roughly 36dB + the insertion loss of the 6 dB-Filters, correct?
Cascading filters in this case won't make much sense then, if the signal can just travel along a different path :)

How can I simulate the filters? I have access to Sonnet Lite, but that's about it when it comes to RF simulation-software. Is there a way to put the filters in there as black boxes with pre-defined S-Parameters?
Title: Re: Open Source HW RF Signal Generator
Post by: eb4fbz on April 18, 2020, 12:59:33 pm
You are right. But in a SP4T there are 3 leackage paths! These will add at the output, and depending on each filter bank loss and phases, you could be limited at 30dB or even less maximum rejection at some frequencies.

To simulate cascaded filters, download the s2p files from manufacturer and you can use them on a free tool as QUCS or RFSim.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on April 18, 2020, 04:23:37 pm
Thanks for pointing that out. I've switched to the ADRF5250 SP5T-Switches. They are a lot more expensive at 7€ per piece, but also offer 46dB isolation at 4 to 6 GHz.

Simulation in RFSim looks good. The Filters are behaving like advertised and the transmission-lines don't distort their behavior too much. There's just a little bit of ripple near the cutoff-frequency.
I've set the variance for the impedance of the transmission-lines to +/- 10% btw.
Title: Re: Open Source HW RF Signal Generator
Post by: rhb on May 03, 2020, 09:19:29 pm
Please forgive my being lazy.   Where can I find a block diagram of the current design concept?

It seems to me that the obvious implementation is a pair of ADF4351s, low pass filters and a mixer plus ancillary bits.

Reg
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on May 05, 2020, 04:22:31 pm
I don't know if I have posted an updated block diagram :)


But quick description is as follows:
- CPU communicates through an FPGA with AD9957 and ADF4355 (ADF4356, ADF5355 and ADF5356 are pin compatible btw.) to generate the signals.
- AD9957 is used up to 425 MHz and also supplies modulated signals
- ADF4355 is used from 425.01 MHz to 6 GHz (Max Amplitude and flatness might suffer above 3 GHz - It's all built on cheap FR4-Board to keep cost down)
- Signal from ADF4355 is LowPass-Filtered via a bank of filters that are switched in and out to filter harmonics
- Output-Amplitude is leveled by ALC-Circuits
- Digitally controlled Step-Attenuator controls output-power from -90 to +10 dBm (Higher output-power possible, but requires an amplifier-module connected to the PA Output and Input)

I did think about getting lower frequencies by mixing two ADF4355 Signals together, but using the AD9957 for lower frequencies saves components and PCB-Space to the tune of almost 100€ for one device. It saves not only a ADF-Chip, but also all the supporting circuitry, additional filters, Mixer and the PCB can stay within the 200x150mm frame (anything larger becomes expensive really fast).

The Step Attenuator isn't on the main board, since there are so many attenuator-modules available on ebay that fit the bill. Most are less than 30€ and having the attenuator as an external module helps with keeping the board-size within the mentioned 200x150mm.
Title: Re: Open Source HW RF Signal Generator
Post by: Yansi on May 05, 2020, 04:43:52 pm
So you have a LF path to the DDS directly and then HF path, where you mix the DDS with just single ADF435x?

I don't think that way you can get all the unwanted mixing products away easily. You would nee lot of band pass filtering to do so.
Title: Re: Open Source HW RF Signal Generator
Post by: rhb on May 05, 2020, 06:47:01 pm
What are the ADF4355 filter specs?  That is pretty critical to overall performance.

Looking at the AD9957 spec, it seems to me you'd get better SPFD if you ran it in the 10-25 MHz range or at 75 MHz and mixed that with the ADF435x to get the desired output frequencies.

I can't see buying a 6 GHz ADF4355 and putting it on FR4.  Either spend the money on better PCB material or drop back to a cheaper chip.

A block diagram and a more detailed description of the design logic would be a big help.  This thread has meandered along for a long time and it's hard to tell where you are.

A OSHW/OSSW replacement for an HP 8648C would be where I would start.  100 kHz to 2.9 GHz with an emphasis on very clean output and tight power level control.  That covers the 2.4 GHz WiFi band and is still reasonable to do on FR4.  I paid ~$1000 for mine in the US.  I'd love to see something comparable under $150.  And at $100 it would be OK if it only went to 2.2 GHz.

Have Fun!
Reg
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on May 05, 2020, 09:16:40 pm
I've drawn a block diagram (see attached picture and yEd-File).

The Filters for the ADF4355, which I have chosen over the 4351 because of its much finer frequency control (16bit Integer + 24 bit Fractional instead of 16bit INT + 12bit Fractional) - the 6 GHz is basically a bonus that comes with it, but can be left out by chosing the 10€ cheaper ADF4355-2BCPZ that can only go up to 4.4GHz, are:
- 750 MHz: Johanson 0500LP15A500E
- 1200 MHz: Johanson 0915LP15B026
- 2 GHz: TDK DEA202025LT-5052C1
- 3 GHz: Johanson 2450LP14A100T
- 6 GHz: Johanson 5515LP15A730

The Filter for the AD9957 is a Johanson 0400LP15A0122.

The current setup (AD9910 Module from ebay with lumped element LC-Filter) has basically no harmonics and just a few fixed spurs around 200 to 300 Mhz, which are most likely caused by some deficiencies on the module.
Approaching 400 MHz, a tiny amount of image frequency can be seen approaching 600 MHz, but its almost down in the noise. With the Johanson-Filter I expect this image frequency to be absent.

The signal of the ADF4351 has a harmonic at twice the fundamental frequency that is pretty consistent 33 dB weaker than the fundamental. Not quite the level of THD the HP 8648 is capable of, but keep in mind, this is the result of Microstrip-Filters on 0.1mm 2113 Prepreg FR4-Board with no shields over the filters. So adding shields and using the SMD-Filters, I'm guessing the result will be better, maybe even reaching -40dB.
The 3rd harmonic is mostly gone, except for frequencies around the switch-threshold of the filters (800 MHz, 1.5 GHz) - The finer granularity of the filters on the new Mainboard should suppress this third harmonic better.
Output-Power was about 0dBm each time I measured, which equates to an output-power of about +1 dBm at the output of the Filter-Board.

Once I'm done taking the measurements (and I found my USB Floppy-Drive) I'll post the measurements, comparing ADF4351 "RAW"-Output and the filtered one.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on May 05, 2020, 10:43:27 pm
Okay, so here are the measurements I just did with the Spectrum Analyzer first connected directly to the ADF4351 and then filtered, as well as the AD9910. I adjusted the ALC-Circuit to a Level-Control Voltage of 1.25V and 2V Bias-Voltage to avoid driving the amplifier that sits at the output of the filters into saturation.

Please note, the 410 MHz-Measurement is completely off, because the signal path is selected wrong (bug in the selection-routine that I can't fix without an extensive rewrite of the program at this point), but starting at 700 MHz, the correct filter is selected. You can see the effect of the 3 GHz Microstrip-Filter, however. :)
As you can see, second harmonic is down 38dB, while any higher harmonics are completely gone at 700 MHz - At this frequency the 750 MHz LPF by MiniCircuits is selected.
At 1.2 GHz the second harmonic is down 30 dB - Filtering is done by the 1.5 GHz Microstrip-Filter.

The filters on the new board will have more overlap, so especially at lower frequencies, the suppression of harmonics will be better.

The measurements of the AD9910 show a rather clean signal, except for the constant spurs that are appearing in the spectrum.
Since I don't see those in spectra I've found on the internet by other people, I'm guessing those come from external circuitry on the module I've got here (Cheap module from ebay with 1117 regulators and 40 MHz Oscillator), or the way I've programmed the internal PLL of the chip to generate the 1GHz Sample-Clock - There's quite a lot that can be configured and I have stopped fiddling with those values once I got a signal.
The image signal at Sample-Clock / 2 - Output-Frequency that appears around 350 MHz could be a problem, but the Johanson-Filters claim to have -30 dB attenuation at that frequency and I'm using 3 in series, so that should provide sufficient suppression of those signals.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on May 06, 2020, 07:35:34 pm
I've done some additional measurements after I've fixed the bug in the filter-selection.
To set the amplitude correctly, I've used the Automatic Level Control by setting the Level-Voltage to the required value and the Bias-Voltage to about 2 Volts via the DACs on the filter-board.
Starting at around 1.3 GHz the output-power is limited by the amplification on the analog-board and can't exceed -1 dBm anymore.

To look at the signal at frequency-ranges beyond 3.1 GHz, I've used the software SATSAGEN to turn my ADALM PLUTO into a Spectrum Analyzer.
Note: The signals around 3.2 GHz are always there and come from the ADALM PLUTO.

According to the manual of the HP 8648C, the spectral purity should have harmonics weaker than -30 dBc.
My current setup doesn't achieve these figures in all ranges. Especially the higher range, where just the 3 GHz Microstrip-Filter is active, shows significant harmonics.
Also of note is the fact that at 0 dBm output-power the amplifier is being overdriven and distorting the signal.
With the new design, the signal is routed either to the Attenuator or a power-amp/directly to the output, and the amplifier has its P1dB-Point at about 20 dBm instead of 16 dBm.

In the block-diagram included in the large picture, you can see the signal-chain I have currently set up.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on May 07, 2020, 06:29:33 pm
Does anyone here have RF generators by HP, Philips, Tektronix, Rigol, etc. and a Spectrum Analyzer to do similar measurements to compare the spectra of these generators to my prototype-setup?

Title: Re: Open Source HW RF Signal Generator
Post by: rhb on May 07, 2020, 10:06:56 pm
I have an 8648C and an 8566B.  I've also got a 346B noise source, so I should be able to check the 8566B response.

It will take a few days as I'll have to set things up to do the tests.  And moving the 8566B is *not* easy.  And  I just got a bunch of new TE I need to test.

Have Fun!
Reg
Title: Re: Open Source HW RF Signal Generator
Post by: rhb on May 10, 2020, 10:57:50 pm
Here are photos of the 8648C on the 8560A at 100, 200, 500 and 750 MHz at 0 dBm output.  The higher frequencies will require using the 8566B which is a real chore to get to where I can connect it to the 8648C.  I'll try to do that in the next few days.  Complicated by having only spent a few minutes running the 8566B.  Stuff like that is always an educational experience.

[attach=1]

[attach=2]

[attach=3]

[attach=4]

Have Fun!
Reg

BTW the marker info is irrelevant I forgot to turn it off.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on May 27, 2020, 04:46:37 pm
Did you get around to get the big Analyzer on the bench and get it up and running?

I plan to do a livestream on my (so far mostly gaming related, but I want to expand that) Twitch-Channel www.twitch.tv/saabfan86 (http://www.twitch.tv/saabfan86) on friday (2100 hours central european time / GMT + 2) where I'll explain the design of each functional block and will answer questions from the chat. I hope it works as I intend it to :D

On Sunday I'll do another live stream, which will probably be shorter, where I'll address all the questions I was unable to answer and also discuss any changes or fixes to errors that were discovered during the first live stream.


So far, I think the approach I chose with the filtering and DDS for lower frequencies looks promising when comparing the spectra to the HP 8648C. Especially at frequencies below 400 Mhz. To be honest, I was expecting my system to perform much worse than what I actually observed.
Especially for a device that is supposed to cost less than 300€ in kit-form (Partially assembled Mainboard + Components and Attenuator-Module).

The closest competitor I was able to find in terms of price and features without going to the used market, would probably be the Era Instruments ERASynth Micro. It has a similar frequency range, but cannot go as low as my design, and it's quite a bit smaller. But on the other hand, does not support advanced modulation schemes, arbitrary waveforms and also does not include any filtering of the harmonics in the output.

I hope I can answer all the questions on friday and I'm looking forward to explain my ideas in more detail than possible in a simple forum post :)

Btw. For all those who can't make it on friday, you can send me questions here on the Forum or via Twitch direct Messages. I'll try to answer the questions and the live stream will be recorded and available on twitch for at least one or two weeks.
Title: Re: Open Source HW RF Signal Generator
Post by: rhb on May 27, 2020, 09:52:11 pm
I spent several days working on a LeCroy DDA-120 before giving up for now so I could check an HP  4145B semiconductor analyzer which I had gotten and needed to test. 

Then I suddenly  got a lot of other stuff on my plate.  A new tenant had a burst water line which flooded an office building and I had to deal with drying that out.    I was fixing fluorescent light fixtures rewiring them for 4' LED lamps today.  And I need to install an HVAC system in my house.

The 8566B is at the bottom of a large stack of gear. and I'm rather space constrained right now because of my  TEA binge.  However, I might be able to roll the stack close enough to the 8648C to hook it up.  I'll see if I can move the dolly close enough.

Reg
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on May 29, 2020, 08:54:34 pm
The livestream has happened and I was able to go over all the individual sections in about 1 hour and 30 minutes.

Links to the Videos are here: https://www.twitch.tv/collections/4VVijwCbExbTEA (https://www.twitch.tv/collections/4VVijwCbExbTEA)

Please post your questions and suggestions so I can try to answer as many of them on my sunday livestream that will also happen around the same time as today (2100 hours GMT +2).
And if you've got a Twitch-Account, feel free to follow me on Twitch or hang around in the chat on Sunday for a more direct interaction :)
Title: Re: Open Source HW RF Signal Generator
Post by: nctnico on June 09, 2020, 12:06:45 am
Does anyone here have RF generators by HP, Philips, Tektronix, Rigol, etc. and a Spectrum Analyzer to do similar measurements to compare the spectra of these generators to my prototype-setup?
No but RF generators typically have a 2nd harmonic at up to -20dB compared to the fundamental frequency. If the 2nd harmonic is at -30dB you have an excellent result.

Interesting project BTW. I have been working on something similar but less complex.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on June 19, 2020, 08:12:53 pm
That's good to know.
I will do another livestream next Thursday where I'll check everything one last time before ordering the boards in China.

If you guys have any more questions or ideas send me a PM or join the Twitch-Chat on Thursday :)
Title: Re: Open Source HW RF Signal Generator
Post by: ogden on June 19, 2020, 08:30:45 pm
No but RF generators typically have a 2nd harmonic at up to -20dB compared to the fundamental frequency. If the 2nd harmonic is at -30dB you have an excellent result.
Could you please name some RF generators with 2nd harmonic at up to -20dB ?
Title: Re: Open Source HW RF Signal Generator
Post by: chrisl on June 23, 2020, 06:54:52 am
No but RF generators typically have a 2nd harmonic at up to -20dB compared to the fundamental frequency. If the 2nd harmonic is at -30dB you have an excellent result.
Could you please name some RF generators with 2nd harmonic at up to -20dB ?
All my gens have the 2nd harmonics better than 40 dBc.
Title: Re: Open Source HW RF Signal Generator
Post by: nctnico on June 23, 2020, 06:13:46 pm
Lucky you. If you go through some specs you'll see that there are several with far lesser performance where it comes to 2nd order harmonics. Usually there is also some dependancy on the output power (logically). Anyway, this isn't a pissing contest about who has the best RF generator; it is about what would be an acceptable performance level for a DIY RF generator you can build from commonly available parts. Aiming at better than -20dB is a good start.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on June 28, 2020, 01:53:25 am
I went through the design one more time and I'm pretty sure it's ready for production now.

The partially assembled boards will be about 50 to 70€ each when ordered from JLCPCB (5 PCB order). Depending on what german customs wants and if JLCPCB charges for the high precision manufacturing or not.

With all the parts that need to be bought from mouser or digikey to be hand soldered (most importantly the expensive ADF4356 and AD9957-Chips) the cost for the full mainboard comes to about 260 to 280€ (with a generous safety-margin).

With a display, keyboard and all the connectors, as well as a power supply and some sheet metal for the case, the material-cost for the entire device (assuming cost for the boards with a 5 board order) should be around 350€.

For comparison, the ERASynth Micro is about 100€ cheaper, but only starts at 12,5 MHz and has no filtering of the harmonics. Old RF Generators on ebay with digital control are around 500 to 1200€.

If someone here wants one of the prototype-boards to test and write code for the device, please send me a PM (I'll have 3 available, maybe 4 depending on how bad I mess up the soldering of the large chips ;) ).
I'll post the updated schematics in the GitHub soon and link it here.

I'm going to program the system with the STM32Cube IDE, since I've become pretty familiar with it by now and it offers much more direct access to the hardware than the STM32 Arduino-Libraries. Especially the DMA-Functions and the possibility to use Free RTOS are interesting.
I am struggling a bit with the Virtual COM-Port though. So if anyone can give me some hints on how to make the chip read and write data via the COM-Port from/to the PC, that would be helpful.
I've got a development-board for the STM32F407 here btw. So I can already play around a bit with some basic functions like communicating with a PC.
Title: Re: Open Source HW RF Signal Generator
Post by: awallin on June 28, 2020, 07:07:54 am
Can you add an open-harware license for the schematics and PCBs? and a software license for the firmware?

I went through the design one more time and I'm pretty sure it's ready for production now.
can you summarize the specs you are aiming for? it's hard to sift through the 5+ page thread and guess at where the specs are now..
(number of output channels?, frequency/level range/resolution?, external 10MHz ref? Ethernet/USB interface? etc.)

Quote
I'll post the updated schematics in the GitHub soon and link it here.
what happened to release early & often?  :P 2-year-old JPEGs of schematics only now...

Quote
I'm going to program the system with the STM32Cube IDE, since I've become pretty familiar with it by now and it offers much more direct access to the hardware than the STM32 Arduino-Libraries. Especially the DMA-Functions and the possibility to use Free RTOS are interesting.

is that IDE available for free?
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on June 28, 2020, 11:46:32 am
For a quicker Overview, I'll edit the first post and add the Specifications for the current prototype.

The reason why I've not updated the GitHub as frequently as I wanted is mostly caused by the fact that this project is a personal hobby project which therefore had the lowest priority in the list of projects I'm working on.
Also I originally had planned to use modules and when that turned out to be a nightmare due to the communication-issues on the SPI Bus, I got frustrated enough that I lost interest for some time.
I think I have posted some schematics that are more recent than 2 years though ;)

The Cube IDE from STM is free. It's a customized Eclipse Distribution with code generating features for basically all micros made by STM.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on July 01, 2020, 10:23:52 pm
I realized I had a few more pins available on the FPGA and decided to isolate the ADF4355 and AD9957 completely from the CPU by routing all the control-signals through the FPGA.

I also compared the footprints of the AD9910 and AD9957 by overlaying the pictures of the pinout in Photoshop and I realized that, except for Pin 51 ("RT" on the AD9957 and DGND on the AD9910), they're "footprint compatible". Meaning by configuring the FPGA in a different way, it's possible to use most of the features of the AD9910 when soldered on this board - The RAM-Sweep inputs and outputs won't be connected, so the RAM-Sweep-Function isn't available when using the AD9910.

Another thing I did was to dedicate separate SPI clock and Data-Lines for the ADF4355 instead of having both the AD9957 and the ADF4355 on the same bus, to make sure no noise from the bus is coupled into the RF-Output like it's happening with my module-based prototype right now.

Also I decided to use resistor-arrays of 4 resistors for the SDRAM instead of 8-Resistor Arrays, since JLCPCB has the 4-Resistor-Arrays available in their assembly-plant. Also they're easier to solder :)

And I added an Interrupt-Request Line from the FPGA to the CPU. Always handy to have the FPGA tell the CPU that it want's something :D
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on July 11, 2020, 01:45:18 am
And another update here just 2 days before I plan to order:
- Added 120 Ohm Series Terminators to every device on i2c-Bus

- Changed the Regulators for the Low Frequency Amps from 78L05 to 7805 and added Heatsinks (didn't realize that the AD8009 draw over 200 mA each at full output-power plus 25 mA quiescent current)

- Checked Power-Rails again for current requirements - I haven't found any more red flags, but airflow from a fan will be required for the local supplies of the RF-Section, since there's a lot of power being dissipated there (the 78L05 for the Attenuator-Supply will probably reach 90°C and the big TO-220 package 7805 will dissipate over 4 Watts under worst case conditions)

- Changed the Inductors of the Bias Tees for the RF-Amplifiers to Coilcraft 4310LC-352KEC. This way I don't need several inductors to have the amps work at from a few kHz up to 6 GHz

- Added cutouts in the soldermask over the RF-Traces whereever possible to remove the negative effects on impedance introduced by solder mask

- Added connector for a PWM-Controlled Fan powered by the +12V-Rail, which also feeds an RPM-Signal back to the CPU

- Added Dedicated +5V Supply to the Attenuator-Connector (5V provided by 7805 in TO-220 package and supplied by 12V-Rail) to make powering mechanical attenuators with higher current demands possible (heatsink might be necessary if the attenuator draws a lot of current)

- Reshaped the soldermask-cutouts for the ADF4355-Section to make room for the 4310LC-352KEC Coils

- Added Soldermask-Cutouts to improve isolation between the individual RF-Sections
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on July 20, 2020, 11:20:30 pm
That software looks interesting for early evaluation, but I have decided to buy the ADF4355 instead of the 5355. And one would need to reverse-engineer the protocol unfortunately.

I have ordered the boards now btw. JLCPCB finished them yesterday and they're now on their way to Germany.
So if anyone is interested in partially assembled boards without any Software on it, I have 3 available :)
Send me a PM and we can discuss details.

Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on July 31, 2020, 10:39:05 am
After some screwups on DHL's part, the boards are finally here!

Production and communication with JLCPCB went smooth as always. There was an issue with trace to hole spacing in the footprint of U8_RF, which they rectified by moving the traces around after my approval and I apparently had selected the wrong resistor-footprint for a part that they just omitted after I approved them to do so.

Over the weekend and the next week, I'll start assembling one board step by step to verify each module. I'll probably will also livestream a good portion of that on my Twitch-Channel.
First will be the switching power supply on the left side of the board, followed by the CPU.
In retrospect, I probably should have paid a few euros more to have all the 22 Ohm series terminators on the datalines populated by JLCPCB, since there are quite a few of those on the board. They are easy to solder, but soldering so many takes time and I'm sometimes lazy  ;D

From a quick look at the board, I also realized I should have taken a look at the bottom side before ordering, since I screwed up the position of one capacitor I moved to the bottom side in my last revision. Unfortunately, I put it right where a cutout in the solder mask is  |O
I think I can just solder the cap in there by using as little solder as possible and being extra careful, but it still is an annoying mistake that could have been avoided.

I hope I'll see some of you in the chat of my stream and until then I'll leave you with a picture of this rather pretty board - If I screwed it up beyond salvage, it'll still make a good wall decoration  :D
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on August 01, 2020, 02:19:24 pm
I have assembled the power supplies, clock generator and the Serial Interface (the boring stuff basically) and so far no smoke :D

All voltages are exactly what they're supposed to be and on monday I'll install the FPGA when I'm at work.

Up to now I have identified the following problems:
- U4_CLK (74LVC74): Footprint a little bit too wide for the chip I ordered. Pin-Pitch is right, so I was able to install it anyway.
- U5_CLK: Ordered the part with the wrong footprint (Ordered PL500-17SC with SOIC-8 Package instead of PL500-17TC in SOT-23 Package). I'll have to install the chip deadbug-style since the PL500-17TC seems to be sold out everywhere.
- U5_LFS, U6_LFS, U7_LFS (Analog supplies for the REFCLK-Parts inside the AD9957): I forgot to order the 1.8V RT9193 Regulators. Don't know why, probably missed them on the list when I ordered. They're not available from Mouser, so I'll have to order from LCSC or Digikey. Until they arrive, I'll just connect the 1.8V from the switch mode converter to the output-pads of these chips. It'll introduce noise to the internal Clock of the AD9957, but at least I'll be able to talk to the chip and see if it does anything at all :)
- C31_HFS: Sits across the cutout for the shield of the ADF4355 Loop-Filter
- ADF4355 Loop-Filter:
   - Silkscreen hard to read (Needs to be rearranged)
   - Power-Traces are inside the shield-area (need to be moved outside or to the 3rd (Power) Layer)
- Tantal Capacitors: Indicator for positive side hard to see in densely populated areas
- Power Idication-LEDs: Only one color and the large Vias are placed BETWEEN Resistor and LED, so no easy to access test-points to measure voltages from PSU-Section :palm:

Not so much a problem, but some things I realized during soldering:
- Assembly: It can get kinda hard to head up GND-Pads and especially through hole contacts. Thermal relief-connects, at least to the large ground plane, might be a good idea.
- RF Power-Supply: It looks a bit too chaotic for my taste.
Title: Re: Open Source HW RF Signal Generator
Post by: rf-messkopf on August 13, 2020, 12:25:32 am
This is a very interesting project that I only stumbled upon today. Thank you very much for sharing. Just a couple of remarks from what I gathered so far:

From the block diagram I reckon that you are using the main synthesizer IC, the ADF4355, in fractional-N mode. This is perfectly fine, but the price to pay is that you get integer boundary spurs with fractional PLL divide ratios. These spurs can be very near the the carrier when the fractional divide ratio is close to an integer. Then they add to the close-in phase noise, which is often a critical requirement for signal generators. Since you already have a DDS synthesizer on the board, it might be worth considering to operate the ADF4355 only in integer-N mode, and feeding the DDS output to the reference input of the ADF4355 above 400 MHz output frequency in order to obtain the required frequency resolution. This modification should only require some additional RF switches and the requisite control lines, as well as some software modifications.

If I'm not mistaken you are using a 10 MHz signal as a reference for the ADF4355, which is divided down from a 20 MHz clock source. This is the minimum input frequency specification for the ADF4355. However, in order to optimize phase noise especially at high VCO frequencies, it is desirable not only to have a reference signal with low phase noise, but also to keep the PLL divide ratios as small as possible, which means that the frequency at the phase-frequency detector should be as high as possible. This is reason that the ADF4355 allows a maximum input frequency of 600 MHz (differential). One way to achieve a good phase noise performance might be the following:
1. Use a low phase noise VCXO with a frequency as high as possible.
2. Phase-lock this VCXO to your reference frequency (e.g. 10 MHz), and ensure that the reference PLL has a very small loop bandwidth (some ten Hertz) in order not to deteriorate the good phase noise performance of the VCXO outside the bandwidth.
3. Feed the VCXO output directly to the phase-frequency detector of your main PLL (bypass internal dividers and doublers in the ADF4355).
4. As mentioned above, you can also use a DDS synthesizer between the low phase noise VCXO and the phase-frequency detector of the main PLL.

I have tried a similar project, although that was much less ambitious (a signal generator based on the ADF4351, starting at 35 MHz output frequency, with switched harmonic filters and output leveling with a voltage controlled attenuator). See here for schematics and some test results: https://www.mariohellmich.de/projects/sig-gen/sig-gen.html (https://www.mariohellmich.de/projects/sig-gen/sig-gen.html).

Unfortunately my design suffers from an elevated spur level at higher output frequencies due to a stability issue with an amplifier at the output of the ADF4351, and for simplicity I have not provided a lot of gain reserves to achieve output levels beyond +10 dBm at higher frequencies. Currently I'm trying to convince myself to tackle a revision II of that design.  :)
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on August 13, 2020, 11:18:08 pm
Yes, the Master Clock-Block could probably be better. There's certainly room for a more complicated setup on the board in that region :D

The master clock is a 20 MHz-Clock from a PL500-17 oscillator that is distributed by a PL133 Chip to the ADF4355, AD9957 and the FPGA as a differential clock-signal. I used ATB2012-75011-T000 Baluns to turn the signal from single ended into parallel, which works pretty well, despite the Baluns not actually being used according to their specification :)

Originally, I was thinking about using a SI5340 as the main clock generator, but decided against it due to the complexity and the fact that it's a QFP-Package.
In hindsight, it might have been better to use it though, I think.

At the moment, I'm trying to figure out how to implement the SDRAM-Controller in the FPGA and how the state machine will need to work to send data to the AD9957.
For a start, I'll just use the FPGA as a distributer for the SPI-Bus to have the CPU talk to the Signal-Sources.
Title: Re: Open Source HW RF Signal Generator
Post by: rf-messkopf on August 15, 2020, 11:33:10 pm
Yes, the Master Clock-Block could probably be better. There's certainly room for a more complicated setup on the board in that region :D

It does not have to be more complicated if you use a high-performance integrated VCXO. They are available, for example, by Crystek, with frequencies up to a couple of 100 MHz. Maybe your total BOM cost will rise by five or ten Euros, and they are available from the major catalog distributors. You can get even better ones with higher frequencies from Axtal or Kristallverarbeitung Neckarbischofsheim, see, e.g., https://www.axtal.com/cms/docs/doc85902.pdf (https://www.axtal.com/cms/docs/doc85902.pdf), although they may be overkill here.

Originally, I was thinking about using a SI5340 as the main clock generator, but decided against it due to the complexity and the fact that it's a QFP-Package.
In hindsight, it might have been better to use it though, I think.

The Si5340/Si5341 are certainly good clock oscillators with low phase noise, I have used the Si5341 as LO for a shortwave receiver. But a good VCXO will be better by orders of magnitude. For example, the Crystek VCXOs have a flicker floor of close to -170dBc/Hz.

Unless you absolutely have to shave costs on that design I would go with a VCXO. BTW: Are you aware of the ADIsimPLL software by Analog Devices? It can simulate your PLL circuit and has built-in models for all the PLL ICs by Analog. It can also synthesize loop filters, so that you do not have to solve complicated systems of equations by hand to determine component values, and it can compute the output phase noise power spectral density for a given phase noise of the reference. This can help you to avoid over-engineering your reference given the performance of the ADF4355.

At the moment, I'm trying to figure out how to implement the SDRAM-Controller in the FPGA and how the state machine will need to work to send data to the AD9957.
For a start, I'll just use the FPGA as a distributer for the SPI-Bus to have the CPU talk to the Signal-Sources.

Keep us updated about your project.  :)
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on August 30, 2020, 11:58:23 pm
The Work continues.

Last Weekend I did some soldering during my livestream, where I tried to figure out why the amplifier for the reference Input didn't work until I realized that I had put a 50 Ohm Terminator next to the PLL-Chip.
Obviously, this screwed up the current flow that was going through the resistor rather than the BFR93 transistor, screwing up the bias-point and everything else.
I ended up just removing the terminator since the signal looked clean enough.
I will have to address the PLL at some time in the future, but since it was pointed out that the master clock could have been implemented better, I've put optimizing this particular PLL on the waitlist for now.

Next I checked the clock-signals to the Chips again to make sure I didn't screw up anything there and found a few things:
- ADF4355 Clock had no DC Return-Path from the PL133 and through the BALUN, so I had to solder a 100 Ohm resistor across the two DC Block-Capacitors that isolate the local termination from the BALUN to make the signal look a lot better. Also the 3.3V Termination isn't really necessary at the 20 MHz I'm feeding into the chip. It would have probably been enough to just use the 50 Ohm resistors to ground to attenuate the signal enough to make it fall in the specified area of the ADF4356 Datasheet.
- AD9957 Clock-Input needs DC Block Capacitors (Oops) - Had to cut the clock-traces and solder in the caps. Not the clock-signal looks good. Also needed 1k Ohm additional series resistance to be within spec (2000mVpp)

After that, I turned my attention to the ADF4356 to get it running. For that I took an example for the ADF5355 and adapted it to the ADF4356 today. The library holds a mirror of the ADFs registers, which allows for easier debugging and all the values in the registers are easy to read and understand the way I organized them. Not very memory-efficient, but for debugging purposes it does the job very well.
Which brings me to the next topic: Debugging this bitch.
First of all: Communication is working! I verified that I can change configuration-values in different registers and the signal arriving at the chip looks really good on the scope. I also had no lockups of the chip that required a complete reset due to spikes on the data-lines like the old system.
BUT: The chip isn't working correctly! I did manage to get one or two frequencies to be more or less what I told the chip I wanted them to be, but most of the time the output is something entirely different from what I told the chip. When I look at the N-Counter output of the chip, which should match the R Counter-Output to be locked to the reference, the signal is also all over the place. Frequency is usually quite a bit lower than the PFD-Frequency and sometimes, at higher frequencies, the pulses even appear irregularly.
From my experiments over the last few hours, the most likely culprit is the automatic VCO Band-Selection and autocalibration inside the chip. I also found several Community-Posts over at Analog Devices, but all the threads were either abandoned, or ended in "I'll tell you how to fix via Email".

So far I have played around with basically all the settings but haven't managed to figure out how to get it to work. Changing the charge pump current changed behavior a bit, but didn't cause the chip to lock. Bleed current didn't do much either. Changing the Polarity of the Phase Frequency Detector only made things worse and enabling or disabling the Doubler or Divider of the Reference-Input didn't do jack either. 

Anyone got any idea what's wrong or has some experience with this chip?

Btw. the values for the loop filter I have gotten from the ADIPLLSIM-Software are (rounded up to what I have in my parts bin):
C1: 47pF / R1: 4.7kOhm, C2: 440pF / R2: 12.1kOhm / C3: 6.5pF
According to the Software this gives a Loop Bandwidth between 42.5kHz (Phase Margin 9.25degrees) at 300uA Charge Pump-Current and 200kHz (Phase Margin 38.6 degrees) at 4.8mA Charge Pump-Current. Which, according to the software, should result in a lock-time of 2.92ms.
As far as I have checked my code, the values for the PLL Registers should be correct (Integer, Frac1, Frac2 match the values my pocket calculator gives me) and are being transmitted in the right order and as I said the chip is reacting correctly to setting bits like the configuration-bits for the MUXOUT.

In case you want to look at the code, I have updated the Github a few minutes ago.

Btw. I originally developed the driver for the ADF4355 and only realized later, during the debugging, that I have a ADF4356 on my board. Changing the Software (I don't use Register 13 right now, which the datasheet says you can do) didn't really change things however.
Title: Re: Open Source HW RF Signal Generator
Post by: OwO on August 31, 2020, 04:00:52 am
Check Vtune? If it did not select the right band Vtune should be pegged low or high. If Vtune is random you probably have a loop stability problem.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on August 31, 2020, 03:04:00 pm
Yes. Vtune is at 4.6V or at 0.2V. Depending on frequency.

I have downloaded the software for the evaluation-board and I'm going to compare the register values the chip is supposed to get (according to the Analog Devices Software) and what it is actually getting.
Title: Re: Open Source HW RF Signal Generator
Post by: rf-messkopf on August 31, 2020, 03:55:11 pm
BUT: The chip isn't working correctly! I did manage to get one or two frequencies to be more or less what I told the chip I wanted them to be, but most of the time the output is something entirely different from what I told the chip. When I look at the N-Counter output of the chip, which should match the R Counter-Output to be locked to the reference, the signal is also all over the place. Frequency is usually quite a bit lower than the PFD-Frequency and sometimes, at higher frequencies, the pulses even appear irregularly.

From my experiments over the last few hours, the most likely culprit is the automatic VCO Band-Selection and autocalibration inside the chip. I also found several Community-Posts over at Analog Devices, but all the threads were either abandoned, or ended in "I'll tell you how to fix via Email".

The N counter and R counter outputs will only be the same when the PLL is locked. I have no experience with the ADF4356 myself, but on many other PLL synthesizer chips from AD you can route the reference input of the PFD or the R counter output to the MUX-OUT output. This allows you to verify that your reference is processed properly.

Check page 26 of the datasheet, there is a restriction on the VCO band selection clock, which has a dedicated divider, which must be set up correctly. The corresponding register must be set as follows: VCO Band Division = Ceiling(f_PFD/1,600,000), or f_PFD/(VCO Band Division × 16) < 100 kHz. See also the example on page 31 of the datasheet. There is another divider for the ADC clock, which must also be set according to the PFD frequency. Moreover, there is a VCO band hold bit, which should be cleared.

Consider hardware problems (solder bridges, broken connections, etc.). If all else fails: Don't overlook the possibility that your chip can be toast. The other day I couldn't get a AFD4002 to lock. Replacing it solved the problem.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on August 31, 2020, 04:44:48 pm
My library contains code that generates the correct dividers for the internal ADC-Clock and also the correct timeouts. Changing these values didn't yield any result though.

I did find out that my code did create the wrong register settings for register 6 and also for register 3 from time to time (depending on the inputs), so I just plugged in the values from the Analog Devices tool for the Evaluation Board.

Unfortunately, the result was the same: Chip didn't generate the right frequencies.

I then started playing around with the settings and updated the register values by hand each time.
When I set the device to a VCO Frequency of 5 GHz and the Output-Divider to 2 and have the processor continuously update the frequency, I noticed that the output jumped around between 1.66 and 1.86 GHz from time to time.
Slowing down the Serial Bus didn't do anything in this regard btw and I can still reliably control the MuxOut-Pin (Checked the R-Counter and the N-Counter-Outputs).

I then started measuring the voltages at the Supply-Pins to make sure everything is okay there.
All the pins that are supposed to be at 3.3V are very close to 3.3V. Vvco and Vvco-reg are at 4.95V.
The other supply-voltages are being created inside the chip and need to be decoupled, where I started to notice something:
- CREG1 is sitting very close to 0V, while CREG2 is at 1.8V. According to the datasheet, both pins are connected to the internal 1.8V Regulator and need to be decoupled with 100nF capacitors.
- Vbias is sitting around 3V and Vref at 4.2V. <- Not quite sure if that's correct.
- Also the chip is getting really hot as soon as it's programmed and sending out a signal. Not quite sure if almost too hot to touch is too much. I can get the power consumption down by setting the power down-bit though.

So yea, busted chip is definitely a possibility  >:(
Btw. reflowing the chip didn't help and the solder looked like it was creating a connection between the pads and the chip when I moved the chip around a bit, so I dont think that the soldering is the problem here.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on August 31, 2020, 11:22:57 pm
Update:
Browsing through the Engineer Zone on Analog Device's Website, I found this:

Quote
Hello,

1. That is the correct behavior. When there is no reference signal, the synthesizer cannot work but the VCO can still generate a frequency which will be driven directly from the output pins.
2. Creg1 pin is floating, so 0V is fine. Datasheet has a typo and will be corrected.


Regards,
Kazim


and also:

Quote
All,

I figured out my issue and wanted to share.  In checking all the hardware components, I noticed that for CREG1 and CREG2 I had values to 1000pF, not the recommend 100nF (0.1uF) values.  This was a mistake in my schematic.  The thing is, the ADF4355 worked with this low cap value while the ADF4356 did not.  After following the eval board and putting a 1uF on CREG2 and 0.1 uF on CREG1, the ADF4356 works as expected.
https://ez.analog.com/rf/f/q-a/117737/migrate-from-adf4355-to-adf4356 (https://ez.analog.com/rf/f/q-a/117737/migrate-from-adf4355-to-adf4356)

I am not entirely sure, but I might have connected a 100nF capacitor to the CREG2 pin. I'll check that tomorrow.

I think it also might be a good idea to pull down the Chip Enable Signal for a second or so before initialization to make sure the chip is properly reset and the registers do not contain some data that is left over from the power up and somehow found its way inside the chip.
Hopefully this will help get this chip finally going.

There's also a way to configure the VCO Bandselect system inside the chip (Application Note AN-1353). I think it unlikely, but not impossible that my attempts at programming the ADF4356 with the values for a 4355, plus maybe one or two completely screwed up register-writes, could have corrupted the internal lookup-tables for the Autoselect. Might be a good idea to read out the chip and see what the internal tables tell me. Fortunately the MUXOUT-Signal (which turns into MISO when writing the reserved value of 0b111 to the MUXOUT-Select Bits in Register 4) is sent through the FPGA, so no acrobatics with jumper wires and soldering iron required to get it to the MISO-Pin of the CPU :)
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on September 01, 2020, 03:46:35 pm
Well, it appears to be working now.
What I did was:
- Changed the capacitor at the CREG2 Node to be sure it's 1uF - Didn't work. The Chip was still selecting the wrong VCO-Band.
- Changed the MUXOUT to Dvdd - Suddenly the Chip selected the right VCO-Band and worked.
- Changed the MUXOUT to Digital Lock Detect - Lock-Signal shows PLL is locked.

Spectrum Analyzer and Counter agree: Output is exactly what I set the chip to put out (within the measurement uncertainty of my equipment).

So the problem was probably a combination of the capacitor and the settings for the MUXOUT, or just the MUXOUT-Settings alone.

Now I have to make sure my Software is generating the right register values reliably.
I will have to test the software and make sure the chip is working properly over its entire frequency-range, of course. But at least this damn roadblock is out of the way now without having to implement workarounds to manually select the VCO-Band.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on September 29, 2020, 11:25:55 pm
Last weekend I started the development of the AD9957 Driver.

I think I can test the first basic version tomorrow (I still don't have the 1.8V Regulators and have to power the PLL and VCO-Circuits of the Chip with the not so clean 1.8V from the switch mode converter for the digital circuits - We'll see how well that goes :D ). Github-Repository is updated.

I also decided to switch from C to C++ for the project to have structures like Classes available and also to make the Driver for the AD9957 easier to port over to other IDEs like the Arduino.

Things to do right now (Next 2 Weeks):
- Test the Drivers
- Come up with a memory-map for the SDRAM attached to the FPGA
- Implement some kind of SDRAM-Controller in the FPGA
- Test the SDRAM and determine the maximum speed before read / write-errors occur <- The minimum speed I'm aiming for is 125 MHz SDRAM-Clock.

Things to do after that:
- Implement Controllers inside the FPGA to hand off programming the AD9957 and ADF4356 to the FPGA (anything from simple playback of values from RAM by a state-machine to something more fancy)
- Come up with a User Interface and mount the board inside a case.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on October 25, 2020, 03:21:31 pm
After quite a bit of frustration (partially because I've been down with a cold for 2 weeks - No Covid-19 though), I've managed to get the AD9957 to semi-work.

At first I had a few difficulties communicating with the chip, but after some fiddling I've got rock-solid communication between the CPU and the Chip (Both Write and Read). The debugging-functions in the STM32IDE really help in that regard. No need to write countless lines of Serial.println()-Statements to debug the code. Just set a breakpoint and done! :)

Unfortunately, I can't seem to get a decent signal out of the chip, which (again) has some features that aren't documented in the Datasheet - The PDF-Doubler that can be enabled by the "open"-marked Bit 0 in CFR 3 for Example.

I have verified Communication and working PLL of the Chip by enabling the SyncClk-Output (PIN55 - Output of SysClk / 4), as well as the PDCLK-Output and the REFCLK-Output:
REFCLK-Output puts out (after I removed the BALUN and replaced it with 2 capacitors) a 51% DutyCycle 20 MHz Square-Wave.
PDCLK puts out a Square-Wave at 125 MHz directly after programming the three CFR-Registers and changes to a different value depending on the Frequency set in the Profile-Register. Most of the Time it's 62,5 MHz.
SyncCLK is a 50% Dutycycle Square-Wave at 250 MHz.

So far so good.

The Output at the IOUT-Pins is a different matter though: When I program any Profile other than Profile 5 in Single Tone-Mode, I get noise with a spectrum from DC to about the StopBand of the Lowpass-Filter.
When I program Profile 5 with the exact same Values, I get a Sine-Wave with the correct frequency but with an amplitude modulation of about 0.9 Hz, as well as huge spikes at 150 and 300 MHz on the Spectrum Analyzer. On the scope it looks like another signal is superimposed on the sinewave.

I've checked all the voltage-rails and they are right where they are supposed to be. Both in terms of voltage and ripple (Ripple is less than the noise-floor of both my Scopes).

Just to check if I had done anything wrong when calculating the register-values, I generated the values with the Software for the Evaluation-Board and dropped them into my software. The result was the same.
What puzzles me is the fact that only Profile 5 seems to be working for Single Tone-Mode (sine-wave with other signals on top of it), despite the Datasheet stating that the chip contains 8 profile-registers that I can read without issues and which are selected by the 3 Profile-Pins (all of them are at 0V and held there by the FPGA, so Profile 0 should be selected).

Anyone got any ideas might be wrong? Or how to check if maybe the Profile-Pins got damaged?
One interesting observation btw.: When I programmed the chip with the values for a 250 MHz Sinewave, the SyncCLK disappeared, but the IOUT-Pins still had the 250 MHz Sine-Wave on them (plus the strange superimposed signal).

Edit:
I changed the RefCLK-Circuit a bit to make the way to GND from the !REFCLKIN-Pin shorter, but it didn't work.
Disabling REFCLK-OUT didn't help either.
Title: Re: Open Source HW RF Signal Generator
Post by: radar_macgyver on October 25, 2020, 07:34:03 pm
Are you using the auto I/O update or pulsing the IO update pin after profile changes?

I dug up an old schematic in which I used an AD9957, and noted that I have a zero-ohm resistor between I/O_RESET and CS. This forces the I/O state machine to reset after every SPI transaction. I also recall having some difficulty with SPI before I set the SDIO 'bidi' bit properly (I used 4-wire SPI). The readback of profile registers (but not writing them) depends on the state of the PROFILE[0..2] inputs.

You may also want to check the various power supplies for the device to make sure they are OK *after programming*. The supply current, especially for DVDD, changes dramatically after enabling various blocks on the chip.

When the operating mode is set for QDUC or interpolating DAC mode, the CCI filters are enabled. They do require a CCI reset, since their internal accumulators initialize with random junk. The symptom of this is random noise at the DAC outputs, as you observe for some of the profiles. You can also sample the CCI_OVFL pin. Maybe CFR1[25:24] are not set to 01?
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on October 25, 2020, 11:13:50 pm
I am pulsing the IO Update-Pin manually after transmitting the contents of one register. I'll try enabling auto IO-Update. I haven't tried changing the profiles yet, since that would require the FPGA to communicate with the CPU as well and so far I have only implemented some very basic logic in the FPGA.

I can read the registers, however and the content is always correct: It's always the same values that I wrote to the registers.

Once the Chip is programmed and doing its thing, the supply-voltages are very stable and have very little ripple on them. I have decided to use linear regulators for all the supply-rails except the DVDD-Supply. For DVDD I'm using a switchmode-converter (Regulator-Chip: TLV62569DBVR).
I've checked the ripple of the switchmode converters output and I didn't notice anything particularly strong on it. Just to be safe, I added 2x 47uF Tantalum capacitors to the 1.8V DVDD-Rail, but that didn't have any effect on the problem I have. The other voltages are very clean - I basically see no difference in the noise on my scopes when the probe touches anything on those rails.
For the linear regulators I use Richtek RT9193-18GB and Richtek RT9193-33GB with 10uF output capacitance and an additional Ferrite bead together with 10, 1 and 0.1 uF Caps as close to the pins as possible to filter any noise on the supply-pins for the analog components (like the DAC).
I noticed, however, that I have used 1uF capacitors for the DVDD-Rail instead of 0.1uF like the Evaluation-Board did. The caps are 0603 package capacitors. So I'll add a few 0.1uF caps to see if that might help.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on October 26, 2020, 01:43:21 am
I have added the 0.1 uF caps and played a bit with the settings:

I then checked all the control signals again and found something interesting:
Many control-signals have quite a bit of noise on them with Spectra very similar to that of SyncCLK-Out. Disabling SyncCLK-OUT doesn't change this.
I have 22 Ohm Series Terminators on all traces that connect the FPGA to the AD9957. On the scope I was able to see spikes with peak-values of up to 300mV. Given the Spectra and the limited Bandwidth of my Rigol Scope (100 MHz Max for both probes and Scope), I think the actual voltage might be quite a bit higher.
DC-Level is very close to 0V btw.
What I'm wondering now: How can INPUT-Lines have that amount of noise on them? Am I measuring wrong? Chip defective? Bad solder joint? The pad underneath the Chip comes to mind - Maybe the Solder didn't make good contact there.
I also noticed a 38kHz amplitude modulation on the SyncCLK-Out that gets more pronounced as soon as one of the Profiles is being programmed. I haven't found the source for this amplitude modulation, but nothing on the board is operating at that frequency and I don't see anything on the supply-rails that would explain this modulation. The most likely candidate (The Buck-Converter for DVDD-1.8V is operating at much higher frequencies and its bursts are happening at much higher frequencies and are not synchronous with the modulation of SyncCLK.
Title: Re: Open Source HW RF Signal Generator
Post by: radar_macgyver on October 26, 2020, 04:39:38 am
Hmm, it could be the EPAD is not properly soldered. There are several GND pins but the high operating frequency means their parasitic inductance can cause trouble. Also, the use of a switcher for the DVDD supply is unfortunate - the switching spikes can be difficult to get rid of, especially without a cleanup LDO. However, this will likely just cause a modulation sideband on your output, not the kind of issues you're seeing.

Maybe consider reflowing the part? Or replacing the chip? Without a schematic I can only guess.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on October 26, 2020, 08:09:22 am
I'll try reflowing the chip later today.

Regarding the switchmode power supply: Since it is only powering the internal DSP of the chip and is not connected to the DAC in a direct manner, I thought there would be a high enough isolation between the Output and the DVDD-1.8V components to make use of a switcher a good idea (the chip draws quite a lot of current on that rail - especially in QDUC-Mode).

Schematics are in the Github, but I just realized that I uploaded the wrong one for the part of the device that covers the AD9957 - I'll rectify that later. :)
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on October 28, 2020, 12:48:40 am
Today I reflowed the chip during a livestream - It didn't go according to plan... I made a mess with the solder when I installed the Chip again and had a lot of solder bridges on the chip. After finally getting rid of them, I realized there was a short on the supply-rails. Where I couldn't tell. Removed the chip again, as well as several capacitors and short was still there. So in the end I isolated the affected supply-rails (desoldered regulators) and zapped the shorted rails with 15 Amps. That cleared the short (without any smoke btw.) and I installed the chip again, as well as the all the caps.

When I tried to communicate with the chip, however, I couldn't read the registers anymore. So all the heat I applied to the chip must have killed it in the end.

But now to the not so bad news: The solder on the center pad had not melted when I desoldered the chip the first time. It looked like it had been squished a bit, but the metal on the bottom of the chip was completely dry. So there was probably not a good connection between the pad and the board, if there was any.

I have now ordered replacement-chips on ebay, but they'll take at least a month to get here. So until then, I'll have to continue without the AD9957.

I'm still not entirely sure where that short circuit came from btw. Can vias create short circuits to inner planes if heat is applied to the board for too long? As I said, I zapped the traces with 3.3V 15 Amps from my bench-supply (one lead to Ground, the other to the supply-rail. I didn't see sparks or noticed any smoke.
Title: Re: Open Source HW RF Signal Generator
Post by: uski on November 01, 2020, 08:45:42 pm
I'm still not entirely sure where that short circuit came from btw. Can vias create short circuits to inner planes if heat is applied to the board for too long? As I said, I zapped the traces with 3.3V 15 Amps from my bench-supply (one lead to Ground, the other to the supply-rail. I didn't see sparks or noticed any smoke.

For next time, if you have a thermal camera, you can put a low current into the short (just a few mA is enough, depending on the model/sensitivity of your camera) and probably see it with the thermal camera.

Interesting project BTW. I found this while searching information around the ERASynth Micro which I find is not good enough. Hopefully you will finish your project and make it available :)
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on November 24, 2020, 05:06:49 pm
The new Chips have arrived and I still see the exact same behavior.

So I decided to rebuild the part of the board with the AD9957-Chip on a small daughter-board that I can just mount into the existing mounting holes on the main board.
Connection will be done with thin wires that will be shorter than 2 cm. So signal integrity on the parallel interface shouldn't be too much of a problem. If it is, I can still reduce the speed of the parallel bus.

What I have changed for the daughter-board:
- More Capacitors - 100nF for each pin and 1uF every 2 pins, plus 10uF for the entire rail.
- Linear Regulators for every rail, including the 1.8V Supply for the digital Core
- 2.5mm hole underneath the chip to be able to inspect and if necessary reflow the solder of the exposed pad
- Fixed the Reference-Clock Input (Single Ended input terminated into 50 Ohms and the complementary input capacitively connected to ground)

With a little luck, JLCPCB will also have the AD9957 in stock by the time I order this daughter-board, so I won't have to solder everything myself :)

Apart from getting this daughter-board, I have thought about removing the series terminators on the signal traces from the FPGA to the AD9957. Last time I measured there I was able to see some ripples, but I wasn't sure if they were caused by a measurement error or if they were actually there.
Title: Re: Open Source HW RF Signal Generator
Post by: SaabFAN on February 14, 2021, 02:29:40 pm
Finally found the Problem - IT WAS IN MY F****** READBACK-FUNCTION!  :wtf:

Hardware is OK, and the Chip is being programmed OK.

But this piece was wrong:
Code: [Select]

HAL_GPIO_WritePin(AD9957_CS_GPIO_Port, AD9957_CS_Pin, GPIO_PIN_RESET); // Select the Chip
HAL_GPIO_WritePin(AD9957_IOUP_GPIO_Port, AD9957_IOUP_Pin, GPIO_PIN_RESET); // Set the IOUpdate-Pin to LOW
HAL_SPI_Transmit(&hspi2, &receiveAddr, 1, 800); // Send the Data to the Chip via SPI2
HAL_SPI_Receive(&hspi2, regBuf, reglength, 800);
HAL_GPIO_WritePin(AD9957_IOUP_GPIO_Port, AD9957_IOUP_Pin, GPIO_PIN_SET); // Set the IOUpdate-Pin HIGH to load the data from the shift register into the register set by the instruction-byte
HAL_GPIO_WritePin(AD9957_CS_GPIO_Port, AD9957_CS_Pin, GPIO_PIN_SET); // Transfer over, Deselect Chip

The Correct way is this way:
Code: [Select]
HAL_GPIO_WritePin(AD9957_CS_GPIO_Port, AD9957_CS_Pin, GPIO_PIN_RESET); // Select the Chip
HAL_GPIO_WritePin(AD9957_IOUP_GPIO_Port, AD9957_IOUP_Pin, GPIO_PIN_RESET); // Set the IOUpdate-Pin to LOW
HAL_SPI_Transmit(&hspi2, &receiveAddr, 1, 800); // Send the Data to the Chip via SPI2
HAL_GPIO_WritePin(AD9957_IOUP_GPIO_Port, AD9957_IOUP_Pin, GPIO_PIN_SET); // Set the IOUpdate-Pin HIGH to load the data from the shift register into the register set by the instruction-byte
HAL_SPI_Receive(&hspi2, regBuf, reglength, 800);
HAL_GPIO_WritePin(AD9957_CS_GPIO_Port, AD9957_CS_Pin, GPIO_PIN_SET); // Transfer over, Deselect Chip
I/O-Update BEFORE Reading Data.
After I corrected this, the Chip behaves correctly.  |O  :-DD :palm:

Which means I spent hours of troubleshooting and about 100€ for new Chips and a Daughterboard for nothing >:(
Anyone here who wants a breakout-board for the AD9957? LOL
Title: Re: Open Source HW RF Signal Generator
Post by: radar_macgyver on February 15, 2021, 02:27:04 pm
 :-+ Glad you found the issue! Do you see the 38 kHz modulation on SYNCOUT with the new board?