赤菟307板子,杜邦线接ov2640显示到LCD屏幕上花屏,RB_DVP_IF_FRM_DONE中断检测不到

刚刚调通了LCD屏幕,

 LCD ID:9341 width:240 height:320 

想在屏幕上显示ov2640摄像头的数据,调试了一天多,线插了N次。估计是杜邦线的问题,导致检测不到。这个摄像头我已经在STM32F411上采集通过,也在STM32F407上采集通过了,都是杜邦线连接的。个人觉得用CH32V307的DVP应该也没啥问题,就过来一试,结果如图所示:

1654578410182882.jpg

1654578410558918.jpg

串口打印输出:

[13:27:34.607]收←◆SystemClk:72000000


[13:27:34.658]收←◆ LCD ID:9341


[13:27:34.790]收←◆width:240 height:320 


[13:27:35.453]收←◆Camera Suc


[13:27:37.530]收←◆RGB565_MODE


[13:27:37.619]收←◆DVP START FRAM,the frame_cnt is 0


[13:27:37.753]收←◆DVP FRAM DONE,the href_cnt is 160

DVP STOP FRAM


[13:27:37.885]收←◆DVP START FRAM,the frame_cnt is 1


[13:27:38.018]收←◆DVP STOP FRAM


[13:27:38.153]收←◆DVP START FRAM,the frame_cnt is 2


[13:27:38.285]收←◆DVP STOP FRAM


[13:27:38.419]收←◆DVP START FRAM,the frame_cnt is 3


[13:27:38.552]收←◆DVP STOP FRAM


[13:27:38.686]收←◆DVP START FRAM,the frame_cnt is 4


[13:27:38.818]收←◆DVP STOP FRAM


[13:27:38.952]收←◆DVP START FRAM,the frame_cnt is 5


[13:27:39.085]收←◆DVP STOP FRAM


[13:27:39.218]收←◆DVP START FRAM,the frame_cnt is 6


[13:27:39.353]收←◆DVP STOP FRAM


[13:27:39.485]收←◆DVP START FRAM,the frame_cnt is 7


[13:27:39.618]收←◆DVP STOP FRAM


[13:27:39.752]收←◆DVP START FRAM,the frame_cnt is 8


[13:27:39.884]收←◆DVP STOP FRAM


[13:27:40.019]收←◆DVP START FRAM,the frame_cnt is 9


[13:27:40.151]收←◆DVP STOP FRAM


[13:27:40.285]收←◆DVP START FRAM,the frame_cnt is 10


[13:27:40.418]收←◆DVP STOP FRAM


[13:27:40.551]收←◆DVP START FRAM,the frame_cnt is 11


[13:27:40.683]收←◆DVP STOP FRAM


[13:27:40.818]收←◆DVP START FRAM,the frame_cnt is 12


[13:27:40.952]收←◆DVP FRAM DONE,the href_cnt is 480

DVP STOP FRAM


[13:27:41.085]收←◆DVP START FRAM,the frame_cnt is 13


[13:27:41.217]收←◆DVP STOP FRAM


[13:27:41.351]收←◆DVP START FRAM,the frame_cnt is 14


[13:27:41.484]收←◆DVP STOP FRAM


[13:27:41.617]收←◆DVP START FRAM,the frame_cnt is 15


[13:27:41.750]收←◆DVP STOP FRAM


[13:27:41.884]收←◆DVP START FRAM,the frame_cnt is 16


[13:27:42.018]收←◆DVP FRAM DONE,the href_cnt is 16

[13:27:42.053]收←◆0

DVP STOP FRAM


[13:27:42.151]收←◆DVP START FRAM,the frame_cnt is 17


[13:27:42.283]收←◆DVP STOP FRAM


[13:27:42.417]收←◆DVP START FRAM,the frame_cnt is 

[13:27:42.447]收←◆18


[13:27:42.549]收←◆DVP STOP FRAM


[13:27:42.684]收←◆DVP START FRAM,the frame_cnt is 19


