0
\$\begingroup\$

Is it OK to use an asynchronous counter for DAC input? If I understand it correctly, the output pins on the counter do not change simultaneously with the clock? Does the latency for every higher bit adds up? In other words, going from 0 to 1 takes the same time as going from let's say 999 to 1000?

My system is 8 bit, but I need to create a sawtooth-looking rapm of 10bit increments. Instead of using two ports, I want to clock an external counter using only one bit. The counter, in turn, will advance every clock cycle, and provide the DAC with 1LSB higher input.

The word asynchronous worries me because if bits have different delays, the transition between powers of 2 can have some intermediate values. For example, going from 7 to 8 would look like 0111 -> 1000. If the bits do not flip simultaneously, the transition could look like this, for example: 0111 -> 0110 -> 01010 -> 1000. Is this how it works? The transitions might have some intermediate/indeterminate state?

\$\endgroup\$
4
  • \$\begingroup\$ Can't you find a DAC with a load pin so that once the "count" has settled down you toggle the load pin and the count number is latched into the drivers for the R-2R network? \$\endgroup\$
    – Andy aka
    Apr 17, 2014 at 22:16
  • \$\begingroup\$ Probably I could find one with 'ready to sample' pin, but am I thinking correctly? I do not mind it to be delayed, as long as I do not get this intermediate 'whatever' states? \$\endgroup\$
    – Nazar
    Apr 17, 2014 at 22:35
  • \$\begingroup\$ How fast does this need to count? \$\endgroup\$
    – gwideman
    Apr 17, 2014 at 23:08
  • \$\begingroup\$ @gwideman About 10kHz. \$\endgroup\$
    – Nazar
    Apr 18, 2014 at 13:04

2 Answers 2

2
\$\begingroup\$

In an asynchronous counter the carry ripples through, and the outputs will not change at exactly the same time.. the time increases as the significance of the bits increases.

So, if you go from 01....1 to 10...0, the outputs might go 01....10, 01...100, ... 00...0, 10...0.

If you have a synchronous counter, the outputs will change at (almost) exactly the same time (a short time after the active clock edge). There might be a small amount of skew, because not everything in the paths will be identical.

If you add a latch to an asynchronous counter, the output will change as with the synchronous counter, but one clock later.

Even with inputs changing perfectly, it's not unusual to see some fairly large glitches at the output of a DAC, especially at transitions like 011..0 to 10...0. Sometimes a low pass filter cleans it up enough, other times an analog S&H or blanking might be necessary to tame the glitch energy.

Edit: Taking @gwideman's suggestion to look at the 4040 datasheet, you can see the ripple times:

enter image description here

So, at 5V supply, it would typically take 180ns for the LS bit to change, and between zero and 1.3usec additionally for rest of the the outputs to settle down (depending on which ones change).

If you were to use a triplet of 74HC161s (4-bit synchronous counters), there is not a specific guarantee of how synchronous the outputs are, but you might guess they'd be within 10% of the propagation delay (WAG) if similarly loaded.

enter image description here

So, perhaps within a few ns typically. BTW, a 74HC4040 would be quite a bit better than a CD4040 so it's not totally a fair comparison.

\$\endgroup\$
3
  • \$\begingroup\$ Is there a better approach to create clock controlable sawtooth ramp of 1024 steps, other than the way I am trying to do? \$\endgroup\$
    – Nazar
    Apr 18, 2014 at 13:15
  • \$\begingroup\$ Depends a bit on frequency, but I think your approach is fine. There's a way to use two triangle DDS chips, but that's probably overkill: edn.com/design/test-and-measurement/4333929/… \$\endgroup\$ Apr 18, 2014 at 13:25
  • \$\begingroup\$ Right... I wanted to use AD9833 programmable function generator referred in your comment. Unless I will really have to conserve the psb space... \$\endgroup\$
    – Nazar
    Apr 18, 2014 at 13:38
1
\$\begingroup\$

The 4040 is what's called a "ripple counter" because the new value ripples across the outputs from LSB to MSB. This timing is characterized in the datasheet. So yes, you are thinking correctly. Possibly look for some other 74HC4040 datasheets, or the older (and slower) 4040 datasheets to get more detail on how it operates. Also, you may be interested in reading about Gray code which changes only 1 bit per count (though it is not useful for this particular application).

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.