SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By mule
#149580
Brijesh,

After testing yesterday I can see that I am missing a pixel every now and then. I upped the DMA priority, but still saw missing pixels. The effect is that the image offsets by one and colours get messed up. So my thinking was also to slow down the FPS. I am pretty sure that I have all clocks setup correctly to capture at 30FPS but going to scale this down now and see how things turn out. Thanks for the register settings, these should assist with the scaling of image and clock rate too.

Thanks - will look out for the email!
By haris
#150149
HI:
its very helping topic going on here. thanks God i found the forum.
I am interfacing ov7690 with STM32F4. I also used example code and modified it according to ov7690 settings.

I have enabled FRAME capture complete interrupt and I am getting it. for now i have issue with DMA. firstly I deliberately clear all the bits D0-D7 by pulling them down manually. and after frame capture interrupt .I start to transmit data to serial. I got zeros.
I have some doubts please clear me.
i use address 0x2001C000 for memory dump in DMA. I read data from that memory location as this
define MEM 0x2001C000
read=0;

while(1)
{
data= *(__uint32__* ) MEM+read;

usart_send(usart2,data);
usart_send(usart2,data>>8);
usart_send(usart2,data>>16);
usart_send(usart2,data>>24);
reed=reed+4;
}

am I reading data correctly?
How will I now to stop reading data?
in what sequence the data is stored in MEM after it gets to DCMI_DR?

I am using snapshot mode.
thanks.
By brijesh
#150240
Hello Haris,

It is difficult to give any suggestions or comments with so little information. There could be so many things that could be wrong.
First question: What board are you using?

Also I would not use hard coded address values for DMA. I am not sure where that address is located.

I would suggest that you first declare an array for image memory and use its address for DMA setup. for example

uint8_t buffer[160x120]

Dma address = &buffer[0]

will work.

Cheers
By haris
#150353
hi brijesh,
I have tried from both methods. same result. from DMA address, and the array approach. I have receiving the same data. first , i was getting 0x02 for whole time, but after changing polarity of psync,hsync on stm32f4 /i get some values.

now i am trying to get color bar test pattern.
I have a question that does color bar data continuously come at output pins or for just first frame in continuous video mode?
means if I set my sensor for color bar test pattern , can I read data any time from output pins?
By brijesh
#150401
If you setup the sensor to output color pattern, then that pattern will be sent as image. It will be sent until you change the configuration.

Note that I had some issue with image size, the default settings on my sensor did not output 640x480, it was about 636x480.
By haris
#150403
thanks, alot
I have problem how to display data received over serial? and where it start and where it ends?
By haris
#150491
thanks a lot for suggestions. in ov7690 the color bar is overlay with image.

i have managed to count hsync pulses between to consecutive vsync pulses i.e. 480.
I tried to get the image data firstly in the memory and then read from it after a snapshot, to do so I declare an array of at least to be length of 480x640 , but i got error at compilation...some memory bank error i think.

I want to ask how can I configure my USART in stm32F4 to get data over serial, at the same time when DMA putting data in memory? with out any lose.
By rujatt
#150537
This Thread is very interesting.
I can not found enought Information about the OV7670 in Germany where I came from.
Can you give me a overview about all the register and the values they must have
for RBG QVGA resolution.
So I must not invent the wheel again .
Furthermore you have wrote that the I2C can not be use on the OV7670 because the I2C
is not the same how the SCCB Protcoll.
What is exactly the different between I2C and SCCB ? What have you found ?
I hope you can tell me that whit easy words so I can understand that and translate to german
without errors.
I will take a Microchip Pic32MX to work with the OV7670 so I can not use the Cortex M3 Sources
and not understand this source.
I hope you can help with much information.
:clap:
By haris
#150550
haris wrote:thanks a lot for suggestions. in ov7690 the color bar is overlay with image.

i have managed to count hsync pulses between to consecutive vsync pulses i.e. 480.
I tried to get the image data firstly in the memory and then read from it after a snapshot, to do so I declare an array of at least to be length of 480x640 , but i got error at compilation...some memory bank error i think.

I want to ask how can I configure my USART in stm32F4 to get data over serial, at the same time when DMA putting data in memory? with out any lose.
I have messed up a lot.... :? :oops:
firstly , connection between ov7690 module and stm32f4 was made with wires about 6 inches... so I get very different behavior every time.. but now I get my PCB which is directly attached to stm32f4. I am getting 480 hsyncs, but can not get data, it still 0x02 , or 0x00.... i think I am not setting the clocks polarity matching with each other (ov7690 and stm32f4)...

=>> now atleast i am getting constant response, but that even get wrong about one in 20 tries...? why is that so? there is no loose connection.

=>>can u send me register setting for clock polarity setting of ov7670 and stm32f4 u have made.
thanks
By rujatt
#150552
thank you haris for this link.
You don't have list with important OV7670 register and
the values needet for rgb 565 Qvga ??
By rujatt
#150554
oje - just I have much problems
I have sign up in "epudn.com" but I have no Points for Download.
your ov_sccb file.
I also found there the file " Sensor_reg" should have the Information
that I search this time.
I dont know, in german are not such download systems
Who can send me the Information via PM ??
Greeting to you
I
By haris
#150661
haris wrote:
haris wrote:thanks a lot for suggestions. in ov7690 the color bar is overlay with image.

i have managed to count hsync pulses between to consecutive vsync pulses i.e. 480.
I tried to get the image data firstly in the memory and then read from it after a snapshot, to do so I declare an array of at least to be length of 480x640 , but i got error at compilation...some memory bank error i think.

I want to ask how can I configure my USART in stm32F4 to get data over serial, at the same time when DMA putting data in memory? with out any lose.
I have messed up a lot.... :? :oops:
firstly , connection between ov7690 module and stm32f4 was made with wires about 6 inches... so I get very different behavior every time.. but now I get my PCB which is directly attached to stm32f4. I am getting 480 hsyncs, but can not get data, it still 0x02 , or 0x00.... i think I am not setting the clocks polarity matching with each other (ov7690 and stm32f4)...

=>> now atleast i am getting constant response, but that even get wrong about one in 20 tries...? why is that so? there is no loose connection.

=>>can u send me register setting for clock polarity setting of ov7670 and stm32f4 u have made.
thanks

:D I set the pclk falling pclkpol, vsync to high vspol and href to low hspol polarity on STM side. PCB works fine and it helped so that i can get rid of hardware issues. I have managed to set my resolution to 128x128, in that way I can get first complete data through DMA to memory location, and then after single frame , I transmit data through serial , and reconstruct data in matlab. the data is in format yuv422. the picture is reconstructed fine. but there are some saturation and hue issues in it. more over every new frame data begins with 0x02 length of 255 long row, what that means? i will upload image in a day or two.
By haris
#150698
hi:
I have getting problem reconstructing data in matlab. YUV422 image is some better than RGB565. why i am getting not good picture? is problem with register setting of ov7690 or with my reconstructing methodology. and why I am getting 0x02 at the start of every picture? why not 0x00!!!!( although I keep it at the end of the data for manipulation).

i have attached my yuv and rgb image .
yuv.png
rgb.png
thanks
You do not have the required permissions to view the files attached to this post.