ADAU14: Capturing pulse shorter than a frame?

Using ADAU1462 will it be possible to capture pulses shorter than an audio frame?

E.g. can in inputs be set as rising edge triggered so it remembers the state even though the signal is no longer high when the next audio frame is processed?

I am trying to count pulses that are only 700ns long

Thank you 

  • +1
    •  Analog Employees 
    on May 12, 2020 10:22 PM 2 months ago

    Hello Mr. Q,

    700 ns is over 1.4MHz signal if it were at that rate. So it is a very small pulse. So let me directly answer your question then propose a possible work-around.

    I am going to assume the frequency of the pulses are less than the sample rate but just a very short duration correct?  

    The GPIO inputs will not be useful for this fast of a signal. They are only sampled once during the frame period and only for one instruction cycle when it looks at the state of the port to decide if it is high or low. There is no latch. So the odds of a pulse this small EVER hitting at exactly the correct time is going to be quite low. This would be a good question for a statistics professor to work out. Slight smile

    So I think there may be a way to do this that is a bit of a creative solution. You will need to test this but I think it is possible. 

    Connect this pulse to one of the serial input port bitclock pins. Hopefully, they are not all taken and one port is available. 

    Tie the SDATA_IN pin for that port high. 

    Set the port bitclock to be a clock slave. 

    Either set the LRCLK to be a slave and connect it to one of the sample rate clocks in your system or just set the LRCLK to be a master.

    Set up the port to be an I2S type of signal. 24 bit but this will be changed in the next step.  

    Then in SigmaStudio you will have to set the input cell for this port to be in 32 bit mode. This is done by right clicking on the input object and selecting Data Format and setting it to 32 bit. 

    Now if I am right on this, you will get all zeros if there are no pulses for both the left and right channel audio data from that port. If a pulse shows up somewhere during the frame, a "1" will be read in since the SDATA_IN is tied high. 

    So in your SigmaStudio project you need to add both channels and check if it is not equal to zero. If it is not equal then a pulse happened. If it is zero then no pulse happened. 

    The serial port bitclock can be as high as 24MHz and the BCLK period min is 40.7 ns so it should be able to pick up the pulse. If there is only one edge it will only pick up a "1" on the falling edge ( if you set the bitclock to be falling edge sensitive) and if there is more than one pulse then you will get two bits. The bits should be in the MSB position since there will not be any further bitclocks. So this means it will be the sign bit in the DSP. The good thing is that a "1" in the sign bit followed by all zeros is a max negative level in 2's compliment so the test for zero should work fine. 

    Obviously, it is a little difficult for me to test this here on the bench. You are better setup to test this. See if it works. I think if you only get one or no edges on the bitclock you will get all zeros. If it happens to be the other way around then try tying the SDATA pin to ground instead.

    From a timing standpoint this is not violating any of the operating parameters of the part so there is no risk of damage. Once the data is in the core then it is just data that you can process however you like. You can run it into a counter. 

    Dave T

  • Hi Dave 

    Thank you for your thorough reply. That is a very creative way to solve the problem and I am confident it would work. I like when people think out of the box!

    In my design I need four inputs that are able to detect these short pulses, and we do not have four serial audio inputs left. 

    We have come up with some HW that extends the pulse so a normal GPIO can detect the pulse.

    Thanks