Skip to content

Commit

Permalink
December-update-2
Browse files Browse the repository at this point in the history
- Improved SCPI server instructions
- Fixed a mistake in Deep Memory Acquisition instructions regarding the maximum amount of reserved space
- Minor grammar and QoL changes
  • Loading branch information
Lightsaver7 committed Dec 28, 2023
2 parents 4e9c11f + d52ef37 commit 0750bbc
Show file tree
Hide file tree
Showing 10 changed files with 172 additions and 75 deletions.
9 changes: 9 additions & 0 deletions appsFeatures/remoteControl/command_list.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ The Jupyter commands are identical to Python API commands, so please refer to th

At the beginning of each table are all command parameter options and available macros.

For API commands you can find a detailed description in these C header files:

- |API_header|


.. |API_header| raw:: html

<a href="https://github.com/RedPitaya/RedPitaya/tree/master/rp-api/api/include/redpitaya" target="_blank">Red Pitaya GitHub API header files</a>


.. _commands_init:

Expand Down
14 changes: 8 additions & 6 deletions appsFeatures/remoteControl/deepMemoryAcquisition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Here is a representation of how the DMA data saving functions:
:align: center
:width: 700

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.
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.

Expand All @@ -52,24 +52,26 @@ In the example below, the memory region is split between both channels, where 10

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:
Once the acquisition is complete, the data is acquired through the *rp_AcqAxiGetDataRaw* or *rp_AcqAxiGetDataV* functions by passing the following parameters:

- Channel number
- Address of triggering moment (by using the *rp_AcqAxiGetWritePointerAtTrig* function)
- Data size
- Location where to store the data (start address of buffer)
- Location where to store the data (start address of buffer). An integer buffer is used to store RAW values and a float buffer for values in Volts.

.. 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.

Once finished, please do not forget to free any resources and reserved memory locations. Otherwise, the performance of Red Pitaya can decrease over time.
Once finished, please do not forget to free the resources and reserved memory locations. Otherwise, the performance of your 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.
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. Afterwards, you must **rebuild the device tree** and **restart** the Red Pitaya for this change to take effect.

The maximum memory allocation is restricted to the size of the board's DDR (512 MB for STEMlab 125-14). However, DMA and Linux share the DDR resources, so allocating too many to the DMA may result in decreased performance. To prevent problems, we recommend leaving 100 MB of the DDR for the Linux, resulting in a maximum DMA region of 412 MB (for STEMlab 125-14).

1. Establish an :ref:`SSH <ssh>` connection.
2. Enable writing permissions and open the **dtraw.dts** file.
Expand Down Expand Up @@ -100,7 +102,7 @@ By default, 2 MB of the DDR RAM are reserved for the Deep Memory Acquisition. Th
.. 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.
To prevent performance decrease problems, we recommend leaving at least 100 MB of the DDR for the proper operation of the Linux OS. The maximal recommended DMA region size is 412 MB for STEMlab 125-14 and SDRlab 122-16 and 924 MB for SIGNALlab 250-12.


API functions
Expand Down
5 changes: 2 additions & 3 deletions appsFeatures/remoteControl/examples_top.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Examples
=========

In the list below you will find examples of remote control and C algorithms. These examples cover all basic Red Pitaya functionalities, such as:
In the list below, you will find examples of how to control Red Pitaya remotely through SCPI commands, as well as with onboard C and Python API commands. JupyterLab also falls into the second category. These examples cover all basic Red Pitaya functionalities, such as:

- signal generation
- signal acquisition
Expand All @@ -27,5 +27,4 @@ You can edit and change them according to your needs and develop customized prog
../examples/communication_interfaces/digcomIF.rst



Additional examples: :ref:`ABCLED`
Web-API example: :ref:`ABCLED`
Binary file added appsFeatures/remoteControl/img/hello_world.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added appsFeatures/remoteControl/img/install_vsc.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions appsFeatures/remoteControl/jupyter/Jupyter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ Examples
********

The code examples are available here:

- :ref:`JupyterLab examples <examples>`
- |jupyterlab_github|
- |welcome_ipynb|
Expand Down

0 comments on commit 0750bbc

Please sign in to comment.