XBEEXBEEPOR模塊接口命令集_第1頁
XBEEXBEEPOR模塊接口命令集_第2頁
XBEEXBEEPOR模塊接口命令集_第3頁
XBEEXBEEPOR模塊接口命令集_第4頁
XBEEXBEEPOR模塊接口命令集_第5頁
已閱讀5頁,還剩4頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

XBEE/XBEEPOR模塊接口命令集

作者MIRROROK(李剛)

時間2008-4-1

一、XBEE/XBEEPRO模塊硬件接口:

XBee-PRO

PinNameDirectionDescription

#

1VCC電源輸入

2DIN/CONFIG#Output輸出串口輸出

3DOUTInput輸入串口輸入

4D8*Output輸出數(shù)字輸出8

5RESET#Input輸入模塊復(fù)位(復(fù)位脈沖至少200ns)

6PWMO/RSSIOutput輸出PWM輸出0/RX信號接收強度

7PWM1Output輸出PWM輸出1

8(保留)

9DTR#/SLEEP_RQ/DI8Input輸入Sleep控制腳或者數(shù)字輸入8

10GND

11AD4/DIO4Either輸入'輸出模擬輸入4或數(shù)字工???

12C!TS#/DTO7Either輸入'輸出Cts信號或數(shù)字工???

13ON/SLEEP#Output輸出模塊狀態(tài)指示

14VREFInput輸入A/D輸入?yún)⒖茧妷?/p>

15Associate/AD5/DIO5Either輸入'輸出連接指示,模擬輸入5,數(shù)字工???

16RTS#/AD6/DI06Either輸入'輸出RTS信號,模擬輸入6,數(shù)字工???

17AD3/DIO3Either輸入'輸出模擬輸入3,數(shù)字工???

18AD2/DIO2Either輸入'輸出模擬輸入2,數(shù)字工。口2

19ADI/DIO1Either輸入'輸出模擬輸入1,數(shù)字工0口1

20ADO/DIOOEither輸入,輸出模擬輸入0,數(shù)字工0口0

注:

1.D08沒有實現(xiàn)

2.最小連接VCC,GND,DOUT,DIN

3.模塊的復(fù)位包含50k上拉電阻

二、XBEE/XBEEPRO模塊指令集

模塊的通訊波特率9600bps,BD命令參數(shù)=3

2.1.ADCandDigitalI/OLineSupport

PinFunctionPin#ATCommand

ADO/DIOO20DO

AD1/DIO119D1

AD2/DI0218D2

AD3/DIO3/(COORD_SEL)17D3

AD4/DI0411D4

AD5/DIO5/(ASSOCIATE)15D5

DIO6/(RTS)16D6

DIO7/(CTS)12D7

DI8/(DTR)/(Sleep_RQ)9D8

ToenableADCandDIOpinfunctions:

ForADCSupport:SetATDn=2

ForDigitalInputsupport:SetATDn=3

ForDigitalOutputLowsupport:SetATDn=4

ForDigitalOutputHighsupport:SetATDn=5

2.2.I/ODataFormat

I/O數(shù)據(jù)都有一個數(shù)據(jù)幀頭.第一個byie定義了數(shù)據(jù)的長度thenumberofsampleslorth-coming.例子中包含DIO和ADC.

數(shù)據(jù)幀頭的最后2個bytes(ChannelIndicatoi?通道指示)定義了哪個通道是激活的.每個bil代表一個DIO或者ADC通

道.

Figure2-04.|Header

采樣數(shù)據(jù)在數(shù)據(jù)幀頭之后,通道指示用來決定如何讀取采樣數(shù)據(jù).如果任何一個DIO使能,前面2個數(shù)據(jù)是DIO數(shù)據(jù)和

ADC數(shù)據(jù)ADC通道數(shù)據(jù)以lObit右對齊方式存儲在一個16bit中

Figure2-05.SampleData

SampleData一

API操作支持2種RX(Receive)數(shù)據(jù)幀指示forI/Odata:

?0x82fbrRX(Receive)Packet:64-bitaddressI/O

,0x83forRX(Receive)Packet:16-bitaddressI/O

TheAPIcommandheaderisthesameasshowninthe**RX(Receive)Packet:64-bitAddress**and**RX(Receive)Packet:64-bit

Address"APItypes|refertop56].RXdataibllowstheformatdescribedinthe:/ODataFormatsection|p12|.

2.3.DIOPinChangeDetect

當-DIO變化監(jiān)測”使能(使用IC命令),DIO線0-7就被監(jiān)視.當一個D【O線的變化被監(jiān)測到:

I.AnRI,'packetissentwith(heupdatedDIOpinlevels.ThispacketwillnotccniainanyADCsamples.

