PIC16C74及其外围设备的照顾和保养
ThePIC16C74isoneofthelatestmid-rangemicrocon-trollersfromMicrochipTechnologyInc.Inthisarticlewe
willbeaddressingafewofthenewfeaturesand
peripheralsofthisnewpart.Themainfocuswillbeon
theA/D(Analog-to-Digital)Converter,theSCI(Serial
CommunicationInterface),andthePWM(PulseWidth
Modulator).Ourintentionistogiveyouasmallprogram
thatinitializestheseperipheralsaswellasexercises
them.Aschematicisprovided.ThePICDEM
TM
2board
fromMicrochipwillrunthisprogram.Thesecondtrim-potdoesnotexistonthePICDEM2board,sothesec-ondA/Dvaluemayfloataround.Thesecondtrimpotis
onlyusedtoshowamethodofchangingA/Dinputpins.
IfyouareusingthePICDEM2board,thentheLEDand
acurrentlimitingresistormustbeconnectedtothe
PWMoutput.Whentheprogramisrun,theRS-232ter-minalwilldisplaytwoA/Dvalues.Thebrightnessofan
LEDisadjustedusingpulsewidthmodulation.Theduty
cycleisdeterminedbythetrimpotsetting.
MFACT003CareandFeedingofthePIC16C74andItsPeripheralsA/DConverterMysteriesAuthor:RobertAngeloTheA/DconverteranditseightinputchannelswillbeMicrochipTechnologyInc.ourfirsttopic.SettinguptheA/Dconverterinvolvestwospecialfunctionregisters:ADCON0ThePIC16C74isoneofthelatestmid-rangemicrocon-