网站首页
IC库存
IC展台
电子资讯
技术资料
PDF文档
我的博客
IC72论坛
ic72 logo
搜索关键字: 所有资讯 行业动态 市场趋势 政策法规 新品发布 技术资讯 价格快报 展会资讯
  • 达普IC芯片交易网 > 新闻中心 > 技术信息 > 正文
  • RSS
  • DS26303 LIU的初始化和配置
    http://www.ic72.com 发布时间:2007/4/23 11:41:04

    引言
    在为一个新设计的电信系统开发软件时,最棘手的任务莫过于实现基本的设备操作。DS26303收发器的大量功能和多端口操作使软件开发更趋复杂。 为了方便初期系统开发,Dallas Semiconductor公司提供了C风格范例代码,它可以在T1或E1模式下初始化设备,软件开发人员只需针对所需的操作修改代码,或编写与特定系统相关的功能。一旦代码编译完毕,即可载入系统进行测试与评估。需要注意的是DS26303有两个版本,分别是DS26303-120和DS26303-75。它们的区别很小,只会影响到几个设置,因此需要弄清楚设计中用到的是哪个器件。

    代码范例


    图1中所示的范例代码在稍加修改之后就可以正确编译以供目标系统使用。'write(address,data)'和'wait(milliseconds)'两个函数调用过程与系统相关,因此需要根据所用的微处理器编写。该代码假定设备被映射到16位的本地总线(地址偏移0x0000),并且设备的数据总线为8位。 对于其他情况,则需要修改代码或编写函数调用来解决。此段代码还包含某些寄存器的多种不同设置,从而为开发人员提供了时钟频率、线路编码等参数的多种选择。虽然包含了大量的基本功能,但该代码并不完备。当需要实现其他附加功能时,请参考数据资料。

    /*
    Configuration Example For DS26303-120 running in E1 mode.

    This Example assumes E1 operation so the function call for T1/J1 configuration
    has been commented out. Simply comment out the E1 configuration function
    call and uncomment the T1 configuration function call for T1 operation. An
    individual function call for J1 operation is not present because it is very
    similar to T1 operation and could easily be implemented in that function.

    This file follows C style conventions. However actual code for the function
    calls listed below are implementation specific and need to be added:

    Function Calls: write(address, data), wait(milliseconds)


    The following comments only indicate some of the possible clock sources
    that can be used for either E1 or T1/J1 operation.

    Master clock configuration can use multiples of n = 1, 2, 4, or 8
    MCLK = Can be a n x 1.544 or n x 2.048 MHz signal for E1 or T1/J1 Operation

    TCLK = Must be a 2.048 MHz Signal for E1 Operation
    TCLK = Must be a 1.544 MHz signal for T1/J1 Operation
    */

    void initialization_main()
    {
    /* Global Initialization Begin */

    /* Reset all channels to their default values */
    write(0x001F, 0x00); // ADDP, Set Address Pointer to Primary Register Bank
    Write(0x000A, 0xFF); // SWR, Reset All Channels

    /* Wait 1 ms for reset to complete */
    wait (1);

    /* The Master Clock Select Register is important for proper */
    /* device operation consult the data sheet for all possible configurations. */
    write(0x001F, 0x01); // ADDP, Set Address Pointer to Individual LIU Register Bank
    write(0x0006, 0x00); // MC, E1 Mode Only MCLK-2.048, TECLK & CLKA Disabled
    // write(0x0006, 0x00); // MC, T1/J1 Mode Only MCLK-1.544, TECLK & CLKA Disabled

    // write(0x0006, 0x03); // MC, T1/J1 or E1 Mode MCLK-1.544, TECLK & CLKA Disabled
    // write(0x0006, 0x07); // MC, T1/J1 or E1 Mode MCLK-3.088, TECLK & CLKA Disabled
    // write(0x0006, 0x0B); // MC, T1/J1 or E1 Mode MCLK-6.176, TECLK & CLKA Disabled
    // write(0x0006, 0x0F); // MC, T1/J1 or E1 Mode MCLK-12.352, TECLK & CLKA Disabled

    // write(0x0006, 0x01); // MC, T1/J1 or E1 Mode MCLK-2.048, TECLK & CLKA Disabled
    // write(0x0006, 0x05); // MC, T1/J1 or E1 Mode MCLK-4.096, TECLK & CLKA Disabled
    // write(0x0006, 0x09); // MC, T1/J1 or E1 Mode MCLK-8.192, TECLK & CLKA Disabled
    // write(0x0006, 0x0D); // MC, T1/J1 or E1 Mode MCLK-16.384, TECLK & CLKA Disabled

    /* Wait 1 ms for clock to settle after configuration */
    wait (1);

    /* The GC register is able to globally CONTROL the AIS During LOS, Short Circuit */
    /* Protection, LINE Coding, JA Depth, JA Position, and JA Enable functions */
    write(0x001F, 0x00); // ADDP, Set Address Pointer to Primary Register Bank
    write(0x000F, 0x80); // GC, Enable RX Internal Impedance, Disable Global CONTROLs


    /* Global Initialization Complete */


    /* Configuration Begin */

    e1_configure();

    // t1_configure();

    /* Configuration Complete */
    }

    void e1_configure()
    {
    /* E1 Initilization Begin */

    /* This function assumes all ports are configured identically. Otherwise, */
    /* the function needs to be revised to support individual port addressing */
    /* and identification. */

    /* Configure analog, remote, or digital loopback as necessary */
    write(0x001F, 0x00); // ADDP, Set Address Pointer to Primary Register Bank
    write(0x0001, 0x00); // ALBC, Disable Analog Loopback for 8 Channels
    // write(0x0001, 0xFF); // ALBC, Enable Analog Loopback for 8 Channels
    write(0x0002, 0x00); // RLBC, Disable Remote Loopback for 8 Channels
    // write(0x0002, 0xFF); // RLBC, Enable Remote Loopback for 8 Channels
    write(0x000C, 0x00); // DLBC, Disable Digital Loopback for 8 Channels
    // write(0x000C, 0xFF); // DLBC, Enable Digital Loopback for 8 Channels

    /* Configure LOS / AIS criteria in E1 mode */
    write(0x001F, 0x00); // ADDP, Set Address Pointer to Primary Register Bank
    write(0x000D, 0x00); // LASCS, Use G.775 Criteria for 8 Channels
    // write(0x000D, 0xFF); // LASCS, Use ETSI 300233 Criteria for 8 Channels

    write(0x001F, 0x00); // ADDP, Set Address Pointer to Primary Register Bank
    write(0x0003, 0x00); // TAOE, Disable Transmit All Ones for 8 Channels
    // write(0x0003, 0xFF); // TAOE, Enable Transmit All Ones for 8 Channels

    write(0x001F, 0x00); // ADDP, Set Address Pointer to Primary Register Bank
    write(0x000E, 0x00); // ATAOS, Disable Automatic Transmit All Ones for 8 Channels
    // write(0x000E, 0xFF); // ATAOS, Enable Automatic Transmit All Ones for 8 Channels

    write(0x001F, 0x00); // ADDP, Set Address Pointer to Primary Register Bank
    write(0x0012, 0x00); // OEB, Disable TX Output High Impedance for 8 Channels
    // write(0x0012, 0xFF); // OEB, Enable TX Output High Impedance for 8 Channels

    write(0x001F, 0xAA); // ADDP, Set Address Pointer to Secondary Register Bank
    write(0x0003, 0x00); // RPDE, Disable Receive Power-Down for 8 Channels
    // write(0x0003, 0xFF); // RPDE, Enable Receive Power-Down for 8 Channels

    write(0x001F, 0xAA); // ADDP, Set Address Pointer to Secondary Register Bank
    write(0x0004, 0x00); // TPDE, Disable Transmit Power-Down for 8 Channels
    // write(0x0004, 0xFF); // TPDE, Enable Transmit Power-Down for 8 Channels

    /* In single rail mode (SMRS register) with HDB3/B8ZS (LCS register) enabled, */
    /* the EZDE and CVDEB registers can enable the excessive zero and code */
    /* violation detection output on the RNEG pin. */
    write(0x001F, 0xAA); // ADDP, Set Address Pointer to Secondary Register Bank
    // write(0x0000, 0x00); // SRMS, Disable Single Rail Mode I/O for 8 Channels
    write(0x0000, 0xFF); // SRMS, Enable Single Rail Mode I/O for 8 Channels

    write(0x001F, 0xAA); // ADDP, Set Address Pointer to Secondary Register Bank
    write(0x0005, 0x00); // EZDE, Disable Excessive Zero Detect for 8 Channels
    // write(0x0005, 0xFF); // EZDE, Enable Excessive Zero Detect for 8 Channels

    write(0x001F, 0xAA); // ADDP, Set Address Pointer to Secondary Register Bank
    write(0x0006, 0x00); // CVDEB, Enable Code Violation Detect for 8 Channels
    // write(0x0006, 0xFF); // CVDEB, Disable Code Violation Detect for 8 Channels

    /* The following six functions can be CONTROLled individually on a per channel */
    /* basis or globally using the GC register. The IAISEL, ISCPD, LCS, IJAFDS, */
    /* IJAPS, and IJAE are ignored when the corresponding function in the GC */
    /* register is enabled. */
    write(0x001F, 0x01); // ADDP, Set Address Pointer to Individual Register Bank
    write(0x0005, 0x00); // IAISEL, Disable Indiv AIS During LOS for 8 Channels
    // write(0x0005, 0xFF); // IAISEL, Enable Indiv AIS During LOS for 8 Channels

    write(0x001F, 0x01); // ADDP, Set Address Pointer to Individual Register Bank
    write(0x0004, 0x00); // ISCPD, Enable Indiv Short Protection for 8 Channels
    // write(0x0004, 0xFF); // ISCPD, Disable Indiv Short Protection for 8 Channels

    write(0x001F, 0xAA); // ADDP, Set Address Pointer to Secondary Register Bank
    write(0x0001, 0x00); // LCS, Enable B8ZS/HDB3 Operation for 8 Channels
    // write(0x0001, 0xFF); // LCS, Enable AMI Operation for 8 Channels

    write(0x001F, 0x01); // ADDP, Set Address Pointer to Individual Register Bank
    // write(0x0002, 0x00); // IJAFDS, Indiv JA 32 Bit Depth for 8 Channels
    write(0x0002, 0xFF); // IJAFDS, Indiv JA 128 Bit Depth for 8 Channels

    write(0x001F, 0x01); // ADDP, Set Address Pointer to Individual Register Bank
    // write(0x0001, 0x00); // IJAPS, Indiv JA Transmit Path for 8 Channels
    write(0x0001, 0xFF); // IJAPS, Indiv JA Receive Path for 8 Channels

    write(0x001F, 0x01); // ADDP, Set Address Pointer to Individual Register Bank
    // write(0x0000, 0x00); // IJAE, Disable Indiv Jitter Attenuator for 8 Channels
    write(0x0000, 0xFF); // IJAE, Enable Indiv Jitter Attenuator for 8 Channels

    /* Configure all channels for a E1 pulse template output. This example uses */
    /* the DS26303-120 device so, TS.TIMPRM = 0 for 120 ohm LINE impedances. If */
    /* the device were a DS26303-75, TS.TIMPRM = 1 for 120 ohm LINE impedances. */
    write(0x001F, 0x00); // ADDP, Set Address Pointer to Primary Register Bank

    Write(0x0010, 0x00) // TST, Select Channel 1 for Template Configuration
    Write(0x0011, 0x00) // TS, E1 Mode 120 ohm G.703 TX/RX Impedance Match

    Write(0x0010, 0x01) // TST, Select Channel 2 for Template Configuration
    Write(0x0011, 0x00) // TS, E1 Mode 120 ohm G.703 TX/RX Impedance Match

    Write(0x0010, 0x02) // TST, Select Channel 3 for Template Configuration
    Write(0x0011, 0x00) // TS, E1 Mode 120 ohm G.703 TX/RX Impedance Match

    Write(0x0010, 0x03) // TST, Select Channel 4 for Template Configuration
    Write(0x0011, 0x00) // TS, E1 Mode 120 ohm G.703 TX/RX Impedance Match

    Write(0x0010, 0x04) // TST, Select Channel 5 for Template Configuration
    Write(0x0011, 0x00) // TS, E1 Mode 120 ohm G.703 TX/RX Impedance Match

    Write(0x0010, 0x05) // TST, Select Channel 6 for Template Configuration
    Write(0x0011, 0x00) // TS, E1 Mode 120 ohm G.703 TX/RX Impedance Match

    Write(0x0010, 0x06) // TST, Select Channel 7 for Template Configuration
    Write(0x0011, 0x00) // TS, E1 Mode 120 ohm G.703 TX/RX Impedance Match

    Write(0x0010, 0x07) // TST, Select Channel 8 for Template Configuration
    Write(0x0011, 0x00) // TS, E1 Mode 120 ohm G.703 TX/RX Impedance Match
    }

    void t1_configure()
    {
    /* T1 Initilization Begin */

    /* This function assumes all ports are configured identically. Otherwise, */
    /* the function needs to be revised to support individual port addressing */
    /* and identification. */

    /* Configure analog, remote, or digital loopback as necessary */
    write(0x001F, 0x00); // ADDP, Set Address Pointer to Primary Register Bank
    write(0x0001, 0x00); // ALBC, Disable Analog Loopback for 8 Channels
    // write(0x0001, 0xFF); // ALBC, Enable Analog Loopback for 8 Channels
    write(0x0002, 0x00); // RLBC, Disable Remote Loopback for 8 Channels
    // write(0x0002, 0xFF); // RLBC, Enable Remote Loopback for 8 Channels
    write(0x000C, 0x00); // DLBC, Disable Digital Loopback for 8 Channels
    // write(0x000C, 0xFF); // DLBC, Enable Digital Loopback for 8 Channels

    write(0x001F, 0x00); // ADDP, Set Address Pointer to Primary Register Bank
    write(0x0003, 0x00); // TAOE, Disable Transmit All Ones for 8 Channels
    // write(0x0003, 0xFF); // TAOE, Enable Transmit All Ones for 8 Channels

    write(0x001F, 0x00); // ADDP, Set Address Pointer to Primary Register Bank
    write(0x000E, 0x00); // ATAOS, Disable Automatic Transmit All Ones for 8 Channels
    // write(0x000E, 0xFF); // ATAOS, Enable Automatic Transmit All Ones for 8 Channels

    write(0x001F, 0x00); // ADDP, Set Address Pointer to Primary Register Bank
    write(0x0012, 0x00); // OEB, Disable TX Output High Impedance for 8 Channels
    // write(0x0012, 0xFF); // OEB, Enable TX Output High Impedance for 8 Channels

    write(0x001F, 0xAA); // ADDP, Set Address Pointer to Secondary Register Bank
    write(0x0003, 0x00); // RPDE, Disable Receive Power-Down for 8 Channels
    // write(0x0003, 0xFF); // RPDE, Enable Receive Power-Down for 8 Channels

    write(0x001F, 0xAA); // ADDP, Set Address Pointer to Secondary Register Bank
    write(0x0004, 0x00); // TPDE, Disable Transmit Power-Down for 8 Channels
    // write(0x0004, 0xFF); // TPDE, Enable Transmit Power-Down for 8 Channels

    /* In single rail mode (SMRS register) with HDB3/B8ZS (LCS register) enabled, */
    /* the EZDE and CVDEB registers can enable the excessive zero and code */
    /* violation detection output on the RNEG pin. */
    write(0x001F, 0xAA); // ADDP, Set Address Pointer to Secondary Register Bank
    // write(0x0000, 0x00); // SRMS, Disable Single Rail Mode I/O for 8 Channels
    write(0x0000, 0xFF); // SRMS, Enable Single Rail Mode I/O for 8 Channels

    write(0x001F, 0xAA); // ADDP, Set Address Pointer to Secondary Register Bank
    write(0x0005, 0x00); // EZDE, Disable Excessive Zero Detect for 8 Channels
    // write(0x0005, 0xFF); // EZDE, Enable Excessive Zero Detect for 8 Channels

    write(0x001F, 0xAA); // ADDP, Set Address Pointer to Secondary Register Bank
    write(0x0006, 0x00); // CVDEB, Enable Code Violation Detect for 8 Channels
    // write(0x0006, 0xFF); // CVDEB, Disable Code Violation Detect for 8 Channels

    /* The following six functions can be CONTROLled individually on a per channel */
    /* basis or globally using the GC register. The IAISEL, ISCPD, LCS, IJAFDS, */
    /* IJAPS, and IJAE are ignored when the corresponding function in the GC */
    /* register is enabled. */
    write(0x001F, 0x01); // ADDP, Set Address Pointer to Individual Register Bank
    write(0x0005, 0x00); // IAISEL, Disable Indiv AIS During LOS for 8 Channels
    // write(0x0005, 0xFF); // IAISEL, Enable Indiv AIS During LOS for 8 Channels

    write(0x001F, 0x01); // ADDP, Set Address Pointer to Individual Register Bank
    write(0x0004, 0x00); // ISCPD, Enable Indiv Short Protection for 8 Channels
    // write(0x0004, 0xFF); // ISCPD, Disable Indiv Short Protection for 8 Channels

    write(0x001F, 0xAA); // ADDP, Set Address Pointer to Secondary Register Bank
    write(0x0001, 0x00); // LCS, Enable B8ZS/HDB3 Operation for 8 Channels
    // write(0x0001, 0xFF); // LCS, Enable AMI Operation for 8 Channels

    write(0x001F, 0x01); // ADDP, Set Address Pointer to Individual Register Bank
    // write(0x0002, 0x00); // IJAFDS, Indiv JA 32 Bit Depth for 8 Channels
    write(0x0002, 0xFF); // IJAFDS, Indiv JA 128 Bit Depth for 8 Channels

    write(0x001F, 0x01); // ADDP, Set Address Pointer to Individual Register Bank
    // write(0x0001, 0x00); // IJAPS, Indiv JA Transmit Path for 8 Channels
    write(0x0001, 0xFF); // IJAPS, Indiv JA Receive Path for 8 Channels

    write(0x001F, 0x01); // ADDP, Set Address Pointer to Individual Register Bank
    // write(0x0000, 0x00); // IJAE, Disable Indiv Jitter Attenuator for 8 Channels
    write(0x0000, 0xFF); // IJAE, Enable Indiv Jitter Attenuator for 8 Channels

    /* Configure all channels for a T1 pulse template output */
    write(0x001F, 0x00); // ADDP, Set Address Pointer to Primary Register Bank

    Write(0x0010, 0x00) // TST, Select Channel 1 for Template Configuration
    Write(0x0011, 0x07) // TS, T1 Mode 100 ohm 533-655 ft. TX/RX Impedance Match

    Write(0x0010, 0x01) // TST, Select Channel 2 for Template Configuration
    Write(0x0011, 0x07) // TS, T1 Mode 100 ohm 533-655 ft. TX/RX Impedance Match

    Write(0x0010, 0x02) // TST, Select Channel 3 for Template Configuration
    Write(0x0011, 0x07) // TS, T1 Mode 100 ohm 533-655 ft. TX/RX Impedance Match

    Write(0x0010, 0x03) // TST, Select Channel 4 for Template Configuration
    Write(0x0011, 0x07) // TS, T1 Mode 100 ohm 533-655 ft. TX/RX Impedance Match

    Write(0x0010, 0x04) // TST, Select Channel 5 for Template Configuration
    Write(0x0011, 0x07) // TS, T1 Mode 100 ohm 533-655 ft. TX/RX Impedance Match

    Write(0x0010, 0x05) // TST, Select Channel 6 for Template Configuration
    Write(0x0011, 0x07) // TS, T1 Mode 100 ohm 533-655 ft. TX/RX Impedance Match

    Write(0x0010, 0x06) // TST, Select Channel 7 for Template Configuration
    Write(0x0011, 0x07) // TS, T1 Mode 100 ohm 533-655 ft. TX/RX Impedance Match

    Write(0x0010, 0x07) // TST, Select Channel 8 for Template Configuration
    Write(0x0011, 0x07) // TS, T1 Mode 100 ohm 533-655 ft. TX/RX Impedance Match




    上一篇:通信原理 绪论(1)
    下一篇:ISDN综述(三)
    www.ic72.com 达普IC芯片交易网
  • 行业动态
  • 市场趋势
  • 政策法规
  • 新品发布
  • Baidu

    IC快速检索:abcdefghijklmnopqrstuvwxyz0123456789
    COPYRIGHT:(1998-2010) IC72 达普IC芯片交易网
    客户服务:service@IC72.com 库存上载:IC72@IC72.com
    (北京)联系方式: 在线QQ咨询:点击这里给我发消息 联系电话:010-82614113 传真:010-82614123
    京ICP备06008810号-21 京公网安备 11010802032910 号 企业资质