Texas Instruments TMS320DM644x Camera Accessories User Manual


 
www.ti.com
2.9.3InitializingtheClockControllerRegisters(MMCCLK)
2.9.4InitializetheInterruptMaskRegister(MMCIM)
2.9.5InitializetheTime-OutRegisters(MMCTORandMMCTOD)
2.9.6InitializetheDataBlockRegisters(MMCBLENandMMCNBLK)
PeripheralArchitecture
AclockdividerintheMMC/SDcontrollerdivides-downthefunctionclocktoproducethememoryclock.
Loadthedivide-downvalueintotheCLKRTbitsintheMMCmemoryclockcontrolregister(MMCCLK).
Thedivide-downvalueisdeterminedbythefollowingequation:
memoryclockfrequency=functionclockfrequency/(2×(CLKRT+1))
TheCLKENbitinMMCCLKdetermineswhetherthememoryclockappearsontheSD_CLKpin.Ifyou
cleartheCLKENto0,thememoryclockisnotprovidedexceptwhenrequired.
ThebitsintheMMCinterruptmaskregister(MMCIM)individuallyenableordisabletheinterruptrequests.
Toenabletheassociatedinterruptrequest,setthecorrespondingbitinMMCIM.Todisabletheassociated
interruptrequest,clearthecorrespondingbit.LoadzerosintothebitsthatarenotusedintheMMC/SD
mode.
Specifythetime-outperiodforresponsesusingtheMMCresponsetime-outregister(MMCTOR)andthe
time-outperiodforreadingdatausingtheMMCdatareadtime-outregister(MMCTOD).
WhentheMMC/SDcontrollersendsacommandtoamemorycard,itmustoftenwaitforaresponse.The
MMC/SDcontrollercanwaitindefinitelyorupto255memoryclockcycles.Ifyouload0intoMMCTOR,
theMMC/SDcontrollerwaitsindefinitelyforaresponse.IfyouloadanonzerovalueintoMMCTOR,the
MMC/SDcontrollerstopswaitingafterthespecifiednumberofmemoryclockcyclesandthensetsa
responsetime-outflag(TOUTRS)intheMMCstatusregister0(MMCST0).Ifyouenabletheassociated
interruptrequest,theMMC/SDcontrolleralsosendsaninterruptrequesttotheARM.
WhentheMMC/SDcontrollerrequestsdatafromamemorycard,itcanwaitindefinitelyforthatdataorit
canstopwaitingafteraprogrammablenumberofcycles.Ifyouload0intoMMCTOD,theMMC/SD
controllerwaitsindefinitely.IfyouloadanonzerovalueintoMMCTOD,theMMC/SDcontrollerwaitsthe
specifiednumberofmemoryclockcyclesandthensetsareaddatatime-outflag(TOUTRD)inMMCST0.
Ifyouenabletheassociatedinterruptrequest,theMMC/SDcontrolleralsosendsaninterruptrequestto
theARM.
SpecifythenumberofbytesinadatablockintheMMCblocklengthregister(MMCBLEN)andthenumber
ofblocksinamultiple-blocktransferintheMMCnumberofblocksregister(MMCNBLK).
YoumustdefinethesizeforeachblockofdatatransferredbetweentheMMC/SDcontrollerandamemory
cardinMMCBLEN.Thevalidsizedependsonthetypeofread/writeoperations.Alengthof0bytesis
prohibited.
Formultiple-blocktransfers,youmustspecifyhowmanyblocksofdataaretobetransferredbetweenthe
MMC/SDcontrollerandamemorycard.Youcanspecifyaninfinitenumberofblocksbyloading0into
MMCNBLK.WhenMMCNBLK=0,theMMC/SDcontrollercontinuestotransferdatablocksuntilthe
transferringisstoppedwithaSTOP_TRANSMISSIONcommand.Totransferaspecificnumberofblocks,
loadMMCNBLKwithavaluefrom1to65535.
MultimediaCard(MMC)/SecureDigital(SD)CardController 24SPRUE30BSeptember2006
SubmitDocumentationFeedback