Professional Documents
Culture Documents
Enc28j60 - Eng
Enc28j60 - Eng
Enc28j60 - Eng
Thank you very much for purchasing our AZ-Delivery ENC28J60 eternet
module. On the following pages, we will introduce you to how to use and
setup this handy device.
Have fun!
The network module is a low-cost, Ethernet-based, highly programmable
module with an ENC28J60 microchip at its heart. The ENC28J60 chip has
an SPI interface for communication with the host controller (our Arduino).
Via SPI the chip only supports mode 0, with SCK (Clock) IDLE Low, LSB
First communication and CS LOW active status.
Please note that the ENC28J60 is a 3.3 Volt chip, but its inputs are 5 Volt
tolerant and do not need a level shifter for the Arduino. Also the outputs with
3.3 Volt level are above the high detection mark of the Arduino and can be
connected directly to our Arduino. Nevertheless it is recommended to use
the outputs with a level shifter for a more stable signal transmission.
However, in our manual we do not do this because of simplicity.
The controller is IEEE 802.3 compatible and supports half and full duplex at
10 Mbit with automatic polarity detection and correction. It has an internal 8
KByte send and receive buffer.
Wiring
1. 5V - 5V power supply
2. GND - Ground
3. LNT - Interrupt (can be unconnected)
4. CLK - Clock out (can be unconnected)
5. SO - SPI BUS (Master in Slave out)
6. WOL - With appropriate programming, spec. WOL packets switch the
output (can be unconnected)
7. SCK - SPI BUS (BUS Clock - maximal 20 Mhz)
8. ST - SPI BUS (Master out Slave in)
9. RST - Chip Reset
10. CS - SPI BUS (Chip Select LOW active)
11. Q3 - Alternative voltage max. 3,3V (MUST be unconnected)
12. GND - Ground
We now connect our module with the Arduino Uno as follows:
This completes the basic connection to our Arduino. The module is also
brought into a defined initial state with each reset of our Arduino via the
reset line, so that no problems are to be expected here with a possible new
programming of the Arduino.
Programming basics
Layer 3 and all other following layers have to be mapped on our Arduino.
Since the IP protocol is layer 3 and the network traffic most used TCP and
UDP protocol is layer 4 (transport layer), we need to implement a custom
TCP/IP stack on the Arduino. We will do that in the next step by including an
appropriate library on our Arduino.
Library installation
In order not to have to completely program a complex TCP/IP stack for our
module, we use the free "EtherCard" library for our module. The
"EtherCard" library can be installed in the Arduino Library Manager.
Alternatively, it can be downloaded directly from GitHub.
We then start our Arduino IDE and bind under Sketch > Include Library >
Add ZIP. Library and insert our previously downloaded ZIP file.
#include <EtherCard.h>
#define SS 10 // Slave Select Pin Nummer
uint8_t Ethernet::buffer[700]; // Packet Buffer Greetings is 512 Byte
After uploading our program on the Arduino, we open the serial monitor in
our IDE and get the following output if everything worked fine:
Our module has been assigned the IP address 172.20.0.156 by the DHCP
server next to a gateway and a DNS server. (The addresses may differ in
your network). We can now ping our module from a PC:
We receive an answer from our module. Also in the serial console we see
the ping as a data package in raw format:
Interesting in this context is that a ping packet can receive data. Windows
uses the repetitive string a-w as data in an ICMP ping packet.
You've done it, you can now use and program your
module for your projects.
Now it is time to learn and make the Projects on your own. You can do that
with the help of many example scripts and other tutorials, which you can
find on the internet.
If you are looking for the high quality products for Arduino and
Raspberry Pi, AZ-Delivery Vertriebs GmbH is the right company to get
them from. You will be provided with numerous application examples,
full installation guides, eBooks, libraries and assistance from our
technical experts.
https://az-delivery.de
Have Fun!
Impressum
https://az-delivery.de/pages/about-us