[13:27:42.816]收←◆DVP STOP FRAM


[13:27:42.950]收←◆DVP START FRAM,the frame_cnt is 20


[13:27:43.082]收←◆DVP STOP FRAM


[13:27:43.216]收←◆DVP START FRAM,the frame_cnt is 21


[13:27:43.349]收←◆DVP STOP FRAM


[13:27:43.482]收←◆DVP START FRAM,the frame_cnt is 22


[13:27:43.615]收←◆DVP STOP FRAM


[13:27:43.750]收←◆DVP START FRAM,the frame_cnt is 23


[13:27:43.882]收←◆DVP STOP FRAM


[13:27:44.016]收←◆DVP START FRAM,the frame_cnt is 24


[13:27:44.149]收←◆DVP STOP FRAM


[13:27:44.282]收←◆DVP START FRAM,the frame_cnt is 25


[13:27:44.415]收←◆DVP STOP FRAM


[13:27:44.549]收←◆DVP START FRAM,the frame_cnt is 26


[13:27:44.682]收←◆DVP STOP FRAM


[13:27:44.818]收←◆DVP START FRAM,the frame_cnt is 27


[13:27:44.948]收←◆DVP STOP FRAM


[13:27:45.082]收←◆DVP START FRAM,the frame_cnt is 28


[13:27:45.216]收←◆DVP FRAM DONE,the href_cnt is 480

DVP STOP FRAM


[13:27:45.348]收←◆DVP START FRAM,the frame_cnt is 29


[13:27:45.482]收←◆DVP STOP FRAM


[13:27:45.615]收←◆DVP START FRAM,the frame_cnt is 30


[13:27:45.748]收←◆DVP STOP FRAM


[13:27:45.881]收←◆DVP START FRAM,the frame_cnt is 31


[13:27:46.014]收←◆DVP STOP FRAM


[13:27:46.148]收←◆DVP START FRAM,the frame_cnt is 32


[13:27:46.282]收←◆DVP FRAM DONE,the href_cnt is 160

DVP STOP FRAM


[13:27:46.414]收←◆DVP START FRAM,the frame_cnt is 33


[13:27:46.547]收←◆DVP STOP FRAM


[13:27:46.681]收←◆DVP START FRAM,the frame_cnt is 34


[13:27:46.814]收←◆DVP STOP FRAM


[13:27:46.948]收←◆DVP START FRAM,the frame_cnt is 35


[13:27:47.081]收←◆DVP STOP FRAM


[13:27:47.215]收←◆DVP START FRAM,the frame_cnt is 36


[13:27:47.348]收←◆DVP FRAM DONE,the href_cnt is 160

DVP STOP FRAM


[13:27:47.480]收←◆DVP START FRAM,the frame_cnt is 37


[13:27:47.613]收←◆DVP STOP FRAM


[13:27:47.748]收←◆DVP START FRAM,the frame_cnt is 38


[13:27:47.880]收←◆DVP STOP FRAM


[13:27:48.014]收←◆DVP START FRAM,the frame_cnt is 39


[13:27:48.147]收←◆DVP STOP FRAM


[13:27:48.281]收←◆DVP START FRAM,the frame_cnt is 40


[13:27:48.414]收←◆DVP FRAM DONE,the href_cnt is 16

[13:27:48.437]收←◆0

DVP STOP FRAM


[13:27:48.547]收←◆DVP START FRAM,the frame_cnt is 41


[13:27:48.683]收←◆DVP STOP FRAM


[13:27:48.813]收←◆DVP START FRAM,the frame_cnt is 42


[13:27:48.946]收←◆DVP STOP FRAM


[13:27:49.080]收←◆DVP START FRAM,the frame_cnt is 43


[13:27:49.212]收←◆DVP STOP FRAM


[13:27:49.346]收←◆DVP START FRAM,the frame_cnt is 44


[13:27:49.479]收←◆DVP STOP FRAM


