Re: cmos camera with a pic



On Sunday, in article
<sMMwg.47109$Uy1.32559@xxxxxxxxxxxxxxxxxx> news12@xxxxxxxx
"Roman Ziak" wrote:

Spehro Pefhany wrote:
On 22 Jul 2006 10:41:02 -0700, the renowned "peres"
<beto.barba@xxxxxxxxx> wrote:

Hi, i need only to store a picture when an event happens, i want to do
it with a pic16f876A, i dont need to do any kind of image processing i
think, just take a picture and store it into a flash, so my question is
what cmos camera do you recomend for this?

thank you in advance

That's a bit high bandwidth (say 4MHz for pretty good resolution) for
a 5MIPS (max) PIC to sit between the camera and an external flash. If
you sampled one pixel per line per frame, it would be very slow (5 or
10 seconds to capture a frame). You probably need something around an
order of magnitude faster to capture an entire (relatively)
high-resolution image in real time.


Best regards,
Spehro Pefhany

For academic reasons let's try different calculation:

Say we do not need color (a security camera) and we have a 320x240
sensor resolution (75k image). Maximum speed of data stream from/to
PIC16F876 over SPI is 5Mbps, which may be achievable.

When doing nothing else.

It is not getting the data OUT of the PIC that is your main problem, getting
the data IN and being sure you can build up an image over several frames!

The data for a frame of 75k BYTES normally output as clocked parallel
data stream at upto 60fps (dependent on camera chips used). Most camera
devices clock this data out using a clock of between 10 and 30 MHz, so you have
to accurately grab EVERY byte in sequence or specific bytes on particular
lines over succesive frames.

This particular PIC only has 384 bytes of RAM so even if you could get
the data in correctly (WITHOUT external acquisition hardware), you could
get ONE pixel per line per frame so you will have to acquire 320 frames
to get the full frame. ===

320 frames at 60fps is 6 seconds, at 30fps it is 12 seconds, assuming
nothing went wrong.

The PIC is not fast enough to acquire 320 pixels in one line without
external stores and hardware.

You would need an external frame store to capture the whole frame to read out
the frame VERY SLOWLY.

So we *could* download an image in 125ms, but we have to send it to
another SPI device and we have only one SPI on our micro. Another 125ms
and we are at theoretical 250ms shutter speed but it will get slightly
higher with SPI protocols overhead and sectoring.

Even if the shutter time was 250ms (which is not possible on a lot of
camera chips), that means the 'event' better be STATIONARY. You have NOT
factored in the 'how to capture the data' in the first place. Let alone
that even if the data rate from the camera was 5MHz BYTES, you are suggesting
serialising to 5MBITSper second, which means you will fall behind the input
data rate VERY quickly. Therefore you will have to take the data as
specific bytes from repeated frames.

Although this does not answer the OP question about the camera or sensor
selection, it would have been nice challenge for Microchip contest some
5-10 years ago, when 16F was cool.

For taking images of STILL objects that do not move for a LONG time.

The PIC especially the PC16F is NOT the right device for the job.

--
Paul Carpenter | paul@xxxxxxxxxxxxxxxxxxxxxxxxxxx
<http://www.pcserviceselectronics.co.uk/> PC Services
<http://www.gnuh8.org.uk/> GNU H8 & mailing list info
<http://www.badweb.org.uk/> For those web sites you hate

.



Relevant Pages

  • Re: Focal-Plane Shutter Anomaly
    ... There are a number of ways a camera manufacturer can approach video capture and I don't know enough about your camera to comment with authority but here's some principles which may shed some light on it. ... Firstly I guess the picture is a crop from a larger landscape frame, that is to say the camera was held the normal way up and you've only shown us a bit of it. ...
    (rec.photo.equipment.35mm)
  • Re: Firewire Capture from Camera (HDV) Jerkey
    ... No matter if we set the camera to output in HDV or DV, ... What I can't seem to figure out is how to get VS9 not to do a realtime ... the "Don't do realtime capture. ... go frame by frame and ...
    (rec.video.desktop)
  • Re: Help: a handheld image processing device
    ... between and after frame captures. ... NOT have a USEB/IEEE1394/or other interface. ... LCD interface and camera ... LCD display and fairly high res CMOS cameras that will plug in to the 20 pin ...
    (comp.arch.embedded)
  • Re: Why are Digital camera images made wrong?
    ... If Photo Paper is available in 4:5 proportions why aren't the camera ... I'm guessing that if the camera manufacturers even gave this any ... of a 35mm frame or digital sensor and the paper products and dime store ... standard aspect ratio frames but oddities like 4:1 or even 7:1 or God ...
    (alt.photography)
  • Re: RED Camera Audio Workflows
    ... Plus or minus one frame is typical in any digital camera. ... what you are using as a reference to determine sync. ... Especially if you are checking sync or aligning the sound based ...
    (rec.arts.movies.production.sound)