请问dp83848的软键复位与硬件复位为什么不同?

2019-07-21 08:59发布

看datasheet里有这样的叙述:
硬件复位时:This will reset the device such that all registers will be reinitialized to default values and the hardware configuration values will be re-latched into the device (similar to the power-up/reset operation).

软件复位时:The software reset will reset the device such that all registers will be reset to default values and the hardware configuration values will be maintained. Software driver code must wait 3 ?s following a software reset before allowing further serial MII operations with the DP83848C

区别在于the hardware configuration values will be re-latched 和the hardware configuration values will be maintained 

首先我不太明白all registers和the hardware configuration values 的区别。然后maintain是保持,re-latched从字面上看是重新锁存?
为什么不把软件复位和硬件复位做成效果一样的呢?还是因为软件复位和硬件复位有本质的区别?


友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
6条回答
XUZJWWSZ
2019-07-21 14:22
以太网部分我都是复制开发板带的例程,基本都是调用的库函数,代码出错的可能性很小。
下面是stm32软复位的代码:
void MCU_Reset(void)
{
        __disable_fault_irq();      // STM32 软复位  
        NVIC_SystemReset();
}

下面是以太网配置的部分代码:
进入:Ethernet_Configuration()
{
。。。。。。。。
。。。。。。。
。。。。。。
/* Reset ETHERNET on AHB Bus */
  ETH_DeInit();

  /* Software reset */
  ETH_SoftwareReset();
。。。。。。
。。。。。。
。。。。。。
。。。。。。
ETH_Init(Ð_InitStructure, HY_ADDRESS);
。。。。。。
。。。。。。
。。。。。



}
在ETH_Init(Ð_InitStructure, HY_ADDRESS)里
有如下代码:
 if(!(ETH_WritePHYRegister(PHYAddress, HY_BCR, HY_Reset)))
  {
    /* Return ERROR in case of write timeout */
    return ETH_ERROR;
  }
  
  /* Delay to assure HY reset */
  _eth_delay_(PHY_ResetDelay);


我相信ETH_WritePHYRegister(PHYAddress, HY_BCR, HY_Reset)这句就实现了DP83848的软复位。
头文件里有:
#define HY_BCR                          0          /*!< Tranceiver Basic Control Register */
#define HY_BSR                          1          /*!< Tranceiver Basic Status Register */
。。。。。
。。。。

#define HY_Reset                       ((u16)0x8000)      /*!< PHY Reset */
#define PHY_Loopback                    ((u16)0x4000)      /*!< Select loop-back mode */
#define PHY_FULLDUPLEX_100M             ((u16)0x2100)      /*!< Set the full-duplex mode at 100 Mb/s */
。。。。。。
。。。。。。
0x8000刚好把第15位置1,与手册中描述的软复位符合。

一周热门 更多>