-
Notifications
You must be signed in to change notification settings - Fork 243
LEDC: div param err and GPIO interrupt type error for GPIO 26 and 27 #2
Comments
I've seen the second issue — it's due to a pullup on the camera reset line. It is stronger than the internal pull-down on GPIO2 of the ESP32, so the chip can not go into programming mode. The fix for this is to connect GPIO2 to GND while flashing using a jumper wire (you may need to solder the second pin header for that). Regarding LEDC, I haven't seen this issue. Will try with latest master. It's probably not important yet at this point, but this camera uses D9 - D2 as its 8 data lines in 8-bit output mode. Pins D1 and D0 are only used in 10-bit mode. So you can ignore D1/D0 and plug the camera directly into the board. |
Thank you for the tip regarding wiring. |
Regarding LEDC error, I understand there is some issue with setting up XCLK signal on GPIO21,
I can troubleshoot it using information provided in ESP32 Technical Reference Manual and LEDC API. I assume this signal should be @ 10MHz - https://github.com/igrr/esp32-cam-demo/blob/master/main/app_main.c#L54 This looks in line with OV7725 data sheet specifying CLK from 10 up to max 48 MHz. What do you think about it? |
Still need to resolve issue with SSCB communication:
@igrr any leads? |
gpio_config_t::intr_type wasn’t initialized and contained garbage data
I have pushed the fix for interrupt type error in 43752e5. /*Fail ,because the div_num overflow or too small*/
if(div_param <= 256 || div_param > LEDC_DIV_NUM_HSTIMER0_V) { //REF TICK This should actually be |
I did quick test and log looks promising.
|
Both issues are resolved in master. |
ledc: fix reported error when div_param == 256 Whenever bit_num and freq_hz are such that div_param == 256, the code would flag that as an error. In fact, value 256 of div_param was a valid one (HW requires that div_param >= 1.0, when interpreted as a Q10.8 fixed point value). Changed the if statements a bit to make the logic clearer, and added more descriptive error messages. Also added missing error for the unimplemented case of low speed mode. Reported in igrr/esp32-cam-demo#2 See merge request !247
Can I config LEDC timer with freq=16MHz to 27MHz, as my mt9v034 only support xclk in this range. |
Hi @liubenyuan, Yes, you can configure LEDC timer with freq=16MHz. Krzysztof |
@krzychb Thanks! Now my mt9v034 works! I am waiting for your wifi-camera demo. BTW, I extend |
I would like to somehow get closer to the upstream OpenMV code, if possible. With the remote goal of running the whole OpenMV on the ESP32. So you are welcome to make a PR which adds some notes to Readme.md that for mt9v034 support, 16-bit SCCB ops are required, and here's a link to the repository which implements these. |
Well, how to make the |
And I think these codes in s_sensor.slv_addr = addr;
s_sensor.id.PID = SCCB_Read(s_sensor.slv_addr, REG_PID);
s_sensor.id.VER = SCCB_Read(s_sensor.slv_addr, REG_VER);
s_sensor.id.MIDL = SCCB_Read(s_sensor.slv_addr, REG_MIDL);
s_sensor.id.MIDH = SCCB_Read(s_sensor.slv_addr, REG_MIDH);
ESP_LOGD(TAG, "Camera PID=0x%02x VER=0x%02x MIDL=0x%02x MIDH=0x%02x\n",
s_sensor.id.PID, s_sensor.id.VER, s_sensor.id.MIDH, s_sensor.id.MIDL);
/* debug mt9v034 */
uint16_t chip_id = mt9v034_chip_id();
printf("camera ID = %x\n", chip_id);
ov7725_init(&s_sensor);
ESP_LOGD(TAG, "Doing SW reset of sensor");
sensor_reset();
ESP_LOGD(TAG, "Setting frame size");
framesize_t framesize = FRAMESIZE_QVGA;
s_sensor.set_framesize(&s_sensor, framesize); So in sensor |
Hi @igrr,
I have connected the camera to ESP32_DevKitJ_V1 and flashed
esp32-cam-demo
application.Compilation was done using the latest esp-idf release.
I have observed two issues:
This error shows up no matter if I power up the board and camera using USB power supply or external power supply.
The text was updated successfully, but these errors were encountered: