DSP read back for data capture
Hi there,
We're trying to read the value of a level detector from our uC and just having a bit of struggle understanding the datasheet.
Our meter is at address 2074 as expected, (data capture register), however all the tests we've done we couldn't get the correct value out of a read of this register. I think that the issue is related to the Program counter register setup and RS bits...
The datasheet states: "The capture count and register select values that correspond to the desired point to be monitored in the signal processing flow can be found in a file output from the program compiler"
My question is how can we get that desired point? Which compiler output file are you refering? Is that the trap.dat?
Would it be possible to use on an example as I'm sure that we can't be the only one wanting to read the value from the DSP.
Thanks a lot for your support,
Tony
Hi Tony,
Sorry for the delayed response.
I assume from your description that you're using a 2nd generation SigmaDSP with hardware trap registers like the AD1940. Although the datasheet describes how to use these registers, it is a bit confusing. I would recommend simply using SigmaStudio as a guide and emulating its method of reading back from the trap registers.
Step 1: Compile your project. Make sure a USBi communication channel is selected and configured in the Hardware configuration tab. Here's my example project with a simple DC input and readback cell:
Step 2: Enter any value into the DC cell. You'll see the write to parameter RAM over the comm port in the capture window.
Step 3: Click the read button on the readback cell.
The exact write and read sequence should appear in the capture window.
You should be able to simply duplicate that write/read sequence in your micro.
Let's try testing this using the Read/Write window in SigmaStudio.
Here's the first write:
Here's the second:
And the readback:
Success!
So, I would suggest that you avoid the complications of manually figuring out the write sequence and simply copy it from SigmaStudio's capture window. The sequence may change when you update and re-compile the project, so be sure to double-check the sequence each time the project is updated. This should work with all SigmaDSP processors, even those with software readback implementation.
Brett,
Thanks for your reply. Tried as per your recommendation, made some progress in being able to read data but unfortunately, no luck... :-(
Here is the situation: I have 2 x audio inputs, one connected to an Read-back block, one connected to an RMS level detector block. (trying both blocks)
I feed an external tone generator to my board, send the init commands as per Sigma software and then translate the read Hex value to a dB value using the formula from the help file: dB_value = 96.32959861 * (readback_value / 219 - 1)
RMS block reads correct value but stalls at -35dB (without audio connected still -35dB so obviously something wrong) while if I mute the DSP core, it does get to -96dB but the linear region seems to be between -35 and -15dB.
Read back block reads nothing that makes sense to us no matter what happens... Whether I connect an input or not, it always read a value which using the same formula (dB_value = 96.32959861 * (readback_value / 219 - 1)) returns -15dB all the time (no matter if signal is fed to the input or not..
Anyway, my questions I guess are:
1) Is there a limitation on the RMS block that would explain why we can't read anything lower than -35dB? any clues?
2) Why is the readback not working.. :- ( are we missing something?
Thanks again for your support,
Tony
Hi Tony,
I'm having trouble reproducing this error. When I read back any source through an envelope cell, I'm getting predictable results. The readback to decibel conversion should be like this:
Amplitude in dBFS = 20 * log (Readback_Value / (2^19 - 1))
2^19 - 1 = 524287 = 0x7FFFF
A good test is putting a square wave source through a volume control and then an envelope detector. Setting the volume control to any value should change the output appropriately.
When I set the volume control to -27 dB, I read back 0x5B7B.
20 * log (0x5B7B / 0x7FFFFF) = 20 * log (0.04466) = -27 dB.
When I set the volume control to -42 dB, I read back 0x1044.
20 * log (0x1044 / 0x7FFFFF) = 20 * log (0.007942) = -42 dB.
So, I don't see the problem you're seeing. Could you send an example project?
Hi,
I now running into a similar problem.
I do a sine wave source, with a gain control, follow by a envelope block and finially the reading block.
I can get the reading correct when I use the peak envelope.
But when I use the RMS envelope, with the same equation,
I get -6dB when i didn't apply any gain.
I get -26dB when i apply a -10db gain.
Is it I need to use another equation for the RMS envelope to get the value right?
Thanks a lot.
it is not a -20db constant, it is a double relationship,
Here is more example:
If I apply a gain of -20dB, the reading is -46dB
If I apply a gain of -15dB, the reading is -36 dB
It is I have a base of -6 without any gain, and then the resulted reading is -6+(2*whatever gain I apply)
Maybe it's just a coincidence but -20dB is a factor of 0.1 (divide by 10) so I wonder if either you or Sigma or doing the gains wrong?
This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.
Thank you,
EZ Admin
I am reading these posts from a long time ago and I see the problem. There is most likely no DC block or HPF being used on the output of the ADC. So there is a DC offset from the converter and that is why the level is still -35db even with no signal because that is the level of the DC offset.
It is a good idea to always turn on the HPF in an ADC if it exists or if you are using the ADAU1701/1401 then use a DC block filter on the output of the ADC right at the start of your DSP signal chain.
Dave T
Please log in to reply.