版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
精品文档-下载后可编辑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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 高职护理感染控制
- 汽车电子电池项目可行性研究报告
- 2026年生理学基础知识考核题库
- 2026年农产品质量安全法普法宣传题库
- 2026年电子竞技产业发展问题探讨
- 2026年外协人员入厂安全教育与现场监管测试
- 护理查对制度智能化
- 2026年新区公共卫生应急体系创新知识试题
- 你可以永远相信我演讲稿
- 2026年仓储物流场所防火间距及堆垛题库
- 高素质农民培训项目总结
- 纤维肌痛综合征的诊断和症状缓解
- 高三化学二轮轮复习示范课 电化学原理及其应用
- 小学心理健康教育-六年级心理健康《做情绪的主人》教学课件设计
- 第三节 中国古典园林构景手法
- 《检具设计标准》
- GB/T 39654-2020品牌评价原则与基础
- GB/T 37459-2019自升式平台升降装置安装要求
- 知识管理概述(精品、全面)课件
- 《全国数据中心应用发展指引(2022)》发布
- 多倍体与单倍体育种课件
评论
0/150
提交评论