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.

  

Parents
  • 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.

Reply Children
No Data