In order to help user's to solve problems when using our SPI camera as so as possible, we have summarized typical problems common in customer use
Q1: The first byte exception in the image data caused the image to fail due to the version upgrade.
- After upgrading to Arducam mini 2mp plus and Arducam 5mp plus from 2mp and 5mp, the read data timing changed slightly. As shown in the figure below.
Arducam mini 2mp /5mp timing
Arducam mini 2mp plus /5mp plus timing
- For the old version of 2mp/5mp SPI camera, since the first byte is dummy invalid data, our code should drop the first byte when reading image data and then get the correct data. reference code(Arduino UNO platform)
Arducam mini 2mp /5mp reference code (UNO platform)
- For the 2mp plus and 5mp plus, we don't need to lost the first byte, reference code
Arducam mini 2mp plus/ 5mp plus reference code
Q2: SPI error will occur on some ARM platform
- For the new version camera (Arducam 2mp plus and 5mp plus), we should add reset the cpld operation. reference code
Q3: Due to the large number of user controller platforms, the poor timing control of different platforms leads to errors
Our test code is in Arduino UNO platform, many users in other platform such as ARM error. Therefore, it is necessary to clarify the timing of the I2C and SPI bus timing
I2c operation request. In 5640, for example.
Read 0x300a register (100-400KHZ clock adviced)
- SPI operation request. Mode: mode 0 (CPOL=0; CPHA=0). SCLK advise 4MHZ, for 2mp plus and new 5mp plus, SCLK support 8MHZ.
- Read command: regBit = 1;
- Read command: regBit = 0;
- Some customer feedback data with header FFD8 and tail FFD9, but exist error in the intermediate data, it is likely that the SPI connection line is too long and the clock speed is too fast, leading data error. It is recommanded to use the shortest possible connection line. If the connection line is too long, SPI speed can be reduced appropriately.
SPI read/write timing
Q4: User can't get the right image using the Host_V2
- In order to help user to see the image easily, Arducam has released Host_V2 application. Using it, user should notice some details:
- Ensure the serial port is right;
- Ensure the baud rate is consistent with the setting in the code;
- Sometimes, due to the user's PC USB port's current is small which will cause the image data error. So it is advised to setting the low baud rate and using short connection line.
Arducam Host_V2 application
Q5: SD card error
- In our code, we define the SD CS 9. So, If user doesn't use our adapter board, please ensure the SD CS of your hardware is matches the pin in the code definition.
- Some SD card slot does support high impedance which will cause the SPI bus is busy and our SPI camera does not work at the same time.
Q6: Choosing the error hardware platform which cause can't detect the sensor
Our Arducam library supports many hardware platform. Such as MINI 2mp or MiNI 5mp plus. Before compiling the code, user should ensure you have configured the right platform in the memorysaver.h file.
Shown as the below figure, we use MINI 2mp plus as a example.
Hardware platform configuration
Q7: User can get the capture done flag but can't get the image
- Sometime, users can get the capture done flag, but can't get the image.
Many factors will cause this result. Please notice those cases:
- 1.User should check and ensure the hardware setup is normal and stable. if the hardware is not stable which will cause the image data error and if the image(JPEG format) header "FFD8"or the imge end "FFD9" is lost, it will not get an image .
- 2.We advise user to test camera module using demos we provide firstly. We have provide some demos on Arduino UNO platform and Arducam ESP8266 platform.
- 3.For some platforms, such as STM32, user should notice the SPI speed. At present, our new camera supports less than 8Mhz and our old camera supports less than 4 Mhz.