We have a little proto board with a RP2040 Rpi cpu and an Efinix T20 FPGA. The Pi configures the FPGA at powerup and then talks SPI to it.
We often need programmable clocks so I added a few parts to make a DDS frequency synthesizer. We use a PLL inside the FPGA to spin up a 204 MHz clock for the 32-bit phase accumulator. The sine lookup is 4K points and the "dac" is six resistors.
This lowpass filter is tacky, but it all works. At 50 MHz, the jitter is a few hundred ps p-p, and that looks mostly like amplitude noise to me.
formatting link
The FPGA 1.2v core supply uses about 30 mA total when this is running at 50 MHz out.
John Larkin Highland Tech Glen Canyon Design Center Lunatic Fringe Electronics
Didn't find your answer? Ask the community — no account required.
J
john larkin
The MSB actually sees 500 ohms.
One can buy a real r-2r network cheap, but it's easier to use 0603 resistors that we have in stock.
If you program high drive strength, that T20 is pretty fierce...
formatting link
Well, that's what the IBIS model says.
John Larkin Highland Tech Glen Canyon Design Center Lunatic Fringe Electronics
D
Don
Also, the ability to adjust assembled resistor values works better for me as a DIYer. Here's mouser's offering for the geniuses in our midst, with the foresight to always choose the correct component:
formatting link
Compared to the R-2R DAC, the binary weighted digital-to-analogue converter has an analogue output voltage which is the weighted sum of the individual inputs. Thus it requires a large range of precision resistors within its ladder network, making its design both expensive and impractical for most DAC's requiring lower levels of resolution. Discussions in this group left me with the impression precision resistor fabrication became trivial thanks to the trimming technology of modern lasers? Is the price of precision resistors still a factor?
M
Martin Brown
And R/2 is two 1R in parallel. You end up with the 1R being the least accurate. It gets out of hand quickly if you want too many bits.
J
john larkin
I figured that using 1% resistors, this sort of dac would be about monotonic at 6 bits. Six bits makes a pretty decent looking sine wave, which filters/interpolates into a low jitter clock.
formatting link
R-2R made from discretes would use twice as many resistors.
The 204 MHz phase accumulator clock has 5 ns p-p jitter. Adding this stuff improves jitter about 20:1.
It will need a fast comparator to make the sine into a cmos level clock to feed back into the FPGA. An LVDS line receiver can do that.
Just a fun little diversion.
John Larkin Highland Tech Glen Canyon Design Center Lunatic Fringe Electronics
C
Chris Jones
You don't want them the same though: The MOSFETS of the CMOS logic outputs have some on-resistance (maybe 30-50 Ohms) and so the resistors in series with each of these outputs should be decreased by whatever you measure that output resistance to be, otherwise the resistance ratio isn't 1:2 in the R-2R network, and the DNL will be poor.
You could use the average of the on-resistance of the NMOS and the PMOS (which are not quite the same), measured on a typical chip, at room temperature, so that it is usually at least roughly correct, rather than systematically and always wrong.
The MOSFET on-resistance is usually a more important effect than the error of 1% resistor tolerances, so it makes sense to fix that before worrying about selecting resistors from the same batch.
It is worth fixing it for R-2R and also for at least a few msbs of binary weighted resistor DACs.
J
john larkin
Or stuff it into a differential input of the FPGA.
John Larkin Highland Tech Glen Canyon Design Center Lunatic Fringe Electronics
M
Martin Brown
Fixed supply voltage load it with a series of different resistors and measure the voltage across them. MOSFETs were a favourite of university physics practicals as they fitted in nicely with solid state theory.
L
Lasse Langwadt
you can probably get it from the IBIS model
J
john larkin
Use Ohm's Law!
This is the IBIS of one gpio pin of the efinix T20.
formatting link
That's pullup to 3.3 volts, the pfet side.
You can see a small glitch at the midpoint of this sine wave
formatting link
which is the classic dac MSB crossover error. It's not enough to matter, but I might tweak the first resistor to beautify that.
John Larkin Highland Tech Glen Canyon Design Center Lunatic Fringe Electronics
W
Waldek Hebisch
For logic MOSFETS in IC-s I just used a multimeter. For power MOSFETS I used "two meter" method: resitor to limit current to reasonable range, ammeter to measure current, voltmeter to measure voltage drop on the MOSFET. Actually, I had extrea voltmeter to measure gate voltage.
J
john larkin
Spice is great for playing with ideas. We are developing a series of resistor-inductor simulators, RL dummy loads, that were invented by fiddling with Spice. They work but I still don't understand them.
John Larkin Highland Tech Glen Canyon Design Center Lunatic Fringe Electronics
B
Bill Sloman
That's risky. Spice isn't great on finding potential parasitic oscillations.
The classic example is the Baxandall Class-D oscillator, which doesn't settle down if you build it with bipolar transistors and too high a feed inductor.
Baxandall's 1958 paper mentions this - but only in a footnote - and he clearly didn't understand what was going on.
In the 67 years since then we've found out that it doesn't happen with MOSFET switches, and - once Spice had been invented - we found that Spice models didn't squeg. With a high inductance feed inductor they started up with a big overshoot, and the switching transistors could get reverse biased during the recovery from that first peak , but after that the Spice model would eventually settle down. Perhaps with a more realistic model of a bipolar transistor it wouldn't have - the Gummel-Poon model doesn't model inverted operation all that well.
I'm now wondering if a zener diode on the centre-tap could clip the overshoot, and prevent the recovery from going negative enough to keep the bipolar switches from ever getting into inverse operation.
The zener diode break-down voltage would have to be chosen so that it didn't turn on during normal operation, but that's easy enough.
If Peter Baxandall had understood that back in 1958, he still probably couldn't have bought a zener diode to do the job - I got into electronics about ten years after that, and while I could buy voltage reference diodes back then, they were expensive and hard to get hold of.
J
john larkin
Differential equations and control theory aren't either.
A little practical experience can supplement a Spice sim. Spice doesn't punch out gates if the voltage is too high, and Spice transistor models don't include wirebond inductance.
John Larkin Highland Tech Glen Canyon Design Center Lunatic Fringe Electronics
W
Waldek Hebisch
Well, that gives static behaviour. Performing measurements at multiple points one can get reasonable approximatin to V-I curve. When building a DAC one want most resistance in external resistors, so few points should be enough (one probably gets more error due to variation in devices than due to nonlinearity).
On PC Linux Spice-NG compiles fine from sources. I did not try to compile it on Raspberry Pi, but IME problems with compilation on Raspberry Pi are rare, so I expect this to work.
OTOH Spice-NG can not read LTSpice file which folks here tend to post. And Spice-NG comes with no device parameters. Parameters for Fairchild 2N3904 and 1N4148 are in datasheet, so one can use them. For handful of other devices I was able to find parmeters on the net. But apparently, for most devices manufacturers consider Spice paremterts as a secret. So due to lack of device data Spice-NG can not be used for accurate simulation (unless somebody can infer parameters from measurements or have some other way to get them).
Concerning IBIS models, text that you linked in other post clamis that the models are plain text with well-described format. If true, one should be able to extract/interpolate various curves from model data with rather simple ad-hoc tool, without need for Spice.
BTW: I tried to use Spice-NG to simulate detector using 1N4148. However, results I obtained look too good: according to Spice-NG such detector should work for signals at few millivolt level and well above 1GHz. My detectort was lightly loaded (1M resistor
filtering capacitor as a load) and low bandwidth. But if
1N4148 really works so well as Spice-NG claims, then people using Shottky or germanium diodes in similar detectors are overdoing it.
Concerning Raspberry Pi, currently Chinese mini-PC is cheaper than Raspberry Pi powerful enough to serve as a main computer. I recently bought a few cheap Orange Pi-s and Milkv Duo-s. But they are low end machines. Would be reasonably powerful as desktop/server in 2000 (or maybe in 1999, clock freqency was increasing fast in those years), but not now. I am using Orange Pi-s to check that my software compiles fine on ARM. I have Milkv Mars, which is slightly more powerful than Milkv Duo S, I use it to test that my software compiles fine on Risc-V. But otherwise those boards are useful as a way to control electronics via Ethernet
B
Bill Sloman
You missed the point. Neither differential equations nor control theory "understand the circuit". That's your job.
It doesn't take a lot of practical experience to know when Spice is falling short. You do have to build the circuit and test it to find out what Spice is missing.
And you have to test it on the cases where Spice falls short, which can be a problem, but your customers will do it for you, and complain bitterly when they find an example.
Microsoft was once described as having the largest testing laboratory in the world - all their customers were roped in
At least some Spice transistor models do include wirebond inductance, and it is not hard (but can be messy) to add them into the circuit being modelled.
J
john larkin
The FPGA DAC drive pins operate near the rails, so all we need to know is Rsds-on and maybe prop delay skew.
We'll never make a very good DAC from an FPGA and a resistor network, but it's good enough to make a decent DDS.
Which gives me an idea.....
John Larkin Highland Tech Glen Canyon Design Center Lunatic Fringe Electronics
W
Waldek Hebisch
If display has sane control, then simple 8 pin micro should be enough. Blue Pill certainly could do this.
Mini PC with 6 GB RAM, 64 GB e-MMC is about $60.
Yes. That is very expensive variant. Also Newegg may be expensive.
I bougt
aliexpress.com/item/1005005785695181.html
which is (including shipping) slightly more than $16.
Milkv-Duo S in $9 + shipping.
Some people claim that satellite box receivers can serve as cheap computers, but I did not try.
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.