2.Anyqueuedsamplcearctransmittedbeforethechangedetectdata.ThismayresultinreceivingapacketwithlessthanIT

(SamplesbeforeTX)samples.

ChangedetectwillnotaffectPinSleepwakc-up.TheD8pin(DTR.'Slccp_RQ/DI8)istheonlylinethatwillwakeamodulefrom

PinSleep.Ifnotallsamplesarecollected,themodulewillstillenterSleepModeafterachangedetectpacketissent.

2.4編程范例:

ModifyRFModuleDestinationAddress

MethodI(Onelinepercommand)

SendATCommandSystemResponse

++?OK<CR>(EnterintoCommandMode)

ATDL<Hnter>(currentvalue)<CR>(ReadDestinationAddresslx>w)

ATDL1A0D<Enter>OK<CR>(ModifyDestinationAddressLow)

ATWR<Entcr>OK<CR>(Writetonon-volatilememory)

ATCN<Entcr>OK<CR>(ExitCommandMode)

Method2(Multiplecommandsononeline)

SendATCommandSystemResponse

+++OK<CR>(EnterintoCommandMode)

ATDL<Enter>{currentvalue)<CR>(RcadDestinationAddressLow)

ATDIJA0D.WR.CN<Enter>OK,OK,OK<CR>(Commandexecutionistriggeredupon

eachinstanceof(hecomma)

2.5.CommandReferenceTables

命令集包含以下8種

1.特殊命令

2.網(wǎng)絡(luò)和安全命令

3.RF接口命令

4.休眠命令(低功耗)

5.串行接口命令

6.1/0i殳置命令

7.診斷命令

8.AT命令

2.5.1特殊命令

適用于XBEEPRO模塊

Table3-01.XBee-PROCommands-Special

ATCommand

NameandDescriptionParameterRangeDefault

CommandCategory

V/riteWrieparametervaluestonon-voiatiiememorysothatparameternxxMcations

persistthrouyisubsequentpower-upofreset

WRSpecial--

NoteOnceWRisissued,noacMitionalctiaractersshouldbesentIothemoduleuntil

aftertheresponseisreceived.

RESpecialRestoreDefaultsRestoremoduleparametersiotactixydefaults.■

SoftwareResetRespondsimmedaielywithanOKthenperformahardreset

FR(vlxW)Special--

700mslater.

Firmwareversioninwhichthecommandwasftrstintroduced(finn^vareversionsarenumberedinhexadecimalnotation.)

2.5.2.網(wǎng)絡(luò)和安全命令

Table3-02.XBer/XBee-PROCommands?Networking&Security(Sub-categoriesdraenatedwithin{brackets})

ATCommand

NameandDescriptionParameterRangeDefault

CommandCategory

NetvwkrgChannelSeVReadthechannelnunWerusedfortran5mittngandreceivingdataOxOB-OxlA(XBee)

CHOxOC(12d)

(Addresses}betw&n褲modules(uses802154proiocolchannelnumbers)OxOC?0x17(XBee-PRO)

NetwockrgPANIDSeVReadfrePAN(PerioralAreaNetwork)IO0x332

ID0-OxFFFF

(Addresswg)UseOrfFFFtobcoaocastmessagesioallPANs(13106d)

DestinationAddressHighSeVReadrheupper32bitsof曲e64-bi:destination

Networksaddress^VhencannedwrtnDL.itdefinesthedesonabonaddressusedfor

DHO-OAFFFFFFFF0

(Addressog}:ran$fniss?nTotransmitusinga16-bltaddress,setDHpyaneiefDzeroardDLfess

:hanOxFFFFOxOOOOOOOOOOOOFFFFisthebroadcastaddressforthePAN.

DestinationAddressLowSeVReadmelower32titsof由e64bitCesunabon

Network嗎address^nencomwedwithDH.DLdetrestnedesoraoonaddressusedtor

01O-OxFFFFFFFF0

{Addre$?g)transmis^jn7btransmitusinga16-bitaddress,setDHparameterozeroardDLless

thanOxFFFFOxOOOOOOOOOOOOFFFFisthebroadcastaddressforthePAN

16-bitSourceAddressSei^ReadmeRFmodule16-bitsourceadcrws.SetMY=

NeNwk嗎

MYOxFFFFtodisablereceptonofpacketswith16-e(taddresses6401sourceaddress0-OxFFFF0

{Addressog}

(senalnu-nber)andbroadcastaddress(OxOOOOOOOOOOOOFFFF)isSwaysenabled

NetworkrgSerialNimberHighReadhigh32bitsoftteRFmodulesuniqueEEE645

SHO-OxFFFFFFFF[read5MFactory-set

{AddressMig)address54-bitsourcea^ressis前“aysenabled

NgtwodurgSerialNimberLow.Readlow32bitsoftheRFmodulesuniqueIEEE64-Wtaddress

SLO-OxFFFFFFFF[readonly]Faclory-set

(Addreswg)64-bitsoireeacWressisalwaysenacted

XBeeReliesSeVReadthemaximumnumberofretnesthemodulewillexecuteIn

Netwockrg

RR(v1.xA04)additiontome3retriesprovidedbythe802154MACForeachXBeeretry,the0-60

(AddressMig)

802154MACcanexecuteupto3regies.

RandomDelaySlots.Set/Readthemwnumvafueoftheback-offexponentmtre

NeUcdcmg

RNC3MA-CAdl9uvithniOidtisusedfor3l同on<ivuiddriceIfRN-0,aillteiundwiddiKe0-3[ej^unent]0

{Addressog}

isdisableddurrgthefirstrteratcxioftheaijortt-n(802154-macMinBE).

MACMode.Set/ReadMACUodevalueMACModeerabtesfdisabiesiheuseofa0-2

NetwodurgMaxStreamhea(Sefinthe802154RFpacketWhenMode0isenabled0=MaxStreamMode

MM(v1.xS0e)0

(Addreswg)duplicatepacketdetectionisenabledaswellascertainATcommanisModes1ard21=902154(noACK$)

arestrict302154modes2:902154懵SACKS)

ATCommand

NomeandDescriptionParameterRangeDefeult

CommandCategory

NodeIdentifierStoresastringdentiberTheregisteronlyacceptspnrtableASCII

dataAstingcannotstartwittiaspace.CamagereturnendsoomandCommandwill

NgMortung

Nl(v1x80*)automabcalyendwtienranmumbytesforthestrrghavebeenentsredTNssvngis20-charaderASCII?mg

{identification}

returnedaspartoftheND(NodeDiscover)commandThisidentjfiefsalsousedwiM

:heDN(DesonaoonNode)co<n(nacd

NodeDiscoverDiscoversaBreportsalRFmodulesfoundThef<Mowinginformation

isreportejfoeea(tmodulediscovered(trteexamplealesuseofTrarsparen:operation

(ATcornandformat)-refertottelongNDcommandOeserphonregardingdifferences

betweenTransparentandAPIoperation).

MY<CF>

SH<CR>

Networking

ND(Y1JC80*)Sl<CR>opttonai20-characierNlvakje

(identification)DB<CR>

NKC?><CR>

ThearxnntoftimethemoduleallowsforresponsesisdeterminedtytheNT

parameterInTransparertoperation,commandcompletionisdesignatedbya<CR>

?camagereturn)NOalsoacceptsaModekJerhfierasaparametermthiscase,onlya

modulerracchmgthesupplied?dertrfiefwillrespond

NerawykingNodeDiscoverTimeSeVRead由eamountoftimeanodewillwaitforresponsesfrom

NT(vlxAO")0x01-OxFC0x19

{identification)odiernxfeswhenuswgtheNO(NodeDiscover)command

DestinationNode.ResolesanNl(NodeWecMier)strrg10apMyscaiacklressThe

fofiowingaventsoccuruponsuccessfulcommandexecution

1DLandDHaresettotheaddressofthemodulew由ttiematdiingNodeIdertifer

Networking

DN(V1JC80*)2'OK'sreturned20-characierASCIIstring

{identiftcanon)■

3RFrroduleauiomancaliyexitsATCommandMode

Ifthereisnoresponsefromamodule200msecoraparametersnotspecified

(leftblarl),thecommandistenwatedandan’ERROR'messageisrelumed

0-1

NetMXking

CE(v1.xW)CooedifutorEnableSec/Readtti?coordinatorsetting.0=EndDewce0

{AssociaXMi)

1=Coortinalor

ScanChannelsSeVReadlistofchannelstoscanforallActK,eandEnergyScansasa

bittedThisaffectsscansnoaledinconmaWnode(AS.ED)andiunngEndDesnce

OxiFFE

AssociationandCoordratorstartup:0-0xFFFF(MMd]

NeMorking(ailXBee-

SC(v1.x8Oe)MtO-OcOBM4-0X0Fbit8?0x13bit12-0x17曲st0.14.15notaitowedon

{Associaiw)PRO

MM-UKVCMb-WWDlty?UX14DIU3-UXWmexaee-KKU)

bit2*(kODM6-0x11bit10-0x15bit14.0x19Channels)

bit3*(kOEM7-0x12bit11-0x16bit15-0x1/?

ScanDuiationSet/Read(tiescandurationexponent.

EndDevice-DurationofActiveScandurrgAssociationOnbeaconsystem,setSD=

BEo<ooadinatorSDmustbesetatleasttotheRghestBEpara門做新ofany

BeaconiojCoordinatormtnwhieftanEndDevic?orCoordinatortoEscover.

Co3dmMor?IfReassIgnPANiO'optonissetonCoordinator(retotoA2paraneier]

SDdetemmesthelengthoftmetheCoordinatorwirscarchannelstolocateexisnng

PAWsIfReass中Channel'optonKset,SDdeterminesbewlong加Coordinaiocwill

Networkrgperform%EnergyScanlodetermineMichchannelitwilloperatecn.

SD(v1M)O-OxOF[exponent]4

{AssodaBon)ScanTjtreismeasuredas傳ofchannelstoscar]*(2ASD)?15.36(ns)Ttienumber

ofchannelstoscanissetbymeSCcommandTheXBeecanscanupto16channels

(SC=OxFFFF)TheXBeePROcanscanupto13channels(SC=Ox3FFE).

Example:Thevabesbek)wshowresultstora13charnelscan

lfSD=Xtime=018secSD=8Jme=47.19sec

SD=2.Ufn?=074secSD=10,ome=3.15mm

S^D=4.lifnft=2QSwSR=12K2=195Amin

SO=6.tin)e=11.80secSD=14,time=5033mm

EndDeviceAssociationSeVReadEndDeviceassociationoption*

bit0-ReassignPanlD

0-'MlonlyassociateCoordinatoroperatingonPANIDWatnaxtesmoduleID

1?MayassociatewithCoordinatoroperatingonan/PANID

bit1-ReassignChannei

0-WillxilyassociatewithCoordinatoroperatingonmalctiiogCHChannelsetting

1?MayassociatewithOxxdinatoroperatingonanyChanrd

Metworkmgbit2-Aut>A$$odate

A1(v1.x80w)0-OxOF[bitfiekl]0

{Association)0-Devte刷r?tattemptAssodatxxi

1-DevceanemptsAssociatonunolsuccess

NoteTht$ai6usedonlytofNon-BeacorsystemsEndDevicesmBeacor-enabled

systemmustalwaysassooaietoaCoordinator

bit3-PolCoordOnPinWake

0-PinWakewillnotpo*theCoordinatorforindrect(pending)data

1-PinWakewillsendPollRequesttoCoordinatortoextractanyperdingdata

bits4-7arereserved

CoordinatorAssociationSeVReadCoodinatorassodatioroptiors

MO-ReassignPan!D

0?Coocdmatorw?notperformAcnveScantolocateavanatiePMID.itvbiiloperate

onD(PANID).

1?CcxxdinawwillperformActiveScaniodetermineanavailableID(PANID).Ka

PAMDconflictisfound,theIDparameterwillchange

t?l1-Reass?gnCh3rnei-

Networking

A2(vlx80,)0?CoortinatorwfnotperformEnergyScantodeterminetreechannelItwinoperate0-7[bitfield)0

{Assodafioo)

onbectianneideterminedbymeCHparameter

1?CoordinatorwillperformEnergyScanlofindafreecharnel,thenoperateonthat

channel

bd2?ABowAssooation-

0?Coordinatorwillnotaitowanydevicestoassoaaietoit

1-Coordinatorwillallow(devicestoassoaatetot

Ms3?7arereserved

AssociationIndicationReaderrorswfrttelastassooatiocrequest

0x00-SuccessfulCompletion-CoordinalorsuccessfullystartedorEndDevice

as$ociaooncomplete

6c01?AaiveScanTimeout

0x02-ActiveScanfoundnoPANs

0x03-ActiveScanfoundPAN.buttheCoordratorAHowAssociationbitisnotset

0x04?ActiveScanfoundPAN.butCoordinatorandEndDevicearenoc

(xMgu例tosupportbeacons

0x05-AdiveScanfoundPAN,buttheCoordratorIDparameterdeesno<matcti

祈eIDparameteroftheEndDevice

0x06?ActiveScanfoundPAN.buttheCoordratorCHparameterSesnotmatchthe

CHparameteroftheEndDevice

Networking0x07-EnergyScarTimeout

AI(v1.xW)0x08?Coordinatorstartrequestfailed0-0x13[read-only]?

{AssodaBon)

0x09-CoordinatorcouldnotstartduetoinvaMparameter

OxOA-CoordinatorReaigrmentisinprogress

OxOB-AssociationRequestno!sent

OxOC?AssoaatonRequestDmedout-noreplywasreceived

OxOD-AssociationRequesthadan

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論