Why SPI Camera?
STM32 is a family of 32-bit microcontroller integrated circuits by STMicroelectronics. The STM32 chips are grouped into related series that are based around the same 32-bit ARM processor core, such as the Cortex-M33F, Cortex-M7F, Cortex-M4F, Cortex-M3, Cortex-M0+, or Cortex-M0. Learn more.
Some STM32 series like STM32F4 and later versions of MCUs have a DCMI peripheral that can be used to interface the STM32 chip directly to camera sensors. The DCMI is flexible enough to support a variety of sensors that output data using a parallel data interface (RGB). However, some STM32 like Previous versions of STM32F4 do not have DCMI, Arducam SPI Camera can be used on any platform as long as they have SPI and I2C interfaces(such as STM32F1, STM32L1). Most importantly, Arducam mini SPI Camera also provides the function of adding multiple cameras to a single microcontroller (even those STM32 series with camera interface).
We show two Arducam mini SPI Cameras, 2MP-OV2640 and 5MP-OV5642. They not only small in size but also have high definition, reduce the complexity of the camera control interface, easy to use hardware interface, and open-source code.
Camera Modules for STM32 MCUs , Raspberry Pi Pico
Arducam Mini 2MP Plus – OV2640 SPI Camera Module for Arduino UNO Mega2560 Board & Raspberry Pi Pico
Buy Now- Can be used in MCU, Raspberry Pi, ARM, DSP, FPGA platforms
- 2 megapixels image sensor OV2640
- M12 mount or CS mount lens holder with changeable lens options
- IR sensitive with proper lens combination
- <span ...
By the way, you maybe have interest in Arduino Camera: SPI Camera Module from Arducam.
This document demonstrates how to use the SPI camera on the STM32 platform.
1.Hardware


Camera connect STM32f103 platform
Camera | CS | MOSI | MISO | SCK | GND | VCC | SDA | SCL |
STM32 | B1 | B15 | B14 | B13 | GND | 3.3 | B11 | B10 |
Camera connect STM32L152 platform
Camera | CS | MOSI | MISO | SCK | GND | VCC | SDA | SCL |
STM32 | PB12 | PB15 | PB14 | PB13 | GND | 3.3 | PB11 | PB10 |
Serial port module connection
Serial port module | GND | TXD | RXD |
STM32 | GND | PA10 | PA9 |
2.Software
2.1 Download the firmware source code package
The Download link:
https://github.com/ArduCAM/STM32.git

2.2 Upzip the firmware source code package

2.3 Enter the folder and Compile program
Note
Please enter the corresponding folder with your STM32 chip model. If you use STM32L152, please use Keil to open the SpiCamer.uvprojx file as the following demo. If you use STM32F103, please use Keil to open the Project.uvprojx file. You can refer to the demo for the next steps.

2.4 Capture
Open host_app\ArduCAM_Host_V2.0_Windows\ArduCAM_Host_V2.exe, then follow the next steps.
- View your device manager and configure the corresponding port number.
- Set the baud rate to 921600.
- If your camera is 2MP OV2640, select 2640; if your camera is 5MP OV5642, select 5642.
- Set the resolution you want to render.
- Set the single or continue mode to capture.
You can see from the demo, the single-mode can get a single shoot, the continue mode can make video streaming.

