Orthogonal-Systems / ocs-base

Base repository structure for open control systems (OCS) projects
Other
0 stars 1 forks source link

ENC28J60 fails to configure if AMC7812.begin() is not run first #2

Open mfe5003 opened 8 years ago

mfe5003 commented 8 years ago

only tested on VMEMega v1a

mfe5003 commented 8 years ago

The issue is caused since SPI bus has multiple slave devices and output pins default to LOW logic level.

In order to fix it all that is required is to set pin 41 on the VMEMega v1a (PORTG PIN0) to high before attempting to setup the ENCJ chip. Pin 41 is the AMC7812 CS pin in the current configuration.

digitalWrite(41,HIGH);

or

PORTG |= (1<<0);

before:

Ethernet.begin(mac);

For a long term fix we should take care to initialize the default daughter board SPI CS pin location on the final design to high somewhere convenient.