本帖最后由 a32425262 于 2015-11-3 15:16 编辑
[ 本帖最后由 a32425262 于 2015-11-3 15:15 编辑 ]\n\ntgwfcc 发表于 2015-10-31 14:50
当时没研究懂就放着了,我记得要改个宏,改成MII模式,具体的我也忘了,如果你比较懂单片机,可以研究下 ...
解决了,修改三个寄存器
/** @defgroup PHY_status_register
* @{
*/
/* The PHY status register value change from a PHY to another so the user have
to update this value depending on the used external PHY */
/**
* @brief For LAN8700
*/
//#define PHY_SR 31 /*!< Tranceiver Status Register */
/**
* @brief For DP83848
*/
//#define PHY_SR 16 /*!< Tranceiver Status Register */
/**
* @brief For DM9161
*/
#define PHY_SR 17 /*!< Tranceiver Status Register */
/* The Speed and Duplex mask values change from a PHY to another so the user have to update
this value depending on the used external PHY */
/**
* @brief For LAN8700
*/
//#define PHY_Speed_Status ((u16)0x0004) /*!< Configured information of Speed: 10Mbps */
//#define PHY_Duplex_Status ((u16)0x0010) /*!< Configured information of Duplex: Full-duplex */
/**
* @brief For DP83848
*/
//#define PHY_Speed_Status ((u16)0x0002) /*!< Configured information of Speed: 10Mbps */
//#define PHY_Duplex_Status ((u16)0x0004) /*!< Configured information of Duplex: Full-duplex */
/**
* @brief For DM9161
*/
#define PHY_Speed_Status ((u16)0x3000) /*!< Configured information of Speed: 10Mbps */
#define PHY_Duplex_Status ((u16)0xA000) /*!< Configured information of Duplex: Full-duplex */
还有就是根据自己板子的硬件连接确定 PHY_ADDRESS,由RX0-RX3和CSR这几个脚组成PHYADDR0-4
芯片复位时,会锁存这5个脚的电平,作为芯片地址,以后就找这个作访问了。
所以,如果你是悬空的话,认为是0,一定要接1才认为是1我的是悬空的,都是00
//#define DP83848_PHY /* Ethernet pins mapped on STM3210C-EVAL Board */
#define PHY_ADDRESS 0x00 /* Relative to STM3210C-EVAL Board */
改完上面几个地方就可以使用了
|