Skip to content

Commit

Permalink
November-update-2
Browse files Browse the repository at this point in the history
November update 2
  • Loading branch information
Lightsaver7 committed Dec 6, 2023
2 parents 3f95141 + 3319dff commit d7d5e41
Show file tree
Hide file tree
Showing 25 changed files with 210 additions and 135 deletions.
13 changes: 7 additions & 6 deletions appsFeatures/examples/acquisition/acqRF-exm1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@ Code - Python API
#? RP_WAVEFORM_RAMP_DOWN, RP_WAVEFORM_DC, RP_WAVEFORM_PWM, RP_WAVEFORM_ARBITRARY,
#? RP_WAVEFORM_DC_NEG, RP_WAVEFORM_SWEEP
channel = rp.RP_CH_1 # rp.RP_CH_2
channel = rp.RP_CH_1
channel2 = rp.RP_CH_2
waveform = rp.RP_WAVEFORM_SINE
freq = 100000
Expand All @@ -1116,7 +1116,7 @@ Code - Python API
#? RP_TRIG_SRC_CHB_NE, RP_TRIG_SRC_EXT_PE, RP_TRIG_SRC_EXT_NE, RP_TRIG_SRC_AWG_PE, RP_TRIG_SRC_AWG_NE,
#? RP_TRIG_SRC_CHC_PE, RP_TRIG_SRC_CHC_NE, RP_TRIG_SRC_CHD_PE, RP_TRIG_SRC_CHD_NE
acq_trig_sour = rp.RP_TRIG_SRC_EXT_PE
acq_trig_sour = rp.RP_TRIG_SRC_CHA_PE
N = 16384
# Initialize the interface
Expand Down Expand Up @@ -1146,7 +1146,6 @@ Code - Python API
# Enable output synchronisation
rp.rp_GenOutEnableSync(True)
rp.rp_GenOutEnable(channel)
Expand All @@ -1155,7 +1154,7 @@ Code - Python API
rp.rp_AcqSetDecimation(rp.RP_DEC_1)
#? Possible triggers:
#? RP_T_CH_1, RP_T_CH_2, RP_T_CH_3, RP_T_CH_4, RP_T_CH_EXT
#? RP_T_CH_1, RP_T_CH_2, RP_T_CH_EXT
# Set trigger level and delay
rp.rp_AcqSetTriggerLevel(rp.RP_T_CH_1, trig_lvl)
Expand Down Expand Up @@ -1202,7 +1201,6 @@ Code - Python API
print(f"Data in Volts: {data_V}")
print(f"Raw data: {data_raw}")
# Release resources
rp.rp_Release()
Expand Down Expand Up @@ -1236,7 +1234,7 @@ Code - Python API
#? RP_TRIG_SRC_CHB_NE, RP_TRIG_SRC_EXT_PE, RP_TRIG_SRC_EXT_NE, RP_TRIG_SRC_AWG_PE, RP_TRIG_SRC_AWG_NE,
#? RP_TRIG_SRC_CHC_PE, RP_TRIG_SRC_CHC_NE, RP_TRIG_SRC_CHD_PE, RP_TRIG_SRC_CHD_NE
acq_trig_sour = rp.RP_TRIG_SRC_EXT_PE
acq_trig_sour = rp.RP_TRIG_SRC_CHA_PE
N = 16384
# Initialize the interface
Expand Down Expand Up @@ -1295,4 +1293,7 @@ Code - Python API
print(f"Data in Volts: {data_V}")
print(f"Raw data: {data_raw}")
# Release resources
rp.rp_Release()
10 changes: 8 additions & 2 deletions appsFeatures/examples/acquisition/acqRF-samp-and-dec.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@ Examples of decimations and time scales of a buffer are given in the tables belo

The table lists only a few decimation examples, users can in practice use the following decimations:

- **OS 2.00-23 and higher:** [1, 2, 4, 8, 16, 17, 18, ..., 65535, 65536] *(powers of 2 up to 16 and then any whole number up to 65536)*
- **OS 2.00-18 and lower:** [1, 2, 4, 8, 16, 64, 256, ..., 32768, 65536] *(powers of 2 up to 65536)*
**SCPI commands:**

