Page 1 of 1

Current read pointer register?

Posted: Mon Nov 10, 2014 2:45 pm
by wa4557
Hey all, I'm trying to program a (relatively fast) arbitrary waveform generator, and in order to do this I want to use the buffer current read pointer.

Is it correct, that this register (0x40200014 for channel A and 0x40200034 for channel B) indicates, where the DAC is currently at playing a pulse. So for my understanding this register should change from 0 to 16k continously when playing a sine wave (or any other wave).

monitor 0x40200014, however gives zero all the time. Am I understanding this register correctly? Am I doing something wrong? And finally: Is there a documenation on these registers (apart from the .odt file of course)

Thanks

Re: Current read pointer register?

Posted: Mon Nov 10, 2014 3:30 pm
by wa4557
One other thing I noticed:
Is it really necessary that any external triggers areseparated by 500µs?
If I want to play pulses for shorter delays than 500µs between two Rising edges, the trigger is ignored !?
Please tell me I'm doing something wrong, a triggering rate of 2kHz is definitely not enough...

Re: Current read pointer register?

Posted: Mon Nov 10, 2014 10:16 pm
by Nils Roos
Is it correct, that this register (0x40200014 for channel A and 0x40200034 for channel B) indicates, where the DAC is currently at playing a pulse. So for my understanding this register should change from 0 to 16k continously when playing a sine wave (or any other wave).
That is correct.
monitor 0x40200014, however gives zero all the time. Am I understanding this register correctly? Am I doing something wrong?
I'd say you are doing something wrong. When I generate a signal and then use the monitor tool to get the current AWG read pointer, it shows different values all the time.
Did you start the signal generator on a continuous waveform ? You have to realize that the monitor tool is quite slow compared to the AWG, which always runs at 125MSps. If you do a one-shot waveform with a more than totally tiny step-value, it will be long over before the monitor tool actually reads the pointer.

The following shows some example output from my RedPitaya:

Code: Select all

redpitaya> generate 1 0.5 10000 tri
redpitaya> monitor 0x40200014
0x0000998c
redpitaya> monitor 0x40200014
0x0000f810
redpitaya> monitor 0x40200014
0x000017a4
redpitaya> monitor 0x40200014
0x0000293c
And finally: Is there a documenation on these registers (apart from the .odt file of course)
Not that I know of. But if you tell me what more you'd need to know, I'll try to find out from the verilog code.

Re: Current read pointer register?

Posted: Mon Nov 10, 2014 10:31 pm
by Nils Roos
Is it really necessary that any external triggers areseparated by 500µs?
I can't say whether it is neccessary or not, but the dead-time of 0.5ms after a trigger event from the external pin is hardcoded into the trigger circuit.
If I want to play pulses for shorter delays than 500µs between two Rising edges, the trigger is ignored !?
Please tell me I'm doing something wrong, a triggering rate of 2kHz is definitely not enough...
You are not doing anything wrong, sorry; but it is not difficult to ease this limitation. If you are not confident about doing it yourself, drop me a note what exactly you need, and I'll see what I can do.

Re: Current read pointer register?

Posted: Mon Nov 10, 2014 10:44 pm
by wa4557
Thanks, I solved both problems:

The first problem was strange: turning the RedPitaya on and off again helped. So a rather simple solution :)
The dead time after the trigger can be reduced in the FPGA source file, those are just two lines in the code. If anyone else experiences the same problem you can let me know!

I'd really suggest to reduce this dead-time, I see no reason why there is half a millisecond of dead time

Thanks for pointing me in the right direction!

Re: Current read pointer register?

Posted: Sat Dec 17, 2022 1:41 am
by ThomasGobmaier
Hi,
I also get only 0 when reading the read point register.
After power on, I connection with ssh, then set the
generator and ask the monitor.

Code: Select all

redpitaya> generate 1 0.5 10000 tri
redpitaya> monitor 0x40200014
0x00000000
redpitaya> monitor 0x40200014
0x00000000
With the code in \Test\generate\generate.cpp the same.

Did something change from the last post until now?

Re: Current read pointer register?

Posted: Mon Dec 19, 2022 8:58 am
by juretrn
I don't know which functions/code are still relevant from 2014, but you can verify the expected behaviour by running the generator from GUI and seeing what happens to the read pointer there.

Re: Current read pointer register?

Posted: Mon Dec 19, 2022 9:56 am
by ThomasGobmaier
Thanks for the tip, that got me one step further !

Conclusion: With the latest library fpga_0.94 the read pointer register is always read 0x00,
with the fpga_0.93 it works.

How I found the workaround:
With one Web App it worked ("Oscilloscope & Signal Generator"),
with another it did not work ("Generator & Oscilloscope").

So the difference is the used fpga library:
"Oscilloscope & Signal Generator" in the path
/opt/redpitaya/www/apps/scopegenpro
uses /opt/redpitaya/fpga/fpga_0.94.bit

and "Generator & Oscilloscope" in the path
/opt/redpitaya/www/apps/scope+gen
uses /opt/redpitaya/fpga/fpga_0.93.bit

So trying the different librarys showed the problem.
cat /opt/redpitaya/fpga/fpga_0.93.bit > /dev/xdevcfg

and stopped working with
cat /opt/redpitaya/fpga/fpga_0.94.bit > /dev/xdevcfg

Re: Current read pointer register?

Posted: Mon Dec 19, 2022 10:31 am
by juretrn
Please see my answer here:
(it's an isue with the docs)
https://github.com/RedPitaya/RedPitaya- ... 1357354821

Re: Current read pointer register?

Posted: Mon Dec 19, 2022 10:48 am
by ThomasGobmaier
Thank you for the quick answer on github !

For the forum readers:
The register was moved, so now the channel A read pointer
is 0x60, and channel B is 0x64. The docs will be updated.

To read channel A:
monitor 0x0x40200060
[edit: the former written address 0x40200260 was a spelling error]

To read channel B:
monitor 0x0x40200064