libraries/EtherShield/EtherShield.cpp
/**
 * Initialise the ENC28J60 using selectable chip select pin
 * Flash the 2 MagJack LEDs
 */
Initialise the ENC28J60 using selectable chip select pin
Flash the 2 MagJack LEDs
Initialise the ENC28J60 using selectable chip select pin Flash the 2 MagJack LEDs
void EtherShield::ES_enc28j60Init( uint8_t* macaddr, uint8_t csPin ) {
  enc28j60InitWithCs( macaddr, csPin );
  enc28j60clkout(2); 
  delay(10);
  for( int f=0; f<3; f++ ) {
  	enc28j60PhyWrite(PHLCON,0x3880);
  	delay(500);
  	enc28j60PhyWrite(PHLCON,0x3990);
  	delay(500);
  }
  enc28j60PhyWrite(PHLCON,0x3476);
  delay(100);
}
void EtherShield :: ES_enc28j60Init ( uint8_t * macaddr , uint8_t csPin ) { enc28j60InitWithCs ( macaddr , csPin ) ; enc28j60clkout ( 2 ) ; delay ( 10 ) ; for ( int f = 0 ; f < 3 ; f ++ ) { enc28j60PhyWrite ( PHLCON , 0x3880 ) ; delay ( 500 ) ; enc28j60PhyWrite ( PHLCON , 0x3990 ) ; delay ( 500 ) ; } enc28j60PhyWrite ( PHLCON , 0x3476 ) ; delay ( 100 ) ; }
Initialise the ENC28J60 using selectable chip select pin
 Flash the 2 MagJack LEDs
Initialise the ENC28J60 using selectable chip select pin Flash the 2 MagJack LEDs
/*initialize enc28j60*/ // change clkout from 6.25MHz to 12.5MHz // 0x880 is PHLCON LEDB=on, LEDA=on // enc28j60PhyWrite(PHLCON,0b0011 1000 1000 00 00); // 0x990 is PHLCON LEDB=off, LEDA=off // enc28j60PhyWrite(PHLCON,0b0011 1001 1001 00 00); // 0x476 is PHLCON LEDA=links status, LEDB=receive/transmit // enc28j60PhyWrite(PHLCON,0b0011 0100 0111 01 10);