- **OS IN_DEV and higher:** [1, 2, 4, 8, 16, 17, 18, ..., 65535, 65536] *(powers of 2 up to 16 and then any whole number up to 65536)* - **ACQ:DEC:F**
- **OS 2.00-23 and lower:** [1, 2, 4, 8, 16, 64, 256, ..., 32768, 65536] *(powers of 2 up to 65536)* - **ACQ:DEC**

**API commands:**

- **OS 2.00-23 and higher:** [1, 2, 4, 8, 16, 17, 18, ..., 65535, 65536] *(powers of 2 up to 16 and then any whole number up to 65536)* - **rp_AcqSetDecimationFactor**

|
**STEMlab 125-14, STEMlab 125-10, STEMlab 125-14 4-Input:**

Expand Down
9 changes: 3 additions & 6 deletions appsFeatures/examples/generation/genRF-exm4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,9 @@ Code - C API
rp_GenFreq(RP_CH_1, 4000.0);
rp_GenFreq(RP_CH_2, 4000.0);
rp_GenOutEnable(RP_CH_1);
rp_GenOutEnable(RP_CH_2);
rp_GenTriggerOnly(RP_CH_1);
rp_GenTriggerOnly(RP_CH_2);
rp_GenOutEnableSync(True)
rp_GenSynchronise()
/* Releasing resources */
free(y);
Expand Down Expand Up @@ -358,11 +357,9 @@ Code - Python API
# Enable output synchronisation
rp.rp_GenOutEnableSync(True)
rp.rp_GenOutEnable(channel)
# Syncronise output channels
rp.rp_GenSynchronise()
rp.rp_GenTriggerOnly(channel)
# Release resources
Expand Down
5 changes: 1 addition & 4 deletions appsFeatures/examples/generation/genRF-exm5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@ Code - C API
rp_GenAmp(RP_CH_2, 1);
rp_GenOutEnableSync(true);
rp_GenTriggerOnly(RP_CH_1);
rp_GenTriggerOnly(RP_CH_2);
rp.rp_GenSynchronise()
/* Release rp resources */
rp_Release();
Expand Down Expand Up @@ -236,11 +235,9 @@ Code - Python API
# Enable output synchronisation
rp.rp_GenOutEnableSync(True)
rp.rp_GenOutEnable(channel)
# Syncronise output channels
rp.rp_GenSynchronise()
rp.rp_GenTriggerOnly(channel)
# Release resources
rp.rp_Release()
Expand Down
3 changes: 0 additions & 3 deletions appsFeatures/examples/generation/genRF-exm6.rst
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ Code - C API
rp_GenTrigger(RP_CH_2);
sleep(1);
rp_GenSynchronise();
rp_GenTrigger(RP_CH_1);
rp_Release();
}
Expand Down Expand Up @@ -302,7 +301,6 @@ Code - Python API
# Enable output synchronisation
rp.rp_GenOutEnableSync(True)
rp.rp_GenOutEnable(channel)
time.sleep(0.1)
# Syncronise output channels
Expand All @@ -311,7 +309,6 @@ Code - Python API
rp.rp_GenTriggerOnly(channel2)
time.sleep(0.5)
rp.rp_GenSynchronise()
rp.rp_GenTriggerOnly(channel)
# Release resources
rp.rp_Release()
Expand Down
63 changes: 41 additions & 22 deletions appsFeatures/remoteControl/deepMemoryAcquisition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,32 +32,15 @@ Required hardware
Functionality
========================

By default, 2 MB of the DDR RAM are reserved for the Deep Memory Acquisition. The DDR memory allocated to the DMA can be configured through the **reg** parameter to a maximum of 256 MB. The :ref:`device tree ecosystem <ecosystem>` must be rebuilt after changing this parameter.

**Changing Reserved Memory**

In the **dtraw.dts** configure the following lines:

.. code-block:: default
buffer@1000000 {
phandle = <0x39>;
reg = <0x1000000 0x200000>;
};
The first parameter in **reg** is *start address (0x1000000)* and the second one is the *region size (0x200000)*.

.. note::

Please note that the more memory you allocate to the DMA, the slower Red Pitaya Linux OS will function as the RAM resources between the two are shared. The memory allocated to the DMA is reserved, so Linux cannot use it.

Here is a representation of how the DMA data saving functions:

.. figure:: img/Deep_Memory.png
:align: center
:width: 700

