MAX038 Function Generator Design

RichardO

Joined May 4, 2013
2,270
In a previous reply I recommended an LM6181. While this is a reasonable IC for use on a +/-15 volt power supply, it may not work very well on +/-5 volts.

The LM6181 output swing will not be very good -- only about 4 volts p-p. It would be nice if the amplifier had a rail-to-rail output that can drive 100 ohms while running from +/-5 volts of supply. I found some but they are _not_ in through-hole packages. :(

The closest I found with a very quick search is an AD8036. The AD8036 also has the advantage that it is a voltage feedback op-amp. (The LM6181 is a current feedback op-amp). If you don't mind a SO-8 packaged IC then the ADA4817-1 is real nice but pricey.
 

Thread Starter

adam555

Joined Aug 17, 2013
858
Thanks Richard, I was about to start with the design of the final amplifier stage; as I just practically finished solving the rest of the problems and coding the counter.

I'm planning on using an AD822AN for now to do the tests, as I already have a spare one at home that I bought last year for another function generator. According to the specs it should be good up to 1.8Mhz, and from +-2.5v to +-15v. I'll take note of those you mentioned for when I buy the final op-amp.

I also need to design the power supply. I was planning on using an AC to 12v DC transformer that I found at home, split the current in two with the circuit attached (or similar), and then use positive and negative 5v regulators... any suggestions or help about this would also be more than welcome.

 

RichardO

Joined May 4, 2013
2,270
I am _not_ real fond of artificial ground circuits. This is especially true in a circuit like this that has lots of high frequencies at fairly high currents running around.

If I were doing it, I would use an AC wall transformer and 2 half-wave rectifier circuits to create an unregulated +/-20 volts. I would then regulate that to give +/-15 volts. I would then regulate the +/-15 volts to get the +/-5 volts. The +/-15 volts is used for the output amp and the +/-5 volts is used for the MAX038.

If you have +/-15 volts then you can use the LM6181 or the like. Your AD822 is way to slow to use except in testing. It is good for audio frequencies and not much more. An output amp that matches the MAX038 and swings +/-10 volts on its output needs a slew rate over 1000 v/uS and a gain-bandwidth product of a several hundred MHz. A nearly perfect amplifier is the THS6022 but it is hard to work with; being a surface mount part with a heat sink pad.
 

Thread Starter

adam555

Joined Aug 17, 2013
858
I agree with you regarding the power supply. One of the options I considered was using the case and power supply that I made last year for the ICL8038. But then I decided making it as small and portable as possible; something like the picture attached below. I also don't want to spend any more money on it -specially since I can get the one in the picture for just £9.99. For this reasons I'm trying to avoid adding a transformer as much as I can, and reuse as many parts as possible from what I have at home.

Yesterday I changed that whole splitting circuit and the regulators for a simple resistor and 2 zener 5v diodes; which regulate each rail. I tested it with the 12v AC to DC adapter and everything worked well; with the exception of the second diode, which gets smoking hot -literally-. The problem is that I need around 120mA for the positive rail, and only 45mA for the negative (the LCD consumes a lot). So I need to use a 10 ohm limiting resistor, and since the negative rail is not using all that current, it's going through the diode... I think. So today I'm about to study how transistor shunt regulators work, and see if I can solve the problem.

I also finished the the op amp test circuit. It worked well; I get 10v peak to peak, but as expected with the AD822, only up to 1Mhz. However I ran into 2 doubts:
- What pair of values should I use for the op amp resistors? I read in some places that recommend the highest values possible, and other places that recommend the lowest; so, which one would suit this application better?
- Also: which is the best place to put the potentiometer that controls the amplitude; at the input of the op amp, or at the output?

Thanks in advance,
 

Attachments

Thread Starter

adam555

Joined Aug 17, 2013
858
I think I solved the power supply without the need for transistors. I paired the function generator with the op amp (both needing 36mA from the +5v and 44mA from the -5v), and the PIC with the LCD (which need 84mA from the +5v), by using this simple circuit:

Untitled-4.jpg
I'm sure it could be improved -this is after all the first time I design anything that doesn't involve LEDs attached to a PIC or an Arduino- but I tested it and everything seems to be working well and without getting hot.

Any further suggestions are more than welcome; even criticism... but only constructive. :)
 

