Skip navigation

This Question is Assumed Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
1,603 Views 3 Replies Last post: Nov 16, 2009 12:22 PM by BrettG RSS
Tony Contributor 8 posts since
Oct 11, 2009
Currently Being Moderated

Nov 3, 2009 10:03 PM

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

BrettG Analog Employee 117 posts since
Jul 23, 2009
Currently Being Moderated
1. Nov 9, 2009 3:30 PM in response to: Tony
Re: DSP read back for data capture

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:

ScreenHunter_01 Nov. 09 15.15.jpg

 

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.

ScreenHunter_02 Nov. 09 15.18.jpg

ScreenHunter_03 Nov. 09 15.20.jpg

Step 3: Click the read button on the readback cell.

ScreenHunter_04 Nov. 09 15.22.jpg

The exact write and read sequence should appear in the capture window.

ScreenHunter_05 Nov. 09 15.22.jpg

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.

ScreenHunter_06 Nov. 09 15.24.jpg

Here's the first write:

ScreenHunter_08 Nov. 09 15.26.jpg

Here's the second:

ScreenHunter_09 Nov. 09 15.27.jpg

And the readback:

ScreenHunter_10 Nov. 09 15.27.jpg

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.

BrettG Analog Employee 117 posts since
Jul 23, 2009
Currently Being Moderated
3. Nov 16, 2009 12:22 PM in response to: Tony
Re: DSP read back for data capture

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?

More Like This

  • Retrieving data ...

Bookmarked By (0)