Author Topic: AD9850 is it possible to generate a square wave with variable duty cycle ?  (Read 18354 times)

0 Members and 1 Guest are viewing this topic.

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
hi
is it possible with AD9850 or AD9851 ?

i need to produce a variable frequency square wave in where software could also change the duty cycle from 1% to 99%

i need this for testing purpose
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: AD9850 is it possible to generate a square wave with variable duty cycle ?
« Reply #1 on: November 23, 2013, 01:43:43 am »
The AD9850/1 is a sine wave synthesizer. Why would you want to use them to generate a square wave?!
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline edavid

  • Super Contributor
  • ***
  • Posts: 3381
  • Country: us
Re: AD9850 is it possible to generate a square wave with variable duty cycle ?
« Reply #2 on: November 23, 2013, 01:55:19 am »
hi
is it possible with AD9850 or AD9851 ?

i need to produce a variable frequency square wave in where software could also change the duty cycle from 1% to 99%

i need this for testing purpose

You can connect the output to a comparator... the internal comparator is probably not good enough, but it depends on how accurate the duty cycle has to be.  The comparator threshold would be set by a 10-12 bit DAC.

The AD9850/1 is a sine wave synthesizer. Why would you want to use them to generate a square wave?!

What chip should the OP use instead?
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: AD9850 is it possible to generate a square wave with variable duty cycle ?
« Reply #3 on: November 23, 2013, 02:09:43 am »
The internal comparator has both its inputs routed out, and is fairly fast, so it is possible to use it to generate variable dc square wave - assuming you can control a reference voltage.

However, as others have pointed out, it is an overly complicated way of doing simple things.
================================
https://dannyelectronics.wordpress.com/
 

Offline vk6zgo

  • Super Contributor
  • ***
  • Posts: 7563
  • Country: au
Re: AD9850 is it possible to generate a square wave with variable duty cycle ?
« Reply #4 on: November 23, 2013, 03:09:34 am »
By definition,once you change the duty cycle,it is no longer a square wave--it becomes a rectangular wave! ;D
 

Offline daveatol

  • Regular Contributor
  • *
  • Posts: 136
  • Country: au
Re: AD9850 is it possible to generate a square wave with variable duty cycle ?
« Reply #5 on: November 23, 2013, 03:13:06 am »
From the datasheet, regarding the reason someone might do this:
Quote
The AD9850 also contains a high speed comparator that can be configured to accept the (externally) filtered output of the DAC to generate a low jitter square wave output. This facilitates the device’s use as an agile clock generator function.
 

Online Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11537
  • Country: my
  • reassessing directives...
Re: AD9850 is it possible to generate a square wave with variable duty cycle ?
« Reply #6 on: November 23, 2013, 07:34:17 am »
ad9850 module from ebay china got trimpot to adjust comparator threshold, if you want software configurable, i believe you need to tap the threshold line and connect to DAC.
The AD9850/1 is a sine wave synthesizer. Why would you want to use them to generate a square wave?!
because it can.
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: AD9850 is it possible to generate a square wave with variable duty cycle ?
« Reply #7 on: November 23, 2013, 02:25:50 pm »
However, as others have pointed out, it is an overly complicated way of doing simple things.

cause i have 10 modules AD9350/AD9351 in lab =D
anyway, can i change my question into: what do you suggest to do it simpler ?

i need a square wave generator from 200Hz to 2Khz with duty cycle variable from 1% to 99% with a step of 1%, but i need the MPU able to change it automatically by software
 

alm

  • Guest
Re: AD9850 is it possible to generate a square wave with variable duty cycle ?
« Reply #8 on: November 23, 2013, 02:28:39 pm »
Triangular wave + comparator fed by a DAC?
 

Online Andy Watson

  • Super Contributor
  • ***
  • Posts: 2074
Re: AD9850 is it possible to generate a square wave with variable duty cycle ?
« Reply #9 on: November 23, 2013, 02:40:58 pm »
i need a square wave generator from 200Hz to 2Khz with duty cycle variable from 1% to 99% with a step of 1%, but i need the MPU able to change it automatically by software
Wobbling an I/O pin at 2 kHz with 1% resolution is well within the capabilities of most MPUs, why try to complicate things? If you don't want to devote software -run time to the task, add another single-chip mpu.
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: AD9850 is it possible to generate a square wave with variable duty cycle ?
« Reply #10 on: November 23, 2013, 02:52:46 pm »
If you don't want to devote software -run time to the task, add another single-chip mpu.

Yes, this is what I would suggest as well. A cheap microcontroller with a timer or two would be a very good way to get a variable duty cycle.

The AD9850/1 is a sine wave synthesizer. Why would you want to use them to generate a square wave?!
because it can.

