-
GD32W515 DCI ov2640摄像头连续捕获模式采集帧率低的问题
OV2640在800*600分辨率,JPG格式输出,日志信息如下:[12:00:37.591]收←◆[DEBUG]ov2640framecount:32768[12:00:38.653]收←◆[DEBUG]ov2640framecount:33792[12:00:39.716]收←◆[DEBUG]ov2640framecount:34816[12:00:40.780]收←◆[DEBUG]ov2640framecount:34816[12:00:41.842]收←◆[DEBUG]ov2640framecount:34816[12:00:42.907]收←◆[DEBUG]ov2640framecount:34816[12:00:43.971]收←◆[DEBUG]ov2640framecount:34816[12:00:45.035]收←◆[DEBUG]ov2640framecount:34816即,将近1S才采集一帧。用逻辑分析仪测试VSYNC,周期大概在37ms,也就是说,一秒有将近30帧输出(可先排除OV2640寄存器相关配置问题,通过串口将jpeg输出到上位机,查看图片也没有问题)。只要DCI有中断回调,则打印日志,日志速率在500K左右(不用考虑日志速率过低导致漏帧问题)。DCI的关键配置代码片段如下(参考官方ov2640例程)://dci相关I/O口配置为166MHZ速率//dci配置dci_parameter_structdci_struct;dci_struct.capture_mode=DCI_CAPTURE_MODE_CONTINUOUS;//DCI_CAPTURE_MODE_SNAPSHOT;dci_struct.clock_polarity=DCI_CK_POLARITY_RISING;dci_struct.hsync_polarity=DCI_HSYNC_POLARITY_LOW;dci_struct.vsync_polarity=DCI_VSYNC_POLARITY_LOW;dci_struct.frame_rate=DCI_FRAME_RATE_ALL;//dma配置dma_multi_data_parameter_structdma_multi_struct;dma_multi_struct.periph_addr=(uint32_t)DCI_DATA_ADDRESS;dma_multi_struct.memory0_addr=(uint32_t)(capture[0].image);dma_multi_struct.direction=DMA_PERIPH_TO_MEMORY;dma_multi_struct.number=(FRAME_BUFFER_SIZE)>>2;dma_multi_struct.periph_inc=DMA_PERIPH_INCREASE_DISABLE;dma_multi_struct.memory_inc=DMA_MEMORY_INCREASE_ENABLE;dma_multi_struct.periph_width=DMA_PERIPH_WIDTH_32BIT;dma_multi_struct.memory_width=DMA_MEMORY_WIDTH_32BIT;dma_multi_struct.circular
2024-01-04 1