




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
精品文档-下载后可编辑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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 海南温室大棚管理办法
- 海南诚信评价管理办法
- 基于神经网络的智能车辆运动规划与控制研究
- 绿色疗法线粒体修复疗法行业探索
- 采茶厂产品价格调整备案登记制度
- 采茶厂现金流预测模型更新机制
- 露营地住宿线上推广行业深度调研及发展项目商业计划书
- 战斗英雄黄继光在歌剧《同心结》中的角色塑造
- 游资通道账户管理办法
- 湖北加班管理暂行办法
- 潍坊交通发展集团有限公司招聘笔试题库2025
- 2025年粮油仓储管理员职业技能竞赛参考试题库(含答案)
- 胸痛中心质控管理
- 第七章城市轨道交通屏蔽门设备接口68课件
- 国家开放大学汉语言文学本科《中国现代文学专题》期末纸质考试第三大题分析题库2025春期版
- 成都大学附属中学英语新初一分班试卷含答案
- 创新创业大赛项目商业计划书模板
- 2025年1月国家开放大学汉语言文学本科《心理学》期末纸质考试试题及答案
- 糖尿病酮症酸中毒疑难病例护理
- 2025年河南省豫地科技集团有限公司招聘笔试参考题库含答案解析
- 居民生活垃圾转运投标方案(技术方案)
评论
0/150
提交评论