aminpix
Advanced Member level 4
I am trying to communicate to a Camera module (OV2640). I read many people used I2C instead of SCCB and it works.
I want both read and write into the Camera, however I fail in the first step.
I uses PS of Zynq and my code is:
What I see in the scope is incomplete data sent to the buss:
Any suggestion?
I want both read and write into the Camera, however I fail in the first step.
I uses PS of Zynq and my code is:
Code:
int main()
{
init_platform();
u8 wdat[2] = {0xFF,0x00};
XIic *Iic;
XIic_Config *ConfigPtr;
ConfigPtr = XIic_LookupConfig(XPAR_IIC_0_DEVICE_ID);
XIic_CfgInitialize(Iic, ConfigPtr, ConfigPtr->BaseAddress);
u32 CntlReg = XIic_ReadReg(Iic->BaseAddress, XIIC_CR_REG_OFFSET);
CntlReg &= ~XIIC_CR_NO_ACK_MASK;
XIic_WriteReg(Iic->BaseAddress, XIIC_CR_REG_OFFSET, CntlReg);
XIic_Start(Iic);
XIic_SetAddress(Iic, XII_ADDR_TO_SEND_TYPE, 0x61);
XIic_MasterSend(Iic, wdat, 1);
cleanup_platform();
return 0;
}
What I see in the scope is incomplete data sent to the buss:
Any suggestion?