[13:27:49.613]收←◆DVP START FRAM,the frame_cnt is 45

[13:27:49.642]收←◆


[13:27:49.746]收←◆DVP STOP FRAM


[13:27:49.879]收←◆DVP START FRAM,the frame_cnt is 

[13:27:49.907]收←◆46


[13:27:50.013]收←◆DVP STOP FRAM


[13:27:50.146]收←◆DVP START FRAM,the frame_cnt is 47


[13:27:50.279]收←◆DVP STOP FRAM


[13:27:50.413]收←◆DVP START FRAM,the frame_cnt is 48


[13:27:50.545]收←◆DVP STOP FRAM


[13:27:50.679]收←◆DVP START FRAM,the frame_cnt is 49


[13:27:50.812]收←◆DVP STOP FRAM


[13:27:50.945]收←◆DVP START FRAM,the frame_cnt is 50


[13:27:51.078]收←◆DVP STOP FRAM


[13:27:51.211]收←◆DVP START FRAM,the frame_cnt is 51


[13:27:51.344]收←◆DVP STOP FRAM


[13:27:51.478]收←◆DVP START FRAM,the frame_cnt is 52


[13:27:51.611]收←◆DVP STOP FRAM


[13:27:51.746]收←◆DVP START FRAM,the frame_cnt is 53


[13:27:51.878]收←◆DVP STOP FRAM


[13:27:52.014]收←◆DVP START FRAM,the frame_cnt is 54


[13:27:52.144]收←◆DVP STOP FRAM


[13:27:52.278]收←◆DVP START FRAM,the frame_cnt is 55


[13:27:52.411]收←◆DVP STOP FRAM


[13:27:52.545]收←◆DVP START FRAM,the frame_cnt is 56


[13:27:52.677]收←◆DVP STOP FRAM


[13:27:52.811]收←◆DVP START FRAM,the frame_cnt is 57


[13:27:52.944]收←◆DVP STOP FRAM


[13:27:53.079]收←◆DVP START FRAM,the frame_cnt is 58


[13:27:53.210]收←◆DVP STOP FRAM


[13:27:53.344]收←◆DVP START FRAM,the frame_cnt is 59


[13:27:53.476]收←◆DVP STOP FRAM


[13:27:53.611]收←◆DVP START FRAM,the frame_cnt is 60


[13:27:53.743]收←◆DVP STOP FRAM


[13:27:53.877]收←◆DVP START FRAM,the frame_cnt is 61


[13:27:54.013]收←◆DVP STOP FRAM


[13:27:54.143]收←◆DVP START FRAM,the frame_cnt is 62


[13:27:54.277]收←◆DVP STOP FRAM


[13:27:54.411]收←◆DVP START FRAM,the frame_cnt is 63


[13:27:54.542]收←◆DVP STOP FRAM


[13:27:54.676]收←◆DVP START FRAM,the frame_cnt is 64


[13:27:54.810]收←◆DVP STOP FRAM


[13:27:54.943]收←◆DVP START FRAM,the frame_cnt is 65


[13:27:55.076]收←◆DVP STOP FRAM


[13:27:55.210]收←◆DVP START FRAM,the frame_cnt is 66


[13:27:55.343]收←◆DVP STOP FRAM


[13:27:55.476]收←◆DVP START FRAM,the frame_cnt is 67


[13:27:55.610]收←◆DVP STOP FRAM


[13:27:55.743]收←◆DVP START FRAM,the frame_cnt is 68


[13:27:55.877]收←◆DVP STOP FRAM


[13:27:56.011]收←◆DVP START FRAM,the frame_cnt is 69


[13:27:56.142]收←◆DVP STOP FRAM


[13:27:56.276]收←◆DVP START FRAM,the frame_cnt is 

[13:27:56.307]收←◆70


[13:27:56.409]收←◆DVP STOP FRAM


[13:27:56.542]收←◆DVP START FRAM,the frame_cnt is 71


[13:27:56.675]收←◆DVP STOP FRAM

打印代码如下:

void DVP_IRQHandler(void)

{


    if (DVP->IFR & RB_DVP_IF_ROW_DONE)

    {

//        printf("DVP ROW DONE\r\n");

        /* Write 0 clear 0 */

        DVP->IFR &= ~RB_DVP_IF_ROW_DONE;  //clear Interrupt


#if (DVP_Work_Mode == RGB565_MODE)

        if (addr_cnt%2)     //buf1 done

        {

            addr_cnt++;

            //Send DVP data to LCD

            DMA_Cmd(DMA2_Channel5, DISABLE );

            DMA_SetCurrDataCounter(DMA2_Channel5,lcddev.width);

            DMA2_Channel5->PADDR = RGB565_DVPDMAaddr0;

            DMA_Cmd(DMA2_Channel5, ENABLE);


        }

        else                //buf0 done

        {

            addr_cnt++;

            //Send DVP data to LCD

            DMA_Cmd(DMA2_Channel5, DISABLE );

            DMA_SetCurrDataCounter(DMA2_Channel5,lcddev.width);

            DMA2_Channel5->PADDR = RGB565_DVPDMAaddr1;

            DMA_Cmd(DMA2_Channel5, ENABLE);

        }


        href_cnt++;



#endif


    }


    if (DVP->IFR & RB_DVP_IF_FRM_DONE)

    {

        DVP->IFR &= ~RB_DVP_IF_FRM_DONE;  //clear Interrupt


#if (DVP_Work_Mode == RGB565_MODE)

        printf("DVP FRAM DONE,the href_cnt is %d\r\n",href_cnt);

        addr_cnt = 0;

        href_cnt = 0;


#endif


    }


    if (DVP->IFR & RB_DVP_IF_STR_FRM)

    {

        DVP->IFR &= ~RB_DVP_IF_STR_FRM;

        printf("DVP START FRAM,the frame_cnt is %d\r\n",frame_cnt);

        frame_cnt++;

    }


    if (DVP->IFR & RB_DVP_IF_STP_FRM)

    {

        printf("DVP STOP FRAM\r\n");

        DVP->IFR &= ~RB_DVP_IF_STP_FRM;


    }


    if (DVP->IFR & RB_DVP_IF_FIFO_OV)

    {

        printf("DVP FIFO OV\r\n");

        DVP->IFR &= ~RB_DVP_IF_FIFO_OV;

#if 0

        printf("FIFO OV\r\n");


#endif

    }


}

按理说:href_cnt为320产生一个RB_DVP_IF_FRM_DONE,然后清零。每一行为240像素,每个像素2字节,也就是480。按奇偶存储到不同的地址空间进行显示去。


问题:1、这种杜邦线是否能够实现出图?还是需要字节做板子用FPC连接出图。

          2、中断未检测到是否多半与杜邦线连接有关?

          3、能给出一些指导意见,从现有硬件上调出图像。

您好,使用杜邦线应该也是没问题的,注意使用的杜邦线不要太长。在我们CH32V307EVT例程下DVP文件夹内有DVP操作OV2640的例程,可以参考一下。附件为CH32V307与OV2640连接的原理图,可以参考一下。

CH32V307EVT下载链接:http://www.wch.cn/downloads/CH32V307EVT_ZIP.html 

icon_pdf.gifHD_V307_TA-1v0.pdf

image.png


image.png


href_cnt是什么意思啊?


您好,href_cnt是程序中定义的一个32位的变量,该变量主要用于在JPEG模式下,记录进入行结束中断的次数,具体可结合程序代码来看


这个板子的DSDA和DSCL直接接到OV2640不用加上拉电阻吗



您好,要接的,在CH32V307 EVT PUB文件夹下有我们带DVP接口的开发板的原理图,你可以参考最新EVT的原理图,如下。EVT下载链接如下:

https://www.wch.cn/downloads/CH32V307EVT_ZIP.html 

image.png


只有登录才能回复,可以选择微信账号登录