AD9957 RAM write difficulty


I am writing to the RAM of the AD9957 for direct data playback to the baseband data path and I am experiencing some strange behaviour.

I write to the RAM using the following method:

1.     1. Take AD9957 out of master reset

2.     2. Configure Control Function Register 1 (for single tone mode)

3.     3. Configure Control Function Register 2 (default settings)

4.     4. Configure Control Function Register 3 (default settings)

5.     5. Configure RAM segment Register 0

6.     6. Select RAM segment 0 by appropriately toggling the RAM Trigger pin

7.     7. Write to RAM segment 0 (with IO updates in between word writes)

8.     8. Repeat steps, 5, 6, 7 for RAM segment 1.

9.     9. Select QDUC mode and enable RAM playback by writing to CFR1.

Firstly, is this the recommended method? (The datasheet does not stipulate IO updates during writes to the RAM but I found them to be necessary).

My primary problem is this: I find that the above method works, but not directly after powering up the AD9957. If I run the above method twice at startup, I get success. After some experimentation, I found that if after step 1 above, I programmed the RAM segment registers as per steps (5, 6, 7, 8) above then reset the AD9957, and then continue as before from step 2, I would always get success. It seems I need to configure the RAM segment registers and then reset the device? (Also, all other modes work directly after power up.) This requirement to reset the device can’t be correct. Do you have any advice you can offer in this matter?



  • 0
    •  Analog Employees 
    on Feb 14, 2012 2:57 AM

    I would suggest the following procedure:

    1. Reset the device.
    2. Leave CFR1 in its default state (Modulation Mode and RAM Enable = 0).

    3. Program both RAM Segment registers as desired.

    4. Issue an I/O Update.
    5. Apply a logic 1 to the RT pin followed by a logic 0 (selects RAM Segment 0).
    6. Write a total of M 32-bit words to the RAM Register (address 0x16 and where M is the number of address locations specified in RAM Segment 0).
    7. Apply a logic 1 to the RT pin (selects RAM Segment 1).
    8. Write a total of N 32-bit words to the RAM Register (addres 0x16 and where N is the number of address locations specified in RAM Segment 1).
    9. Program CFR1 for RAM Enable = 1.
    10. Issue an I/O Update.
    11. Apply a logic 0 to the RT pin (selects RAM Segment 0 and starts RAM playback).

    NOTE. An I/O Update is not necessary when loading RAM during steps 6 and 8.

    Let me know if this works. If not, we may need to tweak the procedure.

  • Thank you for the quick response. I will try this and get back to you.





  • I could not program the RAM successfully using your technique, I found I still had to issue the IO updates during your step 6.


    Would you recommend programming the profile register before or after step 9?


    I seem to be able to get the AD9957 to work reliably if instead to switching directly between single tone mode and modulation mode with RAM playback, I first switch to just modulation mode (with RAM enable = 0), issue an IO update, then enable RAM playback, and then issue an IO update again.


    I also find that I can only get RAM playback mode “continuous recirculate” to work as expected. Is there a limit to how fast you can expect the RAM playback to operate? I have configured the AD9957 to playback from RAM at 18MHz.

  • 0
    •  Analog Employees 
    on Feb 23, 2012 8:57 PM

    According to the person who wrote the code for the Evaluation Board software, the device mode (Single Tone or Modulation) is immaterial when writing to RAM. You can write to RAM and then set the desired mode after the fact. Also, it is best to have RAM Enable = 0 when writing to RAM, though not an absolute requirement.

    Furthermore, an IO_Update is NOT required for each word written to the RAM Register (0x16). All that is required is to have the RAM Segment register(s) loaded followed by an IO_Update to make them effective, then toggle the RT pin, if necessary, to point to the appropriate RAM Segment register. Once this is done, you can write to register address 0x16 repeatedly without an IO_Update (as long as you write the correct number of words, of course). This is how the Evaluation Board software functions.

    There is one caveat, however. The state of the LSB First bit matters. Specifically, when LSB First = 0 (that is, MSB first), the state machine controlling the RAM address pointer starts with the RAM End Address in the RAM Segment register and counts down to the RAM Start Address. Therefore, you must send the RAM words to address 0x16 in descending order (last to first). When LSB First = 1, the state machine counts up, so you must send the RAM words in ascending order.

    There is another caveat with regard to the playback rate. You must program the RAM Address Step Rate register to a value of 1. This is because the Step Rate counter clock operates at the baseband sample rate. Any value other than 1 will cause the RAM playback rate to be different than the baseband data rate, which will yield an undesired output signal.

  • Thanks for your insights, those details have been helpful. I have managed to get the AD9957 to do everything I need it to do.