Following Ben's advice, I tested the data acquisition using the RP's SCPI code. https://redpitaya.readthedocs.io/en/latest/appsFeatures/examples/acquisition/acqRF-exm2.html
I first started by flashing the SD card with the latest version of the RP software 2.00-30. Then I launched the SCPI server according to this page. I plugged the RP's IN1 to an SR 3.1MHz function generator, which was also connected to a oscilloscope to verify that the RP was acquiring the correct waveform characteristics. I put the generator at a Sine wave, 0.01MHz, 0.1V amplitude (=0.2 Vpp), 0V offset. I verified on the oscilloscope that the signal was indeed this one. I executed the code below in my own jupyterlab (not the RP's). I obatined the attached plot.
Here are the things I don't understand:
1/ I had to add the line rp_s.tx_txt('ACQ:SOUR1:GAIN HV') because otherwise I get a constant 1V signal on the plot. Yet I am using the LV calibration on IN1. Furthermore, when I try to use the built-in oscilloscope of the RP, I also need to set the attenuation to HV, otherwise the LV setting also gives me a constant 1V on the scope trace. Why is that?
2/ I don't understand the plot that I got; the amplitude is way too large for a 0.2Vpp signal. What is going on here?
Code:
import sys
import redpitaya_scpi as scpi
import matplotlib.pyplot as plotIP = 'rp-f09ec9.local'rp_s = scpi.scpi(IP)
rp_s.tx_txt('ACQ:RST')
rp_s.tx_txt('ACQ:DEC:F 1')
rp_s.tx_txt('ACQ:SOUR1:GAIN HV')
rp_s.tx_txt('ACQ:START')
rp_s.tx_txt('ACQ:TRig NOW')
while 1:
rp_s.tx_txt('ACQ:TRig:STAT?')
if rp_s.rx_txt() == 'TD':
break
## ! OS 2.00 or higher only ! ##
while 1:
rp_s.tx_txt('ACQ:TRig:FILL?')
if rp_s.rx_txt() == '1':
break
rp_s.tx_txt('ACQ:SOUR1:DATA?')
buff_string = rp_s.rx_txt()
buff_string = buff_string.strip('{}\n\r').replace(" ", "").split(',')
buff = list(map(float, buff_string))
plot.plot(buff)
plot.ylabel('Voltage')
plot.show()