I’m using the Arducam-Mini-5MP-Plus(OV5642) with an Adafruit Feather M0 board. With this I’m facing the “SPI interface error”.
I use your example sketch for the normal 5MP-plus functions. The SPI is wired to the standard HW-SPI bus of the board. CS pin is adjusted to pin 12.
When I connect the OV5642 to an Aduino Micro (ATMega32U4) everything works well, no issues. I’m quite sure that this is no CS-pin issue on the Feather-board, since I always adjust the CS pin declaration accordingly. On the Feather-board for instance, I’m using digital pin 12 for CS.
I went through the few posts that exist and found maybe these possible reasons for the error:
Feather M0 (SAMD21) uses 3.3V logic, the Cam is connected to a 5V supply and hence might require 5V level on the SPI/CS pins?
Feather M0 (SAMD21) runs on 48MHz, hence the SPI clockrate might be too high for the cam (8MHz)?
The cam module requires 300mA and is fed in my setup by 5V through the USB output voltage pin of the Feather-board (supporting up to 500mA). In post
https://www.arducam.com/forums/topic/frequently-asked-questions-faq-about-arducam-spi-cameras/#post-14429 you stated that another board (the ESP8266 Nano V2) isn’t capable of delivering the requested current strength and hence the SPI communication fails.
So for point 1: Do I need to add a level shifter on the SPI bus? The Feather-board is not “officially” 5V-proof, but I saw that it withstands the 5V input levels. On the way out to Arducam, I would assume that the 3.3V level should be sufficient to still drive the SPI on camera side. So I wonder wheather I really would need a shifter at the end.
For point 2: How can I check which max level for the SPI clockrate is used? I’m not able to find this in the code. Can you give me a hint wheather this could be an issue and where I can check this?
For point 3: In the spec for the cam you mention that the cam can operate at 3.3V - 5V. Should I better connect the cam power supply to 3.3V instead of 5V? Does this cause even more current draw?
Thanks for your help.