所需E币: 3
时间: 2019-12-24 19:14
大小: 88.28KB
ThePIC16C5Xhasone8-bittimer(Timer0)whichcanusean8-bitprescaler.Insomeinstances,theuserwouldliketousethistimerforsomeotherpurposeandyet,beabletodoatransmitandreceiveusingtheserialport.Thisapplicationnoteoffersroutinestodoasim-ple8-bittransmitandreceivewithnohandshake,atbaudratesfrom1200to9600.PleasenotethattheseroutinesuseatimedloopwhichisasaccurateastheclockwhichdrivesthePIC16C5X.Theuserentersthefrequencyandbaudratedesired.Thecalculatedvalue“delay”intheserialroutinehastobean8-bitvalueonly.Ifthevalueisgreaterthan8-bits,thefrequencyandbaudratevalueshavetobechanged.AN593SerialPortRoutinesWithoutUsingTimer0CONCLUSIONAuthor:StanD’SouzaMicrochipTechnologyInc.SimpletransmitandreceiveroutinescanbewrittenwithoutusingTimer0togeneratethebaudrate.INTRODUCTIONThePIC16C5Xhasone8-bittimer(Timer0)whichcanusean8-bitprescaler.Insomeinstances,theuserwouldliketousethistimerforsomeotherpurposeandyet,beabletodoatransmitandreceiveusingtheserialport.Thisapplicationnoteoffersroutinestodoasim-ple8-bittransmi……