Electrical impedance of Dout port

dr.benway:

If you are trying to build a DAC with some sort of custom weighting

Yes, that's correct.

This a project about an alternative design of a "DAC ".
The circuit is incomplete and the weighted resistors value is WRONG (I need to calculate the right value yet ).

I posted the schematic, only to explain the kind of topology of the net.

Anyway, the problem is the signal for arduino, or maybe the probe of the scope.
I am sure about this.

Thanks.

Giorgio.

When you mention the "problem", are you saying that you already have an end result that shows the effects of the overshoot of the square wave or that you are just predicting that the overshoot will affect your end result?

[

When you mention the "problem", are you saying that you already have an end result that shows the effects of the overshoot of the square wave or that you are just predicting that the overshoot will affect your end result?

Yes.
I want to generate a squared "sinusoidal" wave summing 4 weighted digital signals.
But,
every signal have overshoots so the results is a "dirty" sinusoid.
This is my problem, not a prediction.
My priority is to eliminate the overshoots from Arduino.
Maybe there is something wrong in my probe.

Thanks.

Maybe there is something wrong in my probe.

I suspect some of your overshoot is due to your breadboard/probe.

May I make a suggestion? Instead of toiling with the circuit you have, use an off the shelf DAC with enough bits of resolution to get the result you expect from your discrete circuit. You are less likely to get the sort of overshoot you are seeing that way. If it is really important that your final product use the weighted resistor approach you are trying now, you can attack that problem again.

Your solution doesn't have to be this complicated.

Take 5 resistors: tie your four output pins together through 4 reistors, R0..3, and from there tie them to ground through Rg. Buffer the output from where the resistors meet, with a jfet or an opamp.

The output voltage is = (V0/R0 + V1 / R1 + V2 / R2 + V3 / R3) / (1 / R0 + 1/R1 + 1 / R2 + 1 / R3 + 1 / Rg). V0..3 is either 0 or 5v, representing the output from your mcu.

All you need is to find the values of R0..R3 (in terms of Rg) to best approximate 16 points on a sine curve over 360 degrees (actually just over 90 degrees but that requires fancier software / hardware).

Take 5 resistors: tie your four output pins together through 4 reistors, R0..3, and from there tie them to ground through Rg. Buffer the output from where the resistors meet, with a jfet or an opamp.

The output voltage is = (V0/R0 + V1 / R1 + V2 / R2 + V3 / R3) / (1 / R0 + 1/R1 + 1 / R2 + 1 / R3 + 1 / Rg). V0..3 is either 0 or 5v, representing the output from your mcu.

Yes, I am sure of this, but this kind of design is useless for my application.

I need a design as this:

My problem is about the implementation of the switch.
The c-mos are working in this case, but maybe there are better design available... i need to study this part yet. :roll_eyes:

But my topic now are the spikes from arduino.
I only need to put the right capacitor at the right place ... :cold_sweat: :cold_sweat: :cold_sweat:

I only need to put the right capacitor at the right place

Only if it were that simple. Two causes for those spikes:

  1. gate capacitance: as long as you have mosfets, you have gate capacitance, especially when they are undampened;
  2. non-atomic operation on the output pins.

Essentially, you took the more difficult route when easier ones are available.

  1. gate capacitance: as long as you have mosfets, you have gate capacitance, especially when they are undampened

Yes, I will put a dump resistor between the gate and the ground, to protect the mos.

If i connect directly the probe to arduino i have this behaviuor:

A probe grounded with a spring have a better result:

So the problem IS the probe.

I the weekned i will post some results ...

Yes, I will put a dump resistor between the gate and the ground, to protect the mos.

A 'damping' resistor if required, needs to be in series with the gate from the driving source, not wired to ground. 220-330 ohms seems to be a popular size to use.

Lefty

My approach to this comes from a naive amateur's perspective. Whenever I want to do a "select i of n" operation, or a multiplexing operation, I fall back on the old tried-and-true 4066 D/A switch. In a 14-pin DIP, or even smaller SMD package, one gets 4 gates with low power drain, very high input impedance, good isolation and bi-directional output (with some limitations on the last - see data sheet). No matter how noisy my input, I've always gotten clean output. In an electrically noisy, DC-motor and long cables, environment, even with 100k, or even more, pull-ups noise has never been a problem, and simple RC timing of inputs yields nice on or off delays. Combining 4066 gates with diode-diode logic and or with each other one can get a lot of flexibiity for implementing just about any logical switching function.
Ciao,
Lenny

I fall back on the old tried-and-true 4066 D/A switch.

You used one of these at 2MHz as the OP wants, or even at 200KHz? They are as leaky as a sieve. I tried several to multiplex a 125KHz RFID signal recently and they were total rubbish. The signals from some unselected channels were just as big as the signal from the selected one.

Grumpy,
You're absolutely correct about my logic, I didn't think past my usually-DC uses. I am rather surprised by your results, however, as the specs on these would imply otherwise. From the TI data sheet for the archetype CD4066B:

Low Crosstalk Between Switches: ?50 dB
Typical at fis = 8 MHz, RL = 1 k?

and

Frequency Response, Switch On = 40 MHz
Typical

Ciao,
Lenny

While that is what the spec sheet says, this is only true when layer out on a PCB with ground plane and terminated correctly. In other words it is the best you will get not what you will get.

I did the following modification in the schematic, so no more overshoots now. ]:smiley:

