Texas Instruments TMS320DM644x Camera Accessories User Manual


 
www.ti.com
3.2MMC/SDModeSingle-BlockWriteOperationUsingCPU
ProceduresforCommonOperations
Toperformasingle-blockwrite,theblocklengthmustbe512bytesandthesamelengthneedstobeset
inboththeMMC/SDcontrollerandthememorycard.Theprocedureforthisoperationis:
1.Writethecard’srelativeaddresstotheMMCargumentregisters(MMCARGHandMMCARGL).Load
thehigherpartoftheaddresstoMMCARGHandthelowpartoftheaddresstoMMCARGL.
2.UsetheMMCcommandregister(MMCCMD)tosendtheSELECT/DESELECT_CARDbroadcast
command.Thisselectstheaddressedcardanddeselectstheothers.
3.WritethedestinationstartaddresstotheMMCargumentregisters.Loadthehighparttothe
MMCARGHregisterandthelowparttoMMCARGL.
4.ReadthecardCSDtodeterminethecard’smaximumblocklength.
5.UseMMCCMDtosendtheSET_BLOCKLENcommand(iftheblocklengthisdifferentthanthelength
usedinthepreviousoperation).Theblocklengthmustbeamultipleof512bytesandlessthenthe
maximumblocklengthspecifiedintheCSD.
6.ResettheFIFO(FIFORSTbitinMMCFIFOCTL).
7.SettheFIFOdirectiontotransmit(FIFODIRbitinMMCFIFOCTL).
8.Settheaccesswidth(ACCWDbitsinMMCFIFOCTL).
9.EnabletheMMCinterrupt.
10.EnabletheDXRDYINTinterrupt.
11.Writethefirst32bytesofthedatablocktothedatatransmitregister(MMCDXR).
12.UseMMCCMDtosendtheWRITE_BLOCKcommandtothecard.
13.WaitfortheMMCinterrupt.
14.UsetheMMCstatusregister0(MMCST0)tocheckforerrorsandthestatusoftheFIFO.Ifallofthe
datahasnotbeenwrittenandiftheFIFOisnotfull,gotostep15.Ifallofthedatahasbeenwritten,
stop.
15.Writethenextnbytes(thisdependsonthesettingoftheFIFOLEVbitinMMCFIFOCTL:0=16bytes,
1=32bytes)ofthedatablocktotheMMCdatatransmitregister(MMCDXR)andgotostep13.
ThesequenceofeventsinthisoperationisshowninFigure14.
32MultimediaCard(MMC)/SecureDigital(SD)CardControllerSPRUE30BSeptember2006
SubmitDocumentationFeedback