Jump to content
  • 0

Genesys-2 Pcam 5C I2C communication


linasr

Question

Dear All,

I am having problem communication with Pcam 5C from Genesys-2 board. There is also FMC Pcam Adapter in between. I can set I2C switch, enable A and B channels, attach logic analyzer to channel B and Pcam 5C on channel B. Pcam 5C is inserted properly - I can measurem VCC3V3 on pin 15.

There is Microblaze in FPGA controlling Xilinx AXI IIC (2.0) with following code:

sendData[0]= 0x31;
sendData[1]= 0x00;
SentByteCount = XIic_Send(IIC_BASE_ADDRESS, CAM_ID, sendData, 2, XIIC_STOP);	
ReceivedByteCount = XIic_Recv(IIC_BASE_ADDRESS, CAM_ID, rxBuffer, 1, XIIC_STOP);

I want to read register 0x3100 of the camera on I2C address 0x78, but it fails , there is no ACK (as in attached picture). Same functions work well controlling I2C switch, so I assume there should be ACK problem. Must Pcam 5C send ACK back or it is completely ignored in Serial Camera Control Bus protocol causing I2C core failure?

 

Thanks

Linas

 

pcam_i2c_Fail.png.ba26325ca30beaa3556cb564de29f25d.png

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

Hello, thank you for your fast reply. Attached is my main file, it's made from Xilinx xiic_low_level_eeprom_example.c file. No interrupts, very low level. I think, my address was wrong, it should be 0x3C since Xilinx IP adds bit for read or write operation. But it still does not work. I also attached a picture how my AXI IIC block is being generated.

Next experiment: write I2C bit banging Microblaze version without ACK/NACK ckeck.

AXI_IIC.png

main.c

Link to comment
Share on other sites

9 minutes ago, elodg said:

Make sure CAM_PWUP is driven high as per https://reference.digilentinc.com/reference/add-ons/pcam-5c/reference-manual#power-up_and_reset.

Also, the OV5640 address is 0x78/0x79 as listed in the Omnivision datasheet. This includes the write/read bit. Therefore, the address you are looking for in binary is 0b0111100. You are not sending this address.

CAM_PWUP is 3.3V, just checked with multimeter. I think, if it would be low I couldn't communicate with I2C switch, since CAM_PWUP is connected to it's reset pin.

And yes, you are right about address, but still does not work after fixing that.

Link to comment
Share on other sites

1 hour ago, BogdanVanca said:

Do you have PULLUP TRUE on both I2C lines in your xdc file? 

Not yet, implementing it right now.

 

Edit: I added PULLUPs on both I2C lines, but it also does not work. I suspect Xilinx IP waiting for ACK/NACK and failing to get it. And I am very curious if the camera uses I2C with ACK/NACK, or normal Serial Camera Control Bus ignoring 9th byte.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...