Texas Instruments TMS320DM357 Switch User Manual


 
3.2.1.5OUTStatusPhase(followingINDataPhase)
USBControllerHostandPeripheralModesOperation
www.ti.com
3.WhenthecontrollergeneratestheEndpoint0interrupt,readHOST_CSR0toestablishwhetherthe
RXSTALLbit(bit2),theERRORbit(bit4),theNAK_TIMEOUTbit(bit7)orRXPKTRDYbit(bit0)has
beenset.
IfRXSTALLbitisset,itindicatesthatthetargetcouldnotcompletethecommandandsohasissueda
STALLresponse.
IfERRORbitisset,itmeansthatthecontrollerhastriedtosendtherequiredINtokenthreetimes
withoutgettinganyresponse.
IfNAK_TIMEOUTbitisset,itmeansthatthecontrollerhasreceivedaNAKresponsetoeachattempt
tosendtheINtoken,forlongerthanthetimesetintheHOST_NAKLIMIT0register.Thecontrollercan
thenbedirectedeithertocontinuetryingthistransaction(untilittimesoutagain)byclearingthe
NAK_TIMEOUTbitortoabortthetransactionbyclearingREQPKTbitandSTATUSPKTbitbefore
clearingtheNAK_TIMEOUTbit.
4.IfRxPktRdyhasbeenset,theCPUshouldsimplyclearRxPktRdy.
FortheOUTStatusPhaseofacontroltransaction(Figure13),theCPUdrivingthehostdeviceneedsto:
1.SetSTATUSPKTandTXPKTRDYbitsofHOST_CSR0(bit6andbit1,respectively).
Note:Thesebitsneedtobesettogether.
2.WaitwhilethecontrollersendstheOUTtokenandazero-lengthDATA1packet.
3.Attheendoftheattempttosendthedata,thecontrollerwillgenerateanEndpoint0interrupt.The
softwareshouldthenreadHOST_CSR0toestablishwhethertheRXSTALLbit(bit2),theERRORbit
(bit4)ortheNAK_TIMEOUTbit(bit7)hasbeenset.
IfRXSTALLbitisset,itindicatesthatthetargetcouldnotcompletethecommandandsohasissueda
STALLresponse.
IfERRORbitisset,itmeansthatthecontrollerhastriedtosendtheSTATUSPacketandthefollowing
datapacketthreetimeswithoutgettinganyresponse.
IfNAK_TIMEOUTbitisset,itmeansthatthecontrollerhasreceivedaNAKresponsetoeachattempt
tosendtheINtoken,forlongerthanthetimesetintheHOST_NAKLIMIT0register.Thecontrollercan
thenbedirectedeithertocontinuetryingthistransaction(untilittimesoutagain)byclearingthe
NAK_TIMEOUTbitortoabortthetransactionbyflushingtheFIFObeforeclearingtheNAK_TIMEOUT
bit.
4.IfnoneofRXSTALL,ERRORorNAK_TIMEOUTbitsisset,theSTATUSPhasehasbeencorrectly
ACKed.
UniversalSerialBus(USB)Controller 50SPRUGH3November2008
SubmitDocumentationFeedback