This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DAC63204: Changing function generator slewrate at runtime

Part Number: DAC63204


Is there any special action required in order to be able to change the function generator slew-rate?

I have test code that successfully sets up the DAC0 output to generate a sine-wave:

    // First value (word) is the data, second value (byte) is the reg addr)
	SPI_DACWrite24_V2(0x0400, 0x03); // DAC-X-VOUT-CMP-CONFIG: Use VDD as reference
	SPI_DACWrite24_V2(0x0000, 0x05); // DAC-X-CMP-MODE-CONFIG: No hysteresis or window (default setting)
	SPI_DACWrite24_V2(0x840D, 0x06); /* DAC-X-FUNC-CONFIG:
										Clear DAC to mid scale
										Sine wave
										1 LSB
										1282 µs/step */
	SPI_DACWrite24_V2(0x1249, 0x1F); // COMMON-CONFIG Register
	SPI_DACWrite24_V2(0x1100, 0x21); // COMMON-DAC-TRIG Register: Start function generator for DAC0 & DAC1

However if I then change the slew-time and reprogram the sine wave frequency does not update. I have to remove power and reconnect for it to take the new setting.

Similarly, if I keep the above initial code, and then periodically update the slew-rate I am expecting the sine-wave to vary in frequency, but I see no change.

I have tried stopping the relevant function generator, and even setting the function generator to "no output" (instead of sine) before setting the new slew-rate, but still I don't see any update to the output frequency.

Example slew-rate update function:

    const uint16_t DAC0_FUNC_CONFIG = 0x8400;

        	SPI_DACWrite24_V2(0x0100, 0x21); // STOP DAC0 function generator
        	SPI_DACWrite24_V2(0x800D, 0x06); // set DAC0 to NO function generator
        	uint16_t new_dacvalue = DAC0_FUNC_CONFIG | sine_slew;
        	SPI_DACWrite24_V2(new_dacvalue, 0x06);
        	SPI_DACWrite24_V2(0x840D, 0x06); // Set DAC0 to SINE wave again.
        	SPI_DACWrite24_V2(0x1100, 0x21); // restart DAC0 function generator


Is there a (known working) process for changing the slew-rate?

The only mention I can find in the datasheet regarding potential issues changing the slew-rate is at the bottom of page 35 where it states "Do not write to CODE-STEPX, SLEW-RATE-X, or DAC-X-DATA during the output slew operation.". However this is why I've tried stopping the function generator before updating the slew-rate.

Thanks in advance for any assistance.

  • Hi Phil, 

    Stopping the function generator is required before changing the slew rate (or any of the function generator settings). You should not have to change the setting to no output, you can keep it as sine. 

    Can you try adding a small delay between stopping the function generator and changing the slew setting? I usually am using the GUI to do this, so there is just a built in delay from me manually changing the settings. Maybe that would make a difference to give the function generator time to fully disable itself internally. 

    Best,

    Katlynne Jones 

  • Hi Katlynne,

    Many thanks for your reply.
    I have had the opportunity to trial various delays now between sending the "STOP FG", sending the new slew rate, and then sending "START FG".

    It seems that the "STOP" doesn't actually stop the FG straight away, but rather is treated like a "request to stop". The FG will then complete the current cycle, and then stop (at least this is what I seem to be observing on the Sine generation).

    I will continue to investigate, I couldn't see anything in the datasheet to specify a required settling time between the STOP and changing of FG settings?

  • Hi Phil, 

    I do not think this is something that was characterized, which is why a minimum delay time is not shown in the datasheet. 

    I can ask the design team if they have an estimated time as to how long it takes for the function generator to stop. 

    Best,

    Katlynne Jones 

  • Hi Katlynne,

    Just as an update to this issue, I think I was nearly there with my last post; it does seem like the STOP of the FG does not happen immediately but rather stops at the end of the current cycle. If this is the case a mention of this in the Datasheet would seem a worthwhile addition.

    Adding some extra information for your reference as well as for anyone else who may travel this path.

    There is one line in the datasheet, under the "programmable slew" section that indicates "Do not write to CODE-STEPX, SLEW-RATE-X, or DAC-X-DATA during the output slew operation.".
    The onboard function generator seems to also be restricted by this rule, (perhaps it uses the slew operation internally to generate the waveforms), and therefore you have to STOP the function generator for a particular DAC output before you change the registers listed.

    To complicate it further, it seems the STOP command does not STOP the function generator immediately, but rather requests for it to stop at the end of the current cycle.

    As an example:

    Blue is DAC output (sine wave) which is allowed to run for a period of time before a STOP command is sent, and a new skew value is set (a total of 5 different values are cycled through)
    Yellow toggles each time the STOP command is sent.

    At the highest frequency used the stop was sent quite close to the end of the cycle, and the FG stopped 5.8ms later (first marker is STOP, second marker is approx. FG actually stopping)

    At the 3rd frequency the cycle time is obviously longer, but the STOP is sent very close to the end of the cycle, so the FG actually stops within ~4.8ms:

    At the lowest frequency we have a long cycle time, and (in this case) the STOP was sent early in the cycle; this meant it took ~98ms for the FG to then actually stop:

    So in summary, if you want to change the settings on the fly, you first have to know what frequency you are running at and then determine how long you need to wait to make sure that the FG has stopped before sending the new settings (or alternatively just ALWAYS wait the longest required time).

  • Hi Phil,

      

    Hope you are having a good day !!!

    Yes, whatever you observed correct and these results are expected from the device.

    There is one more thing which you can utilise for your purpose "DAC-BUSY#" bit. This bit indicates that device is busy and settings(slew rate, etc.) should not be applied until busy signal is cleared.

    Thanks for pointing out "Just as an update to this issue, I think I was nearly there with my last post; it does seem like the STOP of the FG does not happen immediately but rather stops at the end of the current cycle. If this is the case a mention of this in the Datasheet would seem a worthwhile addition" , will try to add in the data-sheet.

     

    Let us know if anymore help needed, would be happy to do that !

     

    Thanks,

    Sanjay

  • Many thanks, I am going to try using the status register, but first I am just enabling the SDO for 4 wire SPI interface.

    I've enabled it in the INTERFACE-CONFIG register by setting SDO-EN, but what is the FSDO-EN? I can't find any reference to FSDO-EN in the datasheet?

    Currently my circuit has a 10k pull-up on the MISO line (as recommended in the datasheet) but the actual level change on the pin is quite slow (you can see the charge curve), so I am looking to improve it. Is there a register setting that I should be changing, or do I just need to pull it up harder?

  • Hi Phil,

     

    1. for FSDO details, please check the section 6.16 timing diagram,  FSDO = 1 enables fast SDO out by half a clock cycle.

    2. regarding MISO slow rise, there is no setting to change the rise/fall of digital lines. You should need change the pull-up resistor.

     

    Thanks,

    Sanjay