东南大学信息学院poc实验报告Word文档下载推荐.docx
《东南大学信息学院poc实验报告Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《东南大学信息学院poc实验报告Word文档下载推荐.docx(17页珍藏版)》请在冰豆网上搜索。
Thehandshakingprocessisdescribedasfollows:
Whentheprinterisreadytoreceiveachar-acter,itholdsRDY=1.ThePOCmustthenholdacharacteratPD(paralleldata)portandproduceapulseattheterminalTR(transferrequest).TheprinterwillchangeRDYto0,takethecharacter
atPDandholdRDYat0untilthecharacterhasbeenprinted(e.g.delay5or10ms),thensetRDYto1againwhenitisreadytoreceivethenextcharacter.
ThebufferregisterBRisusedtotemporarilyholdacharactersentfromtheprocessor,whichchar-acterwillbetransferredtotheprinterlater.
ThestatusregisterSRisusedfortwocontrolfunctions:
①SR7servesasareadyflagtoindicatePOCisreadyornottoreceiveanewcharacterfromtheprocessor.
②SR0isusedtoenabletheinterruptrequestssentbyPOC.
Ininterruptmode,IfSR0=1,thenPOCwillsendaninterruptrequestsignaltoprocessorwhenitisreadytoreceiveacharacter(i.e.,whenSR7=1).
IfSR0=0,thenPOCwillnotinterrupt.
ThetransferofacharactertoPOCviathesystembusproceedsasfollows:
Ininterruptmode,SR0isalways1.
Aftersendingcharactertoprinter,POCsetstheSR7to1,sinceSR0=1,theinterruptrequestsignal(IRQ)issetto0,whichindicateaneffectiveinterruptsignaltotheprocessor.
1、processorsetsthevalueofSR7&
setsthevalueofBR
①WhentheprocessordetectstheeffectiveIRQsignal,theprocessordirectlyselectsBRandwritesacharacterintoBR,(processorwillneverreadthestateofSR7,whichisdifferentwithpollingmode.)
②ThentheprocessorsetstheSR7to0,whichindicatesthatthenewcharacterhasbeenwritteninto
BRandnotprintedyet.
2、POCreadsandsetsthevalueofSR7&
handshakesoperationswiththeprinter
①WhenPOCdetectsthatSR7issetto0,POCthenproceedstostartthehandshakingoperationswiththeprinter.
②Aftersendingcharactertoprinter,POCsetstheSR7to1,whichindicatesPOCisreadytoreceiveanothercharacterfromtheprocessor.Thetransfercyclecannowrepeat.(①and②aresamewiththepollingstate)
PS:
DuringthehandshakingoperationsbetweenPOCandprinter,theprocessordoesnottrytoaccessPOCuntilitreceivestheinterruptrequestsignal
1.TheoverallconnectionofthesimulatedprinterandPOCexpressedinthetopmoduleform
Figure3.Thetopmoduleformoftheproject
2.Designdescriptionofthesimulationinputwaveforms
TheinputandoutputofCPU,POCandprinterareshownbelow:
Processorj
Pins
Description
Input
clk
InputtheclockfortheCPUrunning.
mode
Choosethemodeforprinting.
Whenmode=’1’,selectainterruptmode.
IRQ
ReceivetheinterruptsignalIRQ.
WhenIRQ='
1'
newdatacanbesent.
DIN[7..0]
Readdatafrompoc.
DOUT[7..0]
Writedataintopoc.
Output
rw
ShowthedirectionoftheDOUT[7..0]andDIN[7..0]Whenrw='
0'
readdatafromPOC.
When'
rw'
='
writedatatoPOC.
A0
ControltheaddressreadandwriteonPOC.
WhenA0='
chooseSR.
chooseBR.
CS
CS=‘1’,pocwork.
data[7..0]
ThedatasendtoPOCtobeprinted
POC
InputtheclockforthePOCrunning.
RW
senddatatoCPU.
readdatafromCPU.
Inputaddress,
chooseBR.WhenA0='
RDY
Inputthereadysignalfromprinter.WhenRDY='
theprinterisidle.
WhenRDY='
theprinterisbusy.
InputthemodeofthePOC.
WhenCS=’0’,selectapollingmode.WhenCS=’1’,selectainterruptmode.
ThedatareceivefromCPUtobeprinted.
PD[7..0]
Outputthedatatoprinter.
OutputtheinterruptsignalIRQtoCPU,
showingthePOCandprinterisready.
TR
Theresponsetoprint'
RDYsignal,aone-cyclepulseattheportTR
(transferrequest)showsthatnewdataissenttoprinter.
CS=0POCsendthestateofSRtoCPU;
CS=1CPUreadthedatawriteinBR
Signal
SR[7..0]
TheregistercontainstheflagsforthePOC.WhenSR(7)='
it'
sidle.
WhenSR(7)='
sbusy.
BR[7..0]
Theregisterholdsthevalueofdatatoprint.
printer
Inputtheclockfortheprinterrunning.
InputthepulsesignalfromPOC,toshownewdataiscoming.
InputthedatafromPOC.
OutputRDYsignal,
whenRDY='