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?