导航: 老古网老古论坛XMOS公共讨论区XMOS开源项目区单片机程序设计嵌入式系统广告区域
→寄存器已经能正常控制但8019还不能正常工作

* 99728: RTL8019问题

   lwen1999 
lwen1999发表的帖子 

 寄存器已经能正常控制但8019还不能正常工作
寄存器的问题已经解决但初始化后收不到网络信号。还不能正常工作。int dly; 

 REG00=0x21;    // Stop RTL8019 before initiation.

    for(dly = 50000; dly >   0; dly--);;;  //  The delay time will be replaced by OSTimeDly().
    
 EthPageSel(0);

    REG01 = 0x4C;        // Page Start Register. The Page Start register sets the start page address of
                         // the receive buffer ring.
 REG02 = 0x60;        // Page Stop Register. The Page Stop register sets the stop page address of the 
                      // receive buffer ring.  In 8 bit mode the PSTOP register should not exceed to 0x60, 
       // in 16 bit mode the PSTOP register should not exceed to 0x80.
 REG03 = 0x4C;//5F;  // Boundary Register (03H; Type=R/W in Page0)
                         // This register is used to prevent overwrite of the receive buffer ring. It is 
       // typically used as a pointer indicating the last receive buffer page the host has read.
 REG04 = 0x40;        // Transmit Page Start Register (04H; Type=W in Page0)
                         // This register sets the start page address of the packet to the transmitted.
 REG07 = 0xFF;      // ISR: Interrupt Status Register (07H; Type=R/W in Page0)
                         // This register reflects the NIC status. The host reads it to determine the cause of
       // an interrupt.Individual bits are cleared by writing a "1" into the corresponding bit. 
       // It must be cleared after power up.
 REG0A = 0x00;
 REG0B = 0x00;        // These two registers set the data byte counts of remote DMA.
                         // to debug the connection freely, the NIC is configed as receiving any data from MAC.
    REG0C = 0xC4;      // RCR: Receive Configuration Register (0CH; Type=W in Page0, Type=R in Page2)   

 REG0D = 0xE0;        // TCR: Transmit Configuration Register (0DH; Type=W in Page0, Type=R in Page2)
 REG0E = 0xC8;   // DCR: Data Configuration Register (0EH; Type=W in Page0, Type=R in Page2)
 REG0F = 0x00;   // IMR: Interrupt Mask Register (0FH; Type=W in Page0, Type=R in Page2)
                         // All bits correspond to the bits in the ISR register. POWER UP=all 0s. Setting individual
                         // bits will enable the corresponding interrupts.

    EthPageSel(1);
 REG07 = 0x4D;//4C;  // CURR: Current Page Register (07H; Type=R/W in Page1)
                         // This register points to the page address of the first receive buffer page to be used 
          // for a packet reception.
 REG08 = 0x00;      // MAR0-7: Multicast Address Register (08H - 0FH; Type=R/W in Page1)
                         // These REGisters provide filtering bits of multicast addresses hashed by the CRC logic.
 REG09 = 0x00;
 REG0A = 0x00;
 REG0B = 0x00; 
 REG0C = 0x00;
 REG0D = 0x00;
 REG0E = 0x00;
 REG0F = 0x00;

    EthCardAddrLoad();     // 将网卡地址写入到mar寄存器  
   
    EthPageSel(0);
 REG0C = 0xCC;   //将网卡设置成正常的模式,跟外部网络连接
 REG0D = 0xE0;
 REG00 = 0x22;   // start RTL8019.
 REG07 = 0xFF;    //清除所有中断标志位
 REG0F = 0xFF;

发表时间:2006年11月18日10:23:28

  
回复该帖

本主题共有 3 帖,分页:>>>>>该主题的所有内容[3]条

 *树形目录 只列出部分跟帖的标题以及简单的摘要信息 该主题的部分跟帖如下:

[上一篇帖子]:用51编程控制大尺寸彩色LCD --单片机的显卡--智能VGA控制板[upload=jpg
[下一篇帖子]:本人做过类似的方案老虎机的方案我以前做过,工作原理相似,不过我的是用在酒吧里面玩喝酒的,呵呵 /P