4 years, 3 months ago.

OV7670 with STM32 nucleo

I am trying to connect a OV7670 camera to a STM32 nucleo, following the instructions here in mbed from Fuyuno Sakura. However, I got a distorted image (unfortunatelly I can not upload the figure in mbed, the tool is not working) The image is just a set of points of all colors. I am wondering perhaps it is a matter of setting the clock of the camera as a fraction of the one of the microcontroller and since the STM32 has a different clock to the micro used by Fuyuno, perhaps that is the reason

Any recommendation or advice will be greatly appreciated

Which version of the OV7670 camera do you have ? Is it with or without the AL422 FIFO (buffer) ? Do you have a schematic of your OV7670 which you can post or post the URL for the schematic ? Which STM32 nucleo board are you using ? What is your wiring diagram and voltage to your OV7670 module ? Are you sending the captured camera data to a local LCD ? If yes, which one ? Is the LCD working correctly ? The OV7670 requires the use of I2C interface so will need local pull-up resistors on SDA & SCL lines. The quick solution will be to mimic the setup by Fuyuno Sakura-san using the LPC1768. Then debug from there but the timing and register priming of the OV7670 are critical to the proper operation. Have you verified that the I2C interface is working properly when the OV7670 is configured ? Start with dumping some simple known register data from the OV7670 to validate the I2C interface is not too fast, etc.

posted by Sanjiv Bhatia 09 Apr 2017

I have the OV7670 with FIFO. I am using the STM32F303 nucleo. It apparently runs at 72MHz. I am sending the data to a TFT LCD. A WaveShare http://www.waveshare.com/product/modules/oleds-lcds/graphic-lcd/3.2inch-320x240-touch-lcd-c.htm. I have build libraries that work correctly and tried for previous projects. As for the pull up resistors I have tried the SCL line with and without and both works the same. I also read the datasheet of the camera and apparently the order of the 444 RGB given there and the one used by Fuyuno sakura is inverted.I don't know why. I have mimic the setup of Fuyuno. As for the diagrams, something is happening in this site that I can't upload figures so I'll search for an alternative. You wrote that the timing and the register priming of the OV7670 is critical and I think so too , so what frequency should I set the camera with? The nucleo is running at 72MHz.

posted by Cristian Fuentes 10 Apr 2017

I have found that I was setting the I2c to 100000 when Sakura sets it to 50000.(I thought I2C standard mode is 100Kbps, how can Sakura set that to 50000?) So I changed it to 50000, and now the program does not run at all. Apparently setting the I2C to that frequency halts everything. I am now more confused than before...

posted by Cristian Fuentes 10 Apr 2017

Following my tests, I found that setting the I2C to standard does not work. Now, setting it to fast mode (400kbps) actually makes it work somehow! Now I am getting the image but with very distorted colors. I can see my face, letters that I write etc. I also think that i will have to rewrite the LCD libraries because the transmission is somehow slow.

posted by Cristian Fuentes 10 Apr 2017
Be the first to answer this question.