Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

implementing SCCB with AXI I2C

aminpix

Advanced Member level 4
Joined
Sep 30, 2008
Messages
108
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Activity points
2,342
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:



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?
 

Attachments

  • qa.jpg
    qa.jpg
    115.8 KB · Views: 66
Presumed you are showing the first byte written by the controller, the most obvious point is missing ACK. No meaningful I2C communication can be expected after that. Either wrong address, wiring error or device not ready for communication.
 
Presumed you are showing the first byte written by the controller, the most obvious point is missing ACK. No meaningful I2C communication can be expected after that. Either wrong address, wiring error or device not ready for communication.
How can I force the PS to ignore the ACK?
I thought this part of code make the PS to disregard ACK:

Code:
    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);
 

LaTeX Commands Quick-Menu:

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top