English
Language : 

PIC18F97J60_11 Datasheet, PDF (233/492 Pages) Microchip Technology – 64/80/100-Pin, High-Performance, 1-Mbit Flash Microcontrollers with Ethernet
PIC18F97J60 FAMILY
To read from a PHY register:
1. Write the address of the PHY register to be read
into the MIREGADR register.
2. Set the MIIRD bit (MICMD<0>). The read
operation begins and the BUSY bit (MISTAT<0>)
is set after two TCY.
3. Wait 10.24 s, then poll the BUSY bit to be
certain that the operation is complete. When the
MAC has obtained the register contents, the
BUSY bit will clear itself. While BUSY is set, the
user application should not start any MIISCAN
operations or write to the MIWRH register.
4. Clear the MIIRD bit.
5. Read the entire 16 bits of the PHY register from
the MIRDL and MIRDH registers.
To write to a PHY register:
1. Write the address of the PHY register to be
written into the MIREGADR register.
2. Write the lower 8 bits of data to write into the
MIWRL register.
3. Write the upper 8 bits of data to write into the
MIWRH register. Writing to this register auto-
matically begins the MII transaction, so it must
be written to after MIWRL. The BUSY bit is set
automatically after two TCY.
The PHY register is written after the MII operation
completes, which takes 10.24 s. When the write
operation has completed, the BUSY bit will clear itself.
The application should not start any MII scan or read
operations while busy.
When a PHY register is written to, the entire 16 bits are
written at once; selective bit and/or byte writes are not
implemented. If it is necessary to reprogram only select
bits in the register, the controller must first read the
PHY register, modify the resulting data and then write
the data back to the PHY register.
The MAC can also be configured to perform automatic
back-to-back read operations on a PHY register. To
perform this scan operation:
1. Write the address of the PHY register to be
scanned into the MIREGADR register.
2. Set the MIISCAN bit (MICMD<1>). The scan
operation begins and the BUSY bit is set after
two TCY.
After MIISCAN is set, the NVALID (MISTAT<2>), SCAN
and BUSY bits are also set. The first read operation will
complete after 10.24 s. Subsequent reads will be
done and the MIRDL and MIRDH registers will be con-
tinuously updated automatically at the same interval
until the operation is cancelled. The NVALID bit may be
polled to determine when the first read operation is
complete.
There is no status information which can be used to
determine when the MIRD registers are updated. Since
only one MII register can be read at a time, it must not
be assumed that the values of MIRDL and MIRDH
were read from the PHY at exactly the same time
during a scan operation.
MIISCAN should remain set as long as the scan
operation is desired. The BUSY and SCAN bits are
automatically cleared after MIISCAN is set to ‘0’ and
the last read sequence is completed. MIREGADR
should not be updated while MIISCAN is set.
Starting new PHY operations, such as a read operation
or writing to the MIWRH register, must not be done
while a scan is underway. The operation can be
cancelled by clearing the MIISCAN bit and then polling
the BUSY bit. New operations may be started after the
BUSY bit is cleared.
 2011 Microchip Technology Inc.
DS39762F-page 233