|
| 1 | +| Supported Targets | ESP32-P4 | ESP32-S3 | |
| 2 | +| ----------------- | -------- | -------- | |
| 3 | + |
| 4 | + |
| 5 | +# DVP Camera display via LCD example |
| 6 | + |
| 7 | +## Overview |
| 8 | + |
| 9 | +This example demonstrates how to use the esp_driver_cam component to capture DVP camera sensor signals and display it via LCD interface. This example will auto-detect camera sensors via [ESP camera sensor driver](https://components.espressif.com/components/espressif/esp_cam_sensor) and capture camera sensor signals via DVP interface and display it via LCD interface. |
| 10 | + |
| 11 | +## Usage |
| 12 | + |
| 13 | +The subsections below give only absolutely necessary information. For full steps to configure ESP-IDF and use it to build and run projects, see [ESP-IDF Getting Started](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/index.html#get-started). |
| 14 | + |
| 15 | + |
| 16 | +### Hardware Required |
| 17 | + |
| 18 | +- ESP32S3 devkit with OV2640 camera sensor and ST7789 LCD screen |
| 19 | +- or an ESP32S3-EYE dev-kit |
| 20 | + |
| 21 | +You can also connect camera sensors and LCD screens from other vendors to the ESP chip, you can find corresponding camera or LCD drivers from [ESP Component Registry](https://components.espressif.com), or design your own customized drivers. |
| 22 | + |
| 23 | + |
| 24 | + GND GND |
| 25 | + ┌────────────────────────────────────────────────┐ ┌─────────────────────────────────────────────────────────┐ |
| 26 | + │ │ │ │ |
| 27 | + │ │ │ │ |
| 28 | + │ │ │ │ |
| 29 | + │ │ │ │ |
| 30 | + │ │ │ │ |
| 31 | + │ │ │ │ |
| 32 | + │ │ │ │ |
| 33 | + │ │ │ │ |
| 34 | + │ ┌───────────────┴─────────────┴──────────────────┐ │ |
| 35 | + │ │ │ ┌──────────┴───────────┐ |
| 36 | + │ │ │ LCD MOSI │ │ |
| 37 | + │ │ ├───────────────────────────┤ │ |
| 38 | + ┌───────────┴─────────┐ │ │ │ │ |
| 39 | + │ │ │ │ LCD CLK │ │ |
| 40 | + │ │ │ ├───────────────────────────┤ │ |
| 41 | + │ │ XCLK │ ESP_CHIP │ │ │ |
| 42 | + │ DVP Camera ├──────────────────────┤ │ LCD CS │ LCD Screen │ |
| 43 | + │ │ │ ├───────────────────────────┤ │ |
| 44 | + │ │ D0~7 │ │ │ │ |
| 45 | + │ ├──────────────────────┤ │ LCD DC │ │ |
| 46 | + │ │ │ ├───────────────────────────┤ │ |
| 47 | + │ │ PCLK │ │ │ │ |
| 48 | + │ ├──────────────────────┤ │ LCD BACKLIGHT │ │ |
| 49 | + │ │ │ ├───────────────────────────┤ │ |
| 50 | + │ │ VSYNC │ │ │ │ |
| 51 | + │ ├──────────────────────┤ │ │ │ |
| 52 | + │ │ │ │ │ │ |
| 53 | + │ │ DE (HREF) │ │ │ │ |
| 54 | + │ ├──────────────────────┤ │ └──────────────────────┘ |
| 55 | + │ │ │ │ |
| 56 | + └───────┬──┬──────────┘ │ │ |
| 57 | + │ │ I2C SCL │ │ |
| 58 | + │ └─────────────────────────────────┤ │ |
| 59 | + │ I2C SDA │ │ |
| 60 | + └────────────────────────────────────┤ │ |
| 61 | + └────────────────────────────────────────────────┘ |
| 62 | + |
| 63 | + |
| 64 | +### Set Chip Target |
| 65 | + |
| 66 | +First of all, your target must be supported by both: |
| 67 | + |
| 68 | +- **By your ESP-IDF version**: For the full list of supported targets, run: |
| 69 | + ``` |
| 70 | + idf.py --list-targets |
| 71 | + ``` |
| 72 | +- **By this example**: For the full list of supported targets, refer to the supported targets table at the top of this README. |
| 73 | + |
| 74 | +After you make sure that your target is supported, go to your example project directory and [set the chip target](https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/tools/idf-py.html#select-the-target-chip-set-target): |
| 75 | + |
| 76 | +``` |
| 77 | +idf.py set-target <target> |
| 78 | +``` |
| 79 | + |
| 80 | +For example, to set esp32-S3 as the chip target, run: |
| 81 | + |
| 82 | +``` |
| 83 | +idf.py set-target esp32s3 |
| 84 | +``` |
| 85 | + |
| 86 | + |
| 87 | +### Configure the Project |
| 88 | + |
| 89 | +For information about Kconfig options, see [Project Configuration](https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/kconfig.html) > _Name of relevant section(s)_. |
| 90 | + |
| 91 | +To conveniently check or modify Kconfig options for this example in a project configuration menu, run: |
| 92 | + |
| 93 | +``` |
| 94 | +idf.py menuconfig |
| 95 | +``` |
| 96 | + |
| 97 | +``` |
| 98 | +Set CONFIG_CAMERA_OV2640 to y |
| 99 | +``` |
| 100 | + |
| 101 | +Available options for the camera sensor output horizontal/vertical resolution can be seen in ``menuconfig`` > ``Example Configuration``. |
| 102 | + |
| 103 | + |
| 104 | +### Build and Flash |
| 105 | + |
| 106 | +Execute the following command to build the project, flash it to your development board, and run the monitor tool to view the serial output: |
| 107 | + |
| 108 | +``` |
| 109 | +idf.py build flash monitor |
| 110 | +``` |
| 111 | + |
| 112 | +This command can be reduced to `idf.py flash monitor`. |
| 113 | + |
| 114 | +If the above command fails, check the log on the serial monitor which usually provides information on the possible cause of the issue. |
| 115 | + |
| 116 | +To exit the serial monitor, use `Ctrl` + `]`. |
| 117 | + |
| 118 | + |
| 119 | +## Example Output |
| 120 | + |
| 121 | +If you see the following console output, your example should be running correctly: |
| 122 | + |
| 123 | +``` |
| 124 | +I (1481) main_task: Calling app_main() |
| 125 | +I (278) dvp_spi_lcd: Init SPI bus |
| 126 | +I (278) dvp_spi_lcd: New panel IO SPI |
| 127 | +I (278) dvp_spi_lcd: New ST7789 panel |
| 128 | +I (278) dvp_spi_lcd: Reset and init panel |
| 129 | +I (408) dvp_spi_lcd: Turn on display |
| 130 | +I (408) dvp_spi_lcd: Screen lit up now! |
| 131 | +
|
| 132 | +``` |
| 133 | + |
| 134 | + |
| 135 | +## Reference |
| 136 | + |
| 137 | +- Link to the ESP-IDF feature's API reference, for example [ESP-IDF: Camera Controller Driver](https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/peripherals/camera_driver.html) |
| 138 | +- [ESP-IDF Getting Started](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/index.html#get-started) |
| 139 | +- [Project Configuration](https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/kconfig.html) (Kconfig Options) |
0 commit comments