Author Topic: Wiring ov7670 module [ Solved ]  (Read 5023 times)

Offline @lex

  • Full Member
  • ***
  • Posts: 157
  • Karma: +4/-0
    • View Profile
Wiring ov7670 module [ Solved ]
« on: July 26, 2015, 06:33:48 pm »
Hi there,

I would like to work with the OV7670 camera module on my CB2, can somebody please help on how to wire it to CB2?

Camera                  CB2
Pins                       Pins
VCC  ->
GND ->

XCLK ->
PCLK ->
VSYNC ->
HREF ->
SIO_C ->
SIO_O ->
D0 ->
D1 ->
D2 ->
D3 ->
D4 ->
D5 ->
D6 ->
D7 ->

I will work with kernel 3.4.103.
Appreciate if you could help.

@lex
« Last Edit: October 20, 2015, 03:50:41 pm by @lex »

Offline @lex

  • Full Member
  • ***
  • Posts: 157
  • Karma: +4/-0
    • View Profile
Re: Help wiring ov7670 module
« Reply #1 on: October 07, 2015, 10:34:40 am »
Anyone have this working? Only Cubietech?

I would like to have something like this: http://www.arducam.com/arducam-shiled-rev-c-released/#more-565

Reading OV7670 datasheet i get this VCC:
Quote
VDD-A DC supply voltage – Analog – 2.45 2.75 3.0 V
VDD-C DC supply voltage – Digital Core – 1.62 1.8 1.98 V
VDD-IO DC supply voltage – I/O power – 1.7 – 3.0V V

Seems that VCC is pin 3 (SI1-IO-2V8) on Cubieboard, and Cubietech uses pin 4   PH14 (CSI1-RST#/EINT14) but i don't see fit. And arducam also says it is 4 pins SPI that i suppose would be  PCLK,HREF,SIO_C,SIO_O and XCLK,VSYNC (I2C)?

My understanding is very limited but the arducam modules says it uses SPI and I2C, so where this pin 4 (PH14) would be used for?

Ops! my mistake.
I was looking at the wrong FEX, got the correct fex, it uses PH13 now.
« Last Edit: October 07, 2015, 02:10:46 pm by @lex »

Offline @lex

  • Full Member
  • ***
  • Posts: 157
  • Karma: +4/-0
    • View Profile
Re: Help wiring ov7670 module
« Reply #2 on: October 07, 2015, 06:29:46 pm »
I am stuck on this.

I should mention:
- Wired using 2.8v
- Kernel is 3.4.103 (linux-sunxi)
- followed instructions on http://docs.cubieboard.org/tutorials/expansion_boards_dvk/dvk521/documentations/a10/driver_porting_and_configuration
- Fex according
- Same camera module of DVK521

Dmesg:
Quote
[  638.353061] [CSI]Welcome to CSI driver
[  638.354684] [CSI]csi_init
[  638.372778] [CSI]registered sub device,input_num = 0
[  638.377274] axp20_ldo3: Failed to create debugfs directory
[  638.386480] [CSI]V4L2 device registered as video1
[  638.406825] [ccu-err] clk_enable: invalid handle
[  639.389951] HDMI not connected
[  639.392672] Error -5 on register write
[  639.400505] [CSI_ERR]chip found is not an ov7670 chip.
[  639.405521] [CSI_ERR]sensor initial error when csi open!
ubuntu@apps:~$

Should i wire 3.3v to VCC?

Anyone with DVK521 is using this camera module with success?

Offline @lex

  • Full Member
  • ***
  • Posts: 157
  • Karma: +4/-0
    • View Profile
Re: Help wiring ov7670 module
« Reply #3 on: October 08, 2015, 05:19:08 pm »
I can not get further than this.
I cannot detect the camera using i2C at address 0x42, something wrong wiring the pins directly.
SIO_C -> PB18
SIO_O -> PB19 or vice-versa


Offline premoboss

  • Jr. Member
  • **
  • Posts: 51
  • Karma: +2/-0
    • View Profile
Re: Help wiring ov7670 module
« Reply #4 on: October 12, 2015, 03:23:13 am »
I will try to "isolate" the error to know where it is.
Maybe you can interface the module with and arduino/raspberry? if you get success on them, the problem is on cubieboard side so you have to wotk on cubieboard configuration. if also from other master you cannot make module works, it could be a hardware problem on ov7670 module.

Offline @lex

  • Full Member
  • ***
  • Posts: 157
  • Karma: +4/-0
    • View Profile
Re: Help wiring ov7670 module [kind of solved]
« Reply #5 on: October 12, 2015, 11:01:24 am »
Thanks premoboss,

Searching arduino forums i realized SDA and SCL need 4.7k-10k pull-up resistors. I did that and did not worked until i found it needs an external clock, the XCLK pin.

The ov7670 module is detected now and i get some activities, but i can see only colored stripes, some times green stripes.

I think the circuitry i made are too long for csi or are unreliable.

For those who would like to wire the OV7670 here it is:
Quote
Pin <---------> Pin
Camera                  CB1 / CB2
1          +----------  3v3
2         (4.7k)           20 (GND)
3 ------+-----------  6
4 ------+-----------  7
5                            8
6                            9
7                            5
8                            10
9                            18
10                            17
11                            16
12                            15
13                            14
14                            13
15                            12
16                             11

Camera module: ov7670
1 - VCC      2 - GND
3 - SCL      4 - SDA
5 - VSYNC   6 - HREF
7 - PCLK   8 - XCLK
9 - D7      10 - D6
11 - D5      12 - D4
13 - D3      14 - D2
15 - D1      16 - D0

CB2 - CB1pins
1   VCC-5V                   2   PH15 (CSI1-PWR/EINT15)
3   CSI1-IO-2V8                4   PH14 (CSI1-RST#/EINT14)
5   PG0 (CSI1-PCLK/SDC1-CMD)   6   PB18 (TWI1-SCK)
7   PB19 (TWI1-SDA)             8   PG3 (CSI1-VSYNC/SDC1-D1)
9   PG2 (CSI1-HSYNC/SDC1-D0)   10   PG1 (CSI1-MCLK/SDC1-CLK)
11   PG4 (CSI1-D0/SDC1-D2)       12   PG5 (CSI1-D1/SDC1-D3)
13   PG6 (CSI1-D2/UART3-TX)       14   PG7 (CSI1-D3/UART3-RX)
15   PG8 (CSI1-D4/UART3-RTS)       16   PG9 (CSI1-D5/UART3-CTS)
17   PG10 (CSI1-D6/UART4-TX)       18   PG11 (CSI1-D7/UART4-RX)
19   Ground                   20   Ground

Offline premoboss

  • Jr. Member
  • **
  • Posts: 51
  • Karma: +2/-0
    • View Profile
Re: Help wiring ov7670 module [ Solved ]
« Reply #6 on: October 19, 2015, 04:24:39 am »
Happy to be a help for you :-) take us updated with your progress!

Offline @lex

  • Full Member
  • ***
  • Posts: 157
  • Karma: +4/-0
    • View Profile
Wiring ov7670 module [ Solved ]
« Reply #7 on: October 20, 2015, 03:32:38 pm »
OK!

Here is the update of the progress...
Wires must not be to long for the CSI as you can see it gets noise at high transfer, that is it.

The testing of the pix format is here: https://drive.google.com/open?id=0B7A7OPBC-aN7T0wzdm5yOTM0aDg