cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
13,131 Views
Registered: ‎04-24-2011

camera interfacing with FPGA

 

Hi I am trying to interface between 
1. a camera with a cameralink output
2. a microcontroller with spi. (this microcontroller is the brain of the system (general purpose usage, not for image processing).

because of the rare nature of the system, i dont see any cameralink to spi framegrabber or such. The solution i think of is:

1. FPGA ? FPGA input of cameralink, image processing (basic) and output to spi? can i use one FPGA chip to congifure its I/O port as cameralink signal and also the spi? please recommend any Xilinx chips for this purpose, if you are familiar :) 

2. use a simple PIC/microcontroller and take in the parallel data from cameralink , process and output to spi?

3. Even if I use FPGA, are there available libraries or tools to auto configure the ports as cameralink /spi protocol? 

any input will help! or if you better ideas do share with me:) thanks !! 

p.s. I dont need streaming (only image not video) so fps are not really of concern.

 

0 Kudos
10 Replies
Highlighted
Instructor
Instructor
13,126 Views
Registered: ‎07-21-2009

Re: camera interfacing with FPGA

How much experience do you have with FPGA design?

Have you searched these forums for 'cameralink' threads?  There have been a number of them.

SPI is a simple interface which has been discussed often in these forums.

 

-- Bob Elkind

SIGNATURE:
README for newbies is here: http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369

Summary:
1. Read the manual or user guide. Have you read the manual? Can you find the manual?
2. Search the forums (and search the web) for similar topics.
3. Do not post the same question on multiple forums.
4. Do not post a new topic or question on someone else's thread, start a new thread!
5. Students: Copying code is not the same as learning to design.
6 "It does not work" is not a question which can be answered. Provide useful details (with webpage, datasheet links, please).
7. You are not charged extra fees for comments in your code.
8. I am not paid for forum posts. If I write a good post, then I have been good for nothing.
Highlighted
Professor
Professor
13,114 Views
Registered: ‎08-14-2007

Re: camera interfacing with FPGA

Maybe if you give us an idea of the kind of image processing you need and

what the microcontroller expects to receive on the SPI interface we could

suggest a solution.

 

The reason you don't find camera link to SPI framegrabbers is that the

camera link interface has orders of magnitude more bandwidth than

SPI.  If your image processing algorithm results in much less data

that the video coming in, then you might be able to do what you want

with sufficient hardware in-between the camera and microcontroller.

 

There are other things to consider even if your hardware reduces the

image to a simple "go / no go" output to the microcontroller.  For example

how do you aim anf focus the camera?  Do you need to see image

data through your system or is there a separate path to a video monitor

(like the LCD screen on the back of a digital still camera).

 

Sorry that at this point there are many more questions than answers.

 

-- Gabor

-- Gabor
Highlighted
Instructor
Instructor
13,111 Views
Registered: ‎07-21-2009

Re: camera interfacing with FPGA

If your image processing algorithm results in much less data that the video coming in, then you might be able to do what you want with sufficient hardware in-between the camera and microcontroller.

Gabor, the intended application is still image processing rather than live video processing.  In this context, a slow and cheap interface such as SPI doesn't seem unreasonable -- given the very little information which has been disclosed so far.

 

-- Bob Elkind

SIGNATURE:
README for newbies is here: http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369

Summary:
1. Read the manual or user guide. Have you read the manual? Can you find the manual?
2. Search the forums (and search the web) for similar topics.
3. Do not post the same question on multiple forums.
4. Do not post a new topic or question on someone else's thread, start a new thread!
5. Students: Copying code is not the same as learning to design.
6 "It does not work" is not a question which can be answered. Provide useful details (with webpage, datasheet links, please).
7. You are not charged extra fees for comments in your code.
8. I am not paid for forum posts. If I write a good post, then I have been good for nothing.
0 Kudos
Highlighted
Historian
Historian
13,108 Views
Registered: ‎02-25-2008

Re: camera interfacing with FPGA

 


@alpha86 wrote:

 

Hi I am trying to interface between 
1. a camera with a cameralink output
2. a microcontroller with spi. (this microcontroller is the brain of the system (general purpose usage, not for image processing).

because of the rare nature of the system, i dont see any cameralink to spi framegrabber or such. The solution i think of is:

1. FPGA ? FPGA input of cameralink, image processing (basic) and output to spi? can i use one FPGA chip to congifure its I/O port as cameralink signal and also the spi? please recommend any Xilinx chips for this purpose, if you are familiar :) 

2. use a simple PIC/microcontroller and take in the parallel data from cameralink , process and output to spi?

3. Even if I use FPGA, are there available libraries or tools to auto configure the ports as cameralink /spi protocol? 

any input will help! or if you better ideas do share with me:) thanks !! 

p.s. I dont need streaming (only image not video) so fps are not really of concern.

 


 

Unless I had a Real Good Reason to do otherwise, I would use one (or more, if using Medium or Full Camera LInk) of the National Semiconductor DS90CR288 Camera Link receiver devices to deserialize the Camera Link data/timing signals. Then it's a simple matter of connecting the 28 (or 56 or 84) parallel data lines and the clock (or two or three clocks) synchronous to those data lines to the FPGA.

 

Since you're talking about using a microcontroller to do some unspecified "stuff," you probably want to have an SRAM-based frame store, unless you've got a really big and expensive FPGA.

 

