I cannot access my ov5645 through IIC2.This is my code:
//IIC iic_conf = XIicPs_LookupConfig(IIC_cam); XIicPs_CfgInitialize(&iic_cam,iic_conf,iic_conf->BaseAddress); XIicPs_SetSClk(&iic_cam, IIC_SCLK_RATE); SendBuffer[0] = 0x4; Status = XIicPs_MasterSendPolled(&iic_cam, SendBuffer, 1, SW_IIC_ADDR); if (Status != XST_SUCCESS) { print("I2C write error\n\r"); return XST_FAILURE; } SendBuffer[0]= 0x31; SendBuffer[1]= 0x00; Status = XIicPs_MasterSendPolled(&iic_cam, SendBuffer, 2, IIC_CAM_ADDR); Status = XIicPs_MasterRecvPolled(&iic_cam, RecvBuffer,1, IIC_CAM_ADDR); printf("ID=%d",RecvBuffer[0]); er, 2, IIC_CAM_ADDR);
Since my device mounts at IIC2,SendBuffer[0] in line 07 is 0x4,and the I access my device accorder to normal IIC operation method.But it failed,and I cannot access it.I have tried the address from 0-0x100,so I think address may be not the problem.Please help ,thank s!