基于stm32f4的ov2640摄像头模块lcd图像传输Lcdimagedisplayofov2640cameramodulebasedonstm32f4STMicroelectronicsintroducedtheSTM32F4familyofhigh-performancemicrocontrollersbasedontheARM®Cortex™-M4coreusinga90-nmNVMprocessandART(AdaptiveReal-TimeMemoryAccelerator™).ARTtechnologymakestheprogramnowaitforexecution,improvetheefficiencyofprogramexecution,makingtheSTM32F4seriescanreach210DMIPS@168MHz.TheSTM32F4familyofmicrocontrollersintegratessingle-cycleDSPinstructionsandFPU(floatingpointunit)toimprovecomputationalpowerandallowforcomplexcalculationsandcontrols.IntroductionofSTM32F4ThissectionappliestothewholeSTM32F4xxfamilydevices,unlessotherwisespecified.Thedigitalcameraisasynchronousparallelinterfaceabletoreceiveahigh-speeddataflowfromanexternal8-,10-,12-or14-bitCMOScameramodule.Itsupportsdifferentdataformats:YCbCr4:2:2/RGB565progressivevideoandcompresseddata(JPEG).Thisinterfaceisforusewithblack&whitecameras,X24andX5cameras,anditisassumedthatallpre-processinglikeresizingisperformedinthecameramodule.IntroductionofDCMIofSTM32F4•8-,10-,12-or14-bitparallelinterface•Embedded/externallineandframesynchronization•Continuousorsnapshotmode•Cropfeature•Supportsthefollowingdataformats:–8/10/12/14-bitprogressivevideo:eithermonochromeorrawbayer–YCbCr4:2:2progressivevideo–RGB565progressivevideo–Compresseddata:JPEGDCMImainfeaturesDCMIpinsTableshowstheDCMIpinsNameSignaltypeD[0:13]DatainputsHSYNCHorizontalsynchronizationinputVSYNCVerticalsynchronizationinputPIXCLKPixelclockinputTableDCMIpinsThedigitalcamerainterfaceusestwoclockdomainsPIXCLKandHCLK.ThesignalsgeneratedwithPIXCLKaresampledontherisingedgeofHCLKoncetheyarestable.AnenablesignalisgeneratedintheHCLKdomain,toindicatethatdatacomingfromthecameraarestableandcanbesampled.TheminimumPIXCLKperiodmustbehigherthan2.5HCLKperiods.DCMIclocksDCMIfunctionaloverviewThedigitalcamerainterfaceisasynchronousparallelinterfacethatcanreceivehigh-speed(upto54Mbytes/s)dataflows.Itconsistsofupto14datalines(D13-D0)andapixelclockline(PIXCLK).Thepixelclockhasaprogrammablepolarity,sothatdatacanbecapturedoneithertherisingorthefallingedgeofthepixelclock.Thedataarepackedintoa32-bitdataregister(DCMI_DR)andthentransferredthroughageneral-purposeDMAchannel.TheimagebufferismanagedbytheDMA,notbythecamerainterface.Thedatareceivedfromthecameracanbeorganizedinlines/frames(rawYUB/RGB/Bayermodes)orcanbeasequenceofJPEGimages.ToenableJPEGimagereception,theJPEGbit(bit3ofDCMI_CRregister)mustbeset.ThedataflowissynchronizedeitherbyhardwareusingtheoptionalHSYNC(horizontalsynchronization)andVSYNC(verticalsynchronization)signalsorbysynchronizationcodesembeddedinthedataflow.DCMIblockdiagramTop-levelblockdiagramDMAinterfaceTheDMAinterfaceisactivewhentheCAPTUREbitintheDCMI_CRregisterisset.ADMArequestisgeneratedeachtimethecamerainterfacereceivesacomplete32-bitdatablockinitsregister.DCMIphysicalinterfaceTheinterfaceiscomposedof11/13/15/17inputs.OnlytheSlavemodeissupported.Thecamerainterfacecancapture8-bit,10-bit,12-bitor14-bitdatadependingontheEDM[1:0]bitsintheDCMI_CRregister.Iflessthan14bitsareused,theunuseddatapinsmustnotbeassignedtoDCMIinterfacethroughGPIOalternatefunctions.DCMIsignalsDCMIsignalwaveformsIntroductionofOV2640sensorImagesensoristhecoreofthecamera,thecameraintheimagesensorisamodelOV2640CMOStypedigitalimagesensor.Thesensorsupportsoutputofupto2megapixelimages(1600x1200pointsResolution),supporttheuseofVGAtimingoutputimagedata,theoutputimagedataformatsupportYUV(422/420),YCbCr422,RGB565,andJPEGformats,datacanbegreatlyreducedifimagesareoutputdirectlyinJPEGformatVolume,convenientnetworktransmission.Italsocompensatesforcapturedimages,supportinggammacurves,whitebalance,andsaturationDegree,colorandotherbasictreatment.Accordingtothedifferentresolutionconfiguration,thesensoroutputimagedataframeratefrom15-60framesTune,theworkofpowerbetween125mW-140mW.pinandfunctionalblockdiagramofOV2640OV2640sensorusingBGApackage,it'sfront-endlightingwindow,thepinleadstotheback,thepinpointsSeeFigureforcloth.BelowwecooperatewiththeOV2640functionalblockdiagraminaboveFiguretoexplainthesesignalpins.hardwaredesignCameraschematicTheexperimentusedOV2640cameraschematicdiagramisasfollows:ConnectionofCameraandexperimentboardsoftwaredesignInordertomaketheprojectmoreorganized,weseparatethecameracontrol-relatedcodestoredseparatelyforlaterplant.OnthebasisofLTDC-liquidcrystaldisplayproject,wewillcreatebsp_ov2640.candbsp_ov2640.hThesefilescanalsobenamedaccordingtoyourpreference,theydonotbelongtothecontentsoftheSTM32standardlibrary,isourownrootAccordingtotheapplicationneedstobeprepared.Camerahardware-relatedmacrodefinitionmainfunction