Welcome new user! You can search existing questions and answers without registering, but please register to post new questions and receive answers. Note that due to large amounts of spam attempts, your first three posts will be manually moderated, so please be patient.
Because of un-manageable amounts of spam despite our use of CAPTCHAs, email authorization, and other tools, we have discontinued this forum (see the 700k+ registered users with validated email addresses at right?). Please email us any questions or post bug reports and feature requests on GitHub at https://github.com/jevois -- The content below remains available for future reference.
Welcome to JeVois Tech Zone, where you can ask questions and receive answers from other members of the community.

Is there any mechanism to synchronize an LED strobe with the camera sensor exposure?

+1 vote
Hello, I am wondering if there is any known mechanism, hardware or software, to synchronize an LED strobe to the camera sensor exposure? For example, some sort of trigger to indicate the beginning of a frame capture. This would be extremely useful for my application.

Thanks,

Dave
asked Jun 15, 2017 in Hardware Questions by Wikkus (130 points)

1 Answer

+1 vote
hum, that's a tough one. There is dedicated silicon in the CPU that handles camera capture. It may be that an interrupt or what not gets generated on VSYNC. You would need to go and hack the kernel under drivers/media/video/sunxi-vfe to check this out (good luck, that code is a mess).

If you don't need to be ultra precise, how about, in the process() function of a module:

- get the next frame using inframe.get() as we do for all modules.

- get() blocks until the next frame is complete and returns as soon as it is. We have worked hard to minimize the latency between capture complete by the hardware and get() returning. So by the time it returns you should be in vertical blanking and the next frame will start capturing shortly (assuming your code inside process() is fast enough to sustain the camera framerate and is not creating capture pileups and dropped frames, etc). How soon the next frame starts may depend on the exposure setting (maybe the ov9650 datasheet elucidates that).

- so you could just issue a sendSerial("SYNC") and by the time your serial listener (Arduino, etc) is getting it the next frame should be just at the start of capture.

Even if the latency of you receiving the SYNC string is not very well defined right now, it should be reliable (exactly the framerate), so by adding a fudge delay you should be able to sync up with the start of capture. E.g., let's say you reliably receive it in the middle of the frame, then just wait for a half frame and you will be sync'ed up with frame start.

Or, if you are ready for it, the VSYNC signal is available on the PCB (it will be a terminal of a 0402 size resistor, or you may also be able to get it on a pin of a 1.0mm pitch connector). Please let me know and I will send you a photograph of the location.
answered Jun 16, 2017 by JeVois (46,580 points)
...