您好,欢迎访问三七文档
当前位置:首页 > 电子/通信 > 综合/其它 > 28第7章串行通信接口
233:ØSCI(IntroductiontoSCI)ØSCI(ArchitectureofSCIModule)ØSCI(SCIRegisters)ØSCI(SCIApplicationExamples)7.1SCI(SerialCommunicationInterfaceSCI)UART(UniversalAsynchronousReceiverandTransmitter)SCICPU(Non-Return-to-Zero,NRZ)CPUC28x16FIFO()SCI(Break)167-17-1SCICPU(1)SCI(SCITXD)SCI(SCIRXD)SCI(GPIO)(2)64Kbps(Bitpersecond)234(3)(1~8)(4)4(Overrun)(5)(Idle-line)(Addressbit)(6)(7)(8)(9)(10)(NRZ)(11)137050h82(7~0)(15~8)0(1)(2)16FIFO7.2SCISCI7-2(1)(TX)(7-2)SCITXBUF(CPU)TXSHFSCITXBUFSCITXD(2)(RX)(7-2)RXSHFSCIRXDRXSHFSCIRXBUFCPURXSHFSCIRXBUFSCIRX-EMU(3)(4)SCI2357-2(SCI)1.SCI37-17-1SCIRXDSCITXDSCILSPCLKTXINTRXINT2362.SCISCI/(UART)RS-232C()1~83.SCI(NRZ)1~8()1~87-37-3SCI4.SCI(Talker)237SLEEPSCISLEEP(SCICTL12)1CPUSLEEPSCISLEEP11()SCIRXRDYRXINT1SCISLEEP/10SCI()10ADDR/IDLEMODE(SCICCR3)TXWAKE(SCICTL13)RXWAKE(SCIRXST1)SLEEP(SCICTL12)SCI(1)SCI(SCICTL2RX/BKINTENA1)(2)(3)SLEEPSLEEP15.(Idle-Line)(ADDR/IDLEMODE=0)107-42387-4(1)1)SCI2)SCI3)SLEEPSLEEP1SCICPU(2)1)102)SCISCITXBUFTXWAKE(SCICTL13)1,11(TXWAKESCITXBUFSCI)(3)(WUT)WUT(Wake-upTemporary)TXWAKEWUTTXWAKETXSHFSCITXBUFTXWAKEWUTTXWAKE1)TXWAKE12)SCITXBUF()TXSHF()SCITXBUFTXSHFTXWAKE239WUTTXWAKETXWAKE1113)SCITXBUFTXWAKEWUTSCITXBUFTXSHFWUTTXSHFSCITXBUF(TXWAKE)(4)SCISLEEPRXRDY6.(SCICCR3ADDR/IDLEMODE=1)107-57-5TXWAKESCITXBUFTXWAKETXSHFWUTTXWAKE0WUT(1)TXWAKE1SCITXBUFTXSHF1(2)TXSHFWUTSCITXBUFTXWAKE(TXSHFWUTSCITXBUFTXWAKE)(3)TXWAKE011240(10)127.SCISCI()()181~28SCICLK4SCICLK7-607-6SCI3456(32)7-67-7(1)()(2)67-7SCIRX(1)RXENA(SCICTL10)1(2)SCIRXD(3)RXSHF(SCIBRXUF)RXRDY241(SCIRXST.6)1(4)SCIRXBUFRXRDY(5)SCIRXD(6)RXENARXSHF7-8(1)()(2)37-8SCITX(1)TXENA(SCICTL11)l(2)SCITXBUFTXRDY(3)SCI(TXSHF)(TXRDY1)(TXINTENA1)(4)TXRDY1SCITXBUF(SCITXBUFTXRDY)(5)TXSHF(6)TXENA,SCI(7)8.SCISCICTL2(TXRDY)SCIRXST(RXRDYBRKDT)RXERROR(FEOEPE)SCICPUSCISCIPIERXTX242(1)RX/BKINTENA(SCICTL21)1SCIRXSHFSCIRXBUFRXRDY(SCIRXST.6)1(SCIRXD10)BRKDT(SCIRXST.5)l(2)TXINTENA(SCICTL2.0)lSCITXBUFTXSHFCPUSCITXBUFTXRDY(SCICTL2.7)1RX/BKINTENA(SCICTL3.1)RXRDYBRKDTRXERRINTENA(SCICTL1.6)RXERROR9.SCI(LSPCLK)LSPCLKSCI1664KSCI81)(BRRLSPCLKBAUD×+=16(SCIHBAUD,SCILBAUD)BRR18BAUDLSPCLKBRR-×=1BRR65535BRR=0,16LSPCLKBAUD=7.3SCISCISCI•SCI:SCICCR•SCI1:SCICTL1•:SCIHBAUD,SCILBAUD•SCI2:SCICTL2•SCI:SCIRXST•SCI:SCIRXBUF•SCI:SCITXBUF243•SCI:SCIPRI1.SCI(SCICCR)SCI(SCICommunicationControlRegister,SCICCR)SCI7STOPBITS:SCI6EVEN/ODDPARITYSCI5(PARITYENABLE)11105PARITYENABLESCISCI(3)81/0/()4LOOPBACKENA(Tx)(Rx)103ADDR/IDLEMODESCISLEEPTXWAKE(SCICTL123)RS-232102~0SCICHAR2~0SCI1~88SCIRXBUFSCIRXEMUSCIRXBUF0SCICHAR2SCICHAR1SCICHAR0/000100120103244011410051016110711182.SCI1(SCICTL1)SCI1(SCIControlRegister1,SCICTL1)/TXWAKESLEEPSCI76RXERRINTENASCI1RXERROR(SCIRXST.7)105SWRESETSCI()0SCI(SCICTL2SCIRXST)SWRESET1SWRESET1SCI(BRKDTSCIRXST.5)SWRESETSCISWRESETlSCISWRESETTXRDYSCICTL271TXEMPTYSCICTL261RXWAKESCIRXST10PESCIRXST20OESCIRXST30FESCIRXST40BRKDTSCIRXST50RXRDYSCIRXST60RXERRORSCIRXST7043TXWAKESCITXWAKEADDR/IDLEMODE(SCICCR.3)()24501lTXWAKESCITXBUF111TXWAKESCITXBUF1TXWAKESWRESETTXWAKEWUT2SLEEPSCISCISLEEP1(SCIRXST.6,RXRDY)(SCIRXST5~2,BRKDTFEOEPE)SLEEP011TXENASCITXENASCITXDSCITXBUF010RXENASCISCIRXD()RXENA(RXSHF)SCIRXDRXENASCIRXBUFSCIRXEMU0SCIRXBUFSCIRXEMU1SCIRXBUFSCIRXEMU3.(SCIHBAUD,SCILBAUD)(SCIBaud-SelectRegisters)SCIHBAUDSCILBAUDSCI15~0BAUD15~0SCI16SCIHBAUD()SCILBAUD()16BRR(LSPCLK)SCI1664KSCI7.24.SCI2(SCIControlRegister2,SCICTL2)2467TXRDY1SCITXBUFSCITXBUFTXINTENATXRDYSWRESETTXRDY0SCITXBUF1SCITXBUF6TXEMPTYSCITXBUFTXSHFSWRESET10SCITXBUFTXSHF1SCITXBUFTXSHF5~21RX/BKINTENA/RXRDYRBKDTRX/BKINTENA0RXRDY/BRKDT1RXRDY/BRKDT0TXINTENA(SCITXBUF)TXRDYTXRDY0TXRDY1TXRDY5.SCI:SCIRXSTSCI(SCIReceiverStatusRegister,SCIRXST)7()(SCIRXEMUSCIRXBUF)7RXERRORSCIRXERRORRXERRORRXERRINTENA(SCICTL1.6)11SWRESET016RXRDYSCISCIRXBUF2471RX/BKINTENA(SCICTL2.1)1SCIRXBUFSWRESETRXRDY5BRKDTSCISCISCIRXD110RX/BKINTENA1SLEEP1BRKDTSWRESETSWRESETSCI014FESCI(FrameError)1SWRESET013OESCICPUDMAC(DMA)SCIRXEMUSCIRXBUF1SWRESET012PESCI/1//PE0SWRESET0/1/lRXWAKESCI1RXWAKESCIRXBUFSCIRXDRXWAKESCIRXBUF1SCIRXBUFSWRESET06.SCI(SCIRXEMUSCIRXBUF)(SCIRXEMUSCIRXBUF)RXSHFSCIRXEMUSCIRXBUFRXRDY248(SCIRXST.6)SCIRXEMU(EMU)SCIRXEMURXRDYSCIRXBUF(1)SCISCIRXBUF(EmulationDataBufferRegister,SCIRXEMU)RXRDYSCIRXEMUSCIRXBUFSCIRXEMUSCIRXBUFRXRDY(2)RXSHFRXRDYRX/BKINTENA(SCICTL2.1)(SCIReceiveDataBufferRegister,SCIRXBUF)RXRDYSCIRXBUF15SCIFFFESCIFIFOFIFOl7~007~014SCIFFPESCIFIFOFIFO17~007~013~87~0RXDT7~07.SCI(SCITXBUF)(SCITXBUF)8TXSHFTXRDY(SCICTL2.7)SCITXBUF249TXINTENA(SCICTL2.0)8.SCI(SCIPriorityControlRegister,SCIPRI)7~54~3SCISOFTFREE()430010/x1SCI2~0SCI281xDSPSCI7.4SCI7-1DSPRS-232PCDSP+3.3VRS-232C12VMAX232RS-232C7-9+C1+C5+C3+C4+C2Vcc162738495DB9C1+1C1-3C2-5GND15V-6V+2Vcc16TIOUT14R1IN13R1OUT12T1IN11C2+4MAX3232RXDTXDDSPPCMAX3232PCDSPPCVCVBCWindows-DSPDSP2509600bit/sl8DSPSCI-ADSP#includeDSP281x_Device.hunsignedintRecieveChar;voidScia_init()//SCIA{EALLOW;GpioMuxRegs.GPFMUX.all=0x0030;//GPIOF4/SCITXDAGPIOF5/SCIRXEDIS;SciaRegs.SCICTL2.all=0x0000;//SciaRegs.SCILBAUD=0x00E7;//9600(LSPCLK=150/4=37.5MHz)SciaRegs.SCIHBAUD=0x0001;//BRR=0x01E7=487SciaRegs.SCICCR.all=0x0007;//18//SciaRegs.
本文标题:28第7章串行通信接口
链接地址:https://www.777doc.com/doc-4238446 .html