TThe reserved memory region is located between **ADC_AXI_START** and **ADC_AXI_END** addresses, which are macros for the first and last/end addresses and are automatically configured by the ecosystem. The data is saved in 32-bit chunks (4 Bytes per sample). The **ADC_AXI_START** points to the start of the first Byte (of the first sample), and **ADC_AXI_END** points to the first Byte (of the last sample) of DDR reserved for the DMA.
For easier explanation, the start and end addresses of the DMA buffer are labeled as **ADC_AXI_START** and **ADC_AXI_END**. The data is saved in 32-bit chunks (4 Bytes per sample). The **ADC_AXI_START** points to the start of the first Byte (of the first sample), and **ADC_AXI_END** points to the first Byte (of the last sample) of DDR reserved for the DMA. The size of the whole buffer is **ADC_AXI_SIZE**. All the labels are just for representation and do not reference any macros.

The starting address of the DMA buffer (**ADC_AXI_START**) and the size of the DMA buffer (**ADC_AXI_SIZE**) are acquired through the **rp_AcqAxiGetMemoryRegion** function.

The memory region can capture data from a single channel (the whole memory is allocated to a single channel), or it can be split between both input channels (CH1 (IN1) and CH2 (IN2)) by passing the following parameters to the *rp_AcqAxiSetBuffer()* function:

Expand All @@ -67,7 +50,7 @@ The memory region can capture data from a single channel (the whole memory is al

In the example below, the memory region is split between both channels, where 1024 samples are captured on each channel.

The **Mid Address** in the picture above represents the starting point of the Channel 2 buffer inside the reserved DMA region and is usually set to *(ADC_AXI_START + ADC_AXI_END)/2* (both channels can capture the same amount of data).
The **Mid Address** in the picture above represents the starting point of the *Channel 2 buffer* inside the reserved DMA region and is set to *ADC_AXI_START + (ADC_AXI_SIZE/2)* (both channels can capture the same amount of data).

Once the acquisition is complete, the data is acquired through the *rp_AcqAxiGetDataRaw* function by passing the following parameters:

Expand All @@ -78,11 +61,47 @@ Once the acquisition is complete, the data is acquired through the *rp_AcqAxiGet

.. note::

Depending on the size of the acquired data and how much DDR memory is reserved for the Deep Memory Acquisition the data transfer from DDR might take a while.
Depending on the size of the acquired data and how much DDR memory is reserved for the Deep Memory Acquisition, the data transfer from DDR might take a while.

Once finished, please do not forget to free any resources and reserved memory locations. Otherwise, the performance of Red Pitaya can decrease over time.


Changing reserved memory
=============================

By default, 2 MB of the DDR RAM are reserved for the Deep Memory Acquisition. The DDR memory allocated to the DMA can be configured through the **reg** parameter to a maximum of 256 MB. Afterwards, you must **rebuild the device tree** and **restart** the Red Pitaya for this change to take effect.

1. Establish an :ref:`SSH <ssh>` connection.
2. Enable writing permissions and open the **dtraw.dts** file.

.. code-block:: console
root@rp-f066c8:~# rw
root@rp-f066c8:~# nano /opt/redpitaya/dts/$(monitor -f)/dtraw.dts
3. Search the file for the "buffer" keyword and configure the following lines:

.. code-block:: default
buffer@1000000 {
phandle = <0x39>;
reg = <0x1000000 0x200000>;
};
The first parameter in **reg** is *start address (0x1000000)*, and the second is the *region size (0x200000)*.

4. Finally, rebuild the tree and restart the board.

.. code-block:: console
root@rp-f066c8:~# cd /opt/redpitaya/dts/$(monitor -f)/
root@rp-f066c8:~# dtc -I dts -O dtb ./dtraw.dts -o devicetree.dtb
root@rp-f066c8:~# reboot
.. note::

Please note that the more memory you allocate to the DMA, the slower Red Pitaya Linux OS will function as the RAM resources between the two are shared. The memory allocated to the DMA is reserved, so Linux cannot use it.


API functions
=================
Expand Down
2 changes: 1 addition & 1 deletion developerGuide/hardware/122-16/top.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Technical specifications
| Voltage range | 0.5 Vpp/ -2 dBm |
| | (50 Ohm load) |
+------------------------------------+------------------------------------+
| Short circut protection | N/A, RF transformer |
| Short circuit protection | N/A, RF transformer |
| | & AC-coupled |
+------------------------------------+------------------------------------+
| Connector type | SMA |
Expand Down
2 changes: 1 addition & 1 deletion developerGuide/hardware/122-16_EXT/top.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Technical specifications
| Voltage range | 0.5 Vpp/ -2 dBm |
| | (50 Ohm load) |
+------------------------------------+------------------------------------+
| Short circut protection | N/A, RF transformer |
| Short circuit protection | N/A, RF transformer |
| | & AC-coupled |
+------------------------------------+------------------------------------+
| Connector type | SMA |
Expand Down
2 changes: 1 addition & 1 deletion developerGuide/hardware/125-10/top.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Technical specifications
| Voltage range | ±1 V |
| | |
+------------------------------------+------------------------------------+
| Short circut protection | Yes |
| Short circuit protection | Yes |
| | |
+------------------------------------+------------------------------------+
| Connector type | SMA |
Expand Down
2 changes: 1 addition & 1 deletion developerGuide/hardware/125-14-Z20/top.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Technical specifications
| Voltage range | ±1 V |
| | |
+------------------------------------+------------------------------------+
| Short circut protection | Yes |
| Short circuit protection | Yes |
| | |
+------------------------------------+------------------------------------+
| Connector type | SMA |
Expand Down
2 changes: 1 addition & 1 deletion developerGuide/hardware/125-14/top.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Technical specifications
| Voltage range | ±1 V |
| | |
+------------------------------------+------------------------------------+
| Short circut protection | Yes |
| Short circuit protection | Yes |
| | |
+------------------------------------+------------------------------------+
| Connector type | SMA |
Expand Down
2 changes: 1 addition & 1 deletion developerGuide/hardware/125-14_4IN/top.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Technical specifications
| Voltage range | N/A |
| | |
+------------------------------------+------------------------------------+
| Short circut protection | N/A |
| Short circuit protection | N/A |
| | |
+------------------------------------+------------------------------------+
| Connector type | N/A |
Expand Down
2 changes: 1 addition & 1 deletion developerGuide/hardware/125-14_EXT/top.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Technical specifications
| Voltage range | ±1 V |
| | |
+------------------------------------+------------------------------------+
| Short circut protection | Yes |
| Short circuit protection | Yes |
| | |
+------------------------------------+------------------------------------+
| Connector type | SMA |
Expand Down
2 changes: 1 addition & 1 deletion developerGuide/hardware/125-14_LN/top.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Technical specifications
| Voltage range | ±1 V |
| | |
+------------------------------------+------------------------------------+
| Short circut protection | Yes |
| Short circuit protection | Yes |
| | |
+------------------------------------+------------------------------------+
| Connector type | SMA |
Expand Down
2 changes: 1 addition & 1 deletion developerGuide/hardware/125-14_MULTI/top.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Technical specifications (one board)
| Voltage range | ±1 V |
| | |
+------------------------------------+------------------------------------+
| Short circut protection | Yes |
| Short circuit protection | Yes |
| | |
+------------------------------------+------------------------------------+
| Connector type | SMA |
Expand Down
2 changes: 1 addition & 1 deletion developerGuide/hardware/250-12/top.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Technical specifications
| Voltage range | +-2 V / +-10 V (Hi-Z load) |
| | (software selectable) |
+------------------------------------+------------------------------------+
| Short circut protection | Yes |
| Short circuit protection | Yes |
| | |
+------------------------------------+------------------------------------+
| Connector type | BNC |
Expand Down
2 changes: 1 addition & 1 deletion developerGuide/hardware/compares/vs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Product comparison table
| Voltage range | ±1 V | ±1 V | ±1 V | N/A | 0.5 Vpp/ -2 dBm | +-2 V / +-10 V (Hi-Z load) |
| | | | | | (50 Ohm load) | (software selectable) |
+------------------------------------+------------------------------------+------------------------------------+------------------------------------+------------------------------------+------------------------------------+------------------------------------+
| Short circut protection | Yes | Yes | Yes | N/A | N/A, RF transformer | |
| Short circuit protection | Yes | Yes | Yes | N/A | N/A, RF transformer | |
| | | | | | & AC-coupled | Yes |
+------------------------------------+------------------------------------+------------------------------------+------------------------------------+------------------------------------+------------------------------------+------------------------------------+
| Connector type | SMA | SMA | SMA | N/A | SMA | BNC |
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d7d5e41

Please sign in to comment.