Post Go back to editing

Using Readback and BitWise to monitor the ASRC Lock register

Category: Hardware
Product Number: ADAU1452

I was having loud pops on first turn on of my ADAU1452 based DSP when using the ASRC, and saw this post  -  ADAU1462: loud pop/click when audio starts , following the instructions I added the logic to my program.

The question is, am I using the logic properly?  

I am trying to monitor ASRC 0, but would eventually want to monitor ASRC0, 1 , 2 , 3

When I change the Mask in the DC cell to 0 I always read 0.

When I change the Mask in the DC cell to 1 I always read 1.

When I change the mask in the DC cell to 2 I always read 2, etc... 

Seems wrong? The ASRC is showing as Locked.

  

  • Hello   

    Thanks for the details. It helps so much. 

    What you showed and outlines is all exactly working fine. It requires a little bit of imagination to "see" the hex number in binary and also to follow some Boolean math. 

    You have input to four of the ASRC. ASRC0,1,2,3 as you mentioned. All four are locked. So all four will have the lock bit set. therefore, reading eh lock register will give you 0x00, 0F.

    In binary this is 0b 0000 0000 0000 1111

    Look at the register for the ASRC lock bits:

    You see the last four bits are the ASRCs you had signals going to when you took the screenshot. 

    So then you are using an AND function. You have the DC cell set correctly to 32.0 format. 

    In Boolean math ANYTHING AND'ed with zero will be zero. 

    So this is why when you set it to zero you get zero.

    The other two examples you are setting one bit at a time. Oh!! One thing I should really explain. It is in the Toolbox that these logic blocks are "bitwise" 

    This means it compares one bit on one input to the same corresponding bit in the other input. Then if both are a "1" then the output is a "1" in that bit position. If either is a zero then the output is a zero. 

    The purpose of the DC cell is to setup a mask to mask out the other bits and only get one bit. 

    So if you want to know the status of ASRC0, it is located at bit zero so you use the mask of 0x00 01 which is a "1" in the LSB position.

    If you want to know the status of the ASRC1, then you use a mask of 0x 00 02 which in binary is 0b 0000 0000 0000 0010. So the "1" is in the "second" bit. 

    Since all four ASRCs are locked when you used 2 as a mask you got the 2 as an output. It masked out all of the other bits, you did not get an "F" (1111) you got a 2 (0010). It is only that one bit.

    So how you would use this is to mask out only one bit and then check for Zero or Not-Zero.

    This is where the "Zero-Compare" or the "Buffer" blocks are super handy. 

     You are using the buffer block. 

    So if the input is zero it will output a zero. 

    If the input is NOT zero (does not matter what the value is) it will output a "1" in the bit position you set it up to do. You it can be in the LSB position if you are switching a MUX and need a 32.0 number or it could be a "1" in 8.24 format which you would need if you are using an external controlled volume control 

    So this is a long answer to the short answer of "Yes", you are using the logic properly but what I cannot see is what the buffer is driving. It is set to put the one in 8.24 format so I assume you are driving a volume control with it like I did in my example. 

      Dave T

    Here is the Wiki for the buffer cell:

    Buffer Gate [Analog Devices Wiki]

  • Thank you, I am using this to drive a Volume Control to ramp the volume up and down on lock/unlock. Everything seems to be working properly.

  • There is one part of this that is not clear, or the Wiki has the wrong information. When using the DSP Readback (1) do I need to enable "continuous readback" for the ADAU1452 to automatically do the comparison, or is this only for display? ; and (2) the Wiki says "blue = continuous and orange = stop continuous", but this seems backwards from the actually Sigma Studio, or am I reading it wrong?

                

  • Hello Todd_P,

    The readback is mostly for when you have SigmaStudio connected up. It sends back data that is going through it at around a 10ms rate if you set it to continuous read. So not every sample. Then it displays it on the screen. It is for you to see it when testing the program. It passes the data from the input pin to the output pin unchanged and that data is every sample period. It only sends the data up to the PC to be viewed when you press the button or engage the continuous read. By the way, you can read it with a system controller if you like. There is not continuous, you would have to program your micro to read it every 10ms or so. That functionality is in SigmaStudio program running in the PC. All that happens in the DSP is that the data coming into the input pin is stored into a memory location and send right out the output pin. So your program could read that location at any time. It uses about one or two instructions so it has a small load but not too bad. 

    As far as the color. The Wiki is not great at explaining things. If it is Blue it is NOT in continuous read, you press the blue button to Start the continuous readback. Once you press it then it is orange, so pressing the orange button shuts off the continuous readback. Mouse over it and the pop-up will tell you what to do. Also, look up at the main program commands way up at the top. One of them is called "Action" In there you will see commands to shut off all continuous readbacks. It is not a good idea to turn all of them on. It can overwhelm the USBi. We did setup the program to shut off the read of Readbacks that are not fully visible on the screen which helps that. 

    So you are not reading it wrong, it is just not clear, you press the blue button for continuous read and the orange to stop it. So if it is orange then it is in continuous readback. 

    Dave T