RichardO

Joined May 4, 2013
2,270
You don't do a project like this to save money. You do it to learn new things. As a side benefit, you can get exactly what you want rather than what some other designer thought you would need.

I am surprised that you got to 1 MHz with the AD822. I will wager that it was not a squarewave at that frequency and that you did not get 10 volts p-p at 1 MHz. ;) Also, don't forget that the amplifier has to have a usable output swing when it is loaded. The AD822 will not deliver +/-10 volts or even 10 volts p-p into a reasonable load such as 100 ohms.

At 20 MHz you need to use low value resistors -- say in the 1 K ohm range. Larger value resistors act as low pass filters when combined with stray capacitances in the circuit. In fact, the LM6181, which is a current feedback op-amp, specifies that the feedback resistor should be 820 ohms.

The output amplitude control pot must go on the input to the op-amp. If you put the pot on the output it would have to be a very small value to adjust a voltage into a 50 ohm load. Note that the output of the op-amp goes to the output connector through a 50 ohm resistor. This resistor both limits the output current in the case of a short circuit and acts as a series terminating resistor when driving a coax cable.

You need a gain of 5 to get 10 volts p-p out of your amplifier if it is running on +/- 5 volts. If the output amp is running on +/-15 volts then a gain of 10 will be needed to get 20 volts p-p. I would use a non-inverting amplifier. Connect a 1 K ohm pot with one end of the pot to the MAX038 output and the other end to ground. The wiper would go to the non-inverting input of the amplifier.

Trust me. the circuit to split the power supplies will only cause you grief at the currents you are needing. Remember that the load is not constant. Without a load on the 50 ohm output the current will be "low". With the output shorted, the power supply draw can go up by as much as 100 mA (5 volts /50 ohms)! And this added load can be on either the positive or negative power bus.

You do not want to use a shunt regulator with currents this high that can fluctuate over a 2 or 3 to 1 range. Series pass regulators are your friend. :rolleyes:

If you use an AC wall transformer you don't have to fit it in the case. :)
 

Thread Starter

adam555

Joined Aug 17, 2013
858
I completely agree with you regarding the learning, but It's not that I want to save money; I just can't keep on spending -specially when I'm dedicating far more time to electronics than my business. :oops:

Just double checked the 10Vpp claim with the AD822 at 1Mhz, and you are completely right; good catch! Sorry about that, I misread the display; the amplitude begins to drop at only 100Khz; and you begin to notice the slew rate way before that with the square wave.... and that's without any load (except the oscilloscope).

And by the way, thanks for reminding me the load; I didn't account for it until you mentioned it today. So, I just tested various loads, and I don't think I need to make any changes to the power supply; as the variation in the current is practically negligible with different loads (only 3mA difference from no load to a 100 ohm load). But the amplitude is a different story: it goes down to 9Vpp with a 560 ohm load, 8Vpp with 220 ohm, and 6Vpp with 100 ohm... forgot to measure current changes in the negative rail though.

I'm not sure what you mean by an AC wall transformer; won't I also need to split and regulate the current -on top of rectifying and filtering it-? With the AC to DC adapter I'm saving 2 steps.
 

RichardO

