Arduino Nano + ENC28J60 wiring

Hello arduino folks!

I got a question about how I should wire an Arduino Nano to an ENC28J60 ethernet module. Between them I'm going to use a logic level converter to make sure everything works nice and smooth. I'm pretty sure of how to wire three of the four wires, the SCLK, MOSI, MISO. Arduino Nano SCLK(Digital pin 13) -> Logic level converter RXI Pin -> ENC28J60 SCK Arduino Nano MOSI(Digital pin 11) -> Logic level converter TXO pin -> ENC28J60 ENC SI Arduino Nano MISO(Digital pin 12) -> Logic level converter TXO pin #2 -> ENC28J60 ENC SO

BUT how am I going to wire the ENC28J60 CS pin? some tutorials says, when using the UNO instead of the Nano, to wire it to pin #8 of the Arduino Uno. Soo.

  1. The CS pin from ENC28J60 goes to Arduin Nano pin number?...
  2. In which way is the data travelling? (So I know how to wire it to the Logic level converter)

Thanks in advance!

Archelon: I'm going to use a logic level converter to make sure everything works nice and smooth.

Why? The ENC28J60 doesn't need one. So adding unnecessary hardware means more chance for things to NOT go smooth.

Archelon: when using the UNO instead of the Nano, to wire it to pin #8 of the Arduino Uno. Soo.

CS isn't part of the SPI hardware so it can be any pin. It is defined by the code you use.

Archelon: 2. In which way is the data travelling? (So I know how to wire it to the Logic level converter)

MOSI Sends MISO Receives CLK and CS send, obviously