I should have read the datasheet more carefully! It does seem like awful overkill, but if OP has ten of them and it's just a one-off... Of course, I still can't think of a reasonable way to get digitally controlled duty cycle without complicating it even more.
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: AD9850 is it possible to generate a square wave with variable duty cycle ?
« Reply #11 on: November 23, 2013, 03:12:27 pm »
Ok, i will add a dedicated chip (probably an AVR8 tiny, i mean something in dip8 package), i have no resource available on the main MPU, full at 97% of its schedulable task's list (it is a poor 328 @ 8Mhz) =P

also the AD9350 is already onboard of this equipment, each PCB has one AD9350 on it because it is needed by an other kind of test in where 16 tones must be provided to the circuit under test.

anyway i will add a tiny MPU mounted on a tiny PCB in piggy back to the "mother" pcb, i should have enough space ;D

umm, just an other question: what is the easiest way to build a "custom wave" synthesizer ? Today i was thinking about the USB-audio board, building a wave on PC then putting it into a .wav file, then using a linux machine (such as an usb router with usb-sound driver) to "play" the custom wave.

i also need a custom wave cause i'd like to test an "event detect" algorithm i am implementing on dsPIC33F that should be able to a seismic signal, and seismic signal is not definable as "sinusoidal" or "triangular" or "square" wave, unfortunately
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: AD9850 is it possible to generate a square wave with variable duty cycle ?
« Reply #12 on: November 23, 2013, 03:13:29 pm »
Quote
but i need the MPU able to change it automatically by software

The simplest would be a mcu with hardware pwm.
================================
https://dannyelectronics.wordpress.com/
 

Offline G0HZU

  • Super Contributor
  • ***
  • Posts: 3012
  • Country: gb
Re: AD9850 is it possible to generate a square wave with variable duty cycle ?
« Reply #13 on: November 23, 2013, 04:37:36 pm »
Quote
i need a square wave generator from 200Hz to 2Khz with duty cycle variable from 1% to 99% with a step of 1%, but i need the MPU able to change it automatically by software

That's a fairly similar requirement to a basic car engine management system that has to control and time fuel injectors. This can be done with a fairly basic 8 bit MCU provided it has a decent 16 bit timer and has the required interrupt/port functions built in.

However, if you absolutely 'want' to use the AD9850 and an MCU then one (wacky) method would be to use the DDS to clock the MCU with the MCU set to a 16 bit PWM mode.
Obviously you would have to come up with a scheme where the MCU is initially clocked by something else or it won't be able to program the DDS at the start of the whole process :)

But the end result would be 16bit PWM and ultra fine frequency resolution via the DDS. But as you only want 200Hz to 2kHz o/p you can do the whole thing with a fairly basic MCU chip and keep the DDS chips for something else...
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: AD9850 is it possible to generate a square wave with variable duty cycle ?
« Reply #14 on: November 23, 2013, 04:42:30 pm »
If you mean you already have an ATmega328 on the board then it won't take many cpu cycles to setup one of it's timers to output the square wave with variable duty cycle.

Yes, ATmega328, but unfortunately all the hw resources are already used for other stuff, in particular all the timers are used, no one is free (one timer is used to schedule things, for example), this is the reason why i need to add an external MPU.
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: AD9850 is it possible to generate a square wave with variable duty cycle ?
« Reply #15 on: November 23, 2013, 04:45:29 pm »
Quote
i need a square wave generator from 200Hz to 2Khz with duty cycle variable from 1% to 99% with a step of 1%, but i need the MPU able to change it automatically by software

That's a fairly similar requirement to a basic car engine management system that has to control and time fuel injectors. This can be done with a fairly basic 8
bit MCU provided it has a decent 16 bit timer and has the required interrupt/port functions built in.

you are right, that's for an automotive test equipment, unfortunately the PCB was already engineered and i was asked to modify it "adding" the new testing functions. That's the reason why i found a AD9350 already soldered on the PCB and partially used by 3 of the testing functions in the firmware i found aboard the main MPU =P

in other words, i was asked to to fix the jam =P
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: AD9850 is it possible to generate a square wave with variable duty cycle ?
« Reply #16 on: November 23, 2013, 05:06:24 pm »
what do you think about this kind of equipment (very low price, may be … too low price) ?
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: AD9850 is it possible to generate a square wave with variable duty cycle ?
« Reply #17 on: November 23, 2013, 10:11:32 pm »
Quote
what do you think...

I think you want to ask yourself,

1) what you are trying to do; and
2) how using the parts you have proposed will help you do what you are trying to do.

Lay them out on a piece of paper and hopefully it will be clearer to you.
================================
https://dannyelectronics.wordpress.com/
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: AD9850 is it possible to generate a square wave with variable duty cycle ?
« Reply #18 on: November 24, 2013, 12:28:44 am »
hey  :-DD?

