PIC 使用一个定时器控制led和按键
Thepurposeofthisapplicationnoteistodesignaclock
whilemultiplexingthefeaturesasmuchaspossible,
allowingthecircuittousethe18-pinPIC16C54.Other
devicesintheMicrochiplineexpandonthispart,mak-
ingitagoodstartingpointforlearningthebasics.This
designisusefulbecauseitutilizeseverypinforoutput
andswitchessomeofthemtoinputsbrieflytoreadthe
keys.Foramoreextensiveclockdesign,consultappli-
cationnoteAN529.AN590AClockDesignUsingthePIC16C54forLEDDisplaysandSwitchInputsOPERATIONAuthor:DanMatthewsMicrochipTechnologyInc.SwitchesWhennobuttonsarepressed,thecircuitwilldisplaytheINTRODUCTIONcurrenttime,startingat12:00onreset.PressingSW1Thepurposeofthisapplicationnoteistodesignaclockwillcausesecondstobedisplayed.Thetimeissetbywhilemultiplexingthefeaturesasmuchaspossible,pressingSW2toadvanceminutes,andSW3toallowing