I bought a camera for my Mojo. It’s a small breakout board based on the OV2640 chip made by Omnivision.
The camera is almost plug compatible with the Mojo - you can plug it directly into the header.
Except for the PCLK output. To synchronize the pixel data coming out of the camera, there is a PCLK pin that runs at about 36MHz. If you plug the camera directly into the Mojo this pin connects to pin 34, which can’t quite handle distributing that signal with a low enough skew across the chip.
In other words, if you try to put that signal in there, it will take too long to move around the chip, and you get strange heisenbugs that sometimes disappear when you recompile. For some reason timing violations are only considered a warning in Xilinx ISE, not an error. I can’t imagine a possible use case for a design that doesn’t meet timing - I guess that shows what I know.
It only took me a month to figure that out. But, it turns out that you can run a small wire over to pin 94, because pin 94 has fast enough circuitry. Or something. Either way, I got it to work, except for the red channel which is missing a high bit. This is a picture of my wireless router and my Dilbert doll on my desk:
Omnivision is, for some reason, very tight-lipped about their datasheets. In fact, you have to sign a non-disclosure agreement just to read them. Their camera modules are notorious for having poorly documented configuration routines… I sent them an email to try to get a datasheet, but it may be a while before I can figure out the problem with the red channel.
Blue and green seem okay, though:
Maybe I accidentally got a “sea themed” camera module.
Note that the actual resolution coming out of the camera is about 4x this (8x more pixels - 2x wider and 4x taller) and the color depth is twice as deep (16 bits instead of 8 bits). The code works in two steps, first capturing the image and storing it into RAM, and then reading out the stored value over a serial port. I had to downconvert because of the limited amount of RAM onchip. So there should be sufficient resolution in this chip to do some sort of machine learning. With a compression algorithm more data could be stored and sent.