




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
精品文档-下载后可编辑DS26303LIU的初始化和配置-新品速递引言在为一个新设计的电信系统开发软件时,棘手的任务莫过于实现基本的设备操作。DS26303收发器的大量功能和多端口操作使软件开发更趋复杂。为了方便初期系统开发,DallasSemiconductor公司提供了C风格范例代码,它可以在T1或E1模式下初始化设备,软件开发人员只需针对所需的操作修改代码,或编写与特定系统相关的功能。一旦代码编译完毕,即可载入系统进行测试与评估。需要注意的是DS26303有两个版本,分别是DS26303-120和DS26303-75。它们的区别很小,只会影响到几个设置,因此需要弄清楚设计中用到的是哪个器件。
代码范例
图1中所示的范例代码在稍加修改之后就可以正确编译以供目标系统使用。'write(address,data)'和'wait(milliseconds)'两个函数调用过程与系统相关,因此需要根据所用的微处理器编写。该代码假定设备被映射到16位的本地总线(地址偏移0x0000),并且设备的数据总线为8位。对于其他情况,则需要修改代码或编写函数调用来解决。此段代码还包含某些寄存器的多种不同设置,从而为开发人员提供了时钟频率、线路编码等参数的多种选择。虽然包含了大量的基本功能,但该代码并不完备。当需要实现其他附加功能时,请参考数据资料。
/*ConfigurationExampleForDS26303-120runninginE1mode.ThisExampleassumesE1operationsothefunctioncallforT1/J1configurationhasbeencommentedout.SimplycommentouttheE1configurationfunctioncallanduncommenttheT1configurationfunctioncallforT1operation.AnindividualfunctioncallforJ1operationisnotpresentbecauseitisverysimilartoT1operationandcouldeasilybeimplementedinthatfunction.ThisfilefollowsCstyleconventions.Howeveractualcodeforthefunctioncallslistedbelowareimplementationspecificandneedtobeadded:FunctionCalls:write(address,data),wait(milliseconds)ThefollowingcommentsonlyindicatesomeofthepossibleclocksourcesthatcanbeusedforeitherE1orT1/J1operation.Masterclockconfigurationcanusemultiplesofn=1,2,4,or8MCLK=Canbeanx1.544ornx2.048MHzsignalforE1orT1/J1Operation
TCLK=Mustbea2.048MHzSignalforE1OperationTCLK=Mustbea1.544MHzsignalforT1/J1Operation*/
voidinitialization_main(){/*GlobalInitializationBegin*/
/*Resetallchannelstotheirdefaultvalues*/write(0x001F,0x00);//ADDP,SetAddressPointertoPrimaryRegisterBankWrite(0x000A,0xFF);//SWR,ResetAllChannels
/*Wait1msforresettocomplete*/wait(1);
/*TheMasterClockSelectRegisterisimportantforproper*//*deviceoperationconsultthedatasheetforallpossibleconfigurations.*/write(0x001F,0x01);//ADDP,SetAddressPointertoIndividualLIURegisterBankwrite(0x0006,0x00);//MC,E1ModeOnlyMCLK-2.048,TECLKCLKADisabled//write(0x0006,0x00);//MC,T1/J1ModeOnlyMCLK-1.544,TECLKCLKADisabled
//write(0x0006,0x03);//MC,T1/J1orE1ModeMCLK-1.544,TECLKCLKADisabled//write(0x0006,0x07);//MC,T1/J1orE1ModeMCLK-3.088,TECLKCLKADisabled//write(0x0006,0x0B);//MC,T1/J1orE1ModeMCLK-6.176,TECLKCLKADisabled//write(0x0006,0x0F);//MC,T1/J1orE1ModeMCLK-12.352,TECLKCLKADisabled
//write(0x0006,0x01);//MC,T1/J1orE1ModeMCLK-2.048,TECLKCLKADisabled//write(0x0006,0x05);//MC,T1/J1orE1ModeMCLK-4.096,TECLKCLKADisabled//write(0x0006,0x09);//MC,T1/J1orE1ModeMCLK-8.192,TECLKCLKADisabled//write(0x0006,0x0D);//MC,T1/J1orE1ModeMCLK-16.384,TECLKCLKADisabled
/*Wait1msforclocktosettleafterconfiguration*/wait(1);
/*TheGCregisterisabletogloballycontroltheAISDuringLOS,ShortCircuit*//*Protection,LineCoding,JADepth,JAPosition,andJAEnablefunctions*/write(0x001F,0x00);//ADDP,SetAddressPointertoPrimaryRegisterBankwrite(0x000F,0x80);//GC,EnableRXInternalImpedance,DisableGlobalControls
/*GlobalInitializationComplete*/
/*ConfigurationBegin*/
e1_configure();
//t1_configure();
/*ConfigurationComplete*/}
voide1_configure(){/*E1InitilizationBegin*/
/*Thisfunctionassumesallportsareconfiguredidentically.Otherwise,*//*thefunctionneedstoberevisedtosupportindividualportaddressing*//*andidentification.*/
/*Configureanalog,remote,ordigitalloopbackasnecessary*/write(0x001F,0x00);//ADDP,SetAddressPointertoPrimaryRegisterBankwrite(0x0001,0x00);//ALBC,DisableAnalogLoopbackfor8Channels//write(0x0001,0xFF);//ALBC,EnableAnalogLoopbackfor8Channelswrite(0x0002,0x00);//RLBC,DisableRemoteLoopbackfor8Channels//write(0x0002,0xFF);//RLBC,EnableRemoteLoopbackfor8Channelswrite(0x000C,0x00);//DLBC,DisableDigitalLoopbackfor8Channels//write(0x000C,0xFF);//DLBC,EnableDigitalLoopbackfor8Channels
/*ConfigureLOS/AIScriteriainE1mode*/write(0x001F,0x00);//ADDP,SetAddressPointertoPrimaryRegisterBankwrite(0x000D,0x00);//LASCS,UseG.775Criteriafor8Channels//write(0x000D,0xFF);//LASCS,UseETSI300233Criteriafor8Channels
write(0x001F,0x00);//ADDP,SetAddressPointertoPrimaryRegisterBankwrite(0x0003,0x00);//TAOE,DisableTransmitAllOnesfor8Channels//write(0x0003,0xFF);//TAOE,EnableTransmitAllOnesfor8Channels
write(0x001F,0x00);//ADDP,SetAddressPointertoPrimaryRegisterBankwrite(0x000E,0x00);//ATAOS,DisableAutomaticTransmitAllOnesfor8Channels//write(0x000E,0xFF);//ATAOS,EnableAutomaticTransmitAllOnesfor8Channels
write(0x001F,0x00);//ADDP,SetAddressPointertoPrimaryRegisterBankwrite(0x0012,0x00);//OEB,DisableTXOutputHighImpedancefor8Channels//write(0x0012,0xFF);//OEB,EnableTXOutputHighImpedancefor8Channels
write(0x001F,0xAA);//ADDP,SetAddressPointertoSecondaryRegisterBankwrite(0x0003,0x00);//RPDE,DisableReceivePower-Downfor8Channels//write(0x0003,0xFF);//RPDE,EnableReceivePower-Downfor8Channels
write(0x001F,0xAA);//ADDP,SetAddressPointertoSecondaryRegisterBankwrite(0x0004,0x00);//TPDE,DisableTransmitPower-Downfor8Channels//write(0x0004,0xFF);//TPDE,EnableTransmitPower-Downfor8Channels
/*Insinglerailmode(SMRSregister)withHDB3/B8ZS(LCSregister)enabled,*//*theEZDEandCVDEBregisterscanenabletheexcessivezeroandcode*//*violationdetectionoutputontheRNEGpin.*/write(0x001F,0xAA);//ADDP,SetAddressPointertoSecondaryRegisterBank//write(0x0000,0x00);//SRMS,DisableSingleRailModeI/Ofor8Channelswrite(0x0000,0xFF);//SRMS,EnableSingleRailModeI/Ofor8Channels
write(0x001F,0xAA);//ADDP,SetAddressPointertoSecondaryRegisterBankwrite(0x0005,0x00);//EZDE,DisableExcessiveZeroDetectfor8Channels//write(0x0005,0xFF);//EZDE,EnableExcessiveZeroDetectfor8Channels
write(0x001F,0xAA);//ADDP,SetAddressPointertoSecondaryRegisterBankwrite(0x0006,0x00);//CVDEB,EnableCodeViolationDetectfor8Channels//write(0x0006,0xFF);//CVDEB,DisableCodeViolationDetectfor8Channels
/*Thefollowingsixfunctionscanbecontrolledindividuallyonaperchannel*//*basisorgloballyusingtheGCregister.TheIAISEL,ISCPD,LCS,IJAFDS,*//*IJAPS,andIJAEareignoredwhenthecorrespondingfunctionintheGC*//*registerisenabled.*/write(0x001F,0x01);//ADDP,SetAddressPointertoIndividualRegisterBankwrite(0x0005,0x00);//IAISEL,DisableIndivAISDuringLOSfor8Channels//write(0x0005,0xFF);//IAISEL,EnableIndivAISDuringLOSfor8Channels
write(0x001F,0x01);//ADDP,SetAddressPointertoIndividualRegisterBankwrite(0x0004,0x00);//ISCPD,EnableIndivShortProtectionfor8Channels//write(0x0004,0xFF);//ISCPD,DisableIndivShortProtectionfor8Channels
write(0x001F,0xAA);//ADDP,SetAddressPointertoSecondaryRegisterBankwrite(0x0001,0x00);//LCS,EnableB8ZS/HDB3Operationfor8Channels//write(0x0001,0xFF);//LCS,EnableAMIOperationfor8Channels
write(0x001F,0x01);//ADDP,SetAddressPointertoIndividualRegisterBank//write(0x0002,0x00);//IJAFDS,IndivJA32BitDepthfor8Channelswrite(0x0002,0xFF);//IJAFDS,IndivJA128BitDepthfor8Channels
write(0x001F,0x01);//ADDP,SetAddressPointertoIndividualRegisterBank//write(0x0001,0x00);//IJAPS,IndivJATransmitPathfor8Channelswrite(0x0001,0xFF);//IJAPS,IndivJAReceivePathfor8Channels
write(0x001F,0x01);//ADDP,SetAddressPointertoIndividualRegisterBank//write(0x0000,0x00);//IJAE,DisableIndivJitterAttenuatorfor8Channelswrite(0x0000,0xFF);//IJAE,EnableIndivJitterAttenuatorfor8Channels
/*ConfigureallchannelsforaE1pulsetemplateoutput.Thisexampleuses*//*theDS26303-120deviceso,TS.TIMPRM=0for120ohmlineimpedances.If*//*thedevicewereaDS26303-75,TS.TIMPRM=1for120ohmlineimpedances.*/write(0x001F,0x00);//ADDP,SetAddressPointertoPrimaryRegisterBank
Write(0x0010,0x00)//TST,SelectChannel1forTemplateConfigurationWrite(0x0011,0x00)//TS,E1Mode120ohmG.703TX/RXImpedanceMatch
Write(0x0010,0x01)//TST,SelectChannel2forTemplateConfigurationWrite(0x0011,0x00)//TS,E1Mode120ohmG.703TX/RXImpedanceMatch
Write(0x0010,0x02)//TST,SelectChannel3forTemplateConfigurationWrite(0x0011,0x00)//TS,E1Mode120ohmG.703TX/RXImpedanceMatch
Write(0x0010,0x03)//TST,SelectChannel4forTemplateConfigurationWrite(0x0011,0x00)//TS,E1Mode120ohmG.703TX/RXImpedanceMatch
Write(0x0010,0x04)//TST,SelectChannel5forTemplateConfigurationWrite(0x0011,0x00)//TS,E1Mode120ohmG.703TX/RXImpedanceMatch
Write(0x0010,0x05)//TST,SelectChannel6forTemplateConfigurationWrite(0x0011,0x00)//TS,E1Mode120ohmG.703TX/RXImpedanceMatch
Write(0x0010,0x06)//TST,SelectChannel7forTemplateConfigurationWrite(0x0011,0x00)//TS,E1Mode120ohmG.703TX/RXImpedanceMatch
Write(0x0010,0x07)//TST,SelectChannel8forTemplateConfigurationWrite(0x0011,0x00)//TS,E1Mode120ohmG.703TX/RXImpedanceMatch}
voidt1_configure(){/*T1InitilizationBegin*/
/*Thisfunctionassumesallportsareconfiguredidentically.Otherwise,*//*thefunctionneedstoberevisedtosupportindividualportaddressing*//*andidentification.*/
/*Configureanalog,remote,ordigitalloopbackasnecessary*/write(0x001F,0x00);//ADDP,SetAddressPointertoPrimaryRegisterBankwrite(0x0001,0x00);//ALBC,DisableAnalogLoopbackfor8Channels//write(0x0001,0xFF);//ALBC,EnableAnalogLoopbackfor8Channelswrite(0x0002,0x00);//RLBC,DisableRemoteLoopbackfor8Channels//write(0x0002,0xFF);//RLBC,EnableRemoteLoopbackfor8Channelswrite(0x000C,0x00);//DLBC,DisableDigitalLoopbackfor8Channels//write(0x000C,0xFF);//DLBC,EnableDigitalLoopbackfor8Channels
write(0x001F,0x00);//ADDP,SetAddressPointertoPrimaryRegisterBankwrite(0x0003,0x00);//TAOE,DisableTransmitAllOnesfor8Channels//write(0x0003,0xFF);//TAOE,EnableTransmitAllOnesfor8Channels
write(0x001F,0x00);//ADDP,SetAddressPointertoPrimaryRegisterBankwrite(0x000E,0x00);//ATAOS,DisableAutomaticTransmitAllOnesfor8Channels//write(0x000E,0xFF);//ATAOS,EnableAutomaticTransmitAllOnesfor8Channels
write(0x001F,0x00);//ADDP,SetAddressPointertoPrimaryRegisterBankwrite(0x0012,0x00);//OEB,DisableTXOutputHighImpedancefor8Channels//write(0x0012,0xFF);//OEB,EnableTXOutputHighImpedancefor8Channels
write(0x001F,0xAA);//ADDP,SetAddressPointertoSecondaryRegisterBankwrite(0x0003,0x00);//RPDE,DisableReceivePower-Downfor8Channels//write(0x0003,0xFF);//RPDE,EnableReceivePower-Downfor8Channels
write(0x001F,0xAA);//ADDP,SetAddressPointertoSecondaryRegisterBankwrite(0x0004,0x00);//TPDE,DisableTransmitPower-Downfor8Channels//write(0x0004,0xFF);//TPDE,EnableTransmitPower-Downfor8Channels
/*Insinglerailmode(SMRSregister)withHDB3/B8ZS(LCSregister)enabled,*//*theEZDEandCVDEBregisterscanenabletheexcessivezeroandcode*//*violationdetectionoutputontheRNEGpin.*/write(0x001F,0xAA);//ADDP,SetAddressPointertoSecondaryRegisterBank//write(0x0000,0x00);//SRMS,DisableSingleRailModeI/Ofor8Channelswrite(0x0000,0xFF);//SRMS,EnableSingleRailModeI/Ofor8Channels
write(0x001F,0xAA);//ADDP,SetAddressPointertoSecondaryRegisterBankwrite(0x0005,0x00);//EZDE,DisableExcessiveZeroDetectfor8Channels//write(0x0005,0xFF);//EZDE,EnableExcessiveZeroDetectfor8Channels
write(0x001F,0xAA);//ADDP,SetAddressPointertoSecondaryRegisterBankwrite(0x0006,0x00);//CVDEB,EnableCodeViolationDetectfor8Channels//write(0x0006,0xFF);//CVDEB,DisableCodeViolationDetectfor8Channels
/*Thefollowingsixfunctionscanbecontrolledindividuallyonaperchannel*//*basisorgloballyusingtheGCregister.TheIAISEL,ISCPD,LCS,IJAFDS,*//*IJAPS,andIJAEareignoredwhenthecorrespondingfunctionintheGC*//*registerisenabled.*/write(0x001F,0x01);//ADDP,SetAddressPointertoIndividualRegisterBankwrite(0x0005,0x00);//IAISEL,DisableIndivAISDuringLOSfor8Channels//write(0x0005,0xFF);//IAISEL,EnableIndivAISDuringLOSfor8Channels
write(0x001F,0x01);//ADDP,SetAddressPointertoIndividualRegisterBankwrite(0x0004,0x00);//ISCPD,EnableIndivShortProtectionfor8Channels//write(0x0004,0xFF);//ISCPD,DisableIndivShortProtectionfor8Channels
write(0x001F,0xAA);//ADDP,SetAddressPointertoSecondaryRegisterBankwrite(0x0001,0x00);//LCS,EnableB8ZS/HDB3Operationfor8Channels//write(0x0001,0xFF);//LCS,EnableAMIOperationfor8Channels
write(0x001F,0x01);//ADDP,SetAddressPointertoIndividualRegisterBank//write(0x0002,0x00);//IJAFDS,IndivJA32BitDepthfor8Channelswrite(0x0002,0xFF);//IJAFDS,IndivJA128BitDepthfor8Channels
write(0x001F,0x01);//ADDP,SetAddressPointertoIndividualRegisterBank//write(0x0001,0x00);//IJAPS,IndivJATransmitPathfor8Channelswrite(0x0001,0xFF);//IJAPS,IndivJAReceivePathfor8Channels
write(0x001F,0x01);//ADDP,SetAddressPoin
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 天津市双菱中学2024-2025学年高二上学期期中考试化学试题(含答案)
- 广东省揭阳新华中学2024-2025学年高一下学期第一次月考化学试卷(含答案)
- 2024-2025学年河北省张家口市怀安县八年级(上)期末物理试卷(含答案)
- 2019-2025年军队文职人员招聘之军队文职法学题库综合试卷A卷附答案
- 餐饮厨房考试试题及答案
- 配对合同范本(2篇)
- 2025年度施工员(市政工程)专业技能知识考试题库及答案(一)
- 口腔牙周病知识培训课件
- 化学基本知识培训课件
- 私人酒窖租赁服务酒品保管免责
- 2025年中考百日誓师活动教师代表发言(三)
- 中国家用通风电器具制造行业分析报告
- 生物-天一大联考2025届高三四省联考(陕晋青宁)试题和解析
- 天津2025年天津市住房公积金管理中心招聘9人笔试历年参考题库附带答案详解-1
- 区间价格突破策略(TB版)
- 高中主题班会 远离背后“蛐蛐”课件-高二下学期人际交往主题班会
- 2024广西公务员考试及答案(笔试、申论A、B类、行测)4套 真题
- 2024年山东省济南市中考英语试题卷(含答案解析)
- 汽车坡道玻璃雨棚施工方案
- 新高考英语读后续写——人物描写高级表达素材
- EN10204-2004中文版
评论
0/150
提交评论