Thanks for your reply! [quote author=James C4S link=topic=220677.msg1605226#msg1605226 date=1393167690]

Archelon: I'm going to use a logic level converter to make sure everything works nice and smooth.

Why? The ENC28J60 doesn't need one. So adding unnecessary hardware means more chance for things to NOT go smooth. [/quote] Well, I'm going to power the arduino with a 7.5 V DC wall adapter and the ENC28J60 with 3Volts. I thought that the output signal from the ENC28J60 would be lower than 0.6*Vcc(7.5V)=4.5 which is required for the Arduino Nano to register a logic one? So I thought that I would need a logic level converter, if that's not the case may be you could explain it to me.

[quote author=James C4S link=topic=220677.msg1605226#msg1605226 date=1393167690]

Archelon: when using the UNO instead of the Nano, to wire it to pin #8 of the Arduino Uno. Soo.

CS isn't part of the SPI hardware so it can be any pin. It is defined by the code you use. [/quote] Alright, is the CS pin defined in the code or in the library? 'Cause I can't find where it's defined in the code when i for example look at the code in this tutorial.

[quote author=James C4S link=topic=220677.msg1605226#msg1605226 date=1393167690]

Archelon: 2. In which way is the data travelling? (So I know how to wire it to the Logic level converter)

MOSI Sends MISO Receives CLK and CS send, obviously [/quote] Thanks.

The CS Pin appears to be hardcoded in EtherCard.h as pin 8. You would have to change it there. Look for "csPin =8".

The ENC28J60 is 5V tolerant so level conversion isn't required. You'd have to poke into the ENC28J60 datasheet to find that stated.

Chagrin: The CS Pin appears to be hardcoded in EtherCard.h as pin 8. You would have to change it there. Look for "csPin =8".

Alright! thanks!

Chagrin: The ENC28J60 is 5V tolerant so level conversion isn't required. You'd have to poke into the ENC28J60 datasheet to find that stated.

alright so the ENC28J60 is 5V tolerant so the signals From the Arduino To the ENC28J60 will be registered and will not damage the module. BUT the signals From the ENC28J60 To the arduino, will the arduino register the signal despite the fact that it's 3.3volts? I read somewhere that a logic one/High must be 0.6*Vcc and in this case thats 0.6*7.5V=4.5V? Cause Vcc is the voltage input of the arduino Nano, in this case, right? And that's 7.5 Volts. :/ thanks

“Vin” is the input voltage; “Vcc” is the regulated voltage (5V). That makes your .6 * 5V = 2.5V which gives you plenty of room at 3.3V.

Chagrin: "Vin" is the input voltage; "Vcc" is the regulated voltage (5V). That makes your .6 * 5V = 2.5V which gives you plenty of room at 3.3V.

Great thanks! That solved a lot of problems and misunderstandings.

Chagrin: ... ... The ENC28J60 is 5V tolerant so level conversion isn't required. You'd have to poke into the ENC28J60 datasheet to find that stated.

what about for its own power supply ?

Operational • Two programmable LED outputs for LINK, TX, RX, collision and full/half-duplex status • Seven interrupt sources with two interrupt pins • 25MHz clock • Clock out pin with programmable prescaler • Operating voltage range of 3.14V to 3.45V • TTL level inputs • Temperature range: -40°C to +85°C Industrial, 0°C to +70°C Commercial (SSOP only) • 28-pin SPDIP, SSOP, SOIC, QFN packages

the Nano cannot supply 3.3V if it's not powered via the USB socket.

there's also this diagram from the datasheet;

retronet_RIMBA1ZO:

Chagrin:


The ENC28J60 is 5V tolerant so level conversion isn’t required. You’d have to poke into the ENC28J60 datasheet to find that stated.

what about for its own power supply ?

Operational
• Two programmable LED outputs for LINK, TX,
RX, collision and full/half-duplex status
• Seven interrupt sources with two interrupt pins
• 25MHz clock
• Clock out pin with programmable prescaler
Operating voltage range of 3.14V to 3.45V
• TTL level inputs
• Temperature range: -40°C to +85°C Industrial,
0°C to +70°C Commercial (SSOP only)
• 28-pin SPDIP, SSOP, SOIC, QFN packages

the Nano cannot supply 3.3V if it’s not powered via the USB socket.

I was thinking of using a 3.3V voltage regulator between the 7.5 V power source and the ENC28J60

retronet_RIMBA1ZO:
there’s also this diagram from the datasheet;

alright, two questions

  1. That’s what the datasheet says and it’s probably recommended but as we discussed in the previous posts, won’t the signal from the ENC28J60 be over the logic level threshold of 0.6*Vcc=2.5V?
  2. Why would you need to convert the INT0<-INT and INT1<-WOL? What does those pins mean and what’s their function?
    thanks!

Archelon:
I was thinking of using a 3.3V voltage regulator between the 7.5 V power source and the ENC28J60

heh-heh, i must be more of a newbie then, i was “spoiled” and just connected the 3V3 pin for the ENC28J60 VCC.
looks like i’ll have to get myself some voltage regulators for my Nano.

Archelon:

retronet_RIMBA1ZO:
there’s also this diagram from the datasheet;
<>

alright, two questions

  1. That’s what the datasheet says and it’s probably recommended but as we discussed in the previous posts, won’t the signal from the ENC28J60 be over the logic level threshold of 0.6*Vcc=2.5V?
  2. Why would you need to convert the INT0<-INT and INT1<-WOL? What does those pins mean and what’s their function?
    thanks!

i think #1 doesn’t change - the seniors have explained how the logic levels are matched up. my question was related to the power supply only.
#2 is quite advanced - that’s way beyond me :slight_smile:

WOL is wake-on-lan. INT is used for various events, such as when an ethernet link comes up or a wake-on-lan event occurs. I suppose they'd be helpful if you're running from battery and want to be able to put the MCU to sleep but I've never played with them myself.

retronet_RIMBA1ZO: there's also this diagram from the datasheet;

For a generic application note, of course they will suggest using a level shifter.

However in this specific case with the ATmega328, a shifter is not necessary. The threshold for a HIGH is sufficient for both 3V3 and 5V logic.

[quote author=James C4S link=topic=220677.msg1606989#msg1606989 date=1393274821]

retronet_RIMBA1ZO: there's also this diagram from the datasheet;

For a generic application note, of course they will suggest using a level shifter.

However in this specific case with the ATmega328, a shifter is not necessary. The threshold for a HIGH is sufficient for both 3V3 and 5V logic. [/quote] Thanks, that's what I was thinking.

Thanks for the explanation. I am going to connect the LAN module to MiniPro arduino clone, which doesn't even has the 3V3 pin, as it is missing the FTDL chip (source of the 3,3V on the Nano), and this discussion will help me to connect it.

Just allow me to state one little thing, which however does not have any impact to what's been already stated above. I just have the need to state, that 0.6x5V = 3V and not 2.5V as mentioned above. ;)

VanJ: Just allow me to state one little thing, which however does not have any impact to what's been already stated above. I just have the need to state, that 0.6x5V = 3V and not 2.5V as mentioned above. ;)

This is why I always show my work when I'm doing math. :blush:

Hi all!

You find wiring for more MCU-s (arduino nano, arduino pro mini, maple mini, ESP8266, NodeMCU): https://github.com/UIPEthernet/UIPEthernet/tree/master/hardware

You can download modified UIPEthernet library: https://github.com/UIPEthernet/UIPEthernet/

This working with more MCU-s (AVR-s (atmel atmega),STM32F (maple mini),ESP8266), and have scalable debuging feature.

Best regards