ArduCAM Camera Shield Series SPI Camera Software Application Note Rev 2.
ArduCAM Camera Shield Software Application Note Table of Contents 1 Introduction ............................................................................................................................. 3 2 Software Library Structure .................................................................................................... 3 3 Quick Start Guide ................................................................................................................... 3 4 Example Sketches .............
ArduCAM Camera Shield Software Application Note 5.7.2 Sensor standby................................................................................................................. 9 6 ArduCAM APIs ....................................................................................................................... 9 6.1 void InitCAM (void)............................................................................................................ 9 6.2 void flush_fifo (void) .............................
ArduCAM Camera Shield Software Application Note 1 Introduction This application note describes the detail software operation of ArduCAM camera shield. The latest source code library and examples can be downloaded from the https://github.com/arducam. 2 Software Library Structure The ArdCAM library is designed for Arduino platform,which is composed by two sub-libraries one is ArduCAM and the other is UTFT4ArduCAM_SPI.
ArduCAM Camera Shield Software Application Note " #define ARDUCAM_SHIELD_V2" and the line " #define OV5642_CAM" then comment other lines. After that open the Arduino IDE, the ArduCAM examples can be found from the menu File->Examples->ArduCAM as the Figure 2 shown. Figure 2 Arduino IDE examples Open one of the examples, wiring SPI and I2C interface especially CS pins to ArduCAM shield according to the examples. More information about the wiring can be found from ArduCAM hardware application note.
ArduCAM Camera Shield Software Application Note 4 Example Sketches In the example folder there are six sub directories for different ArduCAM models and the host application. Directories structure lists as Figure 4 shown. The ESP8266 folder is for ArduCAM-ESP8266-UNO board examples. The Mini folder is for ArduCAM-Mini-2MP and ArduCAM-Mini-5MP modules. The Mini_5MP_Plus folder is for ArduCAM-Mini-5MP-Plus (OV5640/OV5642) modules. The RevC folder is for ArduCAM-Shield-RevC or ArduCAM-Shield-RevC+ shields.
ArduCAM Camera Shield Software Application Note application to view the captured images. 4.1.3 ArduCAM_Mini_Capture2SD This example demonstrates how to capture time elapse image and save to TF/SD card. 4.1.4 ArduCAM_Mini_Video2SD This example demonstrates how to capture low resolution and low frame rate MJPEG video to AVI file. 4.1.
ArduCAM Camera Shield Software Application Note Similar to ArduCAM-Mini example, see section 4.1.3. 4.3.5 ArduCAM_Video2SD Similar to ArduCAM-Mini example, see section 4.1.4. 4.4 ArduCAM Shield V2 Examples Similar to ArduCAM Shield Rev.C/Rev.C+ and ArduCAM-Mini-5MP-Plus examples, the examples in this folder is designed for ArduCAM-Shield-V2 with additional performance and features.
ArduCAM Camera Shield Software Application Note is a list of possible hardware platforms: Functions Hardware Platform Single Capture/ Read Burst Read ArduCAM Shield Rev.C √ ArduCAM Shield Rev.
ArduCAM Camera Shield Software Application Note Command Phase Command Phase Data Phase Data Phase SCLK CMD MOSI MISO 0x00 0x00 0x00 0x00 0x00 0x00 0x00 dummy D0 D1 D2 Dn-2 Dn-1 Dn CMD 0x00 0x00 0x00 0x00 0x00 0x00 0x00 Dn+1 Dn+2 Dn+3 Dn+4 Dm-2 Dm-1 Dm CSn First read transaction following read transaction Figure 5 Burst read timing diagram 1 For hardware platforms (ArduCAM-Shield-V2, ArduCAM-Mini-5MP-Plus), you don't need to worry about the first byte.
ArduCAM Camera Shield Software Application Note 6.2 void flush_fifo (void) flash fifo function is used to reset the fifo read pointer to ZERO. 6.3 void start_capture (void) start_capture function is used to issue a capture command. After this command the ArduCAM hardware will wait for a start of a new frame then store the entire frame data to onboard frame buffer. 6.4 void clear_fifo_flag (void) Once a frame image is buffed to onboard memory, the capture completion flag is asserted automatically.
ArduCAM Camera Shield Software Application Note over I2C interface and sensor’s register is accessed with 16bit address and 16bit data. 6.13 byte wrSensorReg8_8(int regID, int regDat) Param1: sensor internal register address Param2: value to be written into the register Return value: error status wrSensorReg8_8 function is used to write a single sensor’s internal register over I2C interface and sensor’s register is accessed with 8bit address and 8bit data. 6.
ArduCAM Camera Shield Software Application Note Param1: sensor internal register address Param2: value read from the register Return value: error status rdSensorReg16_16 function is used to read a single sensor’s internal register value over I2C interface and sensor’s register is accessed with 16bit address and 16bit data. 6.21 void OV2640_set_JPEG_size(uint8_t size) Param1: resolution code OV2640_set_JPEG_size function is used to set the desired resolution with JPEG format for OV2640.
ArduCAM Camera Shield Software Application Note InitCAM function should be called after set_format function. 7 Registers Table Sensor and FIFO timing is controlled with a set of registers which is implemented in the ArduChip. User can send capture commands and read image data with a simple SPI slave interface. The detail description of registers’ bits can be found in the software section in this document.
ArduCAM Camera Shield Software Application Note Bit[1]: Sensor power down IO direction Bit[2]: Sensor power enable IO direction 0 = input, 1 = output 0x06 RW GPIO Write Register Bit[0]: Sensor reset IO value Bit[1]: Sensor power down IO value Bit[2]: Sensor power enable IO value 0x3B RO Reserved 0x3C RO Burst FIFO read operation 0x3D RO Single FIFO read operation 0x3E WO LCD control register with RS=0 0x3F WO LCD control register with RS=1 0x40 RO ArduChip version Bit[7:4]: integer part