0

I have Arduino Nano "clone" which I would like to use with Ethernet ENC28J60 shield. I have noticed that when I include/use UIPEthernet.h library, build-in LED does not work properly. I have written the following sketch which I have uploaded to Arduino and run both with and without Ethernet shield with the same result: LED is not blinking. Once I comment out the line Ethernet.begin(mac), LED starts blinking just fine.

Is there any way to overcome this conflict?

#include <UIPEthernet.h>
EthernetClient ethClient;
uint8_t mac[6] = { 0x90, 0xA2, 0xDA, 0x0D, 0xE2, 0xCD };
void setup() {
 Serial.begin(115200);
 // If this line is commented, LED starts blinking:
 Ethernet.begin(mac);
 pinMode(LED_BUILTIN, OUTPUT);
 Serial.println(F("setup() done."));
}
void loop() {
 digitalWrite(LED_BUILTIN, HIGH);
 delay(1000);
 digitalWrite(LED_BUILTIN, LOW);
 delay(1000);
}

Arduino Nano + Ethernet ENC28J60 shield

asked Aug 11, 2019 at 12:42

1 Answer 1

2

No, you can't.

The LED is on pin 13. Pin 13 is the clock pin for SPI. The ENC28J60 is an SPI device.

You either have control over pin 13, or you have SPI. You can't have both.

answered Aug 11, 2019 at 12:55
1
  • Thanks for this information! Good to know that. Probably there is some way to "stop" Ethernet and start using LED? Unfortunately, I found no Ethernet.stop() or similar. Commented Aug 11, 2019 at 23:36

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.