@dannyf
about me and what i am trying to do, i was already fine with the suggestion provided me in the previous page: MPU used like PWM generator with duty cycle variable from 1% to 99%

we are doing brainstorming (1) now, so i can point out that DDS300 is a cheap function generator module with two output signals, one is for PWM signal, the other is for the DDS signal. The module is TTL and has a 232 port, we can connect it to arduino (or to host computer) in order to choose a variety of waveform output , respectively {sine wave, square wave , triangle wave, heart} wave

It may be helpful if you need such a signals to be probed, and I was asking what do you think about this module, in order to keep attention to a low cost and very cheap tool that may help others, too. Also the DDS300 needs to be hacked, more specifically it needs to be reversed about the protocol, just cause the .exe application provided is for Windows Only without any sources, and this is the second reason i was asking about: more specifically, "has anyone already hacked this module ? does anybody know something about this module's protocol ?"

(1) is a group or individual creativity technique by which efforts are made to find a conclusion for a specific problem by gathering a list of ideas …


about PWM, something similar may be of any interest following this suggestion (that's about an arduino PWM library) :D
 

Offline WarSim

  • Frequent Contributor
  • **
  • Posts: 514
AD9850 is it possible to generate a square wave with variable duty cycle ?
« Reply #19 on: November 24, 2013, 12:32:10 am »

If you mean you already have an ATmega328 on the board then it won't take many cpu cycles to setup one of it's timers to output the square wave with variable duty cycle.

Yes, ATmega328, but unfortunately all the hw resources are already used for other stuff, in particular all the timers are used, no one is free (one timer is used to schedule things, for example), this is the reason why i need to add an external MPU.
Consider making a timer multipurpose.
Or alter your method and use gating of you DSS instead of Duty scheduling and use your DSS clock. 
Depending on the configurability of your chip I may use zero to two more pins.

 


Sent from my iPad using Tapatalk
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: AD9850 is it possible to generate a square wave with variable duty cycle ?
« Reply #20 on: November 26, 2013, 01:03:26 pm »
i am also evalutaing AD9834 which has much more features about the waves it can produce =P
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: AD9850 is it possible to generate a square wave with variable duty cycle ?
« Reply #21 on: November 26, 2013, 01:30:03 pm »
The AD9833 comes as an incredibly small (M-SOP package) chip with an onboard 10 bit DAC, and it's a serial programmable DDS (SPI with a 25 MHz master) with 28bit resolution which can output from 0 to 12.5 MHz {sinusoidal, triangular, square} wave

Connections are as follows:
MOSI ==> SDATA
SCK ==> SCLK
PB0 ==> FSYNC

easy powerful chip !
 

Offline Crazy Ape

  • Regular Contributor
  • *
  • Posts: 181
Re: AD9850 is it possible to generate a square wave with variable duty cycle ?
« Reply #22 on: November 26, 2013, 02:27:10 pm »
The AD9833 comes as an incredibly small (M-SOP package) chip....

At least there are not many pins to solder.

If this is just a one-off / hobby project, grab a module with all the support circuitry already on board, that way you can avoid the possibly tricky soldering (though it's really not that hard).
Example of a couple of modules from random on-line vendors:
http://www.goodluckbuy.com/ad-9833-module-dds-singnal-generater-module-sine-wave-square-wave-triangular-wave-.html
http://www.edoomart.com/dds-module-ad9833-signal-generator-with-circuit-diagram-p-844.html
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: AD9850 is it possible to generate a square wave with variable duty cycle ?
« Reply #23 on: November 27, 2013, 08:46:16 am »
what do you think about the quality of these circuits ? i am wandering about the Q factor of the smd inductors and capacitors mounted around the tiny module, what do you think about ?

correct me if i am wrong, may be that an smd inductor has an inferior Q factor ?

have you ever bought these modules ? and what do you think about the DDS60 ?
 

Offline Crazy Ape

  • Regular Contributor
  • *
  • Posts: 181
Re: AD9850 is it possible to generate a square wave with variable duty cycle ?
« Reply #24 on: November 27, 2013, 09:30:06 am »
what do you think about the quality of these circuits ? i am wandering about the Q factor of the smd inductors and capacitors mounted around the tiny module, what do you think about ?

correct me if i am wrong, may be that an smd inductor has an inferior Q factor ?

have you ever bought these modules ? and what do you think about the DDS60 ?

Ummmm, I only see capacitors on the modules I linked. I've never bought or used them personally so can't help with specifics.

Not sure about the DDS60 kit, though I have used the AD9851 in a radio modification project and it worked well for that.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf