Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
resources:tools-software:sigmastudio:toolbox:basicdsp:dspreadback [21 Jun 2012 20:07] – Added description of numeric formats for each chip Brett Gildersleeveresources:tools-software:sigmastudio:toolbox:basicdsp:dspreadback [16 Jun 2020 03:55] (current) – Added example microcontroller code Joshua Berlin
Line 8: Line 8:
 The DSP Readback block lets you read values back from the DSP at any point in your schematic design.  The DSP Readback block lets you read values back from the DSP at any point in your schematic design. 
  
-The number displayed onscreen is the data value sent back from the DSP considering all the blocks to the left of the Readback block. Every time you click Read, this value will be updated with the latest from the DSP. By displaying the output value from any block, in any format desired, Readback is used chiefly for debugging, and probably will prove very handy.+The number displayed onscreen is the data value sent back from the DSP considering all the blocks to the left of the Readback block. Every time you click Read, this value will be updated with the latest from the DSP. By displaying the output value from any block, in any format desired, Readback is used extensively for debugging. Readbacks can also be used to hold values for a microcontroller to access over the control port.
    
 Values can be read back in either hex or decimal. For the latter, you must specify what format you want the number to be displayed in. The default for 1st generation SigmaDSPs (including AD1940, AD1941, ADAU1701, ADAU1702, ADAU1401) is 5.19: 5 bits for the integer, 19 for the decimal. Any changes to this format will shift the decimal value of the number displayed. Values can be read back in either hex or decimal. For the latter, you must specify what format you want the number to be displayed in. The default for 1st generation SigmaDSPs (including AD1940, AD1941, ADAU1701, ADAU1702, ADAU1401) is 5.19: 5 bits for the integer, 19 for the decimal. Any changes to this format will shift the decimal value of the number displayed.
  
-Newer SigmaDSPs like the ADAU1761, ADAU1781, and ADAU1442 are able to read back in full 28-bit (5.23) accuracy.+Second-generation SigmaDSPs like the ADAU1761, ADAU1781, and ADAU1442 are able to read back in full 28-bit (5.23) accuracy. 
 + 
 +Third-generation SigmaDSPs, such as ADAU1452, ADAU1466, and ADAU1467 are able to read back in full 32-bit (8.24) accuracy. 
  
 See [[resources:tools-software:sigmastudio:usingsigmastudio:numericformats|here for more information about the numeric formats]] used in SigmaDSP. See [[resources:tools-software:sigmastudio:usingsigmastudio:numericformats|here for more information about the numeric formats]] used in SigmaDSP.
  
-For a sample design using this block, see the [[resources/tools-software/sigmastudio/toolbox/examples/basicdspexamples|Basic DSP]] example.+For a sample design using this block, see the [[resources/tools-software/sigmastudio/tutorials/basicdspexamples|Basic DSP]] example. 
 + 
 +For some examples of using this cell to check the peak or RMS level of a signal, please see this EngineerZone forum FAQ: [[ez>message/7669|Monitoring average and instantaneous signal levels]]
    
 +===== Configuring Continuous Readback =====
 +
 +The DSP Readback cell can be configured to read back from the target DSP repeatedly at regular intervals. To enable this mode, right-click the cell and select **Start Continuous Read**.
 +
 +{{ :resources:tools-software:sigmastudio:toolbox:basicdsp:dspreadbackstartcontinuousread.jpg? |}}
 +
 +You can also click the small circle in the cell to enable or disable Continuous Read mode. When the circle is blue, Continuous Read mode is active. When the circle is orange, Continuous Read mode is inactive.
 +
 +{{ :resources:tools-software:sigmastudio:toolbox:basicdsp:continuousreadactive.jpg? |}}{{ :resources:tools-software:sigmastudio:toolbox:basicdsp:continuousreadinactive.jpg? |}}
 +
 +When Continuous Read mode is active, you can change the update rate by right-clicking on the cell and selecting from a list of options. Selecting a slower update rate will allow you to have more readback cells operating at the same time, and will lower the chances of a buffer underrun error on the USB interface.
 +
 +{{ :resources:tools-software:sigmastudio:toolbox:basicdsp:dspreadbackreadtiming.jpg? |}}
 +
 +====== Acessing Readback Values from a Microcontroller ======
 +The following assumes you have a working microcontroller platform, with SigmaDSP interface code based on [[resources:tools-software:sigmastudio:tutorials:microcontroller|Interfacing SigmaDSP Processors with a Microcontroller]].
 +<note tip>It is always recommended to access block parameter addresses from the *PARAMS.h file exported by SigmaStudio. This ensures that as your SigmaStudio project evolves the system controller is always accessing the proper device registers.</note>
 +
 +The Readback block has a single read-only address which holds the value from the input pin. The value is updated with each audio sample. You can read the value and decode to float:
 +<code cpp>
 +double readback_val = SIGMA_READ_REGISTER_FLOAT(MOD_READBACK1_READBACKALGNEWSIGMA3001VALUE_ADDR);
 +</code>
 +
 +Retain the integer representation:
 +<code cpp>
 +int32_t readback_val = SIGMA_READ_REGISTER_INTEGER(MOD_READBACK1_READBACKALGNEWSIGMA3001VALUE_ADDR, 4);
 +</code>
 +
 +Or simply print the value to the serial port; great for debugging.
 +<code cpp>
 +SIGMA_PRINT_REGISTER(MOD_READBACK1_READBACKALGNEWSIGMA3001VALUE_ADDR, 4);
 +</code>
 +Example output: ''VALUE AT 0x35: 0x01 00 00 00''
  
 +<note important>First-generation SigmaDSP processors, such as ADAU1701, do not read back with 5.23 accuracy. For these DSPs, the value from Readback must be bit shifted to accomodate this.</note>
resources/tools-software/sigmastudio/toolbox/basicdsp/dspreadback.txt · Last modified: 16 Jun 2020 03:55 by Joshua Berlin