Texas Instruments TMS320DM648 Computer Drive User Manual


 
www.ti.com
3.11.1HandlingFIFOOverrunConditioninRawDataMode
3.12CapturingDatainTCICaptureMode
CapturingDatainTCICaptureMode
5.WritetoVCxTHRLDtosetthecapturethreshold.Thethresholdneedstobesetinunitsofdouble
word.Onedoublewordisequalto8bytes.Everytimethenumberofreceivedbytesreachesthe
numberspecifiedbythethresholdfields(VCTHRLDx)inthethresholdregister,aYEVTxisgenerated
bythevideocapturemodule.
6.ConfigureaEDMAchanneltomovedatafromYSRCxtoadestinationintheDSPmemory.The
channeltransfersshouldbetriggeredbytheYEVTx.Thesizeofthetransfersshouldbeset
appropriatelyduringtheconfigurationoftheEDMAchannelparameters.TheEDMAmuststartona
doublewordboundaryandmoveanevennumberofwords.
7.Writetothevideoportinterruptenableregister(VPIE)toenableoverrun(COVRx)andcapture
complete(CCMPx)interrupts,ifdesired.
8.Ifrawdatasynchronizationisdesired,setthestartupsynchronizationenable(SSE)bitinVCxSTRT1.
9.WritetoVCxCTLto:
Setcapturemode(CMODE=x1xforrawdatamode).
Choosecaptureoperation(CON,FRAMEbits).
SetVCENbittoenablecapture.
10.CapturestartswhentheICAPENsignalisassertedandVCEN=1.Dataiscapturedonevery
VCLKINxrisingedgewhenCAPENxisactive.EDMAevents(YEVTx)aregeneratedastriggeredby
VCxTHRLD1.Whenacompletedatablockhasbeencaptured(DCOUNT=VCYSTOPandVCXSTOP
combinedvalue),theFRMCbitinVCxSTATissetcausingtheCCMPxbitinVPIStobeset.This
generatesaDSPinterrupt,ifCCMPxisenabledinVPIE.
11.Ifcontinuouscaptureisenabled,thevideoportbeginscapturingagainonthenextVCLKINrising
edgewhenCAPENisvalid.Ifnoncontinuouscaptureisenabled,thenextdatablockiscapturedduring
whichtheDSPmustcleartheFRMCbitorfurthercaptureisdisabled.Ifsingleframecaptureis
enabled,captureisdisableduntiltheDSPclearstheFRMCbit(atwhichpoint,rawdatasyncmust
againbeperformedifenabled).
IncaseofaFIFOoverrun,theCOVRxbitissetinVPIS.ThisconditioninitiatesaninterrupttotheDSP,if
theoverruninterruptisenabled(settingtheCOVRxbitinVPIEenablesoverruninterrupt).
TheoverruninterruptroutineshouldsettheBLKCAPbitinVCxCTLanditshouldreconfigureEDMA
channelsettings.TheEDMAchannelmustbereconfiguredforcaptureofthenextframesincethecurrent
frametransferfailed.SettingtheBLKCAPbitflushesthecaptureFIFOandblocksEDMAeventsforthe
channel.AslongastheBLKCAPbitisset,thevideocapturechannelignorestheincomingdatabutthe
internaldatacountercontinuescounting.
TheBLKCAPbitshouldbeclearedto0inordertocontinuecapture.ClearingtheBLKCAPbittakeseffect
inthesubsequentframeafterarawdatasyncperiodisdetectedonCAPENx.(EDMAeventsarestill
goingtobeblockedintheframeinwhichtheBLKCAPbitiscleared.)
InordertocapturedatainTCIcapturemode,thefollowingstepsareneeded:
1.SetVCASTOP1tospecifysizeofadatapackettobecaptured(VCXSTOPsetsthelower12bitsand
VCYSTOPsetstheupper12bitsofthedatapacket).
2.WritetoVCxTHRLDtosetthecapturethresholdtothedatapacketsize.Everytimethenumberof
receivedbytesreachesthenumberspecifiedbytheVCTHRLD1bits,aYEVTxisgeneratedbythe
videocapturemodule.
3.ConfigureanEDMAchanneltomovedatafromYSRCAtoadestinationintheDSPmemory.The
channeltransfersshouldbetriggeredbytheYEVT.Thesizeofthetransfersshouldbesettothedata
packetsize+8bytesoftimestampinformation.TheEDMAmuststartonadouble-wordboundaryand
moveanevennumberofwords.
4.WritetoTCICTLto:
SetTCIcapturemode(TCMODE=0forparalleldata,1forserialdata).
Selectcountermode(TCMODE).
Enableerrorpacketfiltering(ERRFILT)ifdesired.
SPRUEM1May2007VideoCapturePort69
SubmitDocumentationFeedback