Then it's a simple matter of reading from the frame store, and shifting the data out over an SPI port.

 

There are no available "libraries" for any of this, I think. In the hardware world, we don't use the word "library," anyways.

----------------------------Yes, I do this for a living.
Highlighted
Visitor
Visitor
13,073 Views
Registered: ‎04-24-2011

Re: camera interfacing with FPGA

Sorry for the MIA  and am glad for the help given!

 

hmm well to be more specific, I will just need probably a jpeg compression. Yes the SPI is too slow compared to the cameralink data coming in, that is why I need the FPGA to bring the cameralink data in, do some processing and store the image into a large flash drive first. Whenever I need the image, the microcontroller will request from the FPGA and the FPGA will return the image (using the SPI).

 

Yes I'm not too familiar with FPGA therefore will like to seek the possibility of doing this, I was thinking the I/O pins can be configured as cameralink (LVDS) pins (I only need base 28 pin) and also SPI pins. Do you think the FPGA is enough to do all these?

 

bassman59: thanks for the suggestion, I was thining the cameralink raw signal can be deserialize straight using FPGA. Seems the  DS90CR288 is a better way of doing it. Do you think the SPI interface should be done is such a way as well? (a dedicated transmitter chip.)

 

bassman59: nice point, is the 'IP' in hardware equivalent to the library we talk about?

0 Kudos
Highlighted
Teacher
Teacher
13,069 Views
Registered: ‎08-14-2007

Re: camera interfacing with FPGA

Hi,

take a look at XAPP485.

This will work with Cameralink up to some clock rate limit.

 

We have used the counterpart (XAPP486) for a Cameralink simulator.

However, the receiver is a little more complicated, because of some timing issues.

Somewhere in the XAPP paper it is recommended to contact the author at xilinx for direct assistance.

 

Also, you need to think about connecting some external memory to the FPGA, because the raw picture will probably be too big for the internal memory.

 

Your project is not an easy one, especially for a beginner.

 

Besides, if you consider using an FPGA anyway, why using an external microcontroller?

You can use some processor IP core which then will have direct access to the memory eliminating the spi bottleneck and saving you the extra part on the board.

 

Have a nice synthesis

  eilert

0 Kudos
Highlighted
Professor
Professor
13,063 Views
Registered: ‎08-14-2007

Re: camera interfacing with FPGA

Camera Link is usually used for high performance video, not still capture.  What sort of

camera are you going to connect?  Is it Base, Medium or Full Camera Link?  What's

the maximum (peak) bandwidth on the Camera LInk (clock rate times bits per pixel times

pixels per clock)?  Our company uses a Multimedia DSP chip from NXP ("Nexperia") which

was designed for set-top boxes, but works well for many frame-grabber applications.

It can easily do the JPEG compression, and has a flexible video input port that handles

up to 32 bits at 100 MHz with very little exterrnal logic.  For Base Camera Link you could get

away with one of these plus a National DS90CR288A and very little else.  And at least

in the volume we use it's much cheaper than a Virtex part you'd need to do JPEG compression.

 

-- Gabor

-- Gabor
0 Kudos
Highlighted
Historian
Historian
13,057 Views
Registered: ‎02-25-2008

Re: camera interfacing with FPGA

 


@eilert wrote:

Hi,

take a look at XAPP485.


Great, the undocumented, unmaintainable serilializer. Phooey.

 

----------------------------Yes, I do this for a living.
0 Kudos
Highlighted
Historian
Historian
13,056 Views
Registered: ‎02-25-2008

Re: camera interfacing with FPGA

 


@gszakacs wrote:

Camera Link is usually used for high performance video, not still capture.


 

While that's true, we use it for still capture (single frame) all the time.

----------------------------Yes, I do this for a living.
0 Kudos
Highlighted
Professor
Professor
3,272 Views
Registered: ‎08-14-2007

Re: camera interfacing with FPGA

 


@bassman59 wrote:

 


@gszakacs wrote:

Camera Link is usually used for high performance video, not still capture.


 

While that's true, we use it for still capture (single frame) all the time.


 

O.K. - I mis-spoke.  Camera Link is not often used for stil cameras.  Industrial video is

the most common - and the whole point behind the interface is the high bandwidth that

allows faster frame rates at high resolution.  I'm not indicating that there is something

inherently wrong about capturing a still frame from a video camera and doing something

like compression and sending it out on SPI, but it would be good to get the whole "picture"

here in order to suggest a reasonable solution.  We have cameras that take 500 frames

per second at 1280 x 1024 resolution, and JPEG the images on the fly, recording them

inside the camera and then trickling them out on USB 2.0 using a web-cam style interface.

Those cameras use a Virtex 2 - XC2V3000 to fit the JPEG compression.  Obviously if

you don't do the compression on the fly you could use a smaller FPGA with a soft

processor - or just a microcontroller if you can get the video frame into its memory.

The PNX17xx and PNX15xx series multimedia processors can do this sort of thing

easily and probably have room left over for whatever the original microcontroller

did in the OP's system.  An FPGA is the last thing I'd think of doing JPEG compression

with for a still image application.  But without knowing more it's hard to say whether

or not it's a fit for the OP.

 

-- Gabor

-- Gabor
0 Kudos