The resistor is 47 ohm, the capacitor is 10 nF

The current input of the switch is almost zero.

I'm working with analog devices adg419

http://www.analog.com/static/imported-files/data_sheets/ADG419.pdf

The problem is the frequency.

Now with arduino duemilanove I'm working @ 10 khz but in future I will arrive at 1 mhz or more, so don't know if this is the right switch design for HF.

The biggest trouble now is the op-amp : it works perfectly for 10 minuts and after go on strike!
I have already burned two. =( =( =(

So, where is the problem now?

Anyway, I solved the problem of topic : I NEED THIS RC NETWORK.

100000 thanks 8)

For higher frequency I suggest you use a proper DAC rather than your home-made one. If you only want sine wave output then try this http://www.ebay.co.uk/itm/New-AD9850-DDS-Signal-Generator-Module-0-40MHz-Test-Equipment-/180820399452?pt=UK_BOI_Electrical_Test_Measurement_Equipment_ET&hash=item2a19bc555c.

Have you tried it with 1mhz yet? You can get a 50%duty cycle 1mhz square wave from the 328 pretty easy, tho idont remember offhand its only a few lines of code
I would suggest making a (few) prototype pcb from batchpcb or similiar , making it as tight together as possible, will ground plane, and then check again for your overshoot, you may find its entirely related to the prototyping method you are using

The resistor is 47 ohm, the capacitor is 10 nF

You don't need that capacitor - it is counter-productive, especially if you want to go to 1Mhz later.

You could have used some of the analog switches in the CD/HC family.

I would have used a 4.7 - 22ohm resistor to dampen, but not with an analog switch.

Now with arduino duemilanove I'm working @ 10 khz but in future I will arrive at 1 mhz or more, so don't know if this is the right switch design for HF.

A few hurdles there:

  1. your buffer will give out way before 1Mhz.
  2. your mcu may not be fast enough to produce 1Mhz pin outs.
    ...

Two alternatives to go to 1Mhz and beyond:

  1. DDS. This approach requires additional hardware + programming. But it can generate lots of different waveforms and relieve your mcu.
  2. Use a counter + resistor network. This approach requires just a serial clock (from your mcu).

A 3rd approach would be to use a memory device pre-programmed with your waveform as your own dds.

A 3rd approach would be to use a memory device pre-programmed with your waveform as your own dds.

That's the approach I've found is the most versatile for generating waveforms that are very complex and that you need to repeat... well, repeatedly :).

You can drive the address pins of an EPROM with an up-down counter clocked via your MCU or address the EPROM directly from an MCU output port. I guess you can still buy EPROMs. :slight_smile: The variations are endless.

Those are really the great-grandfather of today's cpld/fpga. Parallel eeprom and parallel sram are still available today, albeit hard to find.

Those are really the great-grandfather of today's cpld/fpga. Parallel eeprom and parallel sram are still available today, albeit hard to find.

I suspected as much. Dual port SRAM is another approach if you need to change the table driving the DAC periodically. I used counters with transparent latches for the address bus part of the dual port.

For higher frequency I suggest you use a proper DAC rather than your home-made one. If you only want sine wave output then try this http://www.ebay.co.uk/itm/New-AD9850-DDS-Signal-Generator-Module-0-40MHz-Test-Equipment-/180820399452?pt=UK_BOI_Electrical_Test_Measurement_Equipment_ET&hash=item2a19bc555c.

Yes,actually the concept of my schematic is very poor. (it sucks :sweat_smile:)
:

I will try this Digital Device System
Thank you very much for the suggest, very appreciated.

Best regards.