I am using this camera to output an image over serial(thanks to Mr_Arduino). It works pretty good, but i cant help wonder if there are some improvements that can be made on the hardware side. In order to get the bytes from the camera. 8 digital inputs need to be read at a high rate of speed(mhz), each signal is bit, making a byte a data. This consumes 8 digital inputs. Is there an ic that could be used to read these inputs and output a byte to arduino , either via serial, spi or analog? Also has anybody ever tried connecting a jpeg compression chip to the output of the ov7670? I know there are cameras out there with a jpeg compression engine already hooked up, but i have never seen an example(post instructable..etc) of someone doing this, I am a little suprised by this, maybe it has to do with the package size or qty these parts need to be ordered in. Does anybody have information on how to do something like this or know where to find out about a jpeg compressor chip?
What is that camera for? What do you want to do with the captured image?
Is there an ic that could be used to read these inputs and output a byte to arduino , either via serial, spi or analog?
These are called bit shift registers. You can have them in both directions (serial to parallel and parallel to serial) and you can use a digital input on the Arduino or use the SPI hardware to read the bits. But in any case, an Arduino isn't well fitted for image processing no matter if it's a raw picture or a JPEG compressed image. In most cases one of the cheap ARM boxes with embedded Linux is a much better choice for the task.
diesel:
8 digital inputs need to be read at a high rate of speed(mhz), each signal is bit, making a byte a data.
If you use port manipulation you can read all 8 bits as a single byte.
Actually on an Uno you would need to put 4 bits on each of two ports because the Uno uses some of the pins on each port for its own purposes. But it would be easy to combine the two inputs into a single byte
A Mega allows you to put all your inputs on a single port.
The shift register is indeed a good solution, but the speed is less than 1/8th compared to using 8 direct pins and I bet the Arduino is already "slow" when dealing with images.
I'd go with Robin2's suggestion and save the shift registers for other I/O operations that don't need to be quite so fast.
There are many image sensors that have jpeg compression as part of the SoC. I have personal experience with the MT9D111 and got a 1600x1200 jpeg out for it. There are many different modules on ebay some even better than the MT9D111. Also there are very easy to use serial jpeg ov7670s that include a compression chip. Just search for ttl camera.
Yes, I am doing a 2 port read to capture the 8 digital pin inputs, using Mr_Arduino's code. Do to the high speed of transfer from the camera, the Arduino isn't fast enough to read each of the pins. I was just trying to find a way to get the same information without having to dedicate 8 digital inputs to the camera. I see the shift register would be an option, but I don't think it would work w/the small time frame in order to capture the signals. What I was thinking is there might be something similar to the shift register that transformed these inputs into a analog signal, which could be read in as a byte on one pin.
As far as the integrated jpeg encoder, yes I have seen those. Haven't used the MT9D111, but I have worked with the Linksprite camera. I have also seen the omnivision cameras that have a jpeg encoder built in. I was just curious if someone had tried adding a jpeg encoder chip to the ov7670.
diesel:
What I was thinking is there might be something similar to the shift register that transformed these inputs into a analog signal, which could be read in as a byte on one pin.
Whatever about saving pins, the ADC is very very slow compared to digital I/O.
Use a Mega which has many more I/O pins and also has ports with the full 8 bits available to you.
And, another thought ... with Arduino 1.5.7 a Leonardo is very much faster at communicating with the PC over USB because it can use the full USB transfer speed. Maybe there are other boards that work like the Leonardo and have more I/O pins ?
Don't you think that the Arduino might be the wrong platform for this camera? I don't know what you want to use it for (you haven't answered that question yet) but you definitely get easier and cheaper solutions than to pimp an Arduino for tasks it's not suited for.
OK, scratch digital to analog off the list. I wasn't aware that analog read was slow. Thanks for the info. I can get data at 2mbs from Arduino via USB, are you saying the Leonardo can go faster?
pylon,
Yes, I am aware this is pushing the Arduino to its hardware limits. It is impressive that Mr Arduino was actually able to get this to work. I am just curious as to what I can get out of it. I am adapting the code to Teensy 3.1. I don't have a specific use in mind, but I may want to send image out via ethernet.
diesel:
I can get data at 2mbs from Arduino via USB, are you saying the Leonardo can go faster?
Best I have got with an Uno is 1,000,000 baud.
Yes, with Arduino 1.5.7 (which has new USB code) the Leonardo will work very much faster. I can't immediately find the test code I used. I think it was either 3x or 5x. The baudrate value is ignored by a Leonardo.
Yes, I can do 2,000,000 baud(2mbs) with Arduino 1.06 and a Uno/Arduino. I will admit though, it is not always consistent at 2mbs, 1mbs is better. I have noticed that sometimes I have to disconnect other devices from the computer's usb ports in order to achieve the 2mbs.
Interesting about the Leonardo though, I will have to give that a try sometime.