I working on OV9655 camera module that is connected to stm32f4discover evaluation board. I am able to capture a picture from the OV9655 module where the video output format is based on RGB565 and save as BMP file on SD cart. Now I want to capture a gray scale picture and save it as BMP file. For that purpose do use YUV(4:2:2:) video format
The picture size is 120*160.
As I am is aware does YUV(4:2:2) format consist of 4 byte: Yo,Uo,Y1,Vo that sent out through OV9655 video interface. The OV9655 interface is connected to DCIM interface on STM32F407 microcontroller.
The following register setting is use to up OV9655 image chip to send out YUV(4:2:2) video format.
OV9655 COM7 Register setting:
Bit7=0 no changed
Bit6..4 = 110 30fps VGA with VerioPixel.
Bit 3..2 not used
Bit 1..0 10 YUV RGB data
The OV9655 TSL Register setting:
Bit 7..6 11 PCL output delay set to 6 ns
Bit4 0 Normal UV output
Bit3.2 00 YUYV output sequence
Bit 1 0
Bit 0 not used
OV9655 COM15 Register:
Bit 7..6 10 Output range  to [FE]
Bit 5..4 Normal RGB output
Bit 3..0 Not Used.
But I am not sure about that above setting for OV9655 is correct.
After the picture is grab by used of DCIM on STM32F407 microcontroller do I want to convert it to BMP file. Right now do I use the same code that is use during conversation of RGB565 to transform YUV(4:2:2) format to BMP file. The code work fine during conversation of RGB565 to BMP file.
But is it possible to use the same procedure during the conversation of YUV(4:2:2) format to BMP file?
Can the same BMP header that is use for RGB565 be use on the YUV(4:2:2) video format?