Joined May 4, 2013
2,270
I completely agree with you regarding the learning, but It's not that I want to save money; I just can't keep on spending -specially when I'm dedicating far more time to electronics than my business. :oops:
That is the way it is with addictions. :(

Just double checked the 10Vpp claim with the AD822 at 1Mhz, and you are completely right; good catch! Sorry about that, I misread the display; the amplitude begins to drop at only 100Khz; and you begin to notice the slew rate way before that with the square wave.... and that's without any load (except the oscilloscope).
Keep this in mind for when we discuss what speed the output amp needs. The output amp is one of the harder aspects of this project.

And by the way, thanks for reminding me the load; I didn't account for it until you mentioned it today. So, I just tested various loads, and I don't think I need to make any changes to the power supply; as the variation in the current is practically negligible with different loads (only 3mA difference from no load to a 100 ohm load). But the amplitude is a different story: it goes down to 9Vpp with a 560 ohm load, 8Vpp with 220 ohm, and 6Vpp with 100 ohm... forgot to measure current changes in the negative rail though.
I think you forgot Ohms Law here. 3 mA times 100 ohms is only 300 mV. That does not agree with your measurements. Part of the problem is that the AD822 is only specified to supply 15 mA into the load. At 15 mA, the output swing is reduced by as much as 2 volts (and as much as 3.9 volts over temperature!).

I'm not sure what you mean by an AC wall transformer; won't I also need to split and regulate the current -on top of rectifying and filtering it-? With the AC to DC adapter I'm saving 2 steps.
What I mean by "wall transformer" is the small box that plugs into an outlet and has low voltage coming out. It is sometimes refered to as an adapter. There are both ac and DC adapters. A DC adapter may just have the rectifiers and filter cap inside or it might also have a voltage regulator inside as well. An ac adapter only has a stepdown transformer inside.

The one I suggest using is an ac adapter -- no rectifiers or filter cap inside. This way a power supply with multiple output voltage can be made. I have included a schematic for what I have in mind. Note that the regulators I used are the standard ones in the LTspice libraries. What you would really use are LM7812, LM7805, LM7912 and LM7905 regulators.
FG_PS.png
 

Thread Starter

adam555

Joined Aug 17, 2013
858
Keep this in mind for when we discuss what speed the output amp needs. The output amp is one of the harder aspects of this project.
I was also thinking about using the spare op amp (probably there will be 2 in the same package) to have a digital output apart from the main one.

I think you forgot Ohms Law here. 3 mA times 100 ohms is only 300 mV. That does not agree with your measurements. Part of the problem is that the AD822 is only specified to supply 15 mA into the load. At 15 mA, the output swing is reduced by as much as 2 volts (and as much as 3.9 volts over temperature!).
Sorry, I didn't explain it right. I was measuring the current for the whole circuit -between the power supply and the positive- to know if the current varies too much to use zener diodes alone as voltage regulators.

I measured it again today I got: 111.5 mA on the +5v for the whole circuit without load, and 122.5 mA with a 100 ohm load; that's 10 mA difference, which I think is fine for the zeners. On the negative I got 40.5 mA without load, and 60 mA with a 100 ohm; which I'm not too sure. At least none of the zeners get hot anymore.

What I mean by "wall transformer" is the small box that plugs into an outlet and has low voltage coming out. It is sometimes refered to as an adapter. There are both ac and DC adapters. A DC adapter may just have the rectifiers and filter cap inside or it might also have a voltage regulator inside as well. An ac adapter only has a stepdown transformer inside.

The one I suggest using is an ac adapter -- no rectifiers or filter cap inside. This way a power supply with multiple output voltage can be made. I have included a schematic for what I have in mind. Note that the regulators I used are the standard ones in the LTspice libraries. What you would really use are LM7812, LM7805, LM7912 and LM7905 regulators.
View attachment 75256
Thanks a lot for all that help.

That circuit is similar to the one I used last year for the other function generator. It's based on a ICL8038, which only goes up to 300Khz; so if end going that way I'll probably use that power supply instead of making the same one again.

I also converted an old PSU from a PC a couple of weeks ago; which has those 3 voltages. That's what I'm using at the moment to test the circuit; but only the positive and negative 5v. I guess I could also continue using it, changing the op amp voltage from 5v to 12v as you suggest, instead of making another external power supply.
 

Thread Starter

adam555

Joined Aug 17, 2013
858
I got the MAX038 up to 20Mhz, but noticed that over 5Mhz the amplitude begins to shrink in all the outputs -with only the oscilloscope connected. Also, the only way I'm reaching those high frequencies is without anything else but the frequency adjusting capacitor -the maximum I can get with the switching transistors, which I just changed, is 6.5Mhz. So I was thinking that, since I won't be passing 5 or 6 Mhz, then an op amp with a slew rate 0f 600+ v/us would do.

You told me that the THS6022 is going to be difficult to use, so I've been looking for alternatives with a minimum of 600 v/us and found these two: the THS4222D -which I already located on ebay-; and the EL8203IS. I couldn't find any through hole though.

I was also trying to change the frequency switching transistors for other ones with lower output capacitance, but for some reason that I don't understand, not all transistors work. For example: I tried the C945, as it only has 3 pF, and it didn't work. Then tried the 2N3904, and only 1 of the 4 worked. Apart from those, the only other NPN transistors with low output capacitance that I have 4 at home where the BC547, with 3.5 pF to 6 pF. All 4 worked, but now I'm not sure what else I need to take into account, apart from the output capacitance, when I buy final transistors that I'm going to use.
 

RichardO

Joined May 4, 2013
2,270
I got the MAX038 up to 20Mhz, but noticed that over 5Mhz the amplitude begins to shrink in all the outputs -with only the oscilloscope connected. Also, the only way I'm reaching those high frequencies is without anything else but the frequency adjusting capacitor -the maximum I can get with the switching transistors, which I just changed, is 6.5Mhz. So I was thinking that, since I won't be passing 5 or 6 Mhz, then an op amp with a slew rate 0f 600+ v/us would do.

You told me that the THS6022 is going to be difficult to use, so I've been looking for alternatives with a minimum of 600 v/us and found these two: the THS4222D -which I already located on ebay-; and the EL8203IS. I couldn't find any through hole though.

I was also trying to change the frequency switching transistors for other ones with lower output capacitance, but for some reason that I don't understand, not all transistors work. For example: I tried the C945, as it only has 3 pF, and it didn't work. Then tried the 2N3904, and only 1 of the 4 worked. Apart from those, the only other NPN transistors with low output capacitance that I have 4 at home where the BC547, with 3.5 pF to 6 pF. All 4 worked, but now I'm not sure what else I need to take into account, apart from the output capacitance, when I buy final transistors that I'm going to use.
You may want to go to 33 pF, 330 pF, 3300 pf, etc instead of 22 pF, etc. The higher capacitance is less likely to be effected by stray capacitances. Note that the capacitance between contacts on a solderless breadboard is quite large -- several picofarads. To use the 33 pF cap you will have to configure the MAX038 to double the charge/discharge current. To do this, connect Fadj (pin8) to ground through a 12 K resistor. The frequency is then set using the Iin pin (pin 10).

As I stated before, the MAX038 should not drop in amplitude at a few MegaHertz. I suspect that your scope and/or probe are not fast enough. Select the square wave and measure the risetime and falltime coming out of the MAX038? Both should be 10 nS or less.

The EL8203 will not work -- its maximum power supply is 5.5 volts. Since you are looking at low voltage parts, I assume that you are not going to have a +/-12 volt power supply to run the output amp. If you are running the output amp from +/- 5 volts then you need a part that can run on 12 volts minimum. The THS6022 looks like it will work on +/- 5 volts just fine.

What circuit are you using for the frequency select transistors? You need to drive the transistors really hard. I would put 2 to 3 ma into the base. There should also be a 10 K resistor from base to emitter to hold the transistor off when it is not being driven. You need a transistor with low output/feedback capacitance, a low on voltage (saturation voltage) and a large F sub T. I don't know why the 2N3904 and 2SC945 did not work.
 

Thread Starter

adam555

Joined Aug 17, 2013
858
You may want to go to 33 pF, 330 pF, 3300 pf, etc instead of 22 pF, etc. The higher capacitance is less likely to be effected by stray capacitances. Note that the capacitance between contacts on a solderless breadboard is quite large -- several picofarads.
I'm not completely sure which values I'm going to use for the capacitors; precisely because of what you said about the stray capacitance, which on the breadboard are so large than I can run the MAX without any capacitor. I also need to take into account the output capacitance of the switching transistors, which will surely prevent me from reaching 20Mhz.

To use the 33 pF cap you will have to configure the MAX038 to double the charge/discharge current. To do this, connect Fadj (pin8) to ground through a 12 K resistor. The frequency is then set using the Iin pin (pin 10).
I have the FADJ connected to a 20k pot; but I've never been completely clear on the exact function of this pin; I just leave the pot at the point where I get the maximum output frequency -which I think is around the 12K you mentioned-.

As I stated before, the MAX038 should not drop in amplitude at a few MegaHertz. I suspect that your scope and/or probe are not fast enough. Select the square wave and measure the risetime and falltime coming out of the MAX038? Both should be 10 nS or less.
It's a 50Mhz oscilloscope and the probes are supposed to be 100Mhz. I say "supposed" because I got them quite cheap on ebay; probably from China. I don't have a faster function generator to check the equipment, so I did a quick test on the clock output of a PIC at 8Mhz. It looked fine; there wasn't any drop in the amplitude.

I also got this chip on Ebay from China, so maybe there's something wrong with it; as it happened with another XR2206 that I also bought from China and has some serious performance issues. Anyway, these pictures are with a 20pF capacitor -directly connected to pin 5 and without anything else- and show the output of a square wave at 1 Mhz...

WP_20141114_001.jpg

at 5 Mhz...

WP_20141114_002.jpg

and at 10Mhz; which, as you can see, has gone down from 2 Vpp to 1.5Vpp. Nothing to do with what the pictures in the datasheet claim.

WP_20141114_003.jpg

The EL8203 will not work -- its maximum power supply is 5.5 volts. Since you are looking at low voltage parts, I assume that you are not going to have a +/-12 volt power supply to run the output amp. If you are running the output amp from +/- 5 volts then you need a part that can run on 12 volts minimum. The THS6022 looks like it will work on +/- 5 volts just fine.
Yesterday I thought about the possibility of using transistors instead of an op amp, and today I did some tests. The best I could get, without any issue, was only up to 200Khz; so I'm not even sure it's possible to reach 20Mhz with the right transistors. If it's possible, I'd rather prefer to do it what way than using a surface mount op amp. How do you see it?

What circuit are you using for the frequency select transistors? You need to drive the transistors really hard. I would put 2 to 3 ma into the base. There should also be a 10 K resistor from base to emitter to hold the transistor off when it is not being driven. You need a transistor with low output/feedback capacitance, a low on voltage (saturation voltage) and a large F sub T. I don't know why the 2N3904 and 2SC945 did not work.
I'm using the circuit that atferrari suggested in post #11 (you can also see it implemented in this other thread), and which so far is working pretty well. Until now I was using 56K resistors (the highest values that worked) between the PIC's I/O pins and the base of each transistor, but no resistor to hold them when they are off. I'm also not using the base bias resistors shown in atferrari's circuit.

The transistors I'm using now are the BC547, and which have 3.5 to 6 pF and a current gain bandwidth product of 300Mhz. The datasheet also states that they have 9 pF input capacitance, which I'm not sure it has any effect.

Before I starting looking to buy the final transistors I need to find out why some of them don't work.
 

RichardO

Joined May 4, 2013
2,270
I'm not completely sure which values I'm going to use for the capacitors; precisely because of what you said about the stray capacitance, which on the breadboard are so large than I can run the MAX without any capacitor. I also need to take into account the output capacitance of the switching transistors, which will surely prevent me from reaching 20Mhz.
33 pF is about the largest capacitor value that can be used for the timing cap. Since there will be a lot of unknown stray capacitance you will need a variable cap to calibrate the 20 MHz range. I am guessing that a cap that varies between 4 and 25 pF will work on a PCB.

I have the FADJ connected to a 20k pot; but I've never been completely clear on the exact function of this pin; I just leave the pot at the point where I get the maximum output frequency -which I think is around the 12K you mentioned-.
The Fadj pin is a voltage input that accepts input of between -2.4 volts and +2.4 volts. See the graph on page 4 of the data sheet. When you use the Fadj pin, you want to connect the pot between +2.5 volts and -2.5 volts with the wiper going to the Fadj pin.

If you use the Iin pin then you should connect the Iin and Fadj pins as shown in figure 2 on the data sheet. Even though the example does not show it, I would put a 470 ohm resistor in series with the pot to limit the current.

It's a 50Mhz oscilloscope and the probes are supposed to be 100Mhz. I say "supposed" because I got them quite cheap on ebay; probably from China. I don't have a faster function generator to check the equipment, so I did a quick test on the clock output of a PIC at 8Mhz. It looked fine; there wasn't any drop in the amplitude.
A 50 MHz scope should have a risetime of about 7 nS. The 100 MHz probe should be about 1/2 that or about 3.5 nS. The risetime of the scope and probe together will be about the square root of the sum of the squares of the 2 risetimes -- About 8 nS. The Max038 has a risetime of about 12 nS. What you would expect to see on your scope is about a 14 nS risetime. Risetime is about 0.35 times 1/frequency at the -3dB point. So, a 14 ns rise time would show a sine at 3 dB down at 25 MHz.I have not run the numbers but this is about what you are seeing in the 10 MHz waveform.

Yesterday I thought about the possibility of using transistors instead of an op amp, and today I did some tests. The best I could get, without any issue, was only up to 200Khz; so I'm not even sure it's possible to reach 20Mhz with the right transistors. If it's possible, I'd rather prefer to do it what way than using a surface mount op amp. How do you see it?
I have tried to make my own fast op-amps. It is really hard to do. I think that you will either have to use a SMD part or go with a +/- 12 volt power supply for the output amp and use a LM6181. I noticed that I had a typo in the earlier reply... I should have said: "The _THS4222_ looks like it will work on +/- 5 volts just fine."

I'm using the circuit that atferrari suggested in post #11 (you can also see it implemented in this other thread), and which so far is working pretty well. Until now I was using 56K resistors (the highest values that worked) between the PIC's I/O pins and the base of each transistor, but no resistor to hold them when they are off. I'm also not using the base bias resistors shown in atferrari's circuit.
With the PIC driving the transistor you don't need the resistor from base to emitter of the transistor. You do want it while using jumpers on the solderless breadboard. I would overdrive the base with a resistance way less than 56 K, i.e. more like 2.2 K. Try both and see which works best...

The transistors I'm using now are the BC547, and which have 3.5 to 6 pF and a current gain bandwidth product of 300Mhz. The datasheet also states that they have 9 pF input capacitance, which I'm not sure it has any effect.

Before I starting looking to buy the final transistors I need to find out why some of them don't work.
The BC547 sounds like it will work although its output capacitance is a bit high. The PN2369 (2N2369 in a plastic package) is a little better. I like the looks of the 2n5770.
 

Thread Starter

adam555

Joined Aug 17, 2013
858
33 pF is about the largest capacitor value that can be used for the timing cap. Since there will be a lot of unknown stray capacitance you will need a variable cap to calibrate the 20 MHz range. I am guessing that a cap that varies between 4 and 25 pF will work on a PCB.
Thanks for the tip; it's much better than what I was planning to do, which was to test the final capacitor values once I had every other component soldered in the final PCB.

The Fadj pin is a voltage input that accepts input of between -2.4 volts and +2.4 volts. See the graph on page 4 of the data sheet. When you use the Fadj pin, you want to connect the pot between +2.5 volts and -2.5 volts with the wiper going to the Fadj pin.

If you use the Iin pin then you should connect the Iin and Fadj pins as shown in figure 2 on the data sheet. Even though the example does not show it, I would put a 470 ohm resistor in series with the pot to limit the current.
Yes, I have the pot and the FADJ pin connected as you said -including the limiting resistor- what I don't have clear is the exact function of this pin. I mean, why have a FADJ if I'm already controlling the frequency with Iin?

I have tried to make my own fast op-amps. It is really hard to do. I think that you will either have to use a SMD part or go with a +/- 12 volt power supply for the output amp and use a LM6181. I noticed that I had a typo in the earlier reply... I should have said: "The _THS4222_ looks like it will work on +/- 5 volts just fine."
I meant a common pull-push amplifier, rather than making an op amp; that would be too complicated for now. Do you think that a pull-push with the right transistors could handle at least 5 Mhz?
 
Last edited:

RichardO

Joined May 4, 2013
2,270
I thought some more about you problems viewing the waveforms at high frequencies.

Looking at your waveform for 1 MHz it looks like your scope probe may not have the high frequency compensation set properly causing the overshoot on the square wave. I don't think this is your problem seeing high frequencies, however, since the overshoot indicates peaking in the frequency response.

When measuring these kinds of frequencies, the ground lead must be the shortest one that comes with the probe -- 4 to 6 inches at most. The probe ground must be right where the 0.1 uF bypass caps connect to the ground bus.

I said that the response at 10 MHz was about what I expect -- I lied. You should not see that kind of attenuation until you get to more than 25 MHz.

Can you take a picture of the 1 MHz square wave with just the risetime showing? The timebase needs to be 200 nS/Division with the X10 magnification turned on.

Also, can you look at the +5 and -5 volt power supplies? They may be sagging when the MAX038 tries to drive internal and external loads. To minimize this you need a 0.1 uF ceramic caps with the shortest leads possible from the MAX038 power pins to ground. You also need a caps of at least 10 uF on the +/-5 power buses where the power comes into the solderless breadboard. I recommend re-reading my notes on prototyping high frequency circuits on a solderless breadboard now that you are seeing the problems caused by the breadboard. The notes are pretty minimal so if you have any questions, let me know!

The Fadj pin is easy to use but only has a limited frequency setting range. The graph on page 4 of the MAX038 data sheet shows about 6:1. In contrast, the Iin pin can set a frequency over a range of about 200:1 according to the other graph on page 4.

See applications information for the LH0002 for an example of a buffer amplifier that you can build. Don't expect great performance, though. The buffer amp is normally placed in the feedback look of a low power op-amp. You are better off just using an op-amp that does not need the extra buffer.

Another comment about the transistors used to select the frequency range. Even a small equivalent resistance (say 20 ohms) of the transistor when it is on will cause a discontinuity in peaks of the triangle and sine waves. This is one measure of how well the transistor switch is working. In simulation I saw a "glitch" of about 35 mV.


View attachment AN-227_buffers.pdf
 

Thread Starter

adam555

Joined Aug 17, 2013
858
I did read the SBB pdf, but to implement all those tips I'll have to completely remake the circuit. Anyway, this weekend I managed to get under control most issues; or at least find the causes and learn how to avoid them. I usually don't worry too much about these small performance issues, not only because I assume they're caused by having it all on a breadboard, but because some of them come and go without changing anything (e.g. the overshoot in the square wave, which I can't even reproduce today).

