![](https://csdnimg.cn/release/download_crawler_static/10394294/bg6.jpg)
聯傑國際股份有限公司 07/06/082001
6
3. How to access Serial EEPROM (SROM)
DAVICOM DM9000 supports the Serial EEPROM (SROM) interface of 93C46 and
provides a very easy method to access it.
DM9000 NIC takes care all detail steps, so YOU just R/W the 0Bh~0Eh registers
which map on the 93C46 address to really READ / WRITE word data in SROM.
93C46 is a 64 word SROM (1024 bits) and its word address maps on DM9000
REG_0C 6 bits of bit5:0, but REG_0C bit7:6 are “don’t care” for SROM access.
3-1. How to READ SROM
SROM READ steps:
1. WRITE the word address, you want to READ from, into REG_0C.
2. WRITE 04h into REG_0B to start the SROM READ operation:
REG_0B bit[3] = 0: Select Serial EEPROM Mode (SROM Mode is normal 0).
REG_0B bit[2] = 1: Issue READ command of Serial EEPROM / PHY.
3. READ REG_0B and WAIT until ERRE bit[0] = 0 OK or following step 4.
4. WAIT at least 150uS then WRITE 0 into REG_0B to clear READ command.
5. READ: the SROM data High_byte is in REG_0E and Low_byte is in REG_0D.
For example:
READ SROM word address 2 (map to Address 4&5 of MAC Address):
1. WRITE 02h to REG_0C
iow(IOaddr, 0x0C, 2h);
2. WRITE 04h to REG_0B
iow(IOaddr, 0x0B, 4h);
3. WAIT until REG_0B ERRE bit[0] = 0 OK or following step 4
do {} while( (READ_REG= ior(IOaddr, 0x0B) ) &1 ); /* DETECT SROM Ready */
4. DELAY at least 150uS then WRITE 0 to REG_0B
delay(150);
iow(IOaddr, 0x0B, 0);
5. REG_0E keeps the SROM data High_byte for you to READ it
READ_High_Byte_Reg = ior(IOaddr, 0x0E);
6. REG_0D keeps the SROM data Low_byte for you to READ it
READ_Low_Byte_Reg = ior(IOaddr, 0x0D);