CSI0 Setup for Greyscale camera

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CSI0 Setup for Greyscale camera

1,689 Views
JimMalone
Contributor III

Hi All,

 

I am starting a project that will take input from a greyscale camera (8 bits to test on a i.MX53 QSBR and later 14 bits on a custom board using a i.MX6Solo).  It is not clear to me how to set the CSI0 port up to accept greyscale data.

 

Table 45-2 of the i.MX53 Reference Manual Rev 2. 12/2011 states that modes for greyscale are supported for both 8 bit and 16 bit.

 

Looking at the CSI0_SENS_DATA_FORMAT field in the IPU_CSI0_SENS_CONF register (Section 45.51.111), it is not intuitively obvious what to select for a greyscale format:

000 full RGB or YUV444

001 YUV422

010 YUV422

011 Bayer or Generic Data

100 RGB565

101 RGB555

110 RGB444

111 JPEG

 

Digging even further, the data sheet has a table (Table 58 in section 4.7.8.1) shows how to connect the CSI0 pins for the respective color formats.  A pure greyscale mode is not present (even though greyscale could be placed in a YUV format without the UV).  The generic data mode is also not clear.

 

Has anyone attempted to use the greyscale mode for camera input on CSI0?

 

(I have a thread going with my local FAEs but I wanted to open this discussion up).

 

Thanks!

Labels (1)
0 Kudos
7 Replies

885 Views
ambiguity
Contributor III

Any updates?  I am running into the same issue with the imx6.

0 Kudos

885 Views
DraganOstojic
Contributor V

The way I solved this problem is I capture as RGB24 which is supported but I specify horizontal resolution as h_res/3 i.e. I fool CSI interface to think that every 3 gray pixels are one rgb pixel. You need to make sure that h_res/3 comes out divisible by 16 and v_res has to be divisible by 8. For example h_res/3=2592/3 and 1296/3 (x2 binning for 5MP gray scale camera) will work.

0 Kudos

885 Views
ambiguity
Contributor III

Thank you for the info... it may definitely help me in the future.  For IMX6, I resolved it as well... see https://community.freescale.com/thread/306822

Basically, just added support for Grayscale so I did not have to change the upper (user) layer.

0 Kudos

885 Views
DraganOstojic
Contributor V

Good that you resolved your issue and thanks for the pointer to the native gray scale support. I'll give it a try.

0 Kudos

885 Views
KlausGuertler
Contributor II

Hi Brilliantov Kirill Vladimirovich,

probably I can not help you with your questions according the Linux BSP.

As you can see from the file I attached for Jim Malone (ForJim.zip), I programmed the capturing of the grayscale camera

at a very low level, register by register, with the IAR compiler for ARM. And at the end I watched the picture via a memory dump. I did not use the BSP in my code.

BR Klaus

0 Kudos

885 Views
BrilliantovKiri
Senior Contributor I
Hello, Klaus! How you configure codec for work with grayscale? I modify mxc_vpu_test.out, change V4L2_PIX_FMT_YUV420 on V4L2_PIX_FMT_GREY in capture.c, but image always have color. Freescale technical support answer: Unfortunately grayscale (generic format) is not supported in Linux BSP, sorry, one will have to add such support himself.
0 Kudos

885 Views
KlausGuertler
Contributor II

Hi Jim,

I connected a monocrome WVGA camera to CSI0 using parallel 8 bit interface
(CSI0_DAT19-12, CSI0_PXCLK, CSI0_HSYNC, CSI0_VSYNC and I2c2).
I attached a file demonstrating my setup, which worked after a lot of
try and error because the manuals are often not very helpful.

I hope this helps.
BR Klaus

0 Kudos