I noticed there was a small drop in the +5v supply, which also comes and goes depending on the day; but I think I have already solved that problem and both supply rails are now steady.

I tried to change the base resistor of the range switching transistors, and rise the base current to the 2 mA you suggested, but these transistors will not work even with 10k resistors -the output waveform is distorted towards the lower half-; so I'm using 33k instead of the previous 56k resistors.

Before I post the picture of the rise time you asked I need to warn you that I think there's something wrong with the x10 magnification of my oscilloscope; it seems to magnify only x5, though it clearly states x10. The picture on the left is of a 5 Mhz square wave at x1 magnification with the time base at 200ns per division. If each cycle occupies 1 division at x1, then at x10 it should occupy 10 division; doesn't it? well, as you can see in the picture on the right, the same 5 Mhz in the 200ns range at x10 occupies only 5 divisions. How can that be?

Untitled-11.jpg

Taking this into account, and now that I got rid of the overshoot, the small drop in the supply voltage, and the discontinuity in the middle of the output waveform, I'm posting again the 1 Mhz square wave:

WP_20141116_002.jpg

5 Mhz...

WP_20141116_003.jpg

10 Mhz (almost)...

WP_20141116_004.jpg

and the 1 Mhz in the 200ns range at x10 (which I think is only x5)...

WP_20141116_005.jpg

I've also confirmed in the oscilloscope's manual that the rise time is the 7ns you calculated, and in the MAX datasheet it states 12ns for the output pin and 10ns for the SYNC pin (the pictures are for the output).

I need to do some more work on the switching transistors, as I've noticed the discontinuity you mentioned, plus a bigger one in the middle (as you can see in the picture below); though I think this last one is due to having the switching circuit with the capacitors far away from the COSC pin. The best thing is to build another small circuit with just the MAX and the switching transistors to do these tests without anything else interfering.

WP_20141116_001.jpg
 
Last edited:

RichardO

Joined May 4, 2013
2,270
OK. It looks like you have a 60 nS risetime. That is about 6 MHz of bandwidth. You said that the 8 MHz clock from a PIC looked OK? It shouldn't if the scope only has 6 MHz of bandwidth... That implies that the problem is in your circuit. Can you give me a picture of your breadboard? Maybe I can help without you having to do a complete rebuild.

That discontinuity near zero volts looks like oscillation. Are you using the artificial ground circuit? If so, that could be part of the problem. Remember that the artificial ground must be stable for both DC and high frequency ac.

One source of flaky waveforms is if the scope ground lead is broken inside the insulation. In my experience, the break is always at the strain relief at the probe end. The test for this is real simple. Pull on the ends of the ground lead and if it stretches at the strain relief then it is broken there.

It does look like your scope has a problem with the magnifier circuit. :( Another thing to add to your list of things to fix. The list for my 25 MHz scope is very long. It is showing its age -- over 40 years old. I bought the scope new and it has served me well so I really need to do a refurbish to get it back to working properly.

I have attached a simulation of the transistor frequency switch in several configurations. You can play with that to get a better feel for different transistors, circuits and resistor values before soldering up a test circuit.

555_Freq_Sw.png
 

Attachments

Thread Starter

adam555

Joined Aug 17, 2013
858
Today I extracted the MAX038 from the circuit and placed in another one with just the minimum components. I got the same results as before without the switching transistors.

Regarding the tests I did with the PIC, what I meant was that there was no attenuation of the amplitude at 8 Mhz as compared with 4 Mhz; but the wave looks like the ones from the MAX038. As a matter of fact, I just repeated the test today, and there is a small attenuation at 8 Mhz; which proves your suspicions that the problem is with the rise time of the oscilloscope.

Talking about the rise time, I don't understand how you got the 60 nS; shouldn't it be 120 nS? I mean, bear in mind that the x10 picture I posted is in reality just x5; so, if 5 divisions is 200 ns, and the trace reaches the top around the 3rd division, that would be 120 nS... unless you are calculating it from 10% to 90%.

I am still using the artificial ground, but I don't think that's the problem; as the discontinuities at the top and bottom and the oscillation at 0 volts only appears when I use the range switching transistors. If I connect the range capacitor directly between COSC and ground -bypassing the switching circuit- I get a clear wave without any faults.

I'm going to begin the transistor tests this week; so thanks for the simulation. I'll post the results next week.
 

RichardO

Joined May 4, 2013
2,270
Talking about the rise time, I don't understand how you got the 60 nS; shouldn't it be 120 nS? I mean, bear in mind that the x10 picture I posted is in reality just x5; so, if 5 divisions is 200 ns, and the trace reaches the top around the 3rd division, that would be 120 nS... unless you are calculating it from 10% to 90%.
Yes, I measured the time from 10% to 90% -- that is the standard method. Measuring from 10% to 90% gets rid of most of the ambiguities caused by overshoot and ringing in the waveform.
 
Top