Reading the RevID
At this point we have all the necessary code to change the dates with the controller, so we can read the EREVID register, situated in the 3rd bank, which contains the Chip review number.
In the example proposed, the register value is put on the PORTB, so, regarding the scheme, the RB0 pin would stay connected from INT, and TRISB set at zero.
The alternative, leaving int connected, it can shift PORTB to the left.
void main() {
encInit();
setBank(3);
PORTB = readETH(EREVID);
while (1);
}The completed code is added at this article.
|