-
Notifications
You must be signed in to change notification settings - Fork 621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding new sensor #440
Comments
Sure. Could you put the code in your github repo? And we can work together to add support for this sensor. |
@WangYuxin-esp I'm just working with the "take_picture.c" example. :) |
@PCossu93 Do you have a list of registers to initialize the sensor? I can add an example, but I don't have this sensor, you need to debug it yourself. |
@WangYuxin-esp the link where to find the datasheet and application notes with the registers. |
It seems that it is not easy to add this driver, because if we do not have this sensor for testing, we cannot know the reliability of the driver. |
@WangYuxin-esp I have the ov7740 sensor and the ESP32-CAM board and I can run tests on the driver and post them here :) |
Has the circuit package of the sensor been adjusted according to the circuit package of the official ESP32-CAM board? |
@WangYuxin-esp yes, I run a test with "take_picture.c" example and ov7740 and this is the result |
@WangYuxin-esp sorry cant load the foto, here's the results Rebooting... rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) entry 0x40080694 I (262) cpu_start: App cpu up. Core 0 register dump: A2 : 0x3f4073a4 A3 : 0x00000000 A4 : 0x00000001 A5 : 0x00000001 0x400884b9: strlen at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/xtensa-esp32-elf/src/newlib/newlib/libc/machine/xtensa/strlen.S:96 Backtrace:0x400d9380:0x3ffb6fb00x400f83eb:0x3ffb6fd0 0x4008d29d:0x3ffb6ff0 0x400f83eb: main_task at C:/Espressif/frameworks/esp-idf-v4.4.2/components/freertos/port/port_common.c:141 (discriminator 2) 0x4008d29d: vPortTaskWrapper at C:/Espressif/frameworks/esp-idf-v4.4.2/components/freertos/port/xtensa/port.c:131 |
The current example shows that |
@WangYuxin-esp here the first tests result entry 0x400806b4 I (0) cpu_start: App cpu up. I (876) gpio: GPIO[32]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 seems the ov7740 pid in sensor.h not match with the real pid... changing the pid with the real one (0x7742) in sensor.h returns this error: rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) entry 0x400806b4 I (0) cpu_start: App cpu up. I (876) gpio: GPIO[32]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 can you fix that? |
The log |
@PCossu93 , Have you reconfirmed the model of this sensor? |
@WangYuxin-esp hi, I apologize for the delay ... the pid written in camera registers is 7742 |
From the technical manual of the sensor, its ID num must be 0x7740. The associated registers are read-only: |
This issue appears to be stale. Please close it if its no longer valid. |
@WangYuxin-esp Hi my friend, after some debugging, i finally managed to write and read camera registers. I noticed that my ov7740 is a modified version with D0 and D1 not connected to the pins of the connector (I attach the photo and the datasheet of the ov7740). I want to use the camera in QVGA and 8-bit RAW but I can't understand which registers I have to modify to make it work in this mode. I hope for your help. |
This is really good news. If you are already able to read and write the register of the sensor normally. It is recommended that you refer to the example here and try to batch write the configuration configuration to the register of the sensor. The reset() will be automatically called by the system. The process of initializing the sensor is as follows:
|
here the results: entry 0x400806b4 I (0) cpu_start: App cpu up. I (863) gpio: GPIO[32]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 |
I think there is something wrong with the values for the registers. Some values are for registers that the datasheet indicates as OTP region or read only. Could you help me verify that this is the problem? |
I think that you have some sort of custom OV7742 image sensor. Correct PID should be 0x7740, not 0x7742 as in your case. I could not find any info on such sensor online though, and all drivers I found for OV7740 do use the 0x7740 PID |
Here my esp-idf project code: #include <esp_log.h> #include "freertos/FreeRTOS.h" // LCD Library // support IDF 5.x #include "esp_camera.h" // ESP32Cam (AiThinker) PIN Map #define CAM_PIN_PWDN 32 static const char *TAG = "example:take_picture"; static camera_config_t camera_config = {
}; // 1.28inch round lcd display GC9A01 extern "C" {
} |
and here the register i used for initialization:
|
your image is probably fine, but you need to convert YUYV to RGB565. this function can turn your buffer into RGB888, which you can then turn into RGB565 easily and display it. |
@me-no-dev I've never used this function but I think you've found the solution to my problem. How can i use it in my code? |
I am trying to use the ov7740 sensor but after a few attempts the camera does not initialize. Could you help me how to add support for ov7740?
The text was updated successfully, but these errors were encountered: