I'm working with a PS5244A and I was having trouble getting the correct frequency output (repetition rate) from the arbitrary waveform generator.
I am using the PS5000Asdk_r10_5_0_28 version of the sdk.
The formula given in the programming guide
- Code: Select all
outputFrequency = dacFrequency * deltaPhase
------------ ----------------
arbWaveSize 2^(phaseAccumSize - bufferAddressWidth)
Seems to be very off.
The problem seems to stem from the fact that the PS5244A has a buffer size of 49512 which is not a power of 2, you can obtain this from the PS5X44A_MAX_SIG_GEN_BUFFER_SIZE defined constant. To get a more accurate estimate of the ouptut frequency, you must replace 2^(bufferAddressWdith) with 49512.
If the formula were correct, you would expect the PS5244A to simply take the the value of the top 16 bits as the address and make that value restart at 49512. The picoscope seems to do some arithmetic to convert the top 16 bits to a 49512.
This becomes problematic when trying to control the waveform on a 5ns timescale (the output frequency of the DAC).
This can be easily verified by giving an arbitrary waveform and a deltaPhase value of 0x8000. According to the datasheet, this should output a sample every 10 nano seconds, but the samples are output every ~13 nano seconds.
Could you:
1. Update the driver so that it simply takes the value of the top 16 bits as the index in the given waveform as described in the programming guide <- I think this would be the preferred option since it keeps the arithmetic simple.
2. Release the code/formula that converts the phaseAccumulator value to an index in the arbitrary waveform?
Thank you,
Mark