ΣSigmaStudio Ask AI Русский Log in

Readback block data format

SigmaDSP & SigmaStudio wygonski Jul 25, 2015 00:00 4 replies Original on forum ↗
Subscribe
wygonski Question
Jul 25, 2015 00:00

I have a DC block in 5.23 format connected to a readback block whose default format is 5.19. I can change the format of the readback block in SigmaStudio to 1.23. However, when I write a 5.23 value to the DC block and read it back (supposedly in 1.23 format), the 4 LSBs are truncated as if the readback format were still 5.19. I am doing the reads under control of my microcontroller.

Is there something I'm missing? Here's my project:

9e4419e53c8ecc40bd4291ad0f4776d9.png
9e4419e53c8ecc40bd4291ad0f4776d9.png
9e4419e53c8ecc40bd4291ad0f4776d9.png-369x237.png
9e4419e53c8ecc40bd4291ad0f4776d9.png-369x237.png
KJBob Reply
Jul 25, 2015 00:00

Hello,

The truncation happens inside the ADAU1701 itself (see its data sheet, page 38). Thus the lower bits are already truncated before they get to SigmaStudio or your microcontroller -- so neither can recover them regardless of the Readback block's format setting. To be sure of getting all the lowest bits, multiply the Readback block's input by 16 as shown:

Of course, this limits the available number range to + 0.9999 -- -1.00 decimal, but now the lowest 4 bits are covered. Since the 1701's Readback register is only 24 bits wide instead of 28, you're going to lose four bits on either the MSB or LSB.

Best regards,

Bob

d33b58815aad19f9a6ee1907eb3436ec.png
d33b58815aad19f9a6ee1907eb3436ec.png
d33b58815aad19f9a6ee1907eb3436ec.png-447x222.png
d33b58815aad19f9a6ee1907eb3436ec.png-447x222.png
wygonski Reply
Jul 27, 2015 00:00

Thanks for the explanation, and it works as you describe. Still, looking at the signal graph, it seems counter-intuitive that -1.0*16=-1.0.

So if I add gain of 16 to my original graph as shown below, what value gets sent to the DAC?

f2504dea58caeb3dbffe5d17486c26a4.png
f2504dea58caeb3dbffe5d17486c26a4.png
f2504dea58caeb3dbffe5d17486c26a4.png-502x116.png
f2504dea58caeb3dbffe5d17486c26a4.png-502x116.png
jon71 Reply
Jul 27, 2015 00:00

This is the head-hurting part of SigmaDSP: it sends LSBs (1.23) to the DACs by tossing out the MSBs (datasheet pg. 29), but reads back MSBs (5.19). So you don't want that *16 function in your audio path (which would clip it), just your readback path. Don't even ask me how long it took me to figure that out

wygonski Reply
Jul 27, 2015 00:00

Thanks, that's how I read p. 29 of the datasheet as well (Numeric formats). Many thanks to you and to KJBob for illuminating this for me.

I will try to mark both your answers as correct.

John