This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
resources:tools-software:sigmastudio:toolbox:basicdsp:dspreadback [11 Oct 2012 17:48] Brett Gildersleeve [Configuring Constant Readback] Updated name to Continuous readback instead of Constant readback |
resources:tools-software:sigmastudio:toolbox:basicdsp:dspreadback [16 Jun 2020 03:55] Joshua Berlin Added example microcontroller code |
||
---|---|---|---|
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. | ||
Line 34: | Line 37: | ||
{{ :resources:tools-software:sigmastudio:toolbox:basicdsp:dspreadbackreadtiming.jpg? |}} | {{ :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> |