Cypress-USB教程第2講課件_第1頁(yè)
Cypress-USB教程第2講課件_第2頁(yè)
Cypress-USB教程第2講課件_第3頁(yè)
Cypress-USB教程第2講課件_第4頁(yè)
Cypress-USB教程第2講課件_第5頁(yè)
已閱讀5頁(yè),還剩44頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

Lecture2AgendaFirstthreeUSBlayersSignalingPacketsTransfersHands-on:BULKINtransfersusingEZ-USBchipandtoolsKeilIntegratedDevelopmentEnvironment(IDE)EZ-USBControlPanelOSInterfaceRequestsTransfersTheUSBOnionPacketsSignalingSignalingReflected-waveSignaling

1footcabledriverreceiverReflected-waveSignaling

2metercabledriverreceiverReflected-waveSignaling

5metercabledriverreceiverTheSIE

(SerialInterfaceEngine)SerialInterfaceEngine(SIE)D+BytesUSBTransceiverD+PacketsPackets:IdentifiedbyPIDSThreePacketTypesWhattheSIEDoesSerialInterfaceEngine(SIE)SYNCOUTADDRENDPCRC5TokenPacketSYNCDATA1PayloadDataCRC16DataPacketSYNCACKSYNCOUTADDRENDPCRC5TokenPacketSYNCDATA0PayloadDataCRC16DataPacketSYNCACKH/SPktPayloadDataPayloadDataACKD+D-USBTransceiverTransfersBulkControlIsochronousInterruptBulkINTransfer(a)INADDRENDPCRC5TokenPacketDATA1PayloadDataCRC16DataPacketACKH/SPktINADDRENDPCRC5TokenPacketDATA0PayloadDataCRC16DataPacketACKH/SPktHDHHHDgood—notethedatatogglegoodBulkINTransfer(b)INADDRENDPCRC5TokenPacketNAKH/SPktINADDRENDPCRC5TokenPacketDATA1PayloadDataCRC16DataPacketACKH/SPktHDHHDINADDRENDPCRC5TokenPacketDATA0PayloadDataCRC16DataPacketACKH/SPktHDHgoodgoodnotreadyBulkINTransfer(c)INADDRENDPCRC5TokenPacketDATA1PayloadDataCRC16DataPacketH(H)DINADDRENDPCRC5TokenPacketDATA1PayloadDataCRC16DataPacketACKH/SPktHHDgood—notesamedataanddata

togglehostseeserror;noresponseBulkINTransfer(d)INADDRENDPCRC5TokenPacketSTALLH/SPktHDINADDRENDPCRC5TokenPacketH(D)devicehasaproblemdevicedetectstokenerrorordoesnotrespondBulkOUTTransfer(a)OUTADDRENDPCRC5TokenPacketDATA0PayloadDataCRC16DataPacketACKH/SPktOUTADDRENDPCRC5TokenPacketDATA1PayloadDataCRC16DataPacketACKH/SPktHHDHDHgood—notethedatatogglegoodBulkOUTTransfer(b)OUTADDRENDPCRC5TokenPacketDATA1PayloadDataCRC16DataPacketACKH/SPktHDHOUTADDRENDPCRC5TokenPacketDATA0PayloadDataCRC16DataPacketACKH/SPktHHDgoodgoodOUTADDRENDPCRC5TokenPacketDATA0PayloadDataCRC16DataPacketNAKH/SPktHHDdevicenotreadyfordatahostsendsdataanywayBulkOUTTransfer(c)OUTADDRENDPCRC5TokenPacketDATA1PayloadDataCRC16DataPacketH(D)HOUTADDRENDPCRC5TokenPacketDATA1PayloadDataCRC16DataPacketACKH/SPktHDHgooddeviceseeserror;noresponseBulkOUTTransfer(d)OUTADDRENDPCRC5TokenPacketSTALLH/SPktHDOUTADDRENDPCRC5TokenPacketH(D)devicehasproblemdevicedetectstokenerrorDATA1PayloadDataCRC16DataPacketHDATA1PayloadDataCRC16DataPacketHControlTransferINADDRENDPCRC5TokenPacketDATA1PayloadDataCRC16DataPacketACKH/SPktDATA08bytesSetupDataCRC16DataPacketACKH/SPktSETUPADDRENDPCRC5TokenPacketHHDDATA1OUTADDRENDPCRC5TokenPacketCRC16DataPktNAKH/SPktHHDHDHDATA1OUTADDRENDPCRC5TokenPacketCRC16DataPktACKH/SPktHHDControloperationnotcompletedControloperationcompletedSETUPDATAHANDSHAKEInterruptIN&OUTINADDRENDPCRC5TokenPacketDATA1PayloadDataCRC16DataPacketACKH/SPktINADDRENDPCRC5TokenPacketDATA0PayloadDataCRC16DataPacketACKH/SPktHDHHHDgood—notethedatatogglegoodOUTADDRENDPCRC5TokenPacketDATA0PayloadDataCRC16DataPacketACKH/SPktOUTADDRENDPCRC5TokenPacketDATA1PayloadDataCRC16DataPacketACKH/SPktHHDHDHgood—notethedatatogglegoodInterrupttransfersareindistinguishablefromBULKtransfers.Theyoccuratmostonceperframe.

IsochronousTransferINADDRENDPCRC5TokenPacketDATA0PayloadDataCRC16DataPacketOUTADDRENDPCRC5TokenPacketDATA0PayloadDataCRC16DataPacketNote:AlwaysDATA0PID,noACKHDHHHands-on:

BulkINtransfers

usingtheEZ-USBchip

andtoolsBULKINTransfer

Registerandbitassignments/*bulkin_a.C6-18-00LTHASimplebulkINtransfer.LoadsEP2INbufferwithanincrementingcount,thenarmsIN2fortransfer.Whentransmitted,replacebytezerooftheEP2INbufferwithacountindicatingthenumberofINtransfersandre-armEP2INforthenextINtransfer.*/xdatavolatilecharIN2BUF[64]_at_0x7E00;

//TRMp.12-3xdatavolatilecharIN2BC_at_0x7FB9;

//TRMp.12-34xdatavolatilecharIN2CS_at_0x7FB8;

//TRMp.12-32#define bBSY 0x02

//TRMp.12-32BULKINTransfer

Ccodecharj,count;main(){for(j=0;j<64;j++) //fillIN2bufferwithincrementingcount

IN2BUF[j]=j;IN2BC

=50; //armthefirsttransfercount=0; //initializetransfercounterwhile(1) //forever { while(IN2CS

&bBSY); //loopwhileIN2busybitisHI count++; //busybitwentLO--IN2BUFreadyformoredata

IN2BUF[0]=count; //replacefirstbufferbytewithcount

IN2BC =50; //armthenextIN2transferbyloadingbytecount } }FirstProjectTutorial

Makeafolderforallclassprojects

Firstprojectfolderis‘bulkin’1StartuV2,CreateanewProject

Navigateto‘usbcode\bulkin’234SelectDevice:EZ-USB(AN21XX)5,type(orpaste)‘bulkin.c’67Saveas‘bulkin.c’8Project/Targets…/AddFiles(selectSourceGroup1)9Select‘bulkin.c’,Addtoproject10Nowit’sshownunderSourceGroup1Project/Options…11Outputtab,check‘CreateHEXFile’box12Click‘buildtarget’13Checkfor‘bulkin.hex’fileIfit’notthere,the‘createHEXfile’projectoptionisnotchecked(step12)14ConnecttheEZ-USBDevBoardConnecttheEZ-USBboardtoaUSBportNOTE:Win2Kmayadvisethatyouneed‘a(chǎn)dministratorprivileges’toinstallRedPWRlightindicatespresenceofVbus(5VfromUSBconnector)Greenlight

meanssuccess.Specifically:TheEZ-USBdriveiscorrectlyinstalledThesystemrecognizedtheboardThedebugmonitorprogramhasloadedsuccessfullyNote:PressingboardRESETdisconnects,thenreconnectstheboardasifyouhaddoneitmanually.17Start‘ControlPanel’151615aNote:ThisisaskedonlyonceandstoredintheRegistry.EndpointTypeAlternateSetting(Interface=0)012MaxPacketSize(bytes)0CTL6464641ININT016642INBULK064642OUTBULK064644INBULK064644OUTBULK064646INBULK064646OUTBULK064648INISO0162568OUTISO0162569INISO016169OUTISO0161610INISO0161610OUTISO01616FromtheTRMDownload‘bulkin.hex’intoboard1819Viewdownloadedhexfile20SelectEndpoint2-IN2122Cleartextwindow,Click‘BulkTransfer’232450Bytesweretransferred

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論