Author Topic: Raspberry PI Camera IMX219 MIPI CSI 4 Lane interface to Lattice FPGA USB 3.0  (Read 8668 times)

0 Members and 1 Guest are viewing this topic.

Offline RoadRunnerTopic starter

  • Frequent Contributor
  • **
  • Posts: 378
  • Country: de
Since quite some time i have been involved with different type of camera sensors and interfacing to to various processors. In my recent project i took Raspberry PI Camera Sony IMX219 MIPI CSI and interfaced to FPGA and streamed over USB3.0 Link.

There are many MIPI CSI to parallel bridge designs available from many FPGA manufacturer but none of them are open source they either have some blackbox modules or uses some very application specific processor. So i made this design with cheap Lattice MachXO3LF FPGA.

I made my own camera board around the sensor from raspberry pi. As turned out IMX219 is 4 lane camera but raspberry pi's board only uses 2 lane mipi and I wanted 4 so that i can run mipi clock slower but still get full performance out of the camera.

This project is still work in progress, Image Quality, Maximum frame rate and Max resolution need improvement.
Project has seen few improvents since start, Can capture From VGA to Full 8Mpixel Video Stream, Frame rate ranging from 15 to 1000 FPS.
Now auto exposure and auto white blance correction is the next target to further improve Image Quality.

more details about the project can be found on my blog

https://www.circuitvalley.com/2020/02/imx219-camera-mipi-csi-receiver-fpga-lattice-raspberry-pi-camera.html

https://www.circuitvalley.com/2020/02/diy-imx219-4-lane-mipi-breakout-board-raspberry-pi-camera-fpga-4-lane-mipi-csi.html


I have published few youtube videos, but i am still new bie to videos.  Test are shown sensor FPS from 15 To 1000FPS from this tiny camera







« Last Edit: February 28, 2020, 04:54:03 pm by RoadRunner »
 
The following users thanked this post: tom66, Berni, ebclr

Offline laugensalm

  • Regular Contributor
  • *
  • Posts: 104
  • Country: ch
That's some solid work, nice job! Good to see more MIPI implementations out in the open source..
 
The following users thanked this post: RoadRunner

Offline Scrts

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: lt
Good job! If it was me, I would probable have gone with Cypress CX3...
 

Offline RoadRunnerTopic starter

  • Frequent Contributor
  • **
  • Posts: 378
  • Country: de
Good job! If it was me, I would probable have gone with Cypress CX3...

Yes I thought of doing that as well. But there are few issues.
I wanted to have this camera as UVC so that I need not to implement any custom solution on PC side.  As this camera only output raw and UVC does not support RAW. So if I would have gone with CX3. I need to implement a application on the PC side to convert from RAW to usable format. Then i would have also need to implement my solution for controlling  camera exposure and gain.

Second problem was availability of development board, FX3 board costs just a fraction of what a CX3 board goes for. Making custom board was a somewhat hassle with BGA and stuff.

But one very significant advantage CX3 would have offered, MAX theoretical bandwidth is higher compare to FX3. As with FX3 it is limited by 100Mhz 32bit GPIF,  while CX3 does have this bottle neck so can go higher up to what USB 3.0 Allows.

Regards
« Last Edit: March 04, 2020, 10:09:16 am by RoadRunner »
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6145
  • Country: ro
Nice!   :-+

Couldn't spot any, does your blog have an RSS/ATOM feed, please?  I would like to subscribe to it.
« Last Edit: March 04, 2020, 08:41:23 am by RoGeorge »
 

Offline RoadRunnerTopic starter

  • Frequent Contributor
  • **
  • Posts: 378
  • Country: de
Nice!   :-+

Couldn't spot any, does your blog have an RSS/ATOM feed, please?  I would like to subscribe to it.

Thanks
I have just added subscription button to Top Right hand side.

Hers is the link
http://feeds.feedburner.com/circuitvalley/bkTd
 
The following users thanked this post: RoGeorge

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6145
  • Country: ro
Added, thank you.   :)

Just FYI, my uBlock Origin blocks the two buttons like they were Facebook buttons or something, but I can still read the "Subscribe To Embedded Engineering Blog" label, which is a good hint there might be some blocked content there.  I didn't noticed uBlock to be doing that with feed buttons from other blogs.

Offline RoadRunnerTopic starter

  • Frequent Contributor
  • **
  • Posts: 378
  • Country: de
Added, thank you.   :)

Just FYI, my uBlock Origin blocks the two buttons like they were Facebook buttons or something, but I can still read the "Subscribe To Embedded Engineering Blog" label, which is a good hint there might be some blocked content there.  I didn't noticed uBlock to be doing that with feed buttons from other blogs.

Thanks for heads up , will check whats wrong.
 

Offline Vcky_electro

  • Contributor
  • Posts: 23
  • Country: in
Great job.   :clap: :clap: :clap: :clap: 1000fps is really awesome..
 

Offline jackthomson43

  • Contributor
  • Posts: 38
  • Country: us
Great Job. I just Love the open source stuff. I have once tried to achieve it with Microcontroller but couldn't, for cameras we have to use microprocessors.
« Last Edit: March 07, 2021, 12:44:00 am by jackthomson43 »
 
The following users thanked this post: RoadRunner

Offline Gloria

  • Newbie
  • Posts: 6
  • Country: cn
Hi,
I am implementing the imaged display by zynqberry (FPGA) + imx219. The basic implementation scheme  is csi2-rx + vdma + hdmi.
Hoever, the color of the  image on the monitor is bad.
I do not know what I can to improve the quality of the image.
One picture is from my phone and one picture is from FPGA. What should I do to make the picture from FPGA become the picture from my phone?
 

Offline Gloria

  • Newbie
  • Posts: 6
  • Country: cn
 :)
 

Offline Gloria

  • Newbie
  • Posts: 6
  • Country: cn
 :)
 

Offline Gloria

  • Newbie
  • Posts: 6
  • Country: cn
 :)
 

Offline RoadRunnerTopic starter

  • Frequent Contributor
  • **
  • Posts: 378
  • Country: de
Rasperry pi perform some color correction, You can look at pydng project how to fix color. Image with my design was also a bit yellowed and washed out. You can need do color correction and also black level correction. It is going to be a color matrix operation.

Is your design open source ?
 

Offline Gloria

  • Newbie
  • Posts: 6
  • Country: cn
Hi,
I understand. I will try in my further study, for I am a beginner of zynq.
Yes, my project is open source. The board is TE0726-03M zynqberry which provides the csi interface.
 

Offline RoadRunnerTopic starter

  • Frequent Contributor
  • **
  • Posts: 378
  • Country: de
Hi,
I understand. I will try in my further study, for I am a beginner of zynq.
Yes, my project is open source. The board is TE0726-03M zynqberry which provides the csi interface.

Can you please point out where source is available?
 

Offline Gloria

  • Newbie
  • Posts: 6
  • Country: cn
I reference the demo provided by the board.
I would like to share with you if you like.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf