竭诚为您提供优质文档/双击可除
nec协议
篇一:necprotocolnec协议
necprotocol
tomyknowledgetheprotocolidescribeherewasdevelopedby nec.iveseenverysimilarprotocoldescriptionsontheinte rnet,andtheretheprotocoliscalledjapaneseFormat.
idoadmitthatidontknowexactlywhodevelopedit.whatidok nowisthatitisusedinmylateVcRproducedbysanyoandwasma rketedunderthenameofFisher.necmanufacturedtheremote controlic.
thisdescriptionwastakenfromtheVcRsservicemanual.tho sewerethedays,whenservicemanualswerefulledwithusefu linformation!
Features
8bitaddressand8bitcommandlengthaddressandcommandare transmittedtwiceforreliabilitypulsedistancemodulati oncarrierfrequencyof38khzbittimeof1.125msor2.25ms modulation
thenec
protocoluses
pulsedistance
encoding
pulseisofathebits.each
560μ
slong38khzcarrierburst(about21cycles).alogical"1"ta kes2.25mstotransmit,whilealogical"0"isonlyhalfoftha t,being1.125ms.therecommendedcarrierduty-cycleis1/4 or1/3.
protocol
thepictureaboveshowsatypicalpulsetrainofthenecproto col.withthisprotocolthelsbistransmittedfirst.inthis caseaddress$59andcommand$16istransmitted.
amessageisstartedbya9msagcburst,whichwasusedtosetth egainoftheearlieriRreceivers.thisagcburstisthenfoll owedbya4.5msspace,whichisthenfollowedbytheaddressan dcommand.addressandcommandaretransmittedtwice.these condtimeallbitsareinvertedandcanbeusedforverificati onofthereceivedmessage.thetotaltransmissiontimeisco nstantbecauseeverybitisrepeatedwithitsinvertedlengt h.ifyourenotinterestedinthisreliabilityyoucanignore theinvertedvalues,oryoucanexpandtheaddressandcomman dto16bitseach!
acommandistransmittedonlyonce,evenwhenthekeyonthere motecontrolremainspressed.every110msarepeatcodeistr ansmittedforaslongasthekeyremainsdown.thisrepeatcod eissimplya9msagcpulsefollowedbya2.25msspaceanda560μsburst.
extendednecprotocol
thenecprotocolissowidelyusedthatsoonallpossibleaddr esseswereusedup.bysacrificingtheaddressredundancyth eaddressrangewasextendedfrom256possiblevaluestoappr oximately65000differentvalues.thiswaytheaddressrang ewasextendedfrom8bitsto16bitswithoutchanginganyothe rpropertyoftheprotocol.thecommandredundancyisstillp reserved.thereforeeachaddresscanstillhandle 256differentcommands.
keepinmindthat256addressvaluesoftheextendedprotocol areinvalidbecausetheyareinfactnormalnecprotocoladdr esses.wheneverthelowbyteistheexactinverseofthehighb yteitisnotavalidextendedaddress.
externallinks
examplecommands
thetablebelowliststhemessagessentbytheremotecontrol ofmylateFisher530VcR(itserveduswellduringits20years longlife).
篇二:红外遥控协议分析之:nec协议
红外遥控编码传输协议
生产厂家对红外遥控的编码做了严格的规范,目前国内
外主流的红外遥控编码传输协议有十多种,如nec、philipsRc-5、philipsRc-6、philipsRc-mm、philipsRecs80、Rca、x-sat、itt、jVc、sharp、nokianRc17和sonysiRc等。
国内最常用的规范有两种:nec和sonysiRc。
这两种规范的调制方式分别为:ppm(脉冲间隔调制)和pwm(脉冲宽度调制)。
谈到这两个概念,我需要具体讲解一下,因为我在网上查阅相关资料时甚是郁闷,好多说法相互矛盾。
有说nec 属于pwm的因为它的脉宽不同,ppm的脉宽是固定的。
而细心地朋友如果探究到nec的典型芯片的芯片手册时,会发现上面这种说法是错误的。
比如upd6121这款红外远程控制芯片的调制方式为ppm。
后来终于在一家国外的网站上找到了能够自圆其说的解释。
个人认为比较正确,拿来和大家分享。
要想认清红外遥控编码传输协议的具体内容,我想还是先捡其重点来讲一下,编码规范中最重要的当属调制这部分了。
而主流的调制方式有两种分别为ppm和pwm,当然其他还有好几种,这里先不讲解,免得糊涂了。
本文就先介绍下ppm和pwm的区别。
ppm(pulsepositionmodulation),其实更加准确的说法应该是pdm(pulsedistancemodulation)即
脉冲间隔调制:
上图为典型编码规范nec协议的调制图,为ppm调制。
可以看出不管是“0”还是“1”,有高频调制波的地方(下文称其为脉冲)其宽度都是相同的位560us,而脉冲间的间。