Go Down

Topic: ov7670 with both arduino uno and now mega (Read 94160 times) previous topic - next topic

Mr_arduino

Fifo vs non fifo does not affect image quality. Also there is no need to feel sad. You will eventually end up with a high quality image.  When I first started with the ov7670 all I got was purple images.

vvavepacket



colors seems ok now as you can see pencil is now yellow, and color of skin looks ok but problem is the glare,, so much glare in ma face i cant do face detection :(  also, i checked com40 register and both bit 6 and 7 are one / '1'. also i dont control anymore the brightness and contrast registers.. im only using the AWB registers you provided..


=( =( =( =(

Mr_arduino

The picture does look a little bit better. Also if you cannot resolve the issue could you please post a list of all the registers you used. I think the issue is you are not writing to some undocumented registers that make the quality better. There are some undocumented parts of the ov7670 that I do not know about but after using a long list of registers that may have come from omnivision the quality improves. Also is auto gain and auto exposure enabled? If not enabling it could help with your problem. Maybe just try copying and pasting all registers that I used from one of my code examples. Also to anyone who is reading this thread if you have ANYTHING from omnivsion that is not posted on the internet I will take a look at it. If you don't want me to post it online I will respect that wish. I tried getting a full datasheet from omnivsion once but they said it is obsolete and as such I got nothing for the ov7670. I do have a datasheet for the ov7675 but nothing is learned from it and I cannot post it anyways however you can find the same exact datasheet that is not bound by an NDA here http://media.digikey.com/pdf/Data%20Sheets/OmniVision%20PDFs/OV7675,OV7175_Web.pdf The ov7670 did appear in an EOL notice a while ago but they must be still selling them how else will you explain the thousands of modules that get sold on ebay and other places every month.

michinyon

Quote
The ov7670 did appear in an EOL notice a while ago but they must be still selling them how else will you explain the thousands of modules that get sold on ebay and other places every month.


There are many kinds of obsolete chips which the makers no longer make,    but which are still sold on ebay,    and that is because various wholesalers and subassembly makers are stuck with lots of obsolete or superseded parts in their production pipeline.   

In fact that is one of the main reasons why there are so many cheap and useful devices on ebay,   it is because they are superseded.

vvavepacket

@Mr_Arduino

attached is the comparative analysis and side by side preview of register settings.

so far I found that these registers make it appear the best as of now, (but the glare issue,, so much whiteness in ma face cant do face detection)
Code: [Select]
  Write(0x12,0xff); // perform reset first. reset first everything
Write(0xb0,0x84); //adding this improve the color a little bit
  Write(AWBC7,0x88);
     Write(AWBC7,0x88);
    Write(AWBC8,0x88);
    Write(AWBC9,0x44);
    Write(AWBC10,0x67);
    Write(AWBC11,0x49);
    Write(AWBC12,0x0e);
    Write(AWBCTR3,0x0a);
    Write(AWBCTR2,0x55);
    Write(AWBCTR1,0x11);
    Write(AWBCTR0,0x9f);


also when I do write the registers about the gain ceiling,, pictures turn very grainy and colors are like smashed  just like in the word document I attached below. Thanks

Mr_arduino

#365
Jul 06, 2014, 02:30 am Last Edit: Jul 06, 2014, 02:35 am by Mr_arduino Reason: 1
I have noticed that multiple users have been sending me word documents lately. I have not had anyone send me a word document ever but now multiple users have tried to send me a word document this week. What you put in there could have easily been added to your post. I admit I was actually a bit paranoid when opening the file thinking the document contains a zero day or something. I doubt that is the case but it was a strange choice to use that format. Next time please just put what you need to put in your forum post. I do not like downloading word documents. If that is really all the registers that you used, you are not using enough. Just copy my long list of registers and use that. It will fix your problems.

Also michinyon yes that does make sense. I would not be surprised if someone has lots of ov7670 sensors that they purchased a while ago before it was declared EOL.

s89146892002

hi everyone I from Taiwan my English is not good
i have some programs
i want  use Uno  drive OV 7670 fifo
but i dont no any circuit connection and icant understand why use 74HC245
please help me
thx~~

Mr_arduino

For the fifo version it appears as though you don't need to buffer any pins. The only reason you would need to use the 74HC245 or similar is if you are directly driving a pin that goes to the ov7670 with arduino pins. The al422 can handle 5v and for sccb (i2c) communication you just pull up to 3.3v instead of 5v.

vvavepacket

@Mr_arduino

Sorry, my apologies

-------------------------------------------------------

AWB AND GAIN CEILING ON
Write(0xb0,0x84); //adding this improve the color a little bit
 Write(AWBC7,0x88);
    Write(AWBC7,0x88);
   Write(AWBC8,0x88);
   Write(AWBC9,0x44);
   Write(AWBC10,0x67);
   Write(AWBC11,0x49);
   Write(AWBC12,0x0e);
   Write(AWBCTR3,0x0a);
   Write(AWBCTR2,0x55);
   Write(AWBCTR1,0x11);
   Write(AWBCTR0,0x9f);

 Write(0x14,0x6a);
 Write(0x4f,0x80);
 Write(0x50,0x80);
 Write(0x51,0x0);
 Write(0x52,0x22);
 Write(0x53,0x5e);
 Write(0x54,0x80);

image ->


AWB ON AND GAIN CEILING OFF
Write(0xb0,0x84); //adding this improve the color a little bit
 Write(AWBC7,0x88);
    Write(AWBC7,0x88);
   Write(AWBC8,0x88);
   Write(AWBC9,0x44);
   Write(AWBC10,0x67);
   Write(AWBC11,0x49);
   Write(AWBC12,0x0e);
   Write(AWBCTR3,0x0a);
   Write(AWBCTR2,0x55);
   Write(AWBCTR1,0x11);
   Write(AWBCTR0,0x9f);

image ->

Mr_arduino

Don't worry it is not a big deal. Anyways I was able to open it before you posted the contents of it here. My opposition to Microsoft word is more of a political issue. I disagree with their practices of making their formats secret. I use libreoffice. However I have already answered your question in my previous post to you and again before that in regards to improving quality. Your problem is that you are not writing enough registers to the module. There are bunch of undocumented registers that when I write the long to the ov7670 list it improves quality. I would like to know what all the registers do but until I can find more documentation this is the best I got.  My project https://github.com/ComputerNerd/ov7670-simple contains less "magic" registers if you are interested or you can try one of my pastebin links.

TeamAlpha


@TeamAlpha I have not tried a resistor voltage divider. I have heard that resistor voltage dividers may be noisy so look at the output using an oscilloscope. I just use a buffer IC chip. Also to generate the XCLK clock you need to use PWM. The way you set this up is slightly different depending on which microcontroller you are using. If you could tell me what you have I can further help you with this.


I see.  We will be using a 10k resistor instead because we don't have access to a buffer IC chip.  Right now, we are testing our XCLK code to see if the Due is properly generating a clock.  For our microcontroller, we are using a AT91SAM3X8E (Due R3).  Our superior is expecting us to connect the OV7670 with the due with 2 wires in a I2C connection (4 wires if you count SDA, SCL, Ground, and Power).  Is this enough for the camera to properly function?  Or is there an easier solution?  And will XCLK output a 5V pulse instead of a 3.3V?  That's why we buffer?

Mr_arduino

#371
Jul 09, 2014, 12:17 am Last Edit: Jul 11, 2014, 04:01 pm by Mr_arduino Reason: 1
The arduino due is 3.3v you do not need a buffer. Sorry for the confusion. Also you did not appear to read my FAQ.
Quote

Q: Will the ov7670 accept twi/sccb/i2c (same thing different names) commands without XCLK?
A: No

If you noticed after posting this I fixed a typo in the FAQ on the first post.

Mr_arduino

Very sorry to double post but this is important.
Previously I have told you all that you would need either external spi ram or the fifo version to get data. For the most part that is true.
Today I decided to get out the 0v7670 module (I admit I haven't done anything with it for a while) and write some code that only uses only the ov7670 and the buffer for 5v to 3.3v conversion.
What the code does is it will send the data from the ov7670 to uart and you can receive it using your pc.
https://github.com/ComputerNerd/ov7670-no-ram-arduino-uno
It also generates a 8mhz clock on pin 11 that you get from 5v to 3.3v and plug into the ov7670.
I called it no-ram but I just mean external ram.
This should be a simpler example of the ov7670 using newer register functions.
Tell me what you think. One thing I think people seem to be forgetting is that I am always open to pull requests.

rogerClark

Thanks.

I bought the non-fifo version but couldnt get it to work, so I bought the FIFO one, but again couldnt get it to work as I was supplied a new version that has 2 more pins (without any documentation !!!)

So if I can use the non fifo one, that would be interesting ;-)

rogerClark

Where is the code for the PC?

The code on GitHub just looks like the Arduino code for use with AVRStudio

Go Up