on
2024-02-26
06:07 AM
- edited on
2024-03-11
02:03 AM
by
Laurids_PETERSE
The main objective of this article is to provide a step-by-step guide on how to improve DCMI frame rate. This demo uses a STM32U575I-EV that is mounted to a ov5640 camera module, but it can be easily tailored for other microcontrollers. In this communication, the camera module is the controller and the DCMI interface is a client, meaning that the camera module imposes the clock frequency on the DCMI. To improve the DCMI frame rate, we recommend this set-up for the ov5640 to reach the required frames per second (fps) rate.
The aim of this article is to increase the DCMI frame rate of an existing example, which is DCMI_ContinousCap_EmbeddedSynchMode in STM32CubeU5 package, from 7.5 fps to 15 fps.
{OV5640_SC_PLL_CONTRL2, 0x30}, /* 7.5 fps*/
Modify to:
{OV5640_SC_PLL_CONTRL2, 0x60}, /* 15 fps*/
Open the main.c file in STM32Cube_FW_U5_Vx.x.x\Projects\STM32U575I-EV\Examples\DCMI\DCMI_ContinousCap_EmbeddedSynchMode\Src folder.
Increase the pixel clock frequency from 12MHz to 24MHz to improve the framerate from 7.5 fps to 15 fps after ov5640 initialization as shown in the code below:
/*Initialize*/
if(OV5640_Init(&OV5640Obj, CAMERA_R320x240, CAMERA_PF_RGB565) != OV5640_OK)
{
status = OV5640_ERROR;
}
OV5640_SetPCLK(&OV5640Obj, OV5640_PCLK_24M);
After following this brief guide, you should now be able to improve the frame rate. If you encounter any issues, do not hesitate to create a post in the ST community for further assistance.