What hardware/platform were you working on?
Arduino
Instructions you have followed. (link/manual/etc.)
Running sample scripts.
Problems you were having? This block of code:
while(1){
//Check if the camera module type is OV5642
myCAM.rdSensorReg16_8(OV5642_CHIPID_HIGH, &vid);
myCAM.rdSensorReg16_8(OV5642_CHIPID_LOW, &pid);
if ((vid != 0x56) || (pid != 0x42)){
Serial.println(F("ACK CMD Can't find OV5642 module!"));
delay(1000);continue;
}else{
Serial.println(F("ACK CMD OV5642 detected."));break;
}
}
Returns 0x49 for OV5642_CHIPID_HIGH and 0x20 for OV5642_CHIPID_LOW, instead of the expected 0x56 0x42.
The dmesg log from your hardware?
Troubleshooting attempts you’ve made? I’ve reduced the script to the minimum sample. This block runs correctly:
while(1){
//Check if the ArduCAM SPI bus is OK
myCAM.write_reg(ARDUCHIP_TEST1, 0x55);
temp = myCAM.read_reg(ARDUCHIP_TEST1);
if(temp != 0x55)
{
Serial.println(F("ACK CMD SPI interface Error!"));
delay(1000);continue;
}else{
Serial.println(F("ACK CMD SPI interface OK."));break;
}
}
I’ve attached and reattached the camera to the arduino model. Everything appears to be hooked up correctly.
What help do you need?
Any ideas why these values would be returned incorrectly? I have tried everything I can think of and i’m at a loss at this point.
@DICKO@tqasdca
So weird phenomenon. Please grab the detail timing of I2C communication.
As normal, the 100K clock speed is suggested. The chip id register is 0x300a and 0x300b.
Maybe we can find the bug from the I2C timing.
@lvbin thats sounds like a good idea. Please can you tell me where to get the detail timing of I2C to show you. I have the camera connected directly to a WAN 1310.
@DICKO
I have not tested it on WAN 1310 hardware platform yet.
Can you test it on Arduino UNO board firstly? To check if it can work normal on UNO.
In order to get the timing of i2c, you should need oscilloscope.
@lvbin Hello
I tried the camera on the Arduino Uno, and I get different sorts of images, depending on the resolution i think. One picture contains hardly any image and the other images show more of the image if i reduce the resolution.
Here is a link to the arduino code and the python program i used to save the image along with the images themselves. GitHub - Dickoabc123/TempCAM
The different images come from me changing this part of the python code # Send the resolution command ser.write(bytearray([0])) going from 0 to 5.
@DICKO
Hello, Thanks for your detail image for me. What about the uart’s baud rate?
The possibility of data loss due to the serial port speed is very high. Please try to set the baud rate to 115200. Feel free to let me know if you need more help.