2013年10月10日星期四

STM32F103 driver OV7670, can not initialize

SIOC-PA6 SIOD-PA7
XCLK-PA8 VSYNC-PB15
HREF-PC6 PCLK-PC7 reset instructions according to the hardware module , pick up about 5K resistor to 3.3V, PWDN directly connected to the GND.
reference to other procedures , initialization almost did not move, but can not succeed, read 7670ID high byte is 00.
I use crystal is 8M, OV7670 without crystal , without the FIFO. PLL clock XCLK choice is divided by 2 , 36MHZ. In the RCC , PLL clock is 72M.
SCCB bus reset it , according to the program simulation perspective, it should be reset successful. SIOC, SIOD level according to the procedures have changed. 3.27 and 3.03V.
u8 rdOV7660Reg (u8 regID, u8 * regDat)
{
/ / write operations through address setting register
startSCCB ();
if (0 == SCCBwriteByte (0x42))
{
stopSCCB ();
return (0);
}
DelaySCCB (1000);
if (0 == SCCBwriteByte (regID))
{
stopSCCB ();
return (0);
}
stopSCCB ();

DelaySCCB (1000);

/ / set the register address is read
startSCCB ();
if (0 == SCCBwriteByte (0x43))
{
stopSCCB ();
return (0);
}
DelaySCCB (1000);
* regDat = SCCBreadByte ();
noAck ();
stopSCCB ();
return (1);
}
Read ID this paragraph , SCCBreadByte () function , the
SCCB_SID_IN; / * set SDA as input * /
DelaySCCB (1500);
for (j = 8; j> 0; j -) / / 8 cycles receiving data
{
DelaySCCB (1500);
SCCB_SIC_H ();
DelaySCCB (1500);
read = read << 1;
if (SCCB_SID_STATE)
{
read = read +1;
}
SCCB_SIC_L ();
DelaySCCB (1500);
}
/ * reconfigure the output * /
SCCB_SID_OUT ;/ * Set SDA as output * /
return (read);
header file # define SCCB_SID_STATE GPIOA-> IDR & 0x80, simulation time to look , IDR07 that is PA7 (SIOD) -bit input port has never changed, resulting SCCB_SID_STATE is always 0 . PA7 control with a small lamp , no problem. Causing the problem can not be solved , another reason is that I read a long time SCCB bus timing , did not understand . Have done , to understand , and pointing . Thank you.
------ Solution ---------------------------------------- ----

has been pulled up . Is a resistance of about 4.5K . Read registers can not reproduce .  
I2C
That should be a problem ! Check the circuit !
------ For reference only -------------------------------------- -
try to read registers Can read out ? I2C two wire pull-up yet ?
------ For reference only -------------------------------------- -
sccb protocols and standards differ i2c protocol
http://www.cnblogs.com/crazybingo/archive/2012/05/06/2485672.html
------ For reference only ----------- ----------------------------

has been pulled up . Is a resistance of about 4.5K . Read registers can not reproduce .
------ For reference only -------------------------------------- -

I went to see.
------ For reference only -------------------------------------- -
I have the same problem , the register value could not be read , an external pull-up resistors have tried, or not , how do you solve ? ? ?
------ For reference only -------------------------------------- -
buddy , problem solving what, I also can not reproduce . . . .
------ For reference only -------------------------------------- -
problem solved the same problem does not fly there to ride to the argument

------ For reference only ---------------------------------- -----
SCCB communications xclk side must also add a non- slow clock (8MHZ can communicate properly , arguably , the higher you can ) !

没有评论:

发表评论