SMPTE ISR resetting

Hello everyone!

First, let me say, please bear with me. This is the first time I’ve posted on this forum and it may be difficult for you to understand what I’m talking about at first.

Anyway, I’ve been tinkering around with the code on [this ](http://SMPTE timecode reader with LCD display)topic. I’ve modified it to control the outputs of 3 74HC595 chips depending on the current received timestamp. I’ve pretty much gotten it to work the way I’d like for it to, minus having one small issue. Whenever the SMPTE audio file is paused, the Arduino won’t reset all the byte variables as I’d like it to. Sync should be assumed to be lost if no data is received after the maximum zero time and it should return to its quiescent state. I can get it to reset the variables if I do this:

void loop() {
temp_bits = total_bits;
if(temp_bits == total_bits){
  delay(11)//Maximum zero time rounded up
  if(temp_bits == total_bits){
    //Clear all the variables here
  }
}

//Rest of the loop here

}

This would work fine, but it interferes with the control of the 74HC595s. I have tried and tried to used millis instead*, but, instead of resetting after 11 milliseconds of no data being detected, it resets the variables every 11 milliseconds, which clearly won’t produce a desirable result at all.

A bit more about my setup:

From my computer, I am playing the SMPTE audio file into a “shaper” circuit which converts the audio-level sine wave into a logic-level 5V wave, along with filtering out some noise with a 74HC14. Whenever you pause the audio file, the shaper circuit retains the last known logic state that it received. This seems to be part of the issue I’m having, because the ISR is still waiting for the second edge of the bit cell, but it never detects one because its paused.

So, after all this, my question simply is: Is there a way I can reset the variables in the sketch after 11 milliseconds have elapsed since the last detected bit cell edge?

*I can post the millis() code I used tomorrow if anyone wants to see it; its on another computer that I don’t have access to at this exact moment.

You copy-pasted the title to the topic, not the link to it. But I think I found the right one.

Modify the ISR to record millis() into a variable when it gets a valid timecode. Then your code can look at the age of the timecode and decide if it wants to display it.

MorganS: You copy-pasted the title to the topic, not the link to it. But I think I found the right one.

Modify the ISR to record millis() into a variable when it gets a valid timecode. Then your code can look at the age of the timecode and decide if it wants to display it.

That did the trick! Thanks!