Skip to content

Commit

Permalink
doc: ad3530r: Update documentation
Browse files Browse the repository at this point in the history
Add sub-section for waveform generation in rst file

Signed-off-by: SGudla <[email protected]>
  • Loading branch information
SaikiranGudla committed Dec 3, 2024
1 parent 8bcd104 commit 627ceee
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions doc/sphinx/source/projects/ad3530r_iio/ad3530r_iio.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,39 @@ through the device manager for windows-based OS as shown below:
.. include:: /source/tinyiiod/iio_firmware_structure.rst

#TODO: Waveform gen
#TODO: Boardlevel attributes and techniques
===================
Waveform Generation
===================

The Firmware supports two modes of data streaming using the SPI-DMA technique for Waveform generation from the IIO client

Configuring data streaming modes
================================

The IIO client can configure the data streaming mode by setting the "data_streaming_mode" iio attribute. The supported modes are:
1. Single Instruction mode
2. Streaming mode

Please refer to the data sheet for more details on the data streaming modes.

Configuring Sampling Frequency
==============================

Using the "sampling_frequency" iio attribute, the rate at which the converter updates the data can be controlled. In this case, it can go all the way from 1000SPS to 570KSPS in case of Single Instruction mode of data streaming. In case of Streaming mode, the sampling frequency is fixed at 1.4MSPS and non-configurable.
The attribute is set to maximum sampling rate supported by default by the platform and can be varied in the accepted ranges by writing to the it.

Based on the sampling_frequency input, the FW calculates the nearest possible period value (based on the prescalers, counter resolutions and other settings) that can be acheived on the counter
and returns back the same after setting it to the counter registers.

Here's a simple formula that calculates the same:
.. image:: /source/projects/ad3530r_iio/sampling_frequency_calculation.png
:width: 600

When to use what mode?
======================

Any combination of channels can be sequenced in case of Single Instruction Mode and sampling_frequency (update rate) can be varied as per the requirement. However, since every transaction is a single instruction (requires an address plus data phase), the maximum achievable sampling rate is limited to 570KSPS.
On the other hand, in case of Streaming mode, only serial channels are allowed to be sequenced (as the chip assumes the regiters to be contiguous in streaming mode) and the sampling frequency is fixed at 1.4MSPS (the highest throughput possible at a given SPI clok frequency). This mode is useful when the maximum sampling rate is required and the data is to be streamed continuously.

=======
Support
Expand Down
Loading
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 627ceee

Please sign in to comment.