Can't find OV2640 module

Dear community,

I'm trying to get an Arducam OV2640 2MP to work with my Arduino MEGA which is connected to a SD-datalogging shield. I connected both the SD-shield and the Arducam to the MISO, MOSI and SCK pins of the Arduino Mega, and the SDA and SCL pins. For the ChipSelect pins, I defined a separate pin for each slave.

I am having the error message " Can't find OV2640 module !" which comes from the following part of the example code:

myCAM.wrSensorReg8_8(0xff, 0x01);  
     myCAM.rdSensorReg8_8(OV2640_CHIPID_HIGH, &vid);
     myCAM.rdSensorReg8_8(OV2640_CHIPID_LOW, &pid);
     if ((vid != 0x26) || (pid != 0x42)) 
      Serial.println("Can't find OV2640 module!");
     else
      Serial.println("OV2640 detected.");

From this thread, I realized that the OV2640_CHIPID_LOW register (0x0B) is 0x41 not 0x42, so I changed it in the code above. Since the problem persisted, I printed with vid and pid values on the serial, and realized that I have vid = 33 and pid = 78.

I have to admit that I don't really understand what this is about, but I do think that this is causing my issue. Should I just change the vid and pid values in the if statement? I'm sure it is more complex than that...

I very much value any help, thank you in advance!

Dear all,

I just solved part of the problem. By converting vid=33 and pid=78 from ASCII to HEX, I obtained vid=0x21 and pid=0x4E. I this changed the relevant line in the code with the following line, and it now runs:

if ( ( vid == 0x21 ) && ( pid == 0x4E ) )

HOWEVER, now the sketch gets stuck at the following line:

while(!myCAM.get_bit(ARDUCHIP_TRIG , CAP_DONE_MASK));

Does someaon know what this means?

Best