Hi, im trying to create a square wave using RAM. Could you please help with that?
Hi, im trying to create a square wave using RAM. Could you please help with that?
Hi Monil,
I think you had initially replied to How to create files for RAM? which discusses creating files for the AD9910 eval software to program to RAM. The AD9910 wasn't intended to generate square waves, but it can be done and there are two slightly different ways to do it. The AD9910 is intended to generate a sine or cosine wave and it lets you control the sine-wave frequency, amplitude, and phase offset (usually for phase-shift-keying). What you want to do is set the output frequency to 0 Hz (FTW = 0) so that the output is no longer generating a sine/cosine wave. You can then alternate the phase offset from 0° to 90° to get an output of sin(0°) = 0 or sin(90°) = 1. (If the output is set for cosines, then cos(0°) = 1 and cos(90°) = 0.) The other, slightly different method is to leave the phase offset fixed at 90° for sin(90°) = 1, and then use amplitude scaling to create your square-wave output.
Creating a RAM file for phase offsets or amplitude scaling should be the same as what is described in How to create files for RAM? . The only Difference being that you are calculating amplitude scale factors (ASF) or phase offset words (POW) according to the equations on page 22 in the datasheet. "AD9910EVBRAMLoader.doc" also explains how to calculate ASFs and POWs and what the RAM file should look like.
The frequency of your square wave will depend on the data that is in your RAM file and the playback rate you have configured for the RAM as explained on page 33 of the datasheet.
What frequencies do you need to generate? If you are generating relatively low frequency square waves, it may be easier to use an AD9834 or similar DDS part instead.