Reading sync signal with Arduino

Hello Arduino friends!

I would like to read a synchronization signal from an IC and process it with the Arduino.

I assume that the signal is a standard high/low clock signal although I can't verify that at the moment (no information in the datasheet).

Assuming that it is, can I simply connect it to a digital IN on the Arduino and then do something like:

pinMode(inPin, INPUT);
while(1)
{
    if(digitalRead(inPin) == HIGH)
    {
        // do something
    }
}

Could I somehow damage the Arduino if the signal turns out not to be a High/Low clock signal?

Anything else important to consider here?

Thank you very much in advance for all the help, it is much appreciated! :slight_smile:

Have a nice day!
Tom

Why don't you just tell us what the IC is?
Yes, you could damage the AVR.

It is an OV7720 火狐体育直播平台,火狐体育登录

If it is a proper video sync, it goes below zero volts, so connecting it to an Arduino is a no-no.

So then what would be the best way to access the sync signal?
I need to know every time the camera starts taking a new frame.

Shift the sync above 0V

Haven't used the '7720, and can't seem to find an actual data sheet right now. (See Footnote.)

However...

Based on experience with OV7710, I will say that the VSYNC (as well as other output signals) is a 3.3 Volt logic signal (assuming that the I/O voltage supplied to the chip is 3.3 Volts), not a PAL or NTSC video sync signal.

Bottom line for me: If you are developing a product that has video capabilities, without a 'scope you are operating blind. I mean, if you know for damn sure that the hardware is operating properly, well, it's possible, but the operating mode for the hardware (frame rate, video mode, etc.) depends on software (somewhere), and---well, you know.

As far as your code: If you are basing your program on some timing information from VSYNC, you need to find its rising edge, not simply detect when VSYNC is high.

Furthermore...

Since the pulse width of the VSYNC signal might be quite small (compared to Arduino's ability to poll its value) a scheme using Pulse Change interrupt might be more appropriate than polling. Whether your program can respond in timely manner, well, that's another matter.

Regards,

Dave

Footnote:
You should try to get a real data sheet. You may be able to get one from Omnivision or one if its distributors or from whatever vendor you got a module using this device.

Sorry, only just now saw your reply.

Thanks a lot for the information you provided!
You are absolutely right about having to detect the rising edge of the sync signal.
I am still waiting for some additional hardware to arrive and then will run some tests to see if I can grab that sync signal with the Arduino.

Thanks again for the input, it is much appreciated!

best regards,
Tom