1. 首页
  2. 课程学习
  3. 嵌入式
  4. 不使用定时器串口例程

不使用定时器串口例程

上传者: 2022-10-23 02:57:02上传 PDF文件 88.28 KB 热度 17次

ThePIC16C5Xhasone8-bittimer(Timer0)whichcan

usean8-bitprescaler.Insomeinstances,theuser

wouldliketousethistimerforsomeotherpurposeand

yet,beabletodoatransmitandreceiveusingtheserial

port.Thisapplicationnoteoffersroutinestodoasim-

ple8-bittransmitandreceivewithnohandshake,at

baudratesfrom1200to9600.Pleasenotethatthese

routinesuseatimedloopwhichisasaccurateasthe

clockwhichdrivesthePIC16C5X.Theuserentersthe

frequencyandbaudratedesired.Thecalculatedvalue

“delay”intheserialroutinehastobean8-bitvalueonly.

Ifthevalueisgreaterthan8-bits,thefrequencyand

baudratevalueshavetobechanged.AN593SerialPortRoutinesWithoutUsingTimer0CONCLUSIONAuthor:StanD’SouzaMicrochipTechnologyInc.SimpletransmitandreceiveroutinescanbewrittenwithoutusingTimer0togeneratethebaudrate.INTRODUCTIONThePIC16C5Xhasone8-bittimer(Timer0)whichcanusean8-bitprescaler.Insomeinstances,theuserwouldliketousethistimerforsomeotherpurposeandyet,beabletodoatransmitandreceiveusingtheserialport.Thisapplicationnoteoffersroutinestodoasim-ple